diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore b/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore new file mode 100644 index 00000000..782f2e88 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/activitypub/.distignore @@ -0,0 +1,38 @@ +.DS_Store +.editorconfig +.git +.gitignore +.github +.travis.yml +.codeclimate.yml +.data +.svnignore +.wordpress-org +.php_cs +Gruntfile.js +LINGUAS +Makefile +README.md +readme.md +CODE_OF_CONDUCT.md +LICENSE.md +_site +_config.yml +bin +composer.json +composer.lock +docker-compose.yml +docker-compose-test.yml +Dockerfile +gulpfile.js +package.json +node_modules +npm-debug.log +phpcs.xml +package.json +package-lock.json +phpunit.xml +phpunit.xml.dist +tests +node_modules +vendor diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE b/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE new file mode 100644 index 00000000..e59f0cc6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/activitypub/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Matthias Pfefferle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php b/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php new file mode 100644 index 00000000..7320f0c6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/activitypub/activitypub.php @@ -0,0 +1,141 @@ +)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' ); + \defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); + \defined( 'ACTIVITYPUB_ALLOWED_HTML' ) || \define( 'ACTIVITYPUB_ALLOWED_HTML', '

",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],d=this.$selection.find(".select2-selection__rendered"),e=c.entityDecode(this.display(b,d));d.empty().text(e),d.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
  • ')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
  • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER||c===d.TAB?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js new file mode 100644 index 00000000..d517ffc9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js @@ -0,0 +1,137 @@ +wp.customize.controlConstructor[ 'generatepress-pro-range-slider' ] = wp.customize.Control.extend( { + ready() { + 'use strict'; + + var control = this, + value, + controlClass = '.customize-control-generatepress-pro-range-slider', + footerActions = jQuery( '#customize-footer-actions' ); + + // Set up the sliders + jQuery( '.generatepress-slider' ).each( function() { + var _this = jQuery( this ); + var _input = _this.closest( 'label' ).find( 'input[type="number"]' ); + var _text = _input.next( '.value' ); + + _this.slider( { + value: _input.val(), + min: _this.data( 'min' ), + max: _this.data( 'max' ), + step: _this.data( 'step' ), + slide( event, ui ) { + _input.val( ui.value ).change(); + _text.text( ui.value ); + }, + } ); + } ); + + // Update the range value based on the input value + jQuery( controlClass + ' .gp_range_value input[type=number]' ).on( 'input', function() { + value = jQuery( this ).attr( 'value' ); + + if ( '' == value ) { + value = -1; + } + + jQuery( this ).closest( 'label' ).find( '.generatepress-slider' ).slider( 'value', parseFloat( value ) ).change(); + } ); + + // Handle the reset button + jQuery( controlClass + ' .generatepress-reset' ).on( 'click', function() { + var icon = jQuery( this ), + visibleArea = icon.closest( '.gp-range-title-area' ).next( '.gp-range-slider-areas' ).children( 'label:visible' ), + input = visibleArea.find( 'input[type=number]' ), + sliderValue = visibleArea.find( '.generatepress-slider' ), + visualValue = visibleArea.find( '.gp_range_value' ), + resetValue = input.attr( 'data-reset_value' ); + + input.val( resetValue ).change(); + visualValue.find( 'input' ).val( resetValue ); + visualValue.find( '.value' ).text( resetValue ); + + if ( '' == resetValue ) { + resetValue = -1; + } + + sliderValue.slider( 'value', parseFloat( resetValue ) ); + } ); + + // Figure out which device icon to make active on load + jQuery( controlClass + ' .generatepress-range-slider-control' ).each( function() { + var _this = jQuery( this ); + + _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); + _this.find( '.range-option-area:first-child' ).show(); + } ); + + // Do stuff when device icons are clicked + jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { + var device = jQuery( this ).data( 'option' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + } ); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + } ); + + // Set the device we're currently viewing + wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); + } ); + + // Set the selected devices in our control when the Customizer devices are clicked + footerActions.find( '.devices button' ).on( 'click', function() { + var device = jQuery( this ).data( 'device' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + } ); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + } ); + } ); + + // Apply changes when desktop slider is changed + control.container.on( 'input change', '.desktop-range', + function() { + control.settings.desktop.set( jQuery( this ).val() ); + } + ); + + // Apply changes when tablet slider is changed + control.container.on( 'input change', '.tablet-range', + function() { + control.settings.tablet.set( jQuery( this ).val() ); + } + ); + + // Apply changes when mobile slider is changed + control.container.on( 'input change', '.mobile-range', + function() { + control.settings.mobile.set( jQuery( this ).val() ); + } + ); + }, +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js new file mode 100644 index 00000000..35c205d4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js @@ -0,0 +1,203 @@ +( function( $, api ) { + // No longer needed as of 1.2.95 + // Keeping it here just in case + api.controlConstructor.spacing = api.Control.extend( { + ready() { + var control = this; + $( '.generate-number-control', control.container ).on( 'change keyup', + function() { + control.setting.set( $( this ).val() ); + } + ); + }, + } ); + + api.controlConstructor[ 'gp-spacing-slider' ] = api.Control.extend( { + ready() { + var control = this; + $( '.slider-input', control.container ).on( 'change keyup', + function() { + control.setting.set( $( this ).val() ); + } + ); + }, + } ); + + api.controlConstructor[ 'generatepress-spacing' ] = api.Control.extend( { + ready() { + var control = this, + controlClass = '.customize-control-generatepress-spacing', + footerActions = jQuery( '#customize-footer-actions' ); + + // Figure out which device icon to make active on load + jQuery( controlClass + ' .gp-spacing-control-section' ).each( function() { + var _this = jQuery( this ); + _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); + _this.find( '.spacing-values-area:first-child' ).show(); + } ); + + // Do stuff when device icons are clicked + jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { + var device = jQuery( this ).data( 'option' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + } ); + + jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + } ); + + // Set the device we're currently viewing + wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); + } ); + + // Set the selected devices in our control when the Customizer devices are clicked + footerActions.find( '.devices button' ).on( 'click', function() { + var device = jQuery( this ).data( 'device' ); + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + } ); + + jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { + var _this = jQuery( this ); + + if ( device === _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + } ); + } ); + + control.container.on( 'change keyup', '.spacing-top', + function() { + control.settings.desktop_top.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-right', + function() { + control.settings.desktop_right.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-bottom', + function() { + control.settings.desktop_bottom.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-left', + function() { + control.settings.desktop_left.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-top', + function() { + control.settings.tablet_top.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-right', + function() { + control.settings.tablet_right.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-bottom', + function() { + control.settings.tablet_bottom.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-left', + function() { + control.settings.tablet_left.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-top', + function() { + control.settings.mobile_top.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-right', + function() { + control.settings.mobile_right.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-bottom', + function() { + control.settings.mobile_bottom.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-left', + function() { + control.settings.mobile_left.set( jQuery( this ).val() ); + } + ); + }, + } ); +}( jQuery, wp.customize ) ); + +jQuery( function( $ ) { + $( '.gp-link-spacing' ).on( 'click', function( e ) { + e.preventDefault(); + + // Set up variables + var _this = $( this ), + element = _this.data( 'element' ); + + // Add our linked-values class to the next 4 elements + _this.parent( '.gp-spacing-section' ).prevAll().slice( 0, 4 ).find( 'input' ).addClass( 'linked-values' ).attr( 'data-element', element ); + + // Change our link icon class + _this.hide(); + _this.next( 'span' ).show(); + } ); + + $( '.gp-unlink-spacing' ).on( 'click', function( e ) { + e.preventDefault(); + + // Set up variables + var _this = $( this ); + + // Remove our linked-values class to the next 4 elements + _this.parent( '.gp-spacing-section' ).prevAll().slice( 0, 4 ).find( 'input' ).removeClass( 'linked-values' ).attr( 'data-element', '' ); + + // Change our link icon class + _this.hide(); + _this.prev( 'span' ).show(); + } ); + + $( '.gp-spacing-section' ).on( 'input', '.linked-values', function() { + var _this = $( this ), + data = _this.attr( 'data-element' ), + val = _this.val(), + targetElements = _this.closest( '.spacing-values-area' ).find( '.linked-values[ data-element="' + data + '" ]' ); + + targetElements.each( function() { + var element = $( this ); + element.val( val ).change(); + } ); + } ); +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js new file mode 100644 index 00000000..1d8b2b3c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js @@ -0,0 +1,148 @@ +( function( api ) { + api.controlConstructor[ 'gp-pro-customizer-typography' ] = api.Control.extend( { + ready() { + var control = this; + + control.container.on( 'change', '.generatepress-font-family select', + function() { + var _this = jQuery( this ), + _value = _this.val(), + _categoryID = _this.attr( 'data-category' ), + _variantsID = _this.attr( 'data-variants' ); + + // Set our font family + control.settings.family.set( _this.val() ); + + // Bail if our controls don't exist + if ( 'undefined' === typeof control.settings.category || 'undefined' === typeof control.settings.variant ) { + return; + } + + setTimeout( function() { + // Send our request to the generate_get_all_google_fonts_ajax function + var response = jQuery.getJSON( { + type: 'POST', + url: ajaxurl, + data: { + action: 'generate_get_all_google_fonts_ajax', + gp_customize_nonce: gp_customize.nonce, + }, + async: false, + dataType: 'json', + } ); + + // Get our response + var fonts = response.responseJSON; + + // Create an ID from our selected font + var id = _value.split( ' ' ).join( '_' ).toLowerCase(); + + // Set our values if we have them + if ( id in fonts ) { + // Get existing variants if this font is already selected + var got_variants = false; + jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) { + var parent = jQuery( this ).closest( '.generatepress-font-family' ); + + if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) { + if ( ! got_variants ) { + updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val(); + got_variants = true; + } + } + } ); + + // We're using a Google font, so show the variants field + _this.closest( '.generatepress-font-family' ).next( 'div' ).show(); + + // Remove existing variants + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + + // Populate our select input with available variants + jQuery.each( fonts[ id ].variants, function( key, value ) { + jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '' ).attr( 'value', value ).text( value ) ); + } ); + + // Set our variants + if ( ! got_variants ) { + control.settings.variant.set( fonts[ id ].variants ); + } else { + control.settings.variant.set( updated_variants ); + } + + // Set our font category + control.settings.category.set( fonts[ id ].category ); + jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category ); + } else { + _this.closest( '.generatepress-font-family' ).next( 'div' ).hide(); + control.settings.category.set( '' ); + control.settings.variant.set( '' ); + jQuery( 'input[name="' + _categoryID + '"' ).val( '' ); + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + } + }, 25 ); + } + ); + + control.container.on( 'change', '.generatepress-font-variant select', + function() { + var _this = jQuery( this ); + var variants = _this.val(); + + control.settings.variant.set( variants ); + + jQuery( '.generatepress-font-variant select' ).each( function( key, value ) { + var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' ); + var parent = jQuery( this ).closest( '.generatepress-font-variant' ); + var font_val = api.control( this_control ).settings.family.get(); + + if ( font_val == control.settings.family.get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) { + jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' ); + api.control( this_control ).settings.variant.set( variants ); + } + } ); + } + ); + + control.container.on( 'change', '.generatepress-font-category input', + function() { + control.settings.category.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-weight select', + function() { + control.settings.weight.set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-transform select', + function() { + control.settings.transform.set( jQuery( this ).val() ); + } + ); + }, + } ); +}( wp.customize ) ); + +jQuery( document ).ready( function( $ ) { + jQuery( '.generatepress-font-family select' ).selectWoo(); + jQuery( '.generatepress-font-variant' ).each( function( key, value ) { + var _this = $( this ); + value = _this.data( 'saved-value' ); + + if ( value ) { + value = value.toString().split( ',' ); + } + + _this.find( 'select' ).selectWoo().val( value ).trigger( 'change.select2' ); + } ); + + $( '.generatepress-font-family' ).each( function( key, value ) { + var _this = $( this ); + + if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) { + _this.next( '.generatepress-font-variant' ).hide(); + } + } ); +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php new file mode 100644 index 00000000..00dd2f9e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/deprecated.php @@ -0,0 +1,324 @@ +manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_backgrounds_is_top_bar_active' ) ) : +/** + * Check to see if the top bar is active + * + * @since 1.3.45 + */ +function generate_backgrounds_is_top_bar_active() +{ + $top_bar = is_active_sidebar( 'top-bar' ) ? true : false; + return apply_filters( 'generate_is_top_bar_active', $top_bar ); +} +endif; + +if ( ! function_exists( 'generate_blog_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_blog_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_blog_is_posts_page' ) ) : +/** + * Check to see if we're on a posts page + */ +function generate_blog_is_posts_page() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_blog_is_posts_page_single' ) ) : +/** + * Check to see if we're on a posts page or a single post + */ +function generate_blog_is_posts_page_single() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_blog_is_excerpt' ) ) : +/** + * Check to see if we're displaying excerpts + */ +function generate_blog_is_excerpt() +{ + if ( ! function_exists( 'generate_get_defaults' ) ) + return; + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + return ( 'excerpt' == $generate_settings['post_content'] ) ? true : false; +} +endif; + +if ( ! function_exists( 'generate_colors_sanitize_hex_color' ) ) : +/** + * Sanitize hex colors + * We don't use the core function as we want to allow empty values + * @since 0.1 + */ +function generate_colors_sanitize_hex_color( $color ) { + if ( '' === $color ) + return ''; + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) + return $color; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_colors_sanitize_rgba' ) ) : +/** + * Sanitize RGBA colors + * @since 1.3.42 + */ +function generate_colors_sanitize_rgba( $color ) { + if ( '' === $color ) + return ''; + + // If string does not start with 'rgba', then treat as hex + // sanitize the hex color and finally convert hex to rgba + if ( false === strpos( $color, 'rgba' ) ) { + return generate_colors_sanitize_hex_color( $color ); + } + + // By now we know the string is formatted as an rgba color so we need to further sanitize it. + $color = str_replace( ' ', '', $color ); + sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_menu_plus_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_menu_plus_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_is_posts_page' ) ) : +/** + * This is an active_callback + * Check if we're on a posts page + */ +function generate_page_header_is_posts_page() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_page_header_is_posts_page_single' ) ) : +/** + * Check to see if we're on a posts page or a single post + */ +function generate_page_header_is_posts_page_single() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_secondary_nav_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_secondary_nav_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_spacing_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_spacing_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_premium_sanitize_typography' ) ) : +/** + * Sanitize typography dropdown + * @since 1.1.10 + * @deprecated 1.2.95 + */ +function generate_premium_sanitize_typography( $input ) +{ + if ( ! function_exists( 'generate_get_all_google_fonts' ) || ! function_exists( 'generate_typography_default_fonts' ) ) { + return 'Open Sans'; + } + + // Grab all of our fonts + $fonts = generate_get_all_google_fonts(); + + // Loop through all of them and grab their names + $font_names = array(); + foreach ( $fonts as $k => $fam ) { + $font_names[] = $fam['name']; + } + + // Get all non-Google font names + $not_google = generate_typography_default_fonts(); + + // Merge them both into one array + $valid = array_merge( $font_names, $not_google ); + + // Sanitize + if ( in_array( $input, $valid ) ) { + return $input; + } else { + return 'Open Sans'; + } +} +endif; + +if ( ! function_exists( 'generate_typography_sanitize_choices' ) ) : +/** + * Sanitize choices + * @since 1.3.24 + */ +function generate_typography_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_choices' ) ) : +/** + * Sanitize our select inputs + */ +function generate_page_header_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_hex_color' ) ) : +/** + * Sanitize colors + * We don't use the core function as we want to allow empty values + */ +function generate_page_header_sanitize_hex_color( $color ) { + if ( '' === $color ) + return ''; + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) + return $color; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_html' ) ) : +/** + * Sanitize our fields that accept HTML + */ +function generate_page_header_sanitize_html( $input ) +{ + return wp_kses_post( $input ); +} +endif; \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php new file mode 100644 index 00000000..a0cb7efc --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/customizer/sanitize.php @@ -0,0 +1,131 @@ +manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); + } +} + +if ( ! function_exists( 'generate_premium_sanitize_checkbox' ) ) { + /** + * Sanitize checkbox + */ + function generate_premium_sanitize_checkbox( $checked ) { + // Boolean check. + return ( ( isset( $checked ) && true == $checked ) ? true : false ); + } +} + +if ( ! function_exists( 'generate_premium_sanitize_hex_color' ) ) { + /** + * Sanitize hex colors + * We don't use the core function as we want to allow empty values + * + * @since 0.1 + */ + function generate_premium_sanitize_hex_color( $color ) { + if ( '' === $color ) { + return ''; + } + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { + return $color; + } + + return ''; + } +} + +if ( ! function_exists( 'generate_premium_sanitize_rgba' ) ) { + /** + * Sanitize RGBA colors + * + * @since 1.3.42 + */ + function generate_premium_sanitize_rgba( $color ) { + if ( '' === $color ) { + return ''; + } + + // If string does not start with 'rgba', then treat as hex + // sanitize the hex color and finally convert hex to rgba + if ( false === strpos( $color, 'rgba' ) ) { + return generate_premium_sanitize_hex_color( $color ); + } + + // By now we know the string is formatted as an rgba color so we need to further sanitize it. + $color = str_replace( ' ', '', $color ); + sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; + + return ''; + } +} + +if ( ! function_exists( 'generate_premium_sanitize_decimal_integer' ) ) { + /** + * Sanitize integers that can use decimals + * + * @since 1.3.41 + */ + function generate_premium_sanitize_decimal_integer( $input ) { + return abs( floatval( $input ) ); + } +} + +/** + * Sanitize integers that can use decimals + * @since 1.4 + */ +function generate_premium_sanitize_decimal_integer_empty( $input ) { + if ( '' == $input ) { + return ''; + } + + return abs( floatval( $input ) ); +} + +if ( ! function_exists( 'generate_premium_sanitize_html' ) ) { + /** + * Sanitize our fields that accept HTML + */ + function generate_premium_sanitize_html( $input ) { + return wp_kses_post( $input ); + } +} + +function generate_premium_sanitize_variants( $input ) { + if ( is_array( $input ) ) { + $input = implode( ',', $input ); + } + + return sanitize_text_field( $input ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js new file mode 100644 index 00000000..fa781916 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/library/select2/select2.full.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
      ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
        '),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('
      • ×
      • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
      • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a ` + + -1, + 'orderby' => 'title', + 'post_type' => 'generate_page_header', + 'suppress_filters' => false, + )); + + $options[ $type ] = ! isset( $options[ $type ] ) ? '' : $options[ $type ]; + + foreach( $page_headers as $header ) { + printf( '', + $header->ID, + selected( $options[ $type ], $header->ID ), + $header->post_title + ); + } + ?> + + ( window_height - offset ) ) { + jQuery( '.fullscreen-enabled' ).attr( 'style', 'height: initial !important' ); + } +} + +jQuery(document).ready(function($) { + + // Run the header height function + generateHeaderHeight(); + + // Set up the resize timer + var generateResizeTimer; + + if ( jQuery('.generate-page-header.fullscreen-enabled')[0] ) { + // Initiate full window height on resize + var width = $(window).width(); + $(window).resize(function() { + if($(window).width() != width){ + clearTimeout(generateResizeTimer); + generateResizeTimer = setTimeout(generateHeaderHeight, 200); + width = $(window).width(); + } + }); + + $( window ).on( "orientationchange", function( event ) { + if($(window).width() != width){ + clearTimeout(generateResizeTimer); + generateResizeTimer = setTimeout(generateHeaderHeight, 200); + width = $(window).width(); + } + }); + } + +}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js new file mode 100644 index 00000000..dd988e11 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/full-height.min.js @@ -0,0 +1 @@ +function generateHeaderHeight(){if(jQuery(".fullscreen-enabled").length){var a,b=jQuery(window).height();a=jQuery(".inside-page-header").length?jQuery(".inside-page-header"):jQuery(".generate-inside-combined-content").length?jQuery(".generate-inside-combined-content"):jQuery(".generate-inside-page-header-content");var c=jQuery(".fullscreen-enabled").offset().top;jQuery(".fullscreen-enabled").css("height",b-c+"px"),a.outerHeight()>b-c&&jQuery(".fullscreen-enabled").attr("style","height: initial !important")}}function generateHeaderParallax(){var a=jQuery(".menu-toggle");if(!a.is(":visible")&&jQuery(".generate-page-header.parallax-enabled")[0]){if(jQuery(".page-header-contained")[0])var b=jQuery(".generate-page-header.parallax-enabled .inside-content-header");else var b=jQuery(".generate-page-header.parallax-enabled");var c=jQuery(this).scrollTop(),d=jQuery(".generate-page-header.parallax-enabled").data("parallax-speed");return b.css("background-position","center "+parseInt(-c/d)+"px")}}jQuery(document).ready(function(a){generateHeaderHeight();var b;if(jQuery(".generate-page-header.parallax-enabled")[0]&&a(document).scroll(function(){generateHeaderParallax()}),jQuery(".generate-page-header.fullscreen-enabled")[0]){var c=a(window).width();a(window).resize(function(){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())}),a(window).on("orientationchange",function(d){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())})}}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js new file mode 100644 index 00000000..d78004e0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js @@ -0,0 +1,9 @@ +/* + * Vide - v0.5.0 + * Easy as hell jQuery plugin for video backgrounds. + * http://vodkabears.github.io/vide/ + * + * Made by Ilya Makarov + * Under MIT License + */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function b(a){var b,c,d,e,f,g,h,i={};for(f=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(","),h=0,g=f.length;g>h&&(c=f[h],-1===c.search(/^(http|https|ftp):\/\//)&&-1!==c.search(":"));h++)b=c.indexOf(":"),d=c.substring(0,b),e=c.substring(b+1),e||(e=void 0),"string"==typeof e&&(e="true"===e||("false"===e?!1:e)),"string"==typeof e&&(e=isNaN(e)?e:+e),i[d]=e;return null==d&&null==e?a:i}function c(a){a=""+a;var b,c,d,e=a.split(/\s+/),f="50%",g="50%";for(d=0,b=e.length;b>d;d++)c=e[d],"left"===c?f="0%":"right"===c?f="100%":"top"===c?g="0%":"bottom"===c?g="100%":"center"===c?0===d?f="50%":g="50%":0===d?f=c:g=c;return{x:f,y:g}}function d(b,c){var d=function(){c(this.src)};a('').load(d),a('').load(d),a('').load(d),a('').load(d)}function e(c,d,e){if(this.$element=a(c),"string"==typeof d&&(d=b(d)),e?"string"==typeof e&&(e=b(e)):e={},"string"==typeof d)d=d.replace(/\.\w*$/,"");else if("object"==typeof d)for(var f in d)d.hasOwnProperty(f)&&(d[f]=d[f].replace(/\.\w*$/,""));this.settings=a.extend({},g,e),this.path=d;try{this.init()}catch(i){if(i.message!==h)throw i}}var f="vide",g={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""},h="Not implemented";e.prototype.init=function(){var b,e,g=this,i=g.path,j=i,k="",l=g.$element,m=g.settings,n=c(m.position),o=m.posterType;e=g.$wrapper=a("
        ").addClass(m.className).css({position:"absolute","z-index":-1,top:0,left:0,bottom:0,right:0,overflow:"hidden","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover","background-size":"cover","background-color":m.bgColor,"background-repeat":"no-repeat","background-position":n.x+" "+n.y}),"object"==typeof i&&(i.poster?j=i.poster:i.mp4?j=i.mp4:i.webm?j=i.webm:i.ogv&&(j=i.ogv)),"detect"===o?d(j,function(a){e.css("background-image","url("+a+")")}):"none"!==o&&e.css("background-image","url("+j+"."+o+")"),"static"===l.css("position")&&l.css("position","relative"),l.prepend(e),"object"==typeof i?(i.mp4&&(k+=''),i.webm&&(k+=''),i.ogv&&(k+=''),b=g.$video=a("")):b=g.$video=a('');try{b.prop({autoplay:m.autoplay,loop:m.loop,volume:m.volume,muted:m.muted,defaultMuted:m.muted,playbackRate:m.playbackRate,defaultPlaybackRate:m.playbackRate})}catch(p){throw new Error(h)}b.css({margin:"auto",position:"absolute","z-index":-1,top:n.y,left:n.x,"-webkit-transform":"translate(-"+n.x+", -"+n.y+")","-ms-transform":"translate(-"+n.x+", -"+n.y+")","-moz-transform":"translate(-"+n.x+", -"+n.y+")",transform:"translate(-"+n.x+", -"+n.y+")",visibility:"hidden",opacity:0}).one("canplaythrough."+f,function(){g.resize()}).one("playing."+f,function(){b.css({visibility:"visible",opacity:1}),e.css("background-image","none")}),l.on("resize."+f,function(){m.resizing&&g.resize()}),e.append(b)},e.prototype.getVideoObject=function(){return this.$video[0]},e.prototype.resize=function(){if(this.$video){var a=this.$wrapper,b=this.$video,c=b[0],d=c.videoHeight,e=c.videoWidth,f=a.height(),g=a.width();g/e>f/d?b.css({width:g+2,height:"auto"}):b.css({width:"auto",height:f+2})}},e.prototype.destroy=function(){delete a[f].lookup[this.index],this.$video&&this.$video.off(f),this.$element.off(f).removeData(f),this.$wrapper.remove()},a[f]={lookup:[]},a.fn[f]=function(b,c){var d;return this.each(function(){d=a.data(this,f),d&&d.destroy(),d=new e(this,b,c),d.index=a[f].lookup.push(d)-1,a.data(this,f,d)}),this},a(document).ready(function(){var b=a(window);b.on("resize."+f,function(){for(var b,c=a[f].lookup.length,d=0;c>d;d++)b=a[f].lookup[d],b&&b.settings.resizing&&b.resize()}),b.on("unload."+f,function(){return!1}),a(document).find("[data-"+f+"-bg]").each(function(b,c){var d=a(c),e=d.data(f+"-options"),g=d.data(f+"-bg");d[f](g,e)})})});jQuery(document).ready(function($) {var page_header_content = $( '.page-header-content' );if ( page_header_content.length ) {if ( page_header_content.hasClass( 'grid-container' ) ) {$( '.inside-page-header-container' ).data('vide').getVideoObject().play();} else {page_header_content.data('vide').getVideoObject().play();}}}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js new file mode 100644 index 00000000..89eae365 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/lc_switch.js @@ -0,0 +1,149 @@ +/** + * lc_switch.js + * Version: 1.0 + * Author: LCweb - Luca Montanari + * Website: http://www.lcweb.it + * Licensed under the MIT license + */ + +(function($){ + if(typeof($.fn.lc_switch) != 'undefined') {return false;} // prevent dmultiple scripts inits + + $.fn.lc_switch = function(on_text, off_text) { + + // destruct + $.fn.lcs_destroy = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + + $wrap.children().not('input').remove(); + $(this).unwrap(); + }); + + return true; + }; + + + // set to ON + $.fn.lcs_on = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + var $input = $wrap.find('input'); + + if(typeof($.fn.prop) == 'function') { + $wrap.find('input').prop('checked', true); + } else { + $wrap.find('input').attr('checked', true); + } + + $wrap.find('input').trigger('lcs-on'); + $wrap.find('input').trigger('lcs-statuschange'); + $wrap.find('.lcs_switch').removeClass('lcs_off').addClass('lcs_on'); + + // if radio - disable other ones + if( $wrap.find('.lcs_switch').hasClass('lcs_radio_switch') ) { + var f_name = $input.attr('name'); + $wrap.parents('form').find('input[name='+f_name+']').not($input).lcs_off(); + } + }); + + return true; + }; + + + // set to OFF + $.fn.lcs_off = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + + if(typeof($.fn.prop) == 'function') { + $wrap.find('input').prop('checked', false); + } else { + $wrap.find('input').attr('checked', false); + } + + $wrap.find('input').trigger('lcs-off'); + $wrap.find('input').trigger('lcs-statuschange'); + $wrap.find('.lcs_switch').removeClass('lcs_on').addClass('lcs_off'); + }); + + return true; + }; + + + // construct + return this.each(function(){ + + // check against double init + if( !$(this).parent().hasClass('lcs_wrap') ) { + + // default texts + var ckd_on_txt = (typeof(on_text) == 'undefined') ? 'ON' : on_text; + var ckd_off_txt = (typeof(off_text) == 'undefined') ? 'OFF' : off_text; + + // labels structure + var on_label = (ckd_on_txt) ? '
        '+ ckd_on_txt +'
        ' : ''; + var off_label = (ckd_off_txt) ? '
        '+ ckd_off_txt +'
        ' : ''; + + + // default states + var disabled = ($(this).is(':disabled')) ? true: false; + var active = ($(this).is(':checked')) ? true : false; + + var status_classes = ''; + status_classes += (active) ? ' lcs_on' : ' lcs_off'; + if(disabled) {status_classes += ' lcs_disabled';} + + + // wrap and append + var structure = + '
        ' + + '
        ' + + on_label + off_label + + '
        '; + + if( $(this).is(':input') && ($(this).attr('type') == 'checkbox' || $(this).attr('type') == 'radio') ) { + + $(this).wrap('
        '); + $(this).parent().append(structure); + + $(this).parent().find('.lcs_switch').addClass('lcs_'+ $(this).attr('type') +'_switch'); + } + } + }); + }; + + + + // handlers + $(document).ready(function() { + + // on click + $(document).delegate('.lcs_switch:not(.lcs_disabled)', 'click tap', function(e) { + + if( $(this).hasClass('lcs_on') ) { + if( !$(this).hasClass('lcs_radio_switch') ) { // not for radio + $(this).lcs_off(); + } + } else { + $(this).lcs_on(); + } + }); + + + // on checkbox status change + $(document).delegate('.lcs_wrap input', 'change', function() { + + if( $(this).is(':checked') ) { + $(this).lcs_on(); + } else { + $(this).lcs_off(); + } + }); + + }); + +})(jQuery); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js new file mode 100644 index 00000000..f1c0f66e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/metabox.js @@ -0,0 +1,220 @@ +jQuery(document).ready(function($) { + $( '#generate-tabs-container input[type="checkbox"]' ).lc_switch( '', '' ); + + $( '.generate-tabs-menu a' ).on( 'click', function( event ) { + event.preventDefault(); + $( this ).parent().addClass( 'generate-current' ); + $( this ).parent().siblings().removeClass( 'generate-current' ); + var tab = $( this ).attr( 'href' ); + $( '.generate-tab-content' ).not(tab).css( 'display', 'none' ); + $( tab ).fadeIn( 100 ); + + if ( '#generate-image-tab' == tab || '#generate-content-tab' == tab ) { + $( '.show-in-excerpt' ).show(); + } else { + $( '.show-in-excerpt' ).hide(); + } + } ); + + $( '#_meta-generate-page-header-content' ).on( 'input change', function() { + if ( this.value.length ) { + $( '.page-header-content-required' ).hide(); + } else { + $( '.page-header-content-required' ).show(); + } + }); +}); + +jQuery(window).on('load', function() { + if ( jQuery( '#_meta-generate-page-header-enable-image-crop' ).val() == 'enable' ) { + jQuery( '#crop-enabled' ).show(); + } + + jQuery( '#_meta-generate-page-header-enable-image-crop' ).change(function () { + if ( jQuery( this ).val() === 'enable' ) { + jQuery( '#crop-enabled' ).show(); + } else { + jQuery( '#crop-enabled' ).hide(); + } + }); + + if ( jQuery( '#_meta-generate-page-header-image-background' ).is( ':checked' ) ) { + jQuery( '.parallax' ).show(); + } else { + jQuery( '.parallax' ).hide(); + } + + jQuery('body').delegate('.image-background', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.parallax').show(); + } else { + jQuery('.parallax').hide(); + jQuery('#_meta-generate-page-header-image-background-fixed').lcs_off(); + } + }); + + if ( jQuery('#_meta-generate-page-header-full-screen').is(':checked')) { + jQuery('.vertical-center').show(); + } else { + jQuery('.vertical-center').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-full-screen', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.vertical-center').show(); + } else { + jQuery('.vertical-center').hide(); + jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); + } + }); + + if ( jQuery('#_meta-generate-page-header-transparent-navigation').is(':checked')) { + jQuery('.navigation-colors').show(); + } else { + jQuery('.navigation-colors').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-transparent-navigation', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.navigation-colors').show(); + } else { + jQuery('.navigation-colors').hide(); + } + }); + + if ( jQuery('#_meta-generate-page-header-combine').is(':checked')) { + jQuery('.combination-options').show(); + } else { + jQuery('.combination-options').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-combine', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.combination-options').show(); + } else { + jQuery('.combination-options').hide(); + } + }); + + if ( jQuery('#_meta-generate-page-header-image-background-type').val() == '' ) { + jQuery('.vertical-center').hide(); + jQuery('.fullscreen').hide(); + } + jQuery('#_meta-generate-page-header-image-background-type').change(function () { + if (jQuery(this).val() === '') { + jQuery('.vertical-center').hide(); + jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); + jQuery('.fullscreen').hide(); + jQuery('#_meta-generate-page-header-full-screen').lcs_off(); + } else { + //jQuery('.vertical-center').show(); + jQuery('.fullscreen').show(); + } + }); + + var $set_button = jQuery('.generate-upload-file'); + /** + * open the media manager + */ + $set_button.click(function (e) { + e.preventDefault(); + + var $thisbutton = jQuery(this); + var frame = wp.media({ + title : $thisbutton.data('title'), + multiple : false, + library : { type : $thisbutton.data('type') }, + button : { text : $thisbutton.data('insert') } + }); + // close event media manager + frame.on('select', function () { + var attachment = frame.state().get('selection').first().toJSON(); + // set the file + //set_dfi(attachment.url); + $thisbutton.prev('input').val(attachment.url); + $thisbutton.nextAll('input.image-id').val(attachment.id); + if ( $thisbutton.data('prev') === true ) { + $thisbutton.prev('input').prevAll('#preview-image').children('.saved-image').remove(); + $thisbutton.prev('input').prevAll('#preview-image').append(''); + } + $thisbutton.nextAll( '.generate-page-header-remove-image' ).show(); + if ( 'upload_image' == $thisbutton.prev( 'input' ).attr( 'id' ) ) { + jQuery( '.featured-image-message' ).hide(); + jQuery( '.page-header-image-settings' ).show(); + jQuery( '.generate-page-header-set-featured-image' ).hide(); + } + }); + + // everthing is set open the media manager + frame.open(); + }); +}); +jQuery(document).ready(function($) { + $('#generate-tabs-container .color-picker').wpColorPicker(); + + jQuery( '.generate-page-header-remove-image' ).on( 'click', function( e ) { + e.preventDefault(); + var input = jQuery( this ).data( 'input' ); + var input_id = jQuery( this ).data( 'input-id' ); + var preview = jQuery( this ).data( 'prev' ); + jQuery( input ).attr( 'value', '' ); + jQuery( input_id ).attr( 'value', '' ); + jQuery( preview ).children( '.saved-image' ).remove(); + jQuery( this ).hide(); + if ( '-1' == jQuery( '#_thumbnail_id' ).attr( 'value' ) ) { + jQuery( '.page-header-image-settings' ).hide(); + jQuery( '.generate-page-header-set-featured-image' ).show(); + + } else { + jQuery( '.generate-page-header-set-featured-image' ).hide(); + jQuery( '.page-header-image-settings' ).show(); + jQuery( '.featured-image-message' ).show(); + } + return false; + }); + + $('#postimagediv').on( 'click', '#remove-post-thumbnail', function() { + // The featured image is gone, so we can hide the message + jQuery( '.featured-image-message' ).hide(); + + // If there's no other image set, we can hide the image settings + if ( '' == jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) { + jQuery( '.page-header-image-settings' ).hide(); + jQuery( '.generate-page-header-set-featured-image' ).show(); + } + + // No more featured image means we can show the 'show excerpt' option + jQuery( '.show-in-excerpt' ).show(); + + return false; + }); + + wp.media.featuredImage.frame().on('select', function() { + + // We have a featured image, so the 'show excerpt' function isn't necessary + jQuery( '.show-in-excerpt' ).hide(); + + // We can stop here if we have a custom image set + if ( '' !== jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) + return; + + // Hide the set your featured image message + jQuery( '.generate-page-header-set-featured-image' ).hide(); + + // Show the "using feaured image" message + jQuery( '.featured-image-message' ).show(); + + // Show the image settings (image link, resizing etc..) + jQuery( '.page-header-image-settings' ).show(); + }); + + $( '.generate-featured-image, .generate-page-header-set-featured-image a' ).on( 'click', function( event ) { + event.preventDefault(); + + // Stop propagation to prevent thickbox from activating. + event.stopPropagation(); + + // Open the featured image modal + wp.media.featuredImage.frame().open(); + }); +}); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js new file mode 100644 index 00000000..8fe3b26c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.js @@ -0,0 +1,17 @@ +function generate_parallax_element( selector, context ) { + context = context || document; + var elements = context.querySelectorAll( selector ); + return Array.prototype.slice.call( elements ); +} + +window.addEventListener( "scroll", function() { + var scrolledHeight= window.pageYOffset; + generate_parallax_element( ".parallax-enabled" ).forEach( function( el, index, array ) { + var limit = el.offsetTop + el.offsetHeight; + if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { + el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-parallax-speed' ) + "px"; + } else { + el.style.backgroundPositionY = "0"; + } + }); +}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js new file mode 100644 index 00000000..8263a901 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/js/parallax.min.js @@ -0,0 +1 @@ +function generate_parallax_element(e,t){var a=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(a)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_parallax_element(".parallax-enabled").forEach(function(t,a,o){var r=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=r?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-parallax-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php new file mode 100644 index 00000000..76b25c4a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/metabox.php @@ -0,0 +1,782 @@ + true ); + $post_types = get_post_types( $args ); + + // Bail if we're not using the old Page Header meta box + if ( 'generate_page_header' !== get_post_type() && '' == $stored_meta['_meta-generate-page-header-content'][0] && '' == $stored_meta['_meta-generate-page-header-image'][0] && '' == $stored_meta['_meta-generate-page-header-image-id'][0] ) { + if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { + foreach ( $post_types as $type ) { + if ( 'attachment' !== $type ) { + add_meta_box( + 'generate_select_page_header_meta_box', + __( 'Page Header', 'gp-premium' ), + 'generate_do_select_page_header_meta_box', + $type, + 'normal', + 'high' + ); + } + } + } + + if ( ! apply_filters( 'generate_page_header_legacy_metabox', false ) ) { + return; + } + } + + array_push( $post_types, 'generate_page_header' ); + foreach ($post_types as $type) { + if ( 'attachment' !== $type ) { + add_meta_box( + 'generate_page_header_meta_box', + __( 'Page Header', 'gp-premium' ), + 'show_generate_page_header_meta_box', + $type, + 'normal', + 'high' + ); + } + } + } +} + +if ( ! function_exists( 'generate_page_header_metabox_enqueue' ) ) { + add_action( 'admin_enqueue_scripts', 'generate_page_header_metabox_enqueue' ); + /** + * Add our metabox scripts + */ + function generate_page_header_metabox_enqueue( $hook ) { + // I prefer to enqueue the styles only on pages that are using the metaboxes + if ( in_array( $hook, array( "post.php", "post-new.php" ) ) ) { + $args = array( 'public' => true ); + $post_types = get_post_types( $args ); + + $screen = get_current_screen(); + $post_type = $screen->id; + + if ( in_array( $post_type, (array) $post_types ) || 'generate_page_header' == get_post_type() ){ + wp_enqueue_media(); + wp_enqueue_script( 'wp-color-picker' ); + wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_script( 'wp-color-picker-alpha', GP_LIBRARY_DIRECTORY_URL . 'alpha-color-picker/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); + + wp_add_inline_script( + 'wp-color-picker-alpha', + 'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );' + ); + + wp_enqueue_style( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'css/metabox.css', array(), GENERATE_PAGE_HEADER_VERSION ); + wp_enqueue_script( 'generate-lc-switch', plugin_dir_url( __FILE__ ) . 'js/lc_switch.js', array( 'jquery' ), GENERATE_PAGE_HEADER_VERSION, false ); + wp_enqueue_script( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'js/metabox.js', array( 'jquery','generate-lc-switch', 'wp-color-picker' ), GENERATE_PAGE_HEADER_VERSION, false ); + + if ( function_exists( 'wp_add_inline_script' ) && function_exists( 'generate_get_default_color_palettes' ) ) { + // Grab our palette array and turn it into JS + $palettes = json_encode( generate_get_default_color_palettes() ); + + // Add our custom palettes + // json_encode takes care of escaping + wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); + } + } + } + } +} + +/** + * Build our Select Page Header meta box. + * + * @since 1.4 + */ +function generate_do_select_page_header_meta_box( $post ) { + wp_nonce_field( basename( __FILE__ ), 'generate_page_header_nonce' ); + $stored_meta = get_post_meta( $post->ID ); + $stored_meta['_generate-select-page-header'][0] = ( isset( $stored_meta['_generate-select-page-header'][0] ) ) ? $stored_meta['_generate-select-page-header'][0] : ''; + + $page_headers = get_posts(array( + 'posts_per_page' => -1, + 'orderby' => 'title', + 'post_type' => 'generate_page_header', + )); + + if ( count( $page_headers ) > 0 ) : + ?> +

        + +

        + +

        + create one?', 'gp-premium' ), + esc_url( admin_url( 'post-new.php?post_type=generate_page_header' ) ) + ); + ?> +

        +

        %1$s

        ', + __( 'Content is required for the below settings to work.', 'gp-premium' ), + '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ? 'style="display:none"' : '' + ); + + if ( '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ) { + ?> + + +
        +
          +
        • + +
        • + +
        • + +
        • + +
        • + +
        • + + +
        • + +
        • + + +
        • + +
        • + + +
          > +

          +
          + /> +

          +
          + +
        +
        +
        + + + +
        + + + +
        + + + + + + + + +
        > +

        +
        + +

        + +

        +
        + +

        + + +
        +
        + +
        + + +

        + +
        + +
        +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        +
        + +
        +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        + +

        +
        + + +

        + +

        +
        + + +

        +
        + +
        +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        +
        +
        +
        +
        + + + + +
        + +

        + +

        + +
        + + + +
        + + + + + + + + +

        + +

        + +

        + +
        + + + +
        + + + + + + + + + +
        + + + +
        +
        + 'FILTER_CONTENT', + '_meta-generate-page-header-image' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-image-id' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-link' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-enable-image-crop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-crop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-width' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-height' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-background-type' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-inner-container' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-alignment' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-spacing' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-background-spacing-unit' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-left-right-padding' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-left-right-padding-unit' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-text-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-link-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-link-color-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background-current' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text-current' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-site-title' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-site-tagline' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-video' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-ogv' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-webm' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-overlay' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-content-autop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-content-padding' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-full-screen' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-vertical-center' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-fixed' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-overlay' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-combine' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-absolute-position' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-transparent-navigation' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-add-to-excerpt' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-logo' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-navigation-logo' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-navigation-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', + ); + + if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { + $options[ '_generate-select-page-header' ] = 'FILTER_SANITIZE_NUMBER_INT'; + } + + foreach ( $options as $key => $sanitize ) { + if ( 'FILTER_SANITIZE_STRING' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING ); + } elseif ( 'FILTER_SANITIZE_URL' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL ); + } elseif ( 'FILTER_SANITIZE_NUMBER_INT' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT ); + } elseif ( 'FILTER_CONTENT' == $sanitize && isset( $_POST[ $key ] ) ) { + if ( current_user_can( 'unfiltered_html' ) ) { + $value = $_POST[ $key ]; + } else { + $value = wp_kses_post( $_POST[ $key ] ); + } + } else { + $value = filter_input( INPUT_POST, $key, FILTER_DEFAULT ); + } + + if ( $value ) { + update_post_meta( $post_id, $key, $value ); + } else { + delete_post_meta( $post_id, $key ); + } + } + } +} + +add_action( 'add_meta_boxes', 'generate_page_header_tags_add_meta_box' ); +/** + * Add our Template Tags meta box. + * + * @param WP_Post $post Current post object. + * + * @since 1.4 + */ +function generate_page_header_tags_add_meta_box( $post ) { + add_meta_box( 'generate_page_header_tags', __( 'Template Tags', 'gp-premium' ), 'generate_page_header_tags_do_meta_box', 'generate_page_header', 'side', 'low' ); +} + +/** + * Meta box display callback. + * + * @param WP_Post $post Current post object. + * + * @since 1.4 + */ +function generate_page_header_tags_do_meta_box( $post ) { + ?> + +

        + + +

        + + +

        + + +

        + + +

        + + + +
      • + ( ! empty( $options[ 'background_video' ] ) ) ? 'mp4:' . esc_url( $options[ 'background_video' ] ) : null, + 'ogv' => ( ! empty( $options[ 'background_video_ogv' ] ) ) ? 'ogv:' . esc_url( $options[ 'background_video_ogv' ] ) : null, + 'webm' => ( ! empty( $options[ 'background_video_webm' ] ) ) ? 'webm:' . esc_url( $options[ 'background_video_webm' ] ) : null, + 'poster' => ( ! empty( $image_url ) ) ? 'poster:' . esc_url( $image_url ) : null + ); + + // Add our videos to a string + $video_output = array(); + foreach( $video_types as $video => $val ) { + $video_output[] = $val; + } + + $video = null; + // Video variable + if ( $video_enabled && '' !== $options[ 'content' ] ) { + + $ext = ( ! empty( $image_url ) ) ? pathinfo( $image_url, PATHINFO_EXTENSION ) : false; + $video_options = array(); + + if ( $ext ) { + $video_options[ 'posterType' ] = 'posterType:' . $ext; + } else { + $video_options[ 'posterType' ] = 'posterType: none'; + } + + $video_options[ 'className' ] = 'className:generate-page-header-video'; + + if ( apply_filters( 'generate_page_header_video_loop', true ) ) { + $video_options[ 'loop' ] = 'loop:true'; + } else { + $video_options[ 'loop' ] = 'loop:false'; + } + + if ( apply_filters( 'generate_page_header_video_muted', true ) ) { + $video_options[ 'muted' ] = 'muted:true'; + } else { + $video_options[ 'muted' ] = 'muted:false'; + } + + $video_options[ 'autoplay' ] = 'autoplay:false'; + + $video = sprintf( ' data-vide-bg="%1$s" data-vide-options="%2$s"', + implode( ', ', array_filter( $video_output ) ), + implode( ', ', array_filter( $video_options ) ) + ); + } + + // Write a class if we're merging the header + $combined_content = ( '' !== $options[ 'merge' ] ) ? ' generate-combined-page-header' : ''; + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + printf( + '
        +
        ', + ( 'fluid' == $options[ 'container_type' ] ) ? $video : null, + $content_class . $parallax . $full_screen . $vertical_center_container . $container_type . $combined_content . ' generate-page-header generate-content-header', + ( 'fluid' !== $options[ 'container_type' ] ) ? $video : null, + $vertical_center, + ( '' !== $options[ 'merge' ] ) ? 'generate-merged-header' : '', + ( ! empty( $parallax ) ) ? 'data-parallax-speed="' . esc_attr( $parallax_speed ) . '"' : '', + $options[ 'page_header_id' ] + ); + } + + do_action( 'generate_inside_merged_page_header' ); + } +} + +if ( ! function_exists( 'generate_page_header_area' ) ) { + /** + * Build our entire page header. + * + * @since 0.1 + * + * @param $image_class The class to give our element if it's an image. + * @param $content_class The class to give our element if it's content. + */ + function generate_page_header_area( $image_class, $content_class ) { + // Get our options + $options = generate_page_header_get_options(); + + // Get out of here if we don't have content or an image + if ( '' == $options[ 'content' ] && ! generate_page_header_get_image( 'ALL' ) ) { + return; + } + + $inner_container = ( '' == $options[ 'inner_container' ] ) ? ' grid-container grid-parent' : ''; + + do_action( 'generate_before_page_header' ); + + // If an image is set and no content is set + if ( '' == $options[ 'content' ] && generate_page_header_get_image( 'ALL' ) ) { + + printf( + '
        + %2$s + %4$s + %3$s +
        ', + esc_attr( $image_class ) . $inner_container . ' generate-page-header', + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + generate_page_header_get_image_output() + ); + + } + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + // If we're not merging our header, we can start the container here + // If we were merging, the container would be added in the generate_before_header hook + if ( '' == $options[ 'merge' ] ) { + generate_page_header_area_start_container( 'page-header-image', 'page-header-content' ); + } + + // Replace any found template tags + $options[ 'content' ] = generate_page_header_template_tags( $options[ 'content' ] ); + + // Print the rest of our page header HTML + // The starting elements are inside generate_page_header_area_start_container() + printf ( '
        +
        + %4$s + %6$s + %5$s +
        +
        +
        +
        ', + ( '' !== $options[ 'merge' ] ) ? 'generate-combined-content' : '', + $inner_container, + ( '' !== $options[ 'merge' ] ) ? 'generate-inside-combined-content' : 'generate-inside-page-header-content', + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) + ); + } + + do_action( 'generate_after_page_header' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php new file mode 100644 index 00000000..b88250ad --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-image.php @@ -0,0 +1,60 @@ + + %2$s + %4$s + %3$s + ', + 'post-image page-header-post-image', + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + generate_page_header_get_image_output() + ); + } + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + printf( + '
        +
        + %3$s + %5$s + %4$s +
        +
        ', + 'post-image generate-page-header generate-post-content-header page-header-post-image', + 'inside-page-header-container inside-post-content-header grid-container grid-parent', + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) + ); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php new file mode 100644 index 00000000..9768b43c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/page-header/functions/post-type.php @@ -0,0 +1,236 @@ + _x( 'Page Headers', 'Post Type General Name', 'gp-premium' ), + 'singular_name' => _x( 'Page Header', 'Post Type Singular Name', 'gp-premium' ), + 'menu_name' => __( 'Page Headers', 'gp-premium' ), + 'name_admin_bar' => __( 'Page Header', 'gp-premium' ), + 'archives' => __( 'Page Header Archives', 'gp-premium' ), + 'parent_item_colon' => __( 'Parent Page Header:', 'gp-premium' ), + 'all_items' => __( 'All Page Headers', 'gp-premium' ), + 'add_new_item' => __( 'Add New Page Header', 'gp-premium' ), + 'new_item' => __( 'New Page Header', 'gp-premium' ), + 'edit_item' => __( 'Edit Page Header', 'gp-premium' ), + 'update_item' => __( 'Update Page Header', 'gp-premium' ), + 'view_item' => __( 'View Page Header', 'gp-premium' ), + 'search_items' => __( 'Search Page Header', 'gp-premium' ), + 'insert_into_item' => __( 'Insert into Page Header', 'gp-premium' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Page Header', 'gp-premium' ), + ); + $args = array( + 'label' => __( 'Page Header', 'gp-premium' ), + 'labels' => $labels, + 'supports' => array( 'title', 'thumbnail' ), + 'hierarchical' => false, + 'public' => false, + 'show_ui' => true, + 'show_in_menu' => function_exists( 'generate_premium_do_elements' ) ? false : true, + 'menu_position' => 100, + 'menu_icon' => 'dashicons-welcome-widgets-menus', + 'show_in_admin_bar' => false, + 'show_in_nav_menus' => false, + 'can_export' => true, + 'has_archive' => false, + 'exclude_from_search' => true, + 'publicly_queryable' => false, + 'capability_type' => 'page', + ); + register_post_type( 'generate_page_header', $args ); + + $post_types = get_post_types( array( 'public' => true ) ); + $term_args = array( + 'sanitize_callback' => 'int', + 'type' => 'string', + 'description' => '', + 'single' => true, + 'show_in_rest' => true, + ); + foreach ( $post_types as $type ) { + register_meta( $type, 'generate_page_header', $term_args ); + } + + $taxonomies = get_taxonomies( array( 'public' => true ) ); + if ( $taxonomies ) { + foreach ( $taxonomies as $taxonomy ) { + add_action( $taxonomy . '_add_form_fields', 'generate_page_header_tax_new_ph_field' ); + add_action( $taxonomy . '_edit_form_fields', 'generate_page_header_tax_edit_ph_field' ); + add_action( 'edit_' . $taxonomy, 'generate_page_header_tax_save_ph' ); + add_action( 'create_' . $taxonomy, 'generate_page_header_tax_save_ph' ); + } + } +} + +add_action( 'admin_menu', 'generate_old_page_header_options_page' ); +/** + * Add our submenu page to the Appearance tab. + * + * @since 1.7 + */ +function generate_old_page_header_options_page() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + add_submenu_page( + 'themes.php', + esc_html__( 'Page Headers', 'gp-premium' ), + esc_html__( 'Page Headers', 'gp-premium' ), + 'manage_options', + 'edit.php?post_type=generate_page_header' + ); +} + +add_action( 'admin_head', 'generate_old_page_header_fix_menu' ); +/** + * Set our current menu in the admin while in the old Page Header pages. + * + * @since 1.7 + */ +function generate_old_page_header_fix_menu() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + global $parent_file, $submenu_file, $post_type; + + $screen = get_current_screen(); + + if ( 'generate_page_header' === $post_type || 'appearance_page_page-header-global-locations' === $screen->base ) { + $parent_file = 'themes.php'; + $submenu_file = 'edit.php?post_type=gp_elements'; + } + + remove_submenu_page( 'themes.php', 'edit.php?post_type=generate_page_header' ); + remove_submenu_page( 'themes.php', 'page-header-global-locations' ); +} + +add_action( 'admin_head', 'generate_page_header_add_legacy_locations_button', 999 ); +/** + * Add legacy buttons to our new GP Elements post type. + * + * @since 1.7 + */ +function generate_page_header_add_legacy_locations_button() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + $screen = get_current_screen(); + + if ( 'generate_page_header' === $screen->post_type ) : + ?> + + post_type && 'edit' === $screen->base ) : + ?> + + +
        + + +
        + + + + + + + + + + + tag in metabox +* Elements: Add generate_elements_metabox_ajax_allow_editors filter +* Elements: Add new 3.0 hooks to hook selector +* Elements: Re-add generate_elements_custom_args filter +* Menu Plus: Better prepare navigation as header for GP 3.0 +* Menu Plus: Better prepare Off-Canvas Panel for GP 3.0 +* Menu Plus: Better prepare sticky navigation for GP 3.0 +* Menu Plus: Add has-menu-bar-items class to mobile header if needed +* Menu Plus: Add is-logo-image class to all site logos +* Menu Plus: Fix mobile header alignment when it has menu bar items +* Secondary Nav: Better prepare sticky navigation for GP 3.0 +* Secondary Nav: Fix hidden navigation widget in top bar when merged with secondary nav +* Sites: Improve the option-only import feature +* Sites: Improve the refresh sites button functionality +* Sites: Improve the undo site import functionality +* Sites: Fix Elementor site import issues +* Sites: Re-add Elementor sites to library +* Spacing: Better prepare Customizer live preview for GP 3.0 +* Spacing: Fix blog column spacing Customizer live preview +* Spacing: Stop handling mobile header, widget and footer widget features added in GP 3.0 +* Typography: Add mobile font size control for H3 (when using GP 3.0) +* Typography: Add mobile font size control for H4 (when using GP 3.0) +* Typography: Add mobile font size control for H5 (when using GP 3.0) +* Typography: Allow empty tablet and mobile site title font size values +* Typography: Make menu toggle CSS selector specific to primary navigation +* WooCommerce: Use CSS for secondary product image functionality instead of JS +* WooCommerce: Only load .js file if needed +* WooCommerce: Fix quantity box functionality when multiple quantity boxes exist on the page +* General: Improve alpha color picker script for better 5.5 compatibility +* General: Move child theme stylesheet after dynamic stylesheet if enabled +* General: Update gp-premium-de_DE.mo +* General: Update gp-premium-es_ES.mo +* General: Update gp-premium-fi.mo +* General: Update gp-premium-pt_PT.mo +* General: Update gp-premium-sv_SE.mo + += 1.11.3 = +* Blog: Set widths to grid-sizer element +* Elements: Fix legacy Page Header/Hooks buttons in the Elements dashboard +* Page Header: Replace .load() with .on('load') +* Page Header: Fix color picker error in WP 5.5 + += 1.11.2 = +* Blog: Remove negative featured image top margin from columns when using one container +* Blog: Fix infinite scroll items loading above viewport when using columns +* Blog: Fix infinite scroll featured images not displaying in Safari +* Elements: Prevent error in editor when generate_get_option() function doesn't exist +* General: Load inline CSS in previews when using external CSS option +* General: Update gp-premium-es_ES.mo +* General: Update gp-premium-pt_PT.mo + += 1.11.1 = +* Elements: Remove stray quote character in Layout Element metabox +* Sections: Fix color picker JS error in WP 5.5 +* General: Fix external CSS option not removing inline CSS in some cases + += 1.11.0 = +* New: Block Elements +* New: Apply Layout Element options to the block editor if set +* New: Generate dynamic CSS in an external file +* Blog: Separate CSS and load only when needed +* Blog: Add column width classes to stylesheet +* Blog: Disable featured image itemprop if microdata is disabled +* Blog: Add generate_blog_masonry_init filter +* Blog: Add generate_blog_infinite_scroll_init filter +* Blog: Fix archive page header overlap when using no featured image padding/one container +* Blog: Replace screen reader text with aria-label in read more buttons +* Disable Elements: Add option to disable the Mobile Header +* Disable Elements: Disable top bar disables it even when combined with Secondary Nav +* Disable Elements: Use generate_show_post_navigation filter to disable single post navigation +* Elements: Use full hook name with generate_ prefix in dropdown +* Elements: Rebuild how Element types are chosen +* Elements: Add chosen hook under type column in edit.php +* Menu Plus: Add generate_after_mobile_header_menu_button filter +* Menu Plus: Add sticky placeholder only when nav becomes sticky +* Menu Plus: Add class to sticky nav when scrolling up +* Menu Plus: Fix navigation branding/mobile header layout when using RTL languages +* Page Header: Prevent PHP notices +* Secondary Nav: Clean up CSS +* Secondary Nav: Add generate_after_secondary_navigation hook +* Secondary Nav: Add generate_before_secondary_navigation hook +* Secondary Nav: Integrate with future flexbox option +* Secondary Nav: Add has-top-bar class if needed +* Secondary Nav: Add screen reader text to mobile menu toggle if no text exists +* Secondary Nav: Remove microdata if disabled +* Secondary Nav: Add generate_secondary_menu_bar_items hook +* Spacing: Set sidebar width in Customizer for future flexbox option +* WooCommerce: Add generate_woocommerce_show_add_to_cart_panel filter +* WooCommerce: Integrate with future flexbox option +* WooCommerce: Ensure WC()->cart is set +* WooCommerce: Remove left margin from SVG menu cart icon +* WooCommerce: Show sticky add to cart panel on sold individually products +* WooCommerce: Remove bottom margin from related/upsell products +* WooCommerce: Fix cart menu item spacing in RTL languages +* WooCommerce: Fix menu item cart dropdown design in RTL languages +* General: Update selectWoo +* General: Update select2 +* General: Run all CSS through PostCSS +* General: Fix various text domains +* General: Fix JS error when toggling nav as header option without Colors/Typography modules +* General: Update all translations over 90% complete +* General: PHP cleanup/coding standards +* General: Add off_canvas_desktop_toggle_label to wpml-config.xml + += 1.10.0 = +* Blog: Remove existing on-the-fly featured image resizer (Image Processing Queue) +* Blog: Choose from existing image sizes for featured images +* Blog: Use CSS to further resize featured images if necessary +* Blog: Fix edge case persistent transient bug with old image resizer +* Elements: Fix broken closing element in metabox +* General: Change scroll variable to gpscroll in smooth scroll script to avoid conflicts +* General: Update responsive widths in Customizer +* General: Fix responsive Customizer views when using RTL +* Menu Plus: Don't output sticky nav branding if sticky nav is disabled +* Menu Plus: Fix focus when off canvas overlay is opened (a11y) +* Menu Plus: Fix sticky navigation jump when navigation branding is in use +* Sections: Fix visible block editor when Sections are enabled +* WooCommerce: Use minmax in grid template definitions to fix overflow issue +* WooCommerce: Prevent add to cart panel interfering with back to top button on mobile +* WooCommerce: WooCommerce: Fix secondary image position if HTML isn't ordered correctly +* General: Add/update all translations over 50% complete. Big thanks to all contributors! +* Translation: Added Arabic - thank you anass! +* Translation: Added Bengali - thank you gtmroy! +* Translation: Added Spanish (Spain) - thank you davidperez (closemarketing.es)! +* Translation: Added Spanish (Argentina) - thank you bratorr! +* Translation: Added Finnish - thank you Stedi! +* Translation: Add Dutch - thank you Robin! +* Translation: Added Ukrainian - thank you EUROMEDIA! +* Translation: Vietnamese added - thank you themevi! + += 1.9.1 = +* Blog: Fix "null" in infinite scroll load more button text +* WooCommerce: Fix hidden added to cart panel on mobile when sticky nav active +* WooCommerce: Fix missing SVG icon in mobile added to cart panel + += 1.9.0 = +* Blog: Support SVG icon feature +* Colors: Add navigation search color options +* Disable Elements: Disable mobile menu in Mobile Header if nav is disabled +* Elements: Add wp_body_open hook +* Elements: Allow 0 mobile padding in Elements +* Elements: Add generate_elements_admin_menu_capability filter +* Elements: Add generate_page_hero_css_output filter +* Elements: Prevent error in Header Element if taxonomy doesn't exist +* Elements: Fix double logo when Header Element has logo + using nav as header +* Elements: Fix mobile header logo not replacing if merge is disabled +* Elements: Fix missing arrow in Choose Element Type select in WP 5.3 +* Elements: Add generate_inside_site_container hook option +* Elements: Add generate_after_entry_content hook option +* Menu Plus: Add off canvas desktop toggle label option +* Menu Plus: Add generate_off_canvas_toggle_output filter +* Menu Plus: Support SVG icon feature +* Menu Plus: Fix sticky navigation overlapping BB controls +* Menu Plus: Add align-items: center to nav as header, mobile header and sticky nav with branding +* Sections: Fix text/visual switch bug in Firefox +* Sites: Add option to revert site import +* Sites: Increase site library limit to 100 +* Spacing: Add live preview to group container padding +* Typography: Add tablet site title/navigation font size options +* Typography: Add archive post title weight, transform, font size and line height +* Typography: Add single content title weight, transform, font size and line height +* Typography: Only call all google fonts once in the Customizer +* Typography: Get Google fonts from readable JSON list +* Typography: Make sure font settings aren't lost if list is changed +* Typography: Only call generate_get_all_google_fonts if needed +* WooCommerce: Add columns gap options (desktop, tablet, mobile) +* WooCommerce: Add tablet column options +* WooCommerce: Add related/upsell tablet column options +* WooCommerce: Support SVG icon feature +* WooCommerce: Prevent empty added to cart panel on single products +* WooCommerce: Fix woocommerce-ordering arrow in old FF versions +* WooCommerce: Make item/items string translatable +* General: Better customizer device widths +* General: Use generate_premium_get_media_query throughout modules +* General: Improve Customizer control styling + += 1.8.3 = +* Menu Plus: Use flexbox for center aligned nav with nav branding +* Menu Plus: Center overlay off canvas exit button on mobile +* Menu Plus: Add alt tag to sticky nav logo +* Menu Plus: Set generate_not_mobile_menu_media_query filter based on mobile menu breakpoint +* Sections: Remember when text tab is active +* Sections: Disable visual editor if turned off in profile +* Typography: Add generate_google_font_display filter +* WooCommerce: Fix single product sidebar layout metabox option +* WooCommerce: Reduce carousel thumbnail max-width to 100px to match new thumbnail sizes + += 1.8.2 = +* Elements: Use Page Hero site title color for mobile header site title +* Menu Plus: Give mobile header site title more left spacing +* Menu Plus: Fix nav search icon in sticky navigation when using nav branding in Firefox +* Site Library: Show Site Library tab even if no sites exist +* Site Library: Show an error message in Site Library if no sites exist +* Typography: Remove reference to generate_get_navigation_location() function +* WooCommerce: Remove quantity field arrows when using quantity buttons in Firefox +* WooCommerce: Remove extra border when loading quantity buttons +* WooCommerce: Use get_price_html() is sticky add to cart panel + += 1.8.1 = +* Menu Plus: Revert sticky nav duplicate ID fix due to Cyrillic script bug + += 1.8 = +* Blog: Apply columns filter to masonry grid sizer +* Colors: Merge Footer Widgets and Footer controls in Color panel +* Colors: Remove edit_theme_options capability to Customizer controls (set by default) +* Disable Elements: Make sure mobile header is disabled when primary navigation is disabled +* Elements: Add content width option in Layout Element +* Elements: Fix mobile header logo when mobile menu toggled +* Elements: Add generate_page_hero_location filter +* Elements: Add generate_elements_show_object_ids filter to show IDs in Display Rule values +* Elements: Prevent merged header wrap from conflicting with Elementor controls +* Elements: Change Container tab name to Content +* Elements: Add woocommerce_share option to Hooks +* Elements: Improve WPML compatibility +* Elements: Improve Polylang compatibility +* Elements: Prevent PHP notices when adding taxonomy locations to non-existent archives +* Elements: Add generate_mobile_cart_items hook to hook list +* Elements: Add generate_element_post_id filter +* Elements: Escape HTML elements inside Element textarea +* Elements: Add Beaver Builder templates to the Display Rules +* Menu Plus: Add mobile header breakpoint option +* Menu Plus: Add off canvas overlay option +* Menu Plus: Add navigation as header option +* Menu Plus: Remove navigation logo option if navigation as header set +* Menu Plus: Add sticky navigation logo option +* Menu Plus: Allow site title in mobile header instead of logo +* Menu Plus: Add option to move exit button inside the off canvas panel +* Menu Plus: Change Slideout Navigation name to Off Canvas Panel +* Menu Plus: Only re-focus after slideout close on escape key +* Menu Plus: Give close slideout event a name so it can be removed +* Menu Plus: Remove invalid transition-delay +* Menu Plus: Improve slideout overlay transition +* Menu Plus: Add mobile open/close icons to GPP font +* Menu Plus: Allow dynamic widget classes in off canvas panel (fixes WC range slider widget issue) +* Menu Plus: Basic compatibility with future SVG icons +* Menu Plus: Prevent duplicate IDs when sticky navigation is cloned +* Secondary Nav: Add dropdown direction option +* Secondary Nav: Basic compatibility with future SVG icons +* Sections: Fix section editor issues in WP 5.0 +* Sections: Show Better Font Awesome icon in editor +* Sites: Re-design UI +* Sites: Add option to activate as a module like all the other modules +* Sites: Don't show backup options button if no options exist +* Sites: Make JS action classes more specific to the site library +* Sites: Set mime types of content.xml and widgets.wie +* Spacing: Add header padding option for mobile +* Spacing: Add widget padding option for mobile +* Spacing: Add footer widgets padding option for mobile +* Spacing: Add content separator option +* Spacing: Apply mobile menu item width to mobile bar only +* WooCommerce: Add option for mini cart in the menu +* WooCommerce: Add option to open off overlay panel on add to cart +* WooCommerce: Add option to open sticky add to cart panel on single products +* WooCommerce: Add option to add +/- buttons to the quantity fields +* WooCommerce: Add option to show number of items in cart menu item +* WooCommerce: Add option to choose single product image area width +* WooCommerce: Add color options for price slider widget +* WooCommerce: Use CSS grid for the product archives +* WooCommerce: Horizontally align add to cart buttons +* WooCommerce: Re-design the cart widget +* WooCommerce: Tighten up product info spacing +* WooCommerce: Improve product tab design to look more like tabs +* WooCommerce: Simplify single product image display +* WooCommerce: Use flexbox for quantity/add to cart alignment +* WooCommerce: Improve rating star styles +* WooCommerce: Use product alignment setting for related/upsell products +* WooCommerce: Remove bottom margin from product image +* WooCommerce: Organize colors in the Customizer +* WooCommerce: Remove title attribute from menu cart item +* WooCommerce: Improve coupon field design +* WooCommerce: Improve result count/ordering styling +* WooCommerce: Add gap around WC single product images +* WooCommerce: Remove arrow from checkout button +* WooCommerce: Hide view cart link on add to cart click +* WooCommerce: Organize CSS +* Introduce in-Customizer shortcuts +* Add generate_disable_customizer_shortcuts filter diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php new file mode 100644 index 00000000..d2bffea0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/fields/secondary-navigation.php @@ -0,0 +1,174 @@ + a, .secondary-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a, .secondary-navigation .menu-bar-item:hover > a, .secondary-navigation .menu-bar-item.sfHover > a'; + $menu_current_selectors = '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a'; + $submenu_hover_selectors = '.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):hover > a, .secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul ul li.sfHover:not([class*="current-menu-"]) > a'; + $submenu_current_selectors = '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a'; + + GeneratePress_Customize_Field::add_title( + 'generate_secondary_navigation_colors_title', + array( + 'section' => 'generate_colors_section', + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'secondary-navigation-colors', + ), + ) + ); + + // Navigation background group. + GeneratePress_Customize_Field::add_color_field_group( + 'secondary_navigation_background', + 'generate_colors_section', + 'secondary-navigation-colors', + array( + 'generate_secondary_nav_settings[navigation_background_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_background_color'], + 'label' => __( 'Navigation Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.secondary-navigation', + 'property' => 'background-color', + 'hide_label' => false, + ), + 'generate_secondary_nav_settings[navigation_background_hover_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_background_hover_color'], + 'label' => __( 'Navigation Background Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => $menu_hover_selectors, + 'property' => 'background-color', + 'hide_label' => true, + ), + 'generate_secondary_nav_settings[navigation_background_current_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_background_current_color'], + 'label' => __( 'Navigation Background Current', 'gp-premium' ), + 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), + 'element' => $menu_current_selectors, + 'property' => 'background-color', + 'hide_label' => true, + ), + ) + ); + + // Navigation text group. + GeneratePress_Customize_Field::add_color_field_group( + 'secondary_navigation_text', + 'generate_colors_section', + 'secondary-navigation-colors', + array( + 'generate_secondary_nav_settings[navigation_text_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_text_color'], + 'label' => __( 'Navigation Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.secondary-navigation .main-nav ul li a, .secondary-navigation .menu-toggle, .secondary-navigation button.menu-toggle:hover, .secondary-navigation button.menu-toggle:focus, .secondary-navigation .mobile-bar-items a, .secondary-navigation .mobile-bar-items a:hover, .secondary-navigation .mobile-bar-items a:focus, .secondary-navigation .menu-bar-items', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_secondary_nav_settings[navigation_text_hover_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_text_hover_color'], + 'label' => __( 'Navigation Text Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => $menu_hover_selectors, + 'property' => 'color', + 'hide_label' => true, + ), + 'generate_secondary_nav_settings[navigation_text_current_color]' => array( + 'default_value' => $secondary_color_defaults['navigation_text_current_color'], + 'label' => __( 'Navigation Text Current', 'gp-premium' ), + 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), + 'element' => $menu_current_selectors, + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + + // Sub-Menu background group. + GeneratePress_Customize_Field::add_color_field_group( + 'secondary_navigation_submenu_background', + 'generate_colors_section', + 'secondary-navigation-colors', + array( + 'generate_secondary_nav_settings[subnavigation_background_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_background_color'], + 'label' => __( 'Sub-Menu Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.secondary-navigation ul ul', + 'property' => 'background-color', + 'hide_label' => false, + ), + 'generate_secondary_nav_settings[subnavigation_background_hover_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_background_hover_color'], + 'label' => __( 'Sub-Menu Background Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => $submenu_hover_selectors, + 'property' => 'background-color', + 'hide_label' => true, + ), + 'generate_secondary_nav_settings[subnavigation_background_current_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_background_current_color'], + 'label' => __( 'Sub-Menu Background Current', 'gp-premium' ), + 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), + 'element' => $submenu_current_selectors, + 'property' => 'background-color', + 'hide_label' => true, + ), + ) + ); + + // Sub-Menu text group. + GeneratePress_Customize_Field::add_color_field_group( + 'secondary_navigation_submenu_text', + 'generate_colors_section', + 'secondary-navigation-colors', + array( + 'generate_secondary_nav_settings[subnavigation_text_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_text_color'], + 'label' => __( 'Sub-Menu Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.secondary-navigation .main-nav ul ul li a', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_secondary_nav_settings[subnavigation_text_hover_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_text_hover_color'], + 'label' => __( 'Sub-Menu Text Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => $submenu_hover_selectors, + 'property' => 'color', + 'hide_label' => true, + ), + 'generate_secondary_nav_settings[subnavigation_text_current_color]' => array( + 'default_value' => $secondary_color_defaults['subnavigation_text_current_color'], + 'label' => __( 'Sub-Menu Text Current', 'gp-premium' ), + 'tooltip' => __( 'Choose Current Color', 'gp-premium' ), + 'element' => $submenu_current_selectors, + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php new file mode 100644 index 00000000..370c5ef8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css.php @@ -0,0 +1,138 @@ +_selector ) { + $this->add_selector_rules_to_output(); + } + + $this->_selector = $selector; + return $this; + } + + /** + * Adds a css property with value to the css output. + * + * @access public + * @since 1.0 + * + * @param string $property - the css property. + * @param string $value - the value to be placed with the property. + * @param string $og_default - check to see if the value matches the default. + * @param string $unit - the unit for the value (px). + * @return $this + */ + public function add_property( $property, $value, $og_default = false, $unit = false ) { + // Add our unit to the value if it exists. + if ( $unit && '' !== $unit ) { + $value = $value . $unit; + if ( '' !== $og_default ) { + $og_default = $og_default . $unit; + } + } + + // If we don't have a value or our value is the same as our og default, bail. + if ( empty( $value ) || $og_default == $value ) { + return false; + } + + $this->_css .= $property . ':' . $value . ';'; + return $this; + } + + /** + * Adds the current selector rules to the output variable + * + * @access private + * @since 1.0 + * + * @return $this + */ + private function add_selector_rules_to_output() { + if ( ! empty( $this->_css ) ) { + $this->_selector_output = $this->_selector; + $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); + + $this->_output .= $selector_output; + + // Reset the css. + $this->_css = ''; + } + + return $this; + } + + /** + * Returns the minified css in the $_output variable + * + * @access public + * @since 1.0 + * + * @return string + */ + public function css_output() { + // Add current selector's rules to output. + $this->add_selector_rules_to_output(); + + // Output minified css. + return $this->_output; + } + + } +endif; diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css new file mode 100644 index 00000000..ed9b708c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.css @@ -0,0 +1,125 @@ +.secondary-navigation.toggled ul ul { + transition: 0s; + visibility: hidden; + float: none; +} + +.secondary-navigation.toggled ul ul.toggled-on { + visibility: visible; +} + +.secondary-navigation.toggled .main-nav ul ul { + position: relative; + top: 0; + left: 0; + width: 100%; + box-shadow: none; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.secondary-navigation.toggled .main-nav ul ul li:last-child > ul { + border-bottom: 0; +} + +.secondary-navigation.toggled .main-nav ul ul.toggled-on { + position: relative; + top: 0; + left: auto !important; + right: auto !important; + width: 100%; + pointer-events: auto; + height: auto; + opacity: 1; + display: block; +} + +.secondary-navigation.toggled .main-nav > ul { + display: block; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li { + float: none; + clear: both; + display: block !important; + text-align: left !important; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li.hide-on-mobile { + display: none !important; +} + +.secondary-navigation.toggled .dropdown-menu-toggle:before { + content: "\f107" !important; +} + +.secondary-navigation.toggled .sfHover > a .dropdown-menu-toggle:before { + content: "\f106" !important; +} + +.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle { + float: right; +} + +.dropdown-hover .secondary-navigation.toggled ul li:hover > ul, +.dropdown-hover .secondary-navigation.toggled ul li.sfHover > ul { + transition-delay: 0s; +} + +.rtl .secondary-navigation.toggled .main-nav .sf-menu > li { + text-align: right !important; +} + +@media (max-width: 768px) { + .secondary-navigation .menu-toggle { + display: block; + } + .secondary-navigation ul, + .secondary-navigation:not(.toggled) .main-nav > ul { + display: none; + } + .secondary-navigation.toggled .main-nav { + flex-basis: 100%; + order: 3; + } + .secondary-nav-aligned-left .secondary-navigation.has-top-bar .menu-toggle { + text-align: left; + } + .secondary-nav-aligned-left .secondary-navigation .top-bar { + order: 2; + } + .secondary-nav-aligned-right .secondary-navigation.has-top-bar .menu-toggle { + text-align: right; + } + .secondary-navigation.has-top-bar .top-bar .inside-top-bar .widget { + margin: 0 20px; + } + .secondary-nav-aligned-center .secondary-navigation .top-bar { + flex-basis: 100%; + } + .secondary-nav-float-right .secondary-navigation { + margin-left: 0; + width: 100%; + margin-top: 1.5em; + } + .secondary-nav-float-right .header-widget { + margin-left: auto; + } + .secondary-nav-float-left .secondary-navigation, + .secondary-nav-float-left .multi-navigation-wrapper { + margin-left: 0; + width: 100%; + margin-top: 1.5em; + } + .secondary-nav-float-left:not(.nav-float-right) .header-widget { + margin-left: auto; + margin-right: auto; + order: unset; + } + .secondary-nav-float-left .site-logo, + .secondary-nav-float-left .site-branding { + order: unset; + } + .secondary-navigation.has-top-bar .inside-navigation, .secondary-navigation.has-menu-bar-items .inside-navigation { + justify-content: space-between; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css new file mode 100644 index 00000000..567c5024 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main-mobile.min.css @@ -0,0 +1 @@ +.secondary-navigation.toggled ul ul{transition:0s;visibility:hidden;float:none}.secondary-navigation.toggled ul ul.toggled-on{visibility:visible}.secondary-navigation.toggled .main-nav ul ul{position:relative;top:0;left:0;width:100%;box-shadow:none;border-bottom:1px solid rgba(0,0,0,.05)}.secondary-navigation.toggled .main-nav ul ul li:last-child>ul{border-bottom:0}.secondary-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block}.secondary-navigation.toggled .main-nav>ul{display:block}.secondary-navigation.toggled .main-nav .sf-menu>li{float:none;clear:both;display:block!important;text-align:left!important}.secondary-navigation.toggled .main-nav .sf-menu>li.hide-on-mobile{display:none!important}.secondary-navigation.toggled .dropdown-menu-toggle:before{content:"\f107"!important}.secondary-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"!important}.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.dropdown-hover .secondary-navigation.toggled ul li.sfHover>ul,.dropdown-hover .secondary-navigation.toggled ul li:hover>ul{transition-delay:0s}.rtl .secondary-navigation.toggled .main-nav .sf-menu>li{text-align:right!important}@media (max-width:768px){.secondary-navigation .menu-toggle{display:block}.secondary-navigation ul,.secondary-navigation:not(.toggled) .main-nav>ul{display:none}.secondary-navigation.toggled .main-nav{flex-basis:100%;order:3}.secondary-nav-aligned-left .secondary-navigation.has-top-bar .menu-toggle{text-align:left}.secondary-nav-aligned-left .secondary-navigation .top-bar{order:2}.secondary-nav-aligned-right .secondary-navigation.has-top-bar .menu-toggle{text-align:right}.secondary-navigation.has-top-bar .top-bar .inside-top-bar .widget{margin:0 20px}.secondary-nav-aligned-center .secondary-navigation .top-bar{flex-basis:100%}.secondary-nav-float-right .secondary-navigation{margin-left:0;width:100%;margin-top:1.5em}.secondary-nav-float-right .header-widget{margin-left:auto}.secondary-nav-float-left .multi-navigation-wrapper,.secondary-nav-float-left .secondary-navigation{margin-left:0;width:100%;margin-top:1.5em}.secondary-nav-float-left:not(.nav-float-right) .header-widget{margin-left:auto;margin-right:auto;order:unset}.secondary-nav-float-left .site-branding,.secondary-nav-float-left .site-logo{order:unset}.secondary-navigation.has-menu-bar-items .inside-navigation,.secondary-navigation.has-top-bar .inside-navigation{justify-content:space-between}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css new file mode 100644 index 00000000..9540b8a4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.css @@ -0,0 +1,377 @@ +.secondary-navigation { + z-index: 99; + padding: 0; +} + +.secondary-navigation .inside-navigation { + display: flex; + align-items: center; + flex-wrap: wrap; + justify-content: space-between; +} + +.secondary-navigation ul { + list-style: none; + margin: 0; + padding-left: 0; +} + +.secondary-navigation li { + position: relative; +} + +.secondary-navigation a { + display: block; + text-decoration: none; +} + +.secondary-navigation ul ul { + display: block; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + float: left; + position: absolute; + left: -99999px; + opacity: 0; + z-index: 99999; + width: 200px; + text-align: left; + top: auto; + transition: opacity 80ms linear; + transition-delay: 0s; + pointer-events: none; + height: 0; + overflow: hidden; +} + +.secondary-navigation ul ul li { + width: 100%; +} + +.secondary-navigation ul ul li a { + line-height: normal; + font-size: 90%; +} + +.secondary-navigation.sub-menu-left ul ul { + box-shadow: -1px 1px 0 rgba(0, 0, 0, 0.1); +} + +.secondary-navigation.sub-menu-left .sub-menu { + right: 0; +} + +.secondary-navigation .main-nav > ul { + display: flex; + flex-wrap: wrap; +} + +.secondary-navigation .main-nav ul ul li a { + line-height: normal; + font-size: 12px; + padding-left: 20px; + padding-right: 20px; + padding-top: 10px; + padding-bottom: 10px; +} + +.secondary-navigation .main-nav ul li.menu-item-has-children > a { + padding-right: 0; + position: relative; +} + +.secondary-navigation .main-nav ul li a { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; +} + +.secondary-navigation .menu-toggle { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; + margin: 0; +} + +.secondary-navigation .menu-item-has-children .dropdown-menu-toggle { + padding-right: 20px; +} + +.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + padding-top: 10px; + padding-bottom: 10px; + margin-top: -10px; +} + +.secondary-navigation .secondary-menu-bar-items { + display: flex; + align-items: center; + font-size: 13px; +} + +.secondary-navigation .menu-bar-item { + position: relative; +} + +.secondary-navigation .menu-bar-item.search-item { + z-index: 20; +} + +.secondary-navigation .menu-bar-item > a { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover > ul { + left: auto; + opacity: 1; + transition-delay: 150ms; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover > ul { + left: 100%; + top: 0; +} + +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover > ul { + right: 100%; + top: 0; + left: auto; +} + +.secondary-nav-float-right .header-widget { + margin-left: 20px; +} + +.secondary-nav-float-right .secondary-navigation { + margin-left: auto; +} + +.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a { + line-height: normal; +} + +.secondary-nav-float-right .secondary-navigation ul ul ul { + top: 0; +} + +.secondary-nav-float-right .multi-navigation-wrapper { + margin-left: auto; +} + +.secondary-nav-float-left .secondary-navigation, +.secondary-nav-float-left .multi-navigation-wrapper { + margin-right: auto; +} + +.secondary-nav-float-left .site-logo, +.secondary-nav-float-left .site-branding { + order: 5; +} + +.secondary-nav-float-left:not(.nav-float-right) .header-widget { + order: -10; + margin-left: 0; + margin-right: 20px; +} + +.secondary-nav-float-left.nav-float-right .site-branding, +.secondary-nav-float-left.nav-float-right .site-logo { + margin-left: auto; + margin-right: auto; +} + +.secondary-nav-float-left.nav-float-right .inside-header .main-navigation, +.secondary-nav-float-left.nav-float-right .header-widget { + order: 10; +} + +.secondary-nav-float-right.nav-float-left .secondary-navigation { + order: 10; +} + +.multi-navigation-wrapper { + display: flex; + flex-direction: column; +} + +.widget-area .secondary-navigation li { + display: block; + float: none; + margin: 0; + padding: 0; + width: 100%; +} + +.widget-area .secondary-navigation ul ul { + left: 100%; + top: 0; + width: 220px; +} + +.secondary-nav-aligned-right .secondary-navigation .inside-navigation { + justify-content: flex-end; +} + +.secondary-nav-aligned-right.rtl .secondary-navigation .inside-navigation { + justify-content: flex-start; +} + +.secondary-nav-aligned-center .secondary-navigation .inside-navigation { + justify-content: center; +} + +.secondary-nav-aligned-center .secondary-navigation .main-nav > ul { + justify-content: center; +} + +.secondary-nav-aligned-left.rtl .secondary-navigation .inside-navigation { + justify-content: flex-end; +} + +.dropdown-click .secondary-navigation ul ul { + visibility: hidden; + float: none; +} + +.dropdown-click .secondary-navigation ul.toggled-on, +.dropdown-click .secondary-navigation ul li.sfHover > ul.toggled-on { + left: auto; + opacity: 1; + visibility: visible; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-click .secondary-navigation ul ul ul.toggled-on { + left: 0; + top: auto; + position: relative; + box-shadow: none; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.dropdown-click .secondary-navigation ul ul li:last-child > ul.toggled-on { + border-bottom: 0; +} + +.dropdown-click .widget-area .secondary-navigation ul ul { + top: auto; + position: absolute; + float: none; + width: 100%; + left: -99999px; +} + +.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on { + position: relative; + left: 0; + right: 0; +} + +.both-right .widget-area .secondary-navigation ul ul, +.right-sidebar .widget-area .secondary-navigation ul ul, +.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + left: auto; + right: 100%; +} + +.dropdown-click.both-right .widget-area .secondary-navigation ul ul, +.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul, +.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + right: 0; +} + +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover > ul { + top: 0; + left: 100%; + width: 220px; +} + +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul { + right: 100%; + left: auto; +} + +.rtl .secondary-navigation ul ul { + float: right; + left: auto; + right: 0; + text-align: right; +} + +.rtl .secondary-navigation ul ul ul { + left: auto; + right: 100%; +} + +.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + transform: rotate(180deg); +} + +/* Top bar */ +.secondary-navigation.has-top-bar .menu-toggle, .secondary-navigation.has-menu-bar-items .menu-toggle { + flex-grow: 0; +} + +.secondary-navigation .top-bar { + background: transparent; +} + +.secondary-navigation .top-bar a { + display: inline; +} + +.secondary-navigation .inside-top-bar { + padding: 0; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar { + margin-right: auto; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget { + margin: 0 10px; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar { + order: 2; + margin-left: auto; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget { + margin-left: 10px; +} + +.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-top-bar { + justify-content: center; +} + +.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-navigation { + display: block; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css new file mode 100644 index 00000000..e21c11da --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/main.min.css @@ -0,0 +1 @@ +.secondary-navigation{z-index:99;padding:0}.secondary-navigation .inside-navigation{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}.secondary-navigation ul{list-style:none;margin:0;padding-left:0}.secondary-navigation li{position:relative}.secondary-navigation a{display:block;text-decoration:none}.secondary-navigation ul ul{display:block;box-shadow:0 1px 1px rgba(0,0,0,.1);float:left;position:absolute;left:-99999px;opacity:0;z-index:99999;width:200px;text-align:left;top:auto;transition:opacity 80ms linear;transition-delay:0s;pointer-events:none;height:0;overflow:hidden}.secondary-navigation ul ul li{width:100%}.secondary-navigation ul ul li a{line-height:normal;font-size:90%}.secondary-navigation.sub-menu-left ul ul{box-shadow:-1px 1px 0 rgba(0,0,0,.1)}.secondary-navigation.sub-menu-left .sub-menu{right:0}.secondary-navigation .main-nav>ul{display:flex;flex-wrap:wrap}.secondary-navigation .main-nav ul ul li a{line-height:normal;font-size:12px;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px}.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-right:0;position:relative}.secondary-navigation .main-nav ul li a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.secondary-navigation .menu-toggle{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px;margin:0}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:20px}.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{padding-top:10px;padding-bottom:10px;margin-top:-10px}.secondary-navigation .secondary-menu-bar-items{display:flex;align-items:center;font-size:13px}.secondary-navigation .menu-bar-item{position:relative}.secondary-navigation .menu-bar-item.search-item{z-index:20}.secondary-navigation .menu-bar-item>a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover>ul{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible}.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover>ul{left:100%;top:0}.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover>ul{right:100%;top:0;left:auto}.secondary-nav-float-right .header-widget{margin-left:20px}.secondary-nav-float-right .secondary-navigation{margin-left:auto}.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a{line-height:normal}.secondary-nav-float-right .secondary-navigation ul ul ul{top:0}.secondary-nav-float-right .multi-navigation-wrapper{margin-left:auto}.secondary-nav-float-left .multi-navigation-wrapper,.secondary-nav-float-left .secondary-navigation{margin-right:auto}.secondary-nav-float-left .site-branding,.secondary-nav-float-left .site-logo{order:5}.secondary-nav-float-left:not(.nav-float-right) .header-widget{order:-10;margin-left:0;margin-right:20px}.secondary-nav-float-left.nav-float-right .site-branding,.secondary-nav-float-left.nav-float-right .site-logo{margin-left:auto;margin-right:auto}.secondary-nav-float-left.nav-float-right .header-widget,.secondary-nav-float-left.nav-float-right .inside-header .main-navigation{order:10}.secondary-nav-float-right.nav-float-left .secondary-navigation{order:10}.multi-navigation-wrapper{display:flex;flex-direction:column}.widget-area .secondary-navigation li{display:block;float:none;margin:0;padding:0;width:100%}.widget-area .secondary-navigation ul ul{left:100%;top:0;width:220px}.secondary-nav-aligned-right .secondary-navigation .inside-navigation{justify-content:flex-end}.secondary-nav-aligned-right.rtl .secondary-navigation .inside-navigation{justify-content:flex-start}.secondary-nav-aligned-center .secondary-navigation .inside-navigation{justify-content:center}.secondary-nav-aligned-center .secondary-navigation .main-nav>ul{justify-content:center}.secondary-nav-aligned-left.rtl .secondary-navigation .inside-navigation{justify-content:flex-end}.dropdown-click .secondary-navigation ul ul{visibility:hidden;float:none}.dropdown-click .secondary-navigation ul li.sfHover>ul.toggled-on,.dropdown-click .secondary-navigation ul.toggled-on{left:auto;opacity:1;visibility:visible;pointer-events:auto;height:auto;overflow:visible}.dropdown-click .secondary-navigation ul ul ul.toggled-on{left:0;top:auto;position:relative;box-shadow:none;border-bottom:1px solid rgba(0,0,0,.05)}.dropdown-click .secondary-navigation ul ul li:last-child>ul.toggled-on{border-bottom:0}.dropdown-click .widget-area .secondary-navigation ul ul{top:auto;position:absolute;float:none;width:100%;left:-99999px}.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on{position:relative;left:0;right:0}.both-right .widget-area .secondary-navigation ul ul,.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.right-sidebar .widget-area .secondary-navigation ul ul{left:auto;right:100%}.dropdown-click.both-right .widget-area .secondary-navigation ul ul,.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul{right:0}.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{top:0;left:100%;width:220px}.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{right:100%;left:auto}.rtl .secondary-navigation ul ul{float:right;left:auto;right:0;text-align:right}.rtl .secondary-navigation ul ul ul{left:auto;right:100%}.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{transform:rotate(180deg)}.secondary-navigation.has-menu-bar-items .menu-toggle,.secondary-navigation.has-top-bar .menu-toggle{flex-grow:0}.secondary-navigation .top-bar{background:0 0}.secondary-navigation .top-bar a{display:inline}.secondary-navigation .inside-top-bar{padding:0}.secondary-nav-aligned-right .secondary-navigation .top-bar{margin-right:auto}.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget{margin:0 10px}.secondary-nav-aligned-left .secondary-navigation .top-bar{order:2;margin-left:auto}.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget{margin-left:10px}.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-top-bar{justify-content:center}.secondary-nav-aligned-center .secondary-navigation.has-top-bar .inside-navigation{display:block} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css new file mode 100644 index 00000000..51b5e656 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.css @@ -0,0 +1,97 @@ +.secondary-navigation.toggled ul ul { + transition: 0s; + visibility: hidden; +} + +.secondary-navigation.toggled ul ul.toggled-on { + visibility: visible; +} + +.secondary-navigation.toggled .main-nav ul ul { + position: relative; + top: 0; + left: 0; + width: 100%; +} + +.secondary-navigation.toggled .main-nav ul ul.toggled-on { + position: relative; + top: 0; + left: auto !important; + right: auto !important; + width: 100%; + pointer-events: auto; + height: auto; + opacity: 1; + display: block; +} + +.secondary-navigation.toggled .main-nav > ul { + display: block; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li { + float: none; + clear: both; + display: block !important; + text-align: left !important; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li.hide-on-mobile { + display: none !important; +} + +.secondary-navigation.toggled .dropdown-menu-toggle:before { + content: "\f107" !important; +} + +.secondary-navigation.toggled .sfHover > a .dropdown-menu-toggle:before { + content: "\f106" !important; +} + +.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle { + float: right; +} + +.secondary-navigation.toggled .sf-menu > li.menu-item-float-right { + float: none !important; + display: inline-block; +} + +.dropdown-hover .secondary-navigation.toggled ul li:hover > ul, +.dropdown-hover .secondary-navigation.toggled ul li.sfHover > ul { + transition-delay: 0s; +} + +.rtl .secondary-navigation.toggled .main-nav .sf-menu > li { + text-align: right !important; +} + +@media (max-width: 768px) { + .secondary-nav-float-left .inside-header .secondary-navigation { + float: none; + } + .secondary-navigation .menu-toggle { + display: block; + } + .secondary-navigation ul { + display: none; + } + .secondary-nav-aligned-left .secondary-navigation .top-bar { + position: absolute; + right: 0; + } + .secondary-nav-aligned-left .secondary-navigation .top-bar + .menu-toggle { + text-align: left; + } + .secondary-nav-aligned-right .secondary-navigation .top-bar { + position: absolute; + left: 0; + } + .secondary-nav-aligned-right .secondary-navigation .top-bar + .menu-toggle { + text-align: right; + } + .secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { + display: block; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css new file mode 100644 index 00000000..f1ded0a3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style-mobile.min.css @@ -0,0 +1 @@ +.secondary-navigation.toggled ul ul{transition:0s;visibility:hidden}.secondary-navigation.toggled ul ul.toggled-on{visibility:visible}.secondary-navigation.toggled .main-nav ul ul{position:relative;top:0;left:0;width:100%}.secondary-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block}.secondary-navigation.toggled .main-nav>ul{display:block}.secondary-navigation.toggled .main-nav .sf-menu>li{float:none;clear:both;display:block!important;text-align:left!important}.secondary-navigation.toggled .main-nav .sf-menu>li.hide-on-mobile{display:none!important}.secondary-navigation.toggled .dropdown-menu-toggle:before{content:"\f107"!important}.secondary-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"!important}.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.secondary-navigation.toggled .sf-menu>li.menu-item-float-right{float:none!important;display:inline-block}.dropdown-hover .secondary-navigation.toggled ul li.sfHover>ul,.dropdown-hover .secondary-navigation.toggled ul li:hover>ul{transition-delay:0s}.rtl .secondary-navigation.toggled .main-nav .sf-menu>li{text-align:right!important}@media (max-width:768px){.secondary-nav-float-left .inside-header .secondary-navigation{float:none}.secondary-navigation .menu-toggle{display:block}.secondary-navigation ul{display:none}.secondary-nav-aligned-left .secondary-navigation .top-bar{position:absolute;right:0}.secondary-nav-aligned-left .secondary-navigation .top-bar+.menu-toggle{text-align:left}.secondary-nav-aligned-right .secondary-navigation .top-bar{position:absolute;left:0}.secondary-nav-aligned-right .secondary-navigation .top-bar+.menu-toggle{text-align:right}.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div{display:block}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css new file mode 100644 index 00000000..e24c07f1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.css @@ -0,0 +1,337 @@ +.secondary-navigation { + clear: both; + z-index: 99; + padding: 0; +} + +.secondary-navigation ul { + list-style: none; + margin: 0; + padding-left: 0; +} + +.secondary-navigation li { + float: left; + position: relative; +} + +.secondary-navigation a { + display: block; + text-decoration: none; +} + +.secondary-navigation ul ul { + display: block; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); + float: left; + position: absolute; + left: -99999px; + opacity: 0; + z-index: 99999; + width: 200px; + text-align: left; + top: auto; + transition: opacity 80ms linear; + transition-delay: 0s; + pointer-events: none; + height: 0; + overflow: hidden; +} + +.secondary-navigation ul ul li { + width: 100%; +} + +.secondary-navigation ul ul li a { + line-height: normal; + font-size: 90%; +} + +.secondary-navigation.sub-menu-left .sub-menu { + right: 0; +} + +.secondary-navigation .main-nav ul ul li a { + line-height: normal; + font-size: 12px; + padding-left: 20px; + padding-right: 20px; + padding-top: 10px; + padding-bottom: 10px; +} + +.secondary-navigation .main-nav ul li.menu-item-has-children > a { + padding-right: 0; + position: relative; +} + +.secondary-navigation .main-nav ul li a { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; +} + +.secondary-navigation .menu-toggle { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; + margin: 0; +} + +.secondary-navigation .menu-item-has-children .dropdown-menu-toggle { + padding-right: 20px; +} + +.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + padding-top: 10px; + padding-bottom: 10px; + margin-top: -10px; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover > ul { + left: auto; + opacity: 1; + transition-delay: 150ms; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover > ul { + left: 100%; + top: 0; +} + +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover > ul { + right: 100%; + top: 0; + left: auto; +} + +.secondary-nav-float-right .secondary-navigation { + float: right; +} + +.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a { + line-height: normal; +} + +.secondary-nav-float-right .secondary-navigation ul ul ul { + top: 0; +} + +.secondary-nav-float-left .inside-header .secondary-navigation { + float: left; + clear: left; +} + +.secondary-nav-float-left .inside-header:after { + clear: both; + content: ''; + display: table; +} + +.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding, +.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo { + float: right; + clear: right; +} + +.secondary-nav-float-left.nav-float-right .inside-header .site-branding, +.secondary-nav-float-left.nav-float-right .inside-header .site-logo { + float: none; + clear: none; +} + +.secondary-nav-float-left.nav-float-right .site-header { + text-align: center; +} + +.secondary-nav-float-right.nav-float-left .inside-header .site-branding, +.secondary-nav-float-right.nav-float-left .inside-header .site-logo { + float: none; + clear: none; +} + +.secondary-nav-float-right.nav-float-left .site-header { + text-align: center; +} + +.widget-area .secondary-navigation li { + display: block; + float: none; + margin: 0; + padding: 0; + width: 100%; +} + +.widget-area .secondary-navigation ul ul { + left: 100%; + top: 0; + width: 220px; +} + +.both-right .widget-area .secondary-navigation ul ul, +.right-sidebar .widget-area .secondary-navigation ul ul, +.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + left: auto; + right: 100%; +} + +.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu > li { + float: none; + display: inline-block; +} + +.secondary-nav-aligned-right .secondary-navigation ul.secondary-menu, +.secondary-nav-aligned-center .secondary-navigation ul.secondary-menu { + font-size: 0px; +} + +.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation { + text-align: left; +} + +.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation:after, +.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation:after { + clear: both; + content: ''; + display: table; +} + +.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation { + text-align: center; +} + +.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation { + text-align: right; +} + +.dropdown-click .secondary-navigation ul ul { + visibility: hidden; +} + +.dropdown-click .secondary-navigation ul.toggled-on, +.dropdown-click .secondary-navigation ul li.sfHover > ul.toggled-on { + left: auto; + opacity: 1; + visibility: visible; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-click .secondary-navigation ul ul ul.toggled-on { + left: 0; + top: auto; + position: relative; +} + +.dropdown-click .widget-area .secondary-navigation ul ul { + top: auto; + position: absolute; + float: none; + width: 100%; + left: -99999px; +} + +.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on { + position: relative; + left: 0; + right: 0; +} + +.dropdown-click.both-right .widget-area .secondary-navigation ul ul, +.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul, +.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + right: 0; +} + +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover > ul { + top: 0; + left: 100%; + width: 220px; +} + +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul { + right: 100%; + left: auto; +} + +.rtl .secondary-navigation ul ul { + float: right; + left: auto; + right: 0; + text-align: right; +} + +.rtl .secondary-navigation ul ul ul { + left: auto; + right: 100%; +} + +.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + transform: rotate(180deg); +} + +/* Top bar */ +.secondary-navigation .top-bar { + background: transparent; +} + +.secondary-navigation .inside-top-bar { + padding: 0; +} + +.secondary-navigation .top-bar a { + display: inline; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar { + float: left; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget { + margin: 0 10px; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar { + float: right; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget { + margin-left: 10px; +} + +.secondary-nav-aligned-center .secondary-navigation .top-bar, +.secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { + display: inline-block; + vertical-align: middle; +} + +.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child) { + margin-left: 10px; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css new file mode 100644 index 00000000..88215e4e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/css/style.min.css @@ -0,0 +1 @@ +.secondary-navigation{clear:both;z-index:99;padding:0}.secondary-navigation ul{list-style:none;margin:0;padding-left:0}.secondary-navigation li{float:left;position:relative}.secondary-navigation a{display:block;text-decoration:none}.secondary-navigation ul ul{display:block;box-shadow:0 2px 2px rgba(0,0,0,.1);float:left;position:absolute;left:-99999px;opacity:0;z-index:99999;width:200px;text-align:left;top:auto;transition:opacity 80ms linear;transition-delay:0s;pointer-events:none;height:0;overflow:hidden}.secondary-navigation ul ul li{width:100%}.secondary-navigation ul ul li a{line-height:normal;font-size:90%}.secondary-navigation.sub-menu-left .sub-menu{right:0}.secondary-navigation .main-nav ul ul li a{line-height:normal;font-size:12px;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px}.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-right:0;position:relative}.secondary-navigation .main-nav ul li a{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.secondary-navigation .menu-toggle{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px;margin:0}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:20px}.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{padding-top:10px;padding-bottom:10px;margin-top:-10px}.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover>ul{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible}.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover>ul{left:100%;top:0}.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover>ul{right:100%;top:0;left:auto}.secondary-nav-float-right .secondary-navigation{float:right}.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a{line-height:normal}.secondary-nav-float-right .secondary-navigation ul ul ul{top:0}.secondary-nav-float-left .inside-header .secondary-navigation{float:left;clear:left}.secondary-nav-float-left .inside-header:after{clear:both;content:'';display:table}.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding,.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo{float:right;clear:right}.secondary-nav-float-left.nav-float-right .inside-header .site-branding,.secondary-nav-float-left.nav-float-right .inside-header .site-logo{float:none;clear:none}.secondary-nav-float-left.nav-float-right .site-header{text-align:center}.secondary-nav-float-right.nav-float-left .inside-header .site-branding,.secondary-nav-float-right.nav-float-left .inside-header .site-logo{float:none;clear:none}.secondary-nav-float-right.nav-float-left .site-header{text-align:center}.widget-area .secondary-navigation li{display:block;float:none;margin:0;padding:0;width:100%}.widget-area .secondary-navigation ul ul{left:100%;top:0;width:220px}.both-right .widget-area .secondary-navigation ul ul,.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.right-sidebar .widget-area .secondary-navigation ul ul{left:auto;right:100%}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu>li{float:none;display:inline-block}.secondary-nav-aligned-center .secondary-navigation ul.secondary-menu,.secondary-nav-aligned-right .secondary-navigation ul.secondary-menu{font-size:0}.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation{text-align:left}.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation:after,.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation:after{clear:both;content:'';display:table}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation{text-align:center}.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation{text-align:right}.dropdown-click .secondary-navigation ul ul{visibility:hidden}.dropdown-click .secondary-navigation ul li.sfHover>ul.toggled-on,.dropdown-click .secondary-navigation ul.toggled-on{left:auto;opacity:1;visibility:visible;pointer-events:auto;height:auto;overflow:visible}.dropdown-click .secondary-navigation ul ul ul.toggled-on{left:0;top:auto;position:relative}.dropdown-click .widget-area .secondary-navigation ul ul{top:auto;position:absolute;float:none;width:100%;left:-99999px}.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on{position:relative;left:0;right:0}.dropdown-click.both-right .widget-area .secondary-navigation ul ul,.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul{right:0}.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{top:0;left:100%;width:220px}.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{right:100%;left:auto}.rtl .secondary-navigation ul ul{float:right;left:auto;right:0;text-align:right}.rtl .secondary-navigation ul ul ul{left:auto;right:100%}.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{transform:rotate(180deg)}.secondary-navigation .top-bar{background:0 0}.secondary-navigation .inside-top-bar{padding:0}.secondary-navigation .top-bar a{display:inline}.secondary-nav-aligned-right .secondary-navigation .top-bar{float:left}.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget{margin:0 10px}.secondary-nav-aligned-left .secondary-navigation .top-bar{float:right}.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget{margin-left:10px}.secondary-nav-aligned-center .secondary-navigation .top-bar,.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div{display:inline-block;vertical-align:middle}.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child){margin-left:10px} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php new file mode 100644 index 00000000..5738848a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/functions/functions.php @@ -0,0 +1,1356 @@ + __( 'Secondary Menu', 'gp-premium' ), + ) + ); + } +} + +if ( ! function_exists( 'generate_secondary_nav_enqueue_scripts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_secondary_nav_enqueue_scripts', 100 ); + /** + * Add our necessary scripts. + * + * @since 0.1 + */ + function generate_secondary_nav_enqueue_scripts() { + // Bail if no Secondary menu is set. + if ( ! has_nav_menu( 'secondary' ) ) { + return; + } + + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + wp_enqueue_style( 'generate-secondary-nav', plugin_dir_url( __FILE__ ) . "css/main{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION ); + wp_enqueue_style( 'generate-secondary-nav-mobile', plugin_dir_url( __FILE__ ) . "css/main-mobile{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION, 'all' ); + } else { + wp_enqueue_style( 'generate-secondary-nav', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION ); + wp_enqueue_style( 'generate-secondary-nav-mobile', plugin_dir_url( __FILE__ ) . "css/style-mobile{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION, 'all' ); + } + + if ( ! defined( 'GENERATE_DISABLE_MOBILE' ) ) { + wp_add_inline_script( + 'generate-navigation', + "jQuery( document ).ready( function($) { + $( '.secondary-navigation .menu-toggle' ).on( 'click', function( e ) { + e.preventDefault(); + $( this ).closest( '.secondary-navigation' ).toggleClass( 'toggled' ); + $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded', $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded' ) === 'true' ? 'false' : 'true' ); + $( this ).toggleClass( 'toggled' ); + $( this ).children( 'i' ).toggleClass( 'fa-bars' ).toggleClass( 'fa-close' ); + $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); + }); + });" + ); + } + } +} + +if ( ! function_exists( 'generate_secondary_nav_enqueue_customizer_scripts' ) ) { + add_action( 'customize_preview_init', 'generate_secondary_nav_enqueue_customizer_scripts' ); + /** + * Add our Customizer preview JS. + * + * @since 0.1 + */ + function generate_secondary_nav_enqueue_customizer_scripts() { + wp_enqueue_script( 'generate-secondary-nav-customizer', plugin_dir_url( __FILE__ ) . 'js/customizer.js', array( 'jquery', 'customize-preview' ), GENERATE_SECONDARY_NAV_VERSION, true ); + + wp_localize_script( + 'generate-secondary-nav-customizer', + 'generateSecondaryNav', + array( + 'isFlex' => function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox(), + ) + ); + } +} + +if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) { + /** + * Set default options. + * + * @since 0.1 + * @param bool $filter Whether to filter the defaults or not. + */ + function generate_secondary_nav_get_defaults( $filter = true ) { + $generate_defaults = array( + 'secondary_nav_mobile_label' => 'Menu', + 'secondary_nav_layout_setting' => 'secondary-fluid-nav', + 'secondary_nav_inner_width' => 'contained', + 'secondary_nav_position_setting' => 'secondary-nav-above-header', + 'secondary_nav_alignment' => 'right', + 'secondary_nav_dropdown_direction' => 'right', + 'navigation_background_color' => '#636363', + 'navigation_text_color' => '#ffffff', + 'navigation_background_hover_color' => '#303030', + 'navigation_text_hover_color' => '#ffffff', + 'navigation_background_current_color' => '#ffffff', + 'navigation_text_current_color' => '#222222', + 'subnavigation_background_color' => '#303030', + 'subnavigation_text_color' => '#ffffff', + 'subnavigation_background_hover_color' => '#474747', + 'subnavigation_text_hover_color' => '#ffffff', + 'subnavigation_background_current_color' => '#474747', + 'subnavigation_text_current_color' => '#ffffff', + 'secondary_menu_item' => '20', + 'secondary_menu_item_height' => '40', + 'secondary_sub_menu_item_height' => '10', + 'font_secondary_navigation' => 'inherit', + 'font_secondary_navigation_variants' => '', + 'font_secondary_navigation_category' => '', + 'secondary_navigation_font_weight' => 'normal', + 'secondary_navigation_font_transform' => 'none', + 'secondary_navigation_font_size' => '13', + 'nav_image' => '', + 'nav_repeat' => '', + 'nav_item_image' => '', + 'nav_item_repeat' => '', + 'nav_item_hover_image' => '', + 'nav_item_hover_repeat' => '', + 'nav_item_current_image' => '', + 'nav_item_current_repeat' => '', + 'sub_nav_image' => '', + 'sub_nav_repeat' => '', + 'sub_nav_item_image' => '', + 'sub_nav_item_repeat' => '', + 'sub_nav_item_hover_image' => '', + 'sub_nav_item_hover_repeat' => '', + 'sub_nav_item_current_image' => '', + 'sub_nav_item_current_repeat' => '', + 'merge_top_bar' => false, + ); + + if ( $filter ) { + return apply_filters( 'generate_secondary_nav_option_defaults', $generate_defaults ); + } + + return $generate_defaults; + } +} + +if ( ! function_exists( 'generate_secondary_nav_customize_register' ) ) { + add_action( 'customize_register', 'generate_secondary_nav_customize_register', 100 ); + /** + * Register our options. + * + * @since 0.1 + * @param object $wp_customize The Customizer object. + */ + function generate_secondary_nav_customize_register( $wp_customize ) { + $defaults = generate_secondary_nav_get_defaults(); + + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + if ( method_exists( $wp_customize, 'register_control_type' ) ) { + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Use the Layout panel in the free theme if it exists. + if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $layout_panel = 'generate_layout_panel'; + } else { + $layout_panel = 'secondary_navigation_panel'; + } + + // Add our secondary navigation panel. + // This shouldn't be used anymore if the theme is up to date. + if ( class_exists( 'WP_Customize_Panel' ) ) { + $wp_customize->add_panel( + 'secondary_navigation_panel', + array( + 'priority' => 100, + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'description' => '', + ) + ); + } + + $wp_customize->add_section( + 'secondary_nav_section', + array( + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 31, + 'panel' => $layout_panel, + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_secondary_navigation_layout_shortcuts', + array( + 'section' => 'secondary_nav_section', + 'element' => __( 'Secondary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'secondary_navigation_color_section', + 'typography' => 'secondary_font_section', + 'backgrounds' => 'secondary_bg_images_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_mobile_label]', + array( + 'default' => $defaults['secondary_nav_mobile_label'], + 'type' => 'option', + 'sanitize_callback' => 'wp_kses_post', + ) + ); + + $wp_customize->add_control( + 'secondary_nav_mobile_label_control', + array( + 'label' => __( 'Mobile Menu Label', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => 'generate_secondary_nav_settings[secondary_nav_mobile_label]', + 'priority' => 10, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + array( + 'default' => $defaults['secondary_nav_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'secondary-fluid-nav' => _x( 'Full', 'Width', 'gp-premium' ), + 'secondary-contained-nav' => _x( 'Contained', 'Width', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + 'priority' => 15, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_inner_width]', + array( + 'default' => $defaults['secondary_nav_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Inner Navigation Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'full-width' => _x( 'Full', 'Width', 'gp-premium' ), + 'contained' => _x( 'Contained', 'Width', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_inner_width]', + 'priority' => 15, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_alignment]', + array( + 'default' => $defaults['secondary_nav_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_alignment]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Alignment', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_alignment]', + 'priority' => 20, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_position_setting]', + array( + 'default' => $defaults['secondary_nav_position_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_position_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Location', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'secondary-nav-below-header' => __( 'Below Header', 'gp-premium' ), + 'secondary-nav-above-header' => __( 'Above Header', 'gp-premium' ), + 'secondary-nav-float-right' => __( 'Float Right', 'gp-premium' ), + 'secondary-nav-float-left' => __( 'Float Left', 'gp-premium' ), + 'secondary-nav-left-sidebar' => __( 'Left Sidebar', 'gp-premium' ), + 'secondary-nav-right-sidebar' => __( 'Right Sidebar', 'gp-premium' ), + '' => __( 'No Navigation', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_position_setting]', + 'priority' => 30, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + array( + 'default' => $defaults['secondary_nav_dropdown_direction'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + array( + 'type' => 'select', + 'label' => __( 'Dropdown Direction', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'right' => __( 'Right', 'gp-premium' ), + 'left' => __( 'Left', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + 'priority' => 35, + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[merge_top_bar]', + array( + 'default' => $defaults['merge_top_bar'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[merge_top_bar]', + array( + 'type' => 'checkbox', + 'label' => __( 'Merge with Secondary Navigation', 'gp-premium' ), + 'section' => 'generate_top_bar', + 'settings' => 'generate_secondary_nav_settings[merge_top_bar]', + 'priority' => 100, + 'active_callback' => 'generate_secondary_nav_show_merge_top_bar', + ) + ); + } +} + +if ( ! function_exists( 'generate_display_secondary_google_fonts' ) ) { + add_filter( 'generate_typography_google_fonts', 'generate_display_secondary_google_fonts', 50 ); + /** + * Add Google Fonts to wp_head if needed. + * + * @since 0.1 + * @param array $google_fonts Existing fonts. + */ + function generate_display_secondary_google_fonts( $google_fonts ) { + if ( ! has_nav_menu( 'secondary' ) ) { + return $google_fonts; + } + + $generate_secondary_nav_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( function_exists( 'generate_typography_default_fonts' ) ) { + $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); + } else { + $not_google = array( + 'inherit', + 'Arial,+Helvetica,+sans-serif', + 'Century+Gothic', + 'Comic+Sans+MS', + 'Courier+New', + 'Georgia,+Times+New+Roman,+Times,+serif', + 'Helvetica', + 'Impact', + 'Lucida+Console', + 'Lucida+Sans+Unicode', + 'Palatino+Linotype', + 'Tahoma,+Geneva,+sans-serif', + 'Trebuchet+MS,+Helvetica,+sans-serif', + 'Verdana,+Geneva,+sans-serif', + ); + } + + $secondary_google_fonts = array(); + + if ( function_exists( 'generate_get_google_font_variants' ) ) { + + // If our value is still using the old format, fix it. + if ( strpos( $generate_secondary_nav_settings['font_secondary_navigation'], ':' ) !== false ) { + $generate_secondary_nav_settings['font_secondary_navigation'] = current( explode( ':', $generate_secondary_nav_settings['font_secondary_navigation'] ) ); + } + + // Grab the variants using the plain name. + $variants = generate_get_google_font_variants( $generate_secondary_nav_settings['font_secondary_navigation'], 'font_secondary_navigation', generate_secondary_nav_get_defaults() ); + + } else { + $variants = ''; + } + + // Replace the spaces in the names with a plus. + $value = str_replace( ' ', '+', $generate_secondary_nav_settings['font_secondary_navigation'] ); + + // If we have variants, add them to our value. + $value = ! empty( $variants ) ? $value . ':' . $variants : $value; + + // Add our value to the array. + $secondary_google_fonts[] = $value; + + // Ignore any non-Google fonts. + $secondary_google_fonts = array_diff( $secondary_google_fonts, $not_google ); + + // Separate each different font with a bar. + $secondary_google_fonts = implode( '|', $secondary_google_fonts ); + + if ( ! empty( $secondary_google_fonts ) ) { + $print_secondary_fonts = '|' . $secondary_google_fonts; + } else { + $print_secondary_fonts = ''; + } + + // Remove any duplicates. + $return = $google_fonts . $print_secondary_fonts; + $return = implode( '|', array_unique( explode( '|', $return ) ) ); + return $return; + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_after_header' ) ) { + add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 ); + /** + * Add the navigation after the header. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_after_header() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-below-header' === $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_header' ) ) { + add_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 ); + /** + * Add the navigation before the header. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_header() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_float_right' ) ) { + add_action( 'generate_before_header_content', 'generate_add_secondary_navigation_float_right', 7 ); + /** + * Add the navigation inside the header so it can float right. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_float_right() { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] || 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +add_action( 'generate_after_header_content', 'generate_do_secondary_navigation_float_right', 7 ); +/** + * Add the navigation inside the header so it can float right. + * + * @since 1.11.0 + */ +function generate_do_secondary_navigation_float_right() { + if ( ! function_exists( 'generate_is_using_flexbox' ) ) { + return; + } + + if ( ! generate_is_using_flexbox() ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] || 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + +} + +add_action( 'generate_before_navigation', 'generate_do_multi_navigation_wrapper_open', 11 ); +/** + * Open our wrapper that puts both navigations inside one element. + * + * @since 1.11.0 + */ +function generate_do_multi_navigation_wrapper_open() { + if ( ! function_exists( 'generate_is_using_flexbox' ) ) { + return; + } + + if ( ! generate_is_using_flexbox() ) { + return; + } + + if ( ! function_exists( 'generate_get_option' ) ) { + return; + } + + if ( ! has_nav_menu( 'secondary' ) ) { + return; + } + + if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { + $menu_settings = wp_parse_args( + get_option( 'generate_menu_plus_settings', array() ), + generate_menu_plus_get_defaults() + ); + + if ( $menu_settings['navigation_as_header'] ) { + return; + } + } + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( + ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-right' === generate_get_option( 'nav_position_setting' ) ) || + ( 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) + ) { + echo '
        '; + } +} + +add_action( 'generate_after_secondary_navigation', 'generate_do_multi_navigation_wrapper_close', 7 ); +/** + * Close our wrapper that puts both navigations inside one element. + * + * @since 1.11.0 + */ +function generate_do_multi_navigation_wrapper_close() { + if ( ! function_exists( 'generate_is_using_flexbox' ) ) { + return; + } + + if ( ! generate_is_using_flexbox() ) { + return; + } + + if ( ! function_exists( 'generate_get_option' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( + ( 'secondary-nav-float-right' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-right' === generate_get_option( 'nav_position_setting' ) ) || + ( 'secondary-nav-float-left' === $generate_settings['secondary_nav_position_setting'] && 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) + ) { + echo '
        '; + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_right_sidebar' ) ) { + add_action( 'generate_before_right_sidebar_content', 'generate_add_secondary_navigation_before_right_sidebar', 7 ); + /** + * Add the navigation into the right sidebar. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_right_sidebar() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-right-sidebar' === $generate_settings['secondary_nav_position_setting'] ) { + echo '
        '; + generate_secondary_navigation_position(); + echo '
        '; + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_left_sidebar' ) ) { + add_action( 'generate_before_left_sidebar_content', 'generate_add_secondary_navigation_before_left_sidebar', 7 ); + /** + * Add the navigation into the left sidebar. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_left_sidebar() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-left-sidebar' === $generate_settings['secondary_nav_position_setting'] ) { + echo '
        '; + generate_secondary_navigation_position(); + echo '
        '; + } + + } +} + +if ( ! function_exists( 'generate_secondary_navigation_position' ) ) { + /** + * Build our secondary navigation. + * Would like to change this function name. + * + * @since 0.1 + */ + function generate_secondary_navigation_position() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + if ( has_nav_menu( 'secondary' ) ) : + do_action( 'generate_before_secondary_navigation' ); + + $microdata = ' itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope"'; + + if ( function_exists( 'generate_get_schema_type' ) && 'microdata' !== generate_get_schema_type() ) { + $microdata = ''; + } + ?> + + + + '; + do_action( 'generate_secondary_menu_bar_items' ); + echo ''; + } + } +} + +if ( ! function_exists( 'generate_secondary_nav_body_classes' ) ) { + add_filter( 'body_class', 'generate_secondary_nav_body_classes' ); + /** + * Adds custom classes to the array of body classes. + * + * @since 0.1 + * @param array $classes Existing body classes. + */ + function generate_secondary_nav_body_classes( $classes ) { + if ( ! has_nav_menu( 'secondary' ) ) { + return $classes; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $classes[] = ( $generate_settings['secondary_nav_position_setting'] ) ? $generate_settings['secondary_nav_position_setting'] : 'secondary-nav-below-header'; + + if ( 'left' === $generate_settings['secondary_nav_alignment'] ) { + $classes[] = 'secondary-nav-aligned-left'; + } elseif ( 'center' === $generate_settings['secondary_nav_alignment'] ) { + $classes[] = 'secondary-nav-aligned-center'; + } elseif ( 'right' === $generate_settings['secondary_nav_alignment'] ) { + $classes[] = 'secondary-nav-aligned-right'; + } else { + $classes[] = 'secondary-nav-aligned-left'; + } + + return $classes; + } +} + +if ( ! function_exists( 'generate_secondary_menu_classes' ) ) { + add_filter( 'generate_secondary_menu_class', 'generate_secondary_menu_classes' ); + /** + * Adds custom classes to the menu. + * + * @since 0.1 + * @param array $classes Existing classes. + */ + function generate_secondary_menu_classes( $classes ) { + + $classes[] = 'secondary-menu'; + $classes[] = 'sf-menu'; + + return $classes; + + } +} + +if ( ! function_exists( 'generate_secondary_navigation_classes' ) ) { + add_filter( 'generate_secondary_navigation_class', 'generate_secondary_navigation_classes' ); + /** + * Adds custom classes to the navigation. + * + * @since 0.1 + * @param array $classes Existing classes. + */ + function generate_secondary_navigation_classes( $classes ) { + $classes[] = 'secondary-navigation'; + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $nav_layout = $generate_settings['secondary_nav_layout_setting']; + + if ( 'secondary-contained-nav' === $nav_layout ) { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + $navigation_location = $generate_settings['secondary_nav_position_setting']; + + if ( 'secondary-nav-float-right' !== $navigation_location && 'secondary-nav-float-left' !== $navigation_location ) { + $classes[] = 'grid-container'; + } + } else { + $classes[] = 'grid-container'; + $classes[] = 'grid-parent'; + } + } + + if ( 'left' === $generate_settings['secondary_nav_dropdown_direction'] ) { + $layout = $generate_settings['secondary_nav_position_setting']; + + switch ( $layout ) { + case 'secondary-nav-below-header': + case 'secondary-nav-above-header': + case 'secondary-nav-float-right': + case 'secondary-nav-float-left': + $classes[] = 'sub-menu-left'; + break; + } + } + + if ( $generate_settings['merge_top_bar'] && is_active_sidebar( 'top-bar' ) ) { + $classes[] = 'has-top-bar'; + } + + if ( generate_secondary_nav_has_menu_bar_items() ) { + $classes[] = 'has-menu-bar-items'; + } + + return $classes; + + } +} + +if ( ! function_exists( 'generate_inside_secondary_navigation_classes' ) ) { + add_filter( 'generate_inside_secondary_navigation_class', 'generate_inside_secondary_navigation_classes' ); + /** + * Adds custom classes to the inner navigation + * + * @since 1.3.41 + * @param array $classes Existing classes. + */ + function generate_inside_secondary_navigation_classes( $classes ) { + $classes[] = 'inside-navigation'; + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $inner_nav_width = $generate_settings['secondary_nav_inner_width']; + + if ( 'full-width' !== $inner_nav_width ) { + $classes[] = 'grid-container'; + $classes[] = 'grid-parent'; + } + + return $classes; + + } +} + +if ( ! function_exists( 'generate_secondary_nav_css' ) ) { + /** + * Generate the CSS in the section using the Theme Customizer. + * + * @since 0.1 + */ + function generate_secondary_nav_css() { + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( function_exists( 'generate_spacing_get_defaults' ) ) { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + $separator = $spacing_settings['separator']; + } else { + $separator = 20; + } + + // Check if we're using our legacy typography system. + $using_dynamic_typography = function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography(); + $secondary_nav_family = ''; + + if ( ! $using_dynamic_typography ) { + if ( function_exists( 'generate_get_font_family_css' ) ) { + $secondary_nav_family = generate_get_font_family_css( 'font_secondary_navigation', 'generate_secondary_nav_settings', generate_secondary_nav_get_defaults() ); + } else { + $secondary_nav_family = current( explode( ':', $generate_settings['font_secondary_navigation'] ) ); + } + + if ( '""' === $secondary_nav_family ) { + $secondary_nav_family = 'inherit'; + } + } + + // Get our untouched defaults. + $og_defaults = generate_secondary_nav_get_defaults( false ); + + $css = new GeneratePress_Secondary_Nav_CSS(); + + $css->set_selector( '.secondary-navigation' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_color'] ) ); + $css->add_property( 'background-image', ! empty( $generate_settings['nav_image'] ) ? 'url(' . esc_url( $generate_settings['nav_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_repeat'] ) ); + + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + if ( function_exists( 'generate_spacing_get_defaults' ) && function_exists( 'generate_get_option' ) && 'text' === generate_get_option( 'container_alignment' ) ) { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $navigation_left_padding = absint( $spacing_settings['header_left'] ) - absint( $generate_settings['secondary_menu_item'] ); + $navigation_right_padding = absint( $spacing_settings['header_right'] ) - absint( $generate_settings['secondary_menu_item'] ); + + $css->set_selector( '.secondary-nav-below-header .secondary-navigation .inside-navigation.grid-container, .secondary-nav-above-header .secondary-navigation .inside-navigation.grid-container' ); + $css->add_property( 'padding', generate_padding_css( 0, $navigation_right_padding, 0, $navigation_left_padding ) ); + } + } + + if ( 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] && has_nav_menu( 'secondary' ) && is_active_sidebar( 'top-bar' ) ) { + $css->set_selector( '.secondary-navigation .top-bar' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + $css->add_property( 'line-height', absint( $generate_settings['secondary_menu_item_height'] ), false, 'px' ); + + if ( ! $using_dynamic_typography ) { + $css->add_property( 'font-family', $secondary_nav_family ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['secondary_navigation_font_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['secondary_navigation_font_transform'] ) ); + $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), false, 'px' ); + } + + $css->set_selector( '.secondary-navigation .top-bar a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + + $css->set_selector( '.secondary-navigation .top-bar a:hover, .secondary-navigation .top-bar a:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_background_hover_color'] ) ); + } + + // Navigation text. + $css->set_selector( '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle,.secondary-menu-bar-items .menu-bar-item > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + + if ( ! $using_dynamic_typography ) { + $css->add_property( 'font-family', ( 'inherit' !== $secondary_nav_family ) ? $secondary_nav_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['secondary_navigation_font_weight'] ), $og_defaults['secondary_navigation_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['secondary_navigation_font_transform'] ), $og_defaults['secondary_navigation_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), $og_defaults['secondary_navigation_font_size'], 'px' ); + } + + $css->add_property( 'padding-left', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + $css->add_property( 'line-height', absint( $generate_settings['secondary_menu_item_height'] ), $og_defaults['secondary_menu_item_height'], 'px' ); + $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_repeat'] ) ); + + $css->set_selector( '.secondary-navigation .secondary-menu-bar-items' ); + $css->add_property( 'color', $generate_settings['navigation_text_color'] ); + + if ( ! $using_dynamic_typography ) { + $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] ), $og_defaults['secondary_navigation_font_size'], 'px' ); + } + + // Mobile menu text on hover. + $css->set_selector( 'button.secondary-menu-toggle:hover,button.secondary-menu-toggle:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + + // Widget area navigation. + $css->set_selector( '.widget-area .secondary-navigation' ); + $css->add_property( 'margin-bottom', absint( $separator ), false, 'px' ); + + // Sub-navigation background. + $css->set_selector( '.secondary-navigation ul ul' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_color'] ) ); + $css->add_property( 'top', 'auto' ); // Added for compatibility purposes on 22/12/2016. + + // Sub-navigation text. + $css->set_selector( '.secondary-navigation .main-nav ul ul li a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_color'] ) ); + + if ( ! $using_dynamic_typography ) { + $css->add_property( 'font-size', absint( $generate_settings['secondary_navigation_font_size'] - 1 ), absint( $og_defaults['secondary_navigation_font_size'] - 1 ), 'px' ); + } + + $css->add_property( 'padding-left', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_repeat'] ) ); + + // Menu item padding on RTL. + if ( is_rtl() ) { + $css->set_selector( 'nav.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); + $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + } + + // Dropdown arrow. + $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); + $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'margin-top', '-' . absint( $generate_settings['secondary_sub_menu_item_height'] ), '-' . absint( $og_defaults['secondary_sub_menu_item_height'] ), 'px' ); + + // Dropdown arrow. + $css->set_selector( '.secondary-navigation .menu-item-has-children .dropdown-menu-toggle' ); + $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), $og_defaults['secondary_menu_item'], 'px' ); + + // Sub-navigation dropdown arrow. + $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); + $css->add_property( 'padding-top', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings['secondary_sub_menu_item_height'] ), $og_defaults['secondary_sub_menu_item_height'], 'px' ); + $css->add_property( 'margin-top', '-' . absint( $generate_settings['secondary_sub_menu_item_height'] ), '-' . absint( $og_defaults['secondary_sub_menu_item_height'] ), 'px' ); + + // Navigation background/text on hover. + $css->set_selector( '.secondary-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a, .secondary-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a, .secondary-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a, .secondary-menu-bar-items .menu-bar-item:hover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_hover_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_hover_color'] ) ); + $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_hover_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_hover_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_hover_repeat'] ) ); + + // Sub-Navigation background/text on hover. + $css->set_selector( '.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):hover > a,.secondary-navigation .main-nav ul ul li:not([class*="current-menu-"]):focus > a,.secondary-navigation .main-nav ul ul li.sfHover:not([class*="current-menu-"]) > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_hover_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_hover_color'] ) ); + $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_hover_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_hover_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_hover_repeat'] ) ); + + // Navigation background / text current + hover. + $css->set_selector( '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_current_color'] ) ); + $css->add_property( 'background-image', ! empty( $generate_settings['nav_item_current_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_current_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_current_repeat'] ) ); + + // Sub-Navigation background / text current + hover. + $css->set_selector( '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_current_color'] ) ); + $css->add_property( 'background-image', ! empty( $generate_settings['sub_nav_item_current_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_current_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_current_repeat'] ) ); + + // RTL menu item padding. + if ( is_rtl() ) { + $css->set_selector( '.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); + $css->add_property( 'padding-right', absint( $generate_settings['secondary_menu_item'] ), false, 'px' ); + } + + if ( function_exists( 'generate_get_option' ) && function_exists( 'generate_get_defaults' ) ) { + $theme_defaults = generate_get_defaults(); + + if ( isset( $theme_defaults['icons'] ) ) { + if ( 'svg' === generate_get_option( 'icons' ) ) { + $css->set_selector( '.secondary-navigation.toggled .dropdown-menu-toggle:before' ); + $css->add_property( 'display', 'none' ); + } + } + } + + $mobile_css = '@media ' . generate_premium_get_media_query( 'mobile-menu' ) . ' {.secondary-menu-bar-items .menu-bar-item:hover > a{background: none;color: ' . $generate_settings['navigation_text_color'] . ';}}'; + + // Return our dynamic CSS. + return $css->css_output() . $mobile_css; + } +} + +if ( ! function_exists( 'generate_secondary_color_scripts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_secondary_color_scripts', 110 ); + /** + * Enqueue scripts and styles + */ + function generate_secondary_color_scripts() { + // Bail if no Secondary menu is set. + if ( ! has_nav_menu( 'secondary' ) ) { + return; + } + + wp_add_inline_style( 'generate-secondary-nav', generate_secondary_nav_css() ); + + if ( class_exists( 'GeneratePress_Typography' ) ) { + wp_add_inline_style( 'generate-secondary-nav', GeneratePress_Typography::get_css( 'secondary-nav' ) ); + } + } +} + +if ( ! function_exists( 'generate_secondary_navigation_class' ) ) { + /** + * Display the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_secondary_navigation_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV. + echo 'class="' . join( ' ', generate_get_secondary_navigation_class( $class ) ) . '"'; // phpcs:ignore -- Escaped in generate_get_secondary_navigation_class. + } +} + +if ( ! function_exists( 'generate_get_secondary_navigation_class' ) ) { + /** + * Retrieve the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_secondary_navigation_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_secondary_navigation_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_secondary_menu_class' ) ) { + /** + * Display the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_secondary_menu_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV. + echo 'class="' . join( ' ', generate_get_secondary_menu_class( $class ) ) . '"'; // phpcs:ignore -- Escaped in generate_get_secondary_menu_class. + } +} + +if ( ! function_exists( 'generate_get_secondary_menu_class' ) ) { + /** + * Retrieve the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_secondary_menu_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_secondary_menu_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_inside_secondary_navigation_class' ) ) { + /** + * Display the classes for the inner navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_inside_secondary_navigation_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + $return = apply_filters( 'generate_inside_secondary_navigation_class', $classes, $class ); + + // Separates classes with a single space, collates classes for post DIV. + echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore -- Escaped above. + } +} + +if ( ! function_exists( 'generate_secondary_nav_remove_top_bar' ) ) { + add_action( 'wp', 'generate_secondary_nav_remove_top_bar' ); + /** + * Remove the top bar and add it to the Secondary Navigation if it's set + */ + function generate_secondary_nav_remove_top_bar() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( $generate_settings['merge_top_bar'] && 'secondary-nav-above-header' === $generate_settings['secondary_nav_position_setting'] && has_nav_menu( 'secondary' ) && is_active_sidebar( 'top-bar' ) ) { + remove_action( 'generate_before_header', 'generate_top_bar', 5 ); + add_action( 'generate_inside_secondary_navigation', 'generate_secondary_nav_top_bar_widget', 5 ); + add_filter( 'generate_is_top_bar_active', '__return_false' ); + } + } +} + +if ( ! function_exists( 'generate_secondary_nav_top_bar_widget' ) ) { + /** + * Build the top bar widget area + * This is placed into the secondary navigation if set + */ + function generate_secondary_nav_top_bar_widget() { + if ( ! is_active_sidebar( 'top-bar' ) ) { + return; + } + ?> +
        +
        + +
        +
        + .secondary-navigation .main-nav ul li a, .secondary-navigation .menu-toggle, .secondary-menu-bar-items .menu-bar-item > a{padding: 0 ' + newval + 'px;}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:' + newval + 'px;}' ); + setTimeout(function() { + jQuery( 'style#secondary_menu_item' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + + wp.customize( 'generate_secondary_nav_settings[secondary_menu_item_height]', function( value ) { + value.bind( function( newval ) { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#secondary_menu_item_height' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + + wp.customize( 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', function( value ) { + value.bind( function( newval ) { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#secondary_sub_menu_item_height' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + +})( jQuery ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php new file mode 100644 index 00000000..7c3e48eb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/secondary-nav/generate-secondary-nav.php @@ -0,0 +1,23 @@ + *:last-child { + margin-bottom: 0; +} + +.generate-sections-container { + background-size: cover; +} + +.generate-sections-container.no-padding .generate-sections-inside-container { + padding: 0px !important; +} + +.generate-sections-enabled.one-container .site-content { + padding: 0; +} + +.generate-sections-enabled.one-container .container { + background: transparent; +} + +.generate-sections-enabled.one-container .site-main { + margin: 0 !important; +} + +.generate-sections-enabled .entry-content { + text-align: center; +} + +.separate-containers .site-main > .generate-sections-container { + margin-bottom: 0; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css new file mode 100644 index 00000000..802b011a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/css/style.min.css @@ -0,0 +1 @@ +.sections-no-sidebars.generate-sections-enabled .container.grid-container,.sections-sidebars.no-sidebar.generate-sections-enabled .container.grid-container{max-width:100%}.sections-no-sidebars.generate-sections-enabled #primary.content-area,.sections-sidebars.no-sidebar.generate-sections-enabled #primary.content-area{width:100%}.sections-no-sidebars.generate-sections-enabled.separate-containers #main.site-main,.sections-no-sidebars.generate-sections-enabled.separate-containers .hentry,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers #main.site-main,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers .hentry{margin:0}.generate-sections-inside-container>:last-child{margin-bottom:0}.generate-sections-container{background-size:cover}.generate-sections-container.no-padding .generate-sections-inside-container{padding:0!important}.generate-sections-enabled.one-container .site-content{padding:0}.generate-sections-enabled.one-container .container{background:0 0}.generate-sections-enabled.one-container .site-main{margin:0!important}.generate-sections-enabled .entry-content{text-align:center}.separate-containers .site-main>.generate-sections-container{margin-bottom:0} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php new file mode 100644 index 00000000..2703c8e4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/generate-sections.php @@ -0,0 +1,329 @@ +ID, '_generate_use_sections', TRUE) : ''; + + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return $template; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + + $new_template = dirname( __FILE__ ) . '/templates/template.php'; + + if ( '' != $new_template ) { + return $new_template; + } + } + return $template; + + } +} + +if ( ! function_exists( 'generate_sections_show_excerpt' ) ) { + add_filter( 'generate_show_excerpt', 'generate_sections_show_excerpt' ); + /** + * If Sections is enabled on a post, make sure we use the excerpt field on the blog page + */ + function generate_sections_show_excerpt( $show_excerpt ) { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + return true; + } + + return $show_excerpt; + } +} + +if ( ! function_exists( 'generate_sections_styles' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_sections_styles' ); + /** + * Enqueue necessary scripts if sections are enabled + */ + function generate_sections_styles() { + + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + // Bail if we're on a posts page + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + wp_enqueue_style( 'generate-sections-styles', plugin_dir_url( __FILE__ ) . 'css/style.min.css' ); + wp_enqueue_script( 'generate-sections-parallax', plugin_dir_url( __FILE__ ) . 'js/parallax.min.js', array(), GENERATE_SECTIONS_VERSION, true ); + } + } +} + +if ( ! function_exists( 'generate_sections_body_classes' ) ) { + add_filter( 'body_class', 'generate_sections_body_classes' ); + /** + * Add classes to our element when sections are enabled + */ + function generate_sections_body_classes( $classes ) { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + $sidebars = apply_filters( 'generate_sections_sidebars', false ); + + // Bail if we're on a posts page + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return $classes; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + $classes[] = 'generate-sections-enabled'; + } + + if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && ! $sidebars ) { + $classes[] = 'sections-no-sidebars'; + } + + if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && $sidebars ) { + $classes[] = 'sections-sidebars'; + } + + return $classes; + } +} + +if ( ! function_exists( 'generate_sections_add_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_sections_add_css', 500 ); + /** + * Create the CSS for our sections + */ + function generate_sections_add_css() { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + if ( ! isset( $use_sections['use_sections'] ) ) { + return; + } + + if ( 'true' !== $use_sections['use_sections'] ) { + return; + } + + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return; + } + + if ( function_exists( 'generate_spacing_get_defaults' ) ) { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $left_padding = $spacing_settings['content_left']; + $right_padding = $spacing_settings['content_right']; + $mobile_padding_left = ( isset( $spacing_settings[ 'mobile_content_left' ] ) ) ? $spacing_settings[ 'mobile_content_left' ] : 30; + $mobile_padding_right = ( isset( $spacing_settings[ 'mobile_content_right' ] ) ) ? $spacing_settings[ 'mobile_content_right' ] : 30; + } else { + $right_padding = 40; + $left_padding = 40; + $mobile_padding = 30; + } + + $sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_sections', TRUE) : ''; + + // check if the repeater field has rows of data + if ( $sections && '' !== $sections ) { + + $css = '.generate-sections-inside-container {padding-left:' . $left_padding . 'px;padding-right:' . $right_padding . 'px;}'; + // loop through the rows of data + $i = 0; + foreach ( $sections['sections'] as $section ) : + $i++; + + // Get image details + $image_id = ( isset( $section['background_image'] ) && '' !== $section['background_image'] ) ? intval( $section['background_image'] ) : ''; + $image_url = ( '' !== $image_id ) ? wp_get_attachment_image_src( $image_id, 'full' ) : ''; + + // Get the padding type + $padding_type = apply_filters( 'generate_sections_padding_type','px' ); + + // If someone has changed the padding type using a filter, use their value + if ( 'px' !== $padding_type ) { + $top_padding_type = $padding_type; + $bottom_padding_type = $padding_type; + } else { + $top_padding_type = ( isset( $section['top_padding_unit'] ) && '' !== $section['top_padding_unit'] ) ? $section['top_padding_unit'] : $padding_type; + $bottom_padding_type = ( isset( $section['bottom_padding_unit'] ) && '' !== $section['bottom_padding_unit'] ) ? $section['bottom_padding_unit'] : $padding_type; + } + + // Default padding top + $padding_top = apply_filters( 'generate_sections_default_padding_top','40' ); + + // Default padding bottom + $padding_bottom = apply_filters( 'generate_sections_default_padding_bottom','40' ); + + $custom_id = ( isset( $section['custom_id'] ) ) ? $section['custom_id'] : ''; + $custom_id = ( '' == $custom_id ) ? "generate-section-$i" : $custom_id; + + // Get the values + $background_color = ( isset( $section['background_color'] ) && '' !== $section['background_color'] ) ? 'background-color:' . esc_attr( $section['background_color'] ) . ';' : ''; + $background_image = ( ! empty( $image_url[0] ) ) ? 'background-image:url(' . esc_url( $image_url[0] ) . ');' : ''; + + if ( isset( $section['background_color_overlay'] ) && '' !== $section['background_color_overlay'] ) { + if ( '' !== $background_image && '' !== $background_color ) { + $background_image = 'background-image:linear-gradient(0deg, ' . $section['background_color'] . ',' . $section['background_color'] . '), url(' . esc_url( $image_url[0] ) . ');'; + $background_color = ''; + } + } + + $text_color = ( isset( $section['text_color'] ) && '' !== $section['text_color'] ) ? 'color:' . esc_attr( $section['text_color'] ) . ';' : ''; + $link_color = ( isset( $section['link_color'] ) && '' !== $section['link_color'] ) ? 'color:' . esc_attr( $section['link_color'] ) . ';' : ''; + $link_color_hover = ( isset( $section['link_color_hover'] ) && '' !== $section['link_color_hover'] ) ? 'color:' . esc_attr( $section['link_color_hover'] ) . ';' : ''; + $top_padding = ( isset( $section['top_padding'] ) && '' !== $section['top_padding'] ) ? 'padding-top:' . absint( $section['top_padding'] ) . $top_padding_type . ';' : 'padding-top:' . $padding_top . 'px;'; + $bottom_padding = ( isset( $section['bottom_padding'] ) && '' !== $section['bottom_padding'] ) ? 'padding-bottom:' . absint( $section['bottom_padding'] ) . $bottom_padding_type . ';' : 'padding-bottom:' . $padding_bottom . 'px;'; + + // Outer container + if ( '' !== $background_color || '' !== $background_image ) { + $css .= '#' . $custom_id . '.generate-sections-container{' . $background_color . $background_image . '}'; + } + + // Inner container + if ( '' !== $top_padding || '' !== $bottom_padding || '' !== $text_color ) { + $css .= '#' . $custom_id . ' .generate-sections-inside-container{' . $top_padding . $bottom_padding . $text_color . '}'; + } + + // Link color + if ( '' !== $link_color ) { + $css .= '#' . $custom_id . ' a,#generate-section-' . $i . ' a:visited{' . $link_color . '}'; + } + + // Link color hover + if ( '' !== $link_color_hover ) { + $css .= '#' . $custom_id . ' a:hover{' . $link_color_hover . '}'; + } + + $mobile = generate_premium_get_media_query( 'mobile' ); + $css .= '@media ' . esc_attr( $mobile ) . ' {.generate-sections-inside-container {padding-left: ' . $mobile_padding_left . 'px;padding-right: ' . $mobile_padding_right . 'px;}}'; + endforeach; + + // Build CSS + wp_add_inline_style( 'generate-style', $css ); + + } + } +} + +if ( ! function_exists( 'generate_sections_filter_admin_init' ) ) { + add_action( 'admin_init', 'generate_sections_filter_admin_init' ); + /* + * Recreate the default filters on the_content + * this will make it much easier to output the meta content with proper/expected formatting + */ + function generate_sections_filter_admin_init() { + if ( user_can_richedit() ) { + add_filter( 'generate_section_content', 'convert_smilies' ); + add_filter( 'generate_section_content', 'convert_chars' ); + add_filter( 'generate_section_content', 'wpautop' ); + add_filter( 'generate_section_content', 'shortcode_unautop' ); + add_filter( 'generate_section_content', 'prepend_attachment' ); + } + } +} + +if ( ! function_exists( 'generate_sections_filter' ) ) { + add_action( 'init', 'generate_sections_filter' ); + /* + * Recreate the default filters on the_content + * this will make it much easier to output the meta content with proper/expected formatting + */ + function generate_sections_filter() { + if ( is_admin() ) { + return; + } + + add_filter( 'generate_section_content', 'convert_smilies' ); + add_filter( 'generate_section_content', 'convert_chars' ); + add_filter( 'generate_section_content', 'wpautop' ); + add_filter( 'generate_section_content', 'shortcode_unautop' ); + add_filter( 'generate_section_content', 'prepend_attachment' ); + add_filter( 'generate_section_content', 'do_shortcode'); + + add_filter( 'generate_the_section_content', array($GLOBALS['wp_embed'], 'autoembed'), 9 ); + } +} + +if ( ! function_exists( 'generate_sections_save_content' ) ) { + add_action( 'save_post', 'generate_sections_save_content', 99, 4 ); + /* + * When we save our post, grab all of the section content and save it as regular content. + * + * This will prevent content loss/theme lock. + */ + function generate_sections_save_content( $post_id, $post ) { + + if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) { + return; + } + + if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { + return; + } + + if ( ! current_user_can('edit_post', $post_id ) ) { + return; + } + + // See if we're using sections + $use_sections = get_post_meta( $post_id, '_generate_use_sections', true); + + // Make sure use sections exists and that we're not saving a revision + if ( ! isset( $use_sections['use_sections'] ) || wp_is_post_revision( $post_id ) ) { + return; + } + + // Return if sections are set to false + if ( 'true' !== $use_sections['use_sections'] ) { + return; + } + + // Get our sections + $sections = get_post_meta( $post_id, '_generate_sections', true ); + + // Return if there's nothing in our sections + if ( ! isset( $sections ) || '' == $sections ) { + return; + } + + // Prevent infinite loop + remove_action( 'save_post', 'generate_sections_save_content', 99, 4 ); + + // Let's do some stuff if sections aren't empty + if ( '' !== $sections ) { + // Set up our content variable + $content = ''; + + // Loop through each section and add our content to the content variable + foreach ( $sections['sections'] as $section ) { + $content .= ( isset( $section['content'] ) && '' !== $section['content'] ) ? $section['content'] . "\n\n" : ''; + } + + // Now update our post if we have section content + if ( '' !== $content ) { + $post->post_content = $content; + wp_update_post( $post, true ); + } + } + + // Re-hook the save_post action + add_action('save_post', 'generate_sections_save_content', 99, 4); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js new file mode 100644 index 00000000..2c49e753 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.js @@ -0,0 +1,17 @@ +function generate_sections_parallax_element( selector, context ) { + context = context || document; + var elements = context.querySelectorAll( selector ); + return Array.prototype.slice.call( elements ); +} + +window.addEventListener( "scroll", function() { + var scrolledHeight= window.pageYOffset; + generate_sections_parallax_element( ".generate-sections-container.enable-parallax" ).forEach( function( el, index, array ) { + var limit = el.offsetTop + el.offsetHeight; + if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { + el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-speed' ) + "px"; + } else { + el.style.backgroundPositionY = "0"; + } + }); +}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js new file mode 100644 index 00000000..7004f63b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/js/parallax.min.js @@ -0,0 +1 @@ +function generate_sections_parallax_element(e,t){var o=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(o)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_sections_parallax_element(".generate-sections-container.enable-parallax").forEach(function(t,o,n){var a=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=a?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css new file mode 100644 index 00000000..6927a1b3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css @@ -0,0 +1,348 @@ +body { + -webkit-backface-visibility: hidden; +} +#_generate_sections_metabox { + opacity: 0; + height: 0; + overflow: hidden; +} + +#_generate_use_sections_metabox { + display: block !important; +} + +.generate_sections_control { + padding-top: 8px; +} + +.generate-sections-enabled #postdivrich { + opacity: 0; + height: 0; + overflow: hidden; +} +.generate-sections-enabled #_generate_sections_metabox { + opacity: 1; + height: auto; +} + +.generate_sections_control .warning { + color: red; +} +.generate_sections_control .dodelete-repeating_textareas { + float: right; +} +.generate_sections_control .section { + border: 1px solid #DFDFDF; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + margin: 6px 0px 8px; + overflow: hidden; + position: relative; + background: white; +} +.generate_sections_control .section .section-title { + font-size: 14px; + padding: 0 0 0 15px; + margin: 0; + max-height: 50px; +} +.generate_sections_control .section .section-title > span { + cursor: pointer; + overflow:hidden; + display:block; + max-height:50px; + line-height:50px; + width:100%; +} +.generate_sections_control .section .section-controls { + position: absolute; + top:0; + right:0; + text-align: right; +} +.rtl .generate_sections_control .section .section-controls { + right:auto;left:0; +} +.generate_sections_control .section .section-controls a { + color: #aaa; + display:block; + float:left; + border-left: 1px solid #efefef; +} +.generate_sections_control .section .section-controls a:hover { + color: #777; +} +.generate_sections_control .section textarea { + display: none; +} +.generate_sections_control .section h3 { + color: #999; + font-size: 1em; + margin: 15px 6px; + text-transform: uppercase; +} +.generate_sections_control .section .ui-sortable-placeholder { + line-height: 1.4em; + border: 3px dashed #DDD; +} +.generate-sections-modal .media-menu-item { + cursor: pointer; +} +.custom-classes input { + width:100%; +} +.js .generate_sections_control .move-section { + cursor: move; +} +.generate-sections-modal p { + margin-top:5px; +} +#_generate_sections_metabox { + box-shadow: 0 0 0 transparent; +} +.section-controls a { + line-height:50px; + padding: 0 15px; + width:initial; + height:initial; +} + +.generate_sections_control .section .section-controls a.delete-section:hover { + color: red; +} + +.generate_sections_control p { + margin: 5px; +} + +textarea#generate-sections-editor { + border:0; +} + +#generate-sections-editor_ifr { + min-height: 400px; +} + +a#generate-add-section, a#generate-delete-sections { + height: auto; + line-height: inherit; + padding: 10px 20px; +} + +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > * { + display:none; +} + +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .generate-sections-add-media, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .su-generator-button, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .envira-gallery-choose-gallery, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .gridable-insert-row-button { + display: inline-block; +} + +#custom-media-buttons > * { + display: none; +} + +#custom-media-buttons > .insert-media, +#custom-media-buttons > .su-generator-button, +#custom-media-buttons > .envira-gallery-choose-gallery, +#custom-media-buttons > .gridable-insert-row-button, +#custom-media-buttons > .bfa-iconpicker { + display: inline-block; +} + +#_generate_sections_metabox { + background: transparent; + border: 0; +} +#_generate_sections_metabox > .handlediv, #_generate_sections_metabox > .hndle { + display: none; +} +#_generate_sections_metabox > .inside { + padding-left: 0; + padding-right: 0; +} + +body.wp-admin .grid-container { + max-width: 100%; +} + +.generate-sections-modal h3 { + margin-top: 0; +} + +input#custom_classes, +input#custom_id { + width: 100%; + max-width: 300px; +} + +.box-type select, +.inner-box-type select, +.parallax-effect select, +.top-padding input, +.bottom-padding input { + width: 100%; + box-sizing: border-box; +} + +.send-to-editor { + display: inline-block; + margin-top: 15px !important; +} + +#generate-sections-modal-dialog .media-frame-title .dashicons-arrow-down { + display: none; +} + +.gs-grid-container { + margin-left: auto; + margin-right: auto; + max-width: 100%; + padding-left: 10px; + padding-right: 10px; +} + +.gs-grid-parent { + padding-left: 0; + padding-right: 0; +} + +.gs-grid-container:before, +.gs-grid-container:after { + content: "."; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; + clear: both; +} + +@media screen and (min-width: 769px) { + .gs-grid-50:before, + .gs-grid-50:after, + .gs-grid-33:before, + .gs-grid-33:after, + .gs-grid-25:before, + .gs-grid-25:after + .gs-grid-20:before, + .gs-grid-20:after + .gs-grid-12:before, + .gs-grid-12:after { + content: "."; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; + clear: both; + } + .gs-grid-50, + .gs-grid-33, + .gs-grid-25, + .gs-grid-20, + .gs-grid-12 { + box-sizing: border-box; + padding-left: 10px; + padding-right: 10px; + } + .gs-grid-50 { + width: 50% !important; + float: left; + } + .gs-grid-33 { + width: 33.333% !important; + float: left; + } + .gs-grid-25 { + width: 25% !important; + float: left; + } + .gs-grid-20 { + width: 20% !important; + float: left; + } + .gs-grid-12 { + width: 12.5% !important; + float: left; + } + .top-border { + border-top: 1px solid #EFEFEF; + } + .bottom-border { + border-bottom: 1px solid #EFEFEF; + } + .border-right { + border-right: 1px solid #EFEFEF; + } + .border-left { + border-left: 1px solid #EFEFEF; + } +} + +@media screen and (max-width: 768px) { + .gs-grid-50, .gs-grid-33, .gs-grid-25, .gs-grid-12 { + width: 100% !important; + } + .generate_sections_control .section .section-controls { + position: relative; + } +} + +@media screen and (max-width: 500px) { + .generate_sections_control .section .section-controls a:first-child { + border-left: 0; + } +} + +#generate-sections-modal-dialog .media-modal-close { + text-decoration: none; + text-align: center; +} +/* + The styles below were ripped from the Media Modal in WordPress 3.5 + ~~ Thanks for building a beautiful Modal UI ( that I could steal ) +*/ +body.generate-modal-open { overflow: hidden; } + +.generate-sections-modal .media-modal { z-index: 65535; } +.generate-sections-modal .media-modal-backdrop { z-index: 65534; } +.generate-sections-modal .media-frame-content .panel { display: none; padding: 2em; } +.generate-sections-modal .media-frame-content .panel.active { display: block; } +.generate-sections-modal .media-frame-content .panel .section-title input { width:100%;padding:10px; } +.generate-sections-modal .media-frame-content .panel .html-active .mce-panel { display: none; } +.generate-sections-modal .media-frame-content .panel .html-active .wp-editor-area { display: block !important; min-height: 300px; } +.generate-sections-modal .media-frame-content .panel .mce-wp-dfw, .generate-sections-modal .media-frame-content .panel .qt-dfw { display: none; } +.generate-sections-modal .media-frame-content .panel .generate-sections-remove-image { display: none; } + +textarea.no-rich-edit { + width: 100%; + min-height: 300px; +} + +.wp-picker-container .wp-color-result.button { + height: 24px; + margin: 0 6px 6px 0px; + padding: 0 0 0 30px; + font-size: 11px; +} + +.wp-color-result:after { + display: none; +} + +.wp-color-result-text { + background: #f7f7f7; + border-radius: 0 2px 2px 0; + border-left: 1px solid #ccc; + color: #555; + display: block; + line-height: 22px; + padding: 0 6px; + text-align: center; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css new file mode 100644 index 00000000..5f95b304 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css @@ -0,0 +1,92 @@ +.lcs_wrap { + display: inline-block; + direction: ltr; + height: 28px; + vertical-align: middle; +} +.lcs_wrap input { + display: none; +} + +.lcs_switch { + display: inline-block; + position: relative; + width: 73px; + height: 28px; + border-radius: 30px; + background: #ddd; + overflow: hidden; + cursor: pointer; + transition: all .2s ease-in-out; +} +.lcs_cursor { + display: inline-block; + position: absolute; + top: 3px; + width: 22px; + height: 22px; + border-radius: 100%; + background: #fff; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1); + z-index: 10; + transition: all .2s linear; +} +.lcs_label { + font-family: "Trebuchet MS", Helvetica, sans-serif; + font-size: 12px; + letter-spacing: 1px; + line-height: 18px; + color: #fff; + font-weight: bold; + position: absolute; + width: 33px; + top: 5px; + overflow: hidden; + text-align: center; + opacity: 0; + transition: all .2s ease-in-out .1s; +} +.lcs_label.lcs_label_on { + left: -70px; + z-index: 6; +} +.lcs_label.lcs_label_off { + right: -70px; + z-index: 5; +} + + +/* on */ +.lcs_switch.lcs_on { + background: #75b936; + box-shadow: 0 0 2px #579022 inset; +} +.lcs_switch.lcs_on .lcs_cursor { + left: 48px; +} +.lcs_switch.lcs_on .lcs_label_on { + left: 10px; + opacity: 1; +} + + +/* off */ +.lcs_switch.lcs_off { + background: #b2b2b2; + box-shadow: 0px 0px 2px #a4a4a4 inset; +} +.lcs_switch.lcs_off .lcs_cursor { + left: 3px; +} +.lcs_switch.lcs_off .lcs_label_off { + right: 10px; + opacity: 1; +} + + +/* disabled */ +.lcs_switch.lcs_disabled { + opacity: 0.65; + filter: alpha(opacity=65); + cursor: default; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js new file mode 100644 index 00000000..f9215062 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js @@ -0,0 +1,835 @@ +/*-----------------------------------------------------------------------------------*/ +/* Generate Sections Metabox +/* +/* © Kathy Darling http://www.kathyisawesome.com +/* 2016-07-19. */ +/*-----------------------------------------------------------------------------------*/ + +/** + * @type {Object} JavaScript namespace for our application. + */ +var Generate_Sections = { + backbone_modal: { + __instance: undefined + } +}; + +(function($, Generate_Sections) { + + + // Model + Generate_Sections.Section = Backbone.Model.extend({ + defaults: { + "title": "", + "box_type": "", + "inner_box_type": "", + "custom_classes": "", + "custom_id": "", + "top_padding": "", + "bottom_padding": "", + "top_padding_unit": "", + "bottom_padding_unit": "", + "background_color": "", + "background_image": "", + "background_image_preview": "", + "parallax_effect": "", + "background_color_overlay": "", + "text_color": "", + "link_color": "", + "link_color_hover": "", + "content": "" + } + }); + + + // Collection + Generate_Sections.SectionsCollection = Backbone.Collection.extend({ + model: Generate_Sections.Section, + el: "#generate_sections_container", + comparator: function(model) { + return model.get('index'); + } + }); + + + /** + * Primary Modal Application Class + */ + Generate_Sections.backbone_modal.Application = Backbone.View.extend({ + + attributes: { + id: "generate-sections-modal-dialog", + class: "generate-sections-modal", + role: "dialog" + }, + + template: wp.template("generate-sections-modal-window"), + + mediaUploader: null, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE settings + /*-----------------------------------------------------------------------------------*/ + + tmc_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE defaults + /*-----------------------------------------------------------------------------------*/ + + tmc_defaults: { + theme: "modern", + menubar: false, + wpautop: true, + indent: false, + toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", + plugins: "fullscreen,image,wordpress,wpeditimage,wplink", + max_height: 500 + }, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags settings + /*-----------------------------------------------------------------------------------*/ + + qt_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags defaults + /*-----------------------------------------------------------------------------------*/ + + qt_defaults: { + buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" + }, + + model: Generate_Sections.Section, + + events: { + "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", + "click .media-button-insert": "saveModal", + "click .media-menu-item": "switchTab", + "keydown": "keydown", + "click .generate-sections-upload-button": "openMediaUploader", + "click .generate-sections-remove-image": "removeImage", + "click div.media-frame-title h1": "toggleMenu" + }, + + + + /** + * Simple object to store any UI elements we need to use over the life of the application. + */ + ui: { + nav: undefined, + content: undefined + }, + + + /** + * Instantiates the Template object and triggers load. + */ + initialize: function() { + _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); + + this.focusManager = new wp.media.view.FocusManager({ + el: this.el + }); + + this.changeInsertText(); + this.tinyMCEsettings(); + this.render(); + }, + + /** + * switch the insert button text to "insert section" + */ + changeInsertText: function(restore) { + + var restore = typeof restore !== 'undefined' && restore == true ? true : false; + + if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { + this.insertIntoPost = wp.media.view.l10n.insertIntoPost; + wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; + // switch the insert button text back + } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { + wp.media.view.l10n.insertIntoPost = this.insertIntoPost; + } + }, + + + /** + * Merge the default TinyMCE settings + */ + tinyMCEsettings: function() { + // get the #content"s tinyMCE settings or use default + var init_settings = typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ? tinyMCEPreInit.mceInit.content : this.tmc_defaults; + + // get the #content"s quicktags settings or use default + var qt_settings = typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ? tinyMCEPreInit.qtInit.content : this.qt_defaults; + + var _this = this; + var custom_settings = { + selector: "#generate-sections-editor", + wp_autoresize_on: false, + cache_suffix: "", + min_height: 400, + } + + // merge our settings with WordPress" and store for later use + this.tmc_settings = $.extend({}, init_settings, custom_settings); + + this.qt_settings = $.extend({}, qt_settings, { + id: "generate-sections-editor" + }); + }, + + + /** + * Assembles the UI from loaded template. + * @internal Obviously, if the template fail to load, our modal never launches. + */ + render: function() { + + "use strict"; + + // Build the base window and backdrop, attaching them to the $el. + // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus + this.$el.attr("tabindex", "0") + .html(this.template); + + // Handle any attempt to move focus out of the modal. + //jQuery(document).on("focusin", this.preserveFocus); + + // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active + // and append the modal to the body. + jQuery("body").addClass("generate-modal-open").prepend(this.$el); + + // aria hide the background + jQuery("#wpwrap").attr("aria-hidden", "true"); + + this.renderContent(); + + this.renderPreview(); + + this.selected(); + this.colorPicker(); + this.startTinyMCE(); + + // Set focus on the modal to prevent accidental actions in the underlying page + this.$el.focus(); + + return this; + }, + + /** + * Make the menu mobile-friendly + */ + toggleMenu: function() { + this.$el.find('.media-menu').toggleClass('visible'); + }, + + /** + * Create the nav tabs & panels + */ + renderContent: function() { + + var model = this.model; + + var menu_item = wp.template("generate-sections-modal-menu-item"); + + // Save a reference to the navigation bar"s unordered list and populate it with items. + this.ui.nav = this.$el.find(".media-menu"); + + // reference to content area + this.ui.panels = this.$el.find(".media-frame-content"); + + // loop through the tabs + if (generate_sections_metabox_i18n.tabs.length) { + + // for...of is nicer, but not supported by minify, so stay with for...in for now + for (var tab in generate_sections_metabox_i18n.tabs) { + + if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { + + tab = generate_sections_metabox_i18n.tabs[tab]; + + var $new_tab = $(menu_item({ + target: tab.target, + name: tab.title + })); + + var panel = wp.template("generate-sections-edit-" + tab.target); + + var $new_panel = $(panel(model.toJSON())); + + if (tab.active == "true") { + $new_tab.addClass("active"); + $new_panel.addClass("active"); + } + + jQuery( 'body' ).on( 'generate_section_show_settings', function() { + jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); + jQuery( '.generate-sections-modal .panel' ).removeClass('active'); + jQuery( '.generate-section-item-style' ).addClass('active'); + jQuery( '.generate-section-settings' ).addClass('active'); + }); + + this.ui.nav.append($new_tab); + this.ui.panels.append($new_panel); + } + } + } + + }, + + + /** + * Render the background image preview + */ + renderPreview: function(image_id) { + + var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); + + var $preview = $("#generate-section-image-preview"); + $preview.children().remove(); + + if (image_id > 0) { + this.background = new wp.media.model.Attachment.get(image_id); + + this.background.fetch({ + success: function(att) { + if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { + $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); + $preview.next().find(".generate-sections-remove-image").show(); + } + } + }); + } + + }, + + + /** + * Set the default option for the select boxes + */ + selected: function() { + + var _this = this; + + this.$el.find("select").each(function(index, select) { + + var attribute = jQuery(select).attr("name"); + var selected = _this.model.get(attribute); + jQuery(select).val(selected); + + }); + }, + + /** + * Start the colorpicker + */ + colorPicker: function() { + this.$el.find(".generate-sections-color").wpColorPicker(); + }, + + /** + * Start TinyMCE on the textarea + */ + startTinyMCE: function() { + + // set the default editor + this.ui.panels.find("#wp-generate-sections-editor-wrap").addClass(generate_sections_metabox_i18n.default_editor); + + // remove tool buttons if richedit disabled + if (!generate_sections_metabox_i18n.user_can_richedit) { + this.ui.panels.find(".wp-editor-tabs").remove(); + } + + // add our copy to the collection in the tinyMCEPreInit object because switch editors + if (typeof tinyMCEPreInit == 'object') { + tinyMCEPreInit.mceInit["generate-sections-editor"] = this.tmc_settings; + tinyMCEPreInit.qtInit["generate-sections-editor"] = this.qt_settings; + tinyMCEPreInit.mceInit["generate-sections-editor"].wp_keep_scroll_position = false; + } + + try { + + var rich = (typeof tinyMCE != "undefined"); + + // turn on the quicktags editor + quicktags(this.qt_settings); + + // attempt to fix problem of quicktags toolbar with no buttons + QTags._buttonsInit(); + + if (rich !== false) { + // turn on tinyMCE + tinyMCE.init(this.tmc_settings); + } + + } catch (e) {} + + }, + + /** + * Launch Media Uploader + */ + openMediaUploader: function(e) { + + var _this = this; + + $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); + + e.preventDefault(); + + // If the uploader object has already been created, reopen the dialog + if (this.mediaUploader) { + this.mediaUploader.open(); + return; + } + // Extend the wp.media object + this.mediaUploader = wp.media.frames.file_frame = wp.media({ + title: generate_sections_metabox_i18n.media_library_title, + button: { + text: generate_sections_metabox_i18n.media_library_button + }, + multiple: false + }); + + + // When a file is selected, grab the URL and set it as the text field"s value + this.mediaUploader.on("select", function() { + + attachment = _this.mediaUploader.state().get("selection").first().toJSON(); + + $input.val(attachment.id); + + _this.renderPreview(attachment.id); + }); + // Open the uploader dialog + this.mediaUploader.open(); + + }, + + /** + * Remove the background image + */ + removeImage: function(e) { + e.preventDefault(); + $("#generate-section-image-preview").children().remove(); + $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); + $("#generate-sections-background-image").val(""); + }, + + + /** + * Closes the modal and cleans up after the instance. + * @param e {object} A jQuery-normalized event object. + */ + closeModal: function(e) { + "use strict"; + + e.preventDefault(); + this.undelegateEvents(); + jQuery(document).off("focusin"); + jQuery("body").removeClass("generate-modal-open"); + jQuery("body").removeClass("generate-section-content"); + + // remove restricted media modal tab focus once it's closed + this.$el.undelegate('keydown'); + + // remove the tinymce editor + // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) + if (typeof tinyMCE != "undefined") { + tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); + } + + // remove modal and unset instances + this.remove(); + Generate_Sections.backbone_modal.__instance = undefined; + this.mediaUploader = null; + Generate_Sections.modalOpen = null; + + // switch the insert button text back + this.changeInsertText(true); + + // send focus back to where it was prior to modal open + Generate_Sections.lastFocus.focus(); + + // aria unhide the background + jQuery("#wpwrap").attr("aria-hidden", "false"); + + // Fix bug where the window scrolls down 50px on close + var topDistance = jQuery("body").offset().top; + if ( topDistance >= jQuery("body").scrollTop() ) { + jQuery("body").scrollTop(0); + } + + }, + + /** + * Responds to the btn-ok.click event + * @param e {object} A jQuery-normalized event object. + * @todo You should make this your own. + */ + saveModal: function(e) { + "use strict"; + + this.model.get("index"); + + var model = this.model; + + // send the tinymce content to the textarea + if (typeof tinyMCE != "undefined") { + tinymce.triggerSave(); + } + + var $inputs = this.ui.panels.find("input, select, textarea"); + + $inputs.each(function(index, input) { + + var name = $(input).attr("name"); + + if (model.attributes.hasOwnProperty(name)) { + var value = $(input).val(); + model.set(name, value); + } + + }); + + this.closeModal(e); + }, + + /** + * Handles tab clicks and switches to corresponding panel + * @param e {object} A jQuery-normalized event object. + */ + switchTab: function(e) { + "use strict"; + e.preventDefault(); + + // close lingering wp link windows + if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { + tinyMCE.activeEditor.execCommand('wp_link_cancel'); + tinyMCE.activeEditor.execCommand('wp_media_cancel'); + } + + this.ui.nav.children().removeClass("active"); + this.ui.panels.children().removeClass("active"); + + var target = jQuery(e.currentTarget).addClass("active").data("target"); + + this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); + }, + + /** + * close on keyboard shortcuts + * @param {Object} event + */ + keydown: function(e) { + // Close the modal when escape is pressed. + if (27 === e.which && this.$el.is(':visible')) { + this.closeModal(e); + e.stopImmediatePropagation(); + } + } + + }); + + + // Singular View + Generate_Sections.sectionView = Backbone.View.extend({ + + model: Generate_Sections.Section, + tagName: 'div', + + initialize: function() { + // re-render on all changes EXCEPT index + this.listenTo(this.model, "change", this.maybeRender); + }, + + attributes: { + class: "ui-state-default section" + }, + + // Get the template from the DOM + template: wp.template("generate-sections-section"), + + events: { + 'click .edit-section': 'editSection', + 'click .section-title > span': 'editSection', + 'click .delete-section': 'removeSection', + 'click .toggle-section': 'toggleSection', + 'reorder': 'reorder', + }, + + maybeRender: function(e) { + if (this.model.hasChanged('index')) return; + this.render(); + }, + + // Render the single model - include an index. + render: function() { + this.model.set('index', this.model.collection.indexOf(this.model)); + this.$el.html(this.template(this.model.toJSON())); + + if (!this.model.get('title')) { + this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); + } + this.$el.find('textarea').val(JSON.stringify(this.model)); + + return this; + }, + + + // launch the edit modal + editSection: function(e) { + + // stash the current focus + Generate_Sections.lastFocus = document.activeElement; + Generate_Sections.modalOpen = true; + + e.preventDefault(); + if (Generate_Sections.backbone_modal.__instance === undefined) { + Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ + model: this.model + }); + } + + }, + + // reorder after sort + reorder: function(event, index) { + this.$el.trigger('update-sort', [this.model, index]); + }, + + // remove/destroy a model + removeSection: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + this.model.destroy(); + Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting + } + }, + }); + + + // List View + Generate_Sections.sectionListView = Backbone.View.extend({ + + el: "#generate_sections_container", + events: { + 'update-sort': 'updateSort', + // 'add-section': 'addOne' + }, + + // callback for clone button + addSection: function(model) { + this.collection.add(model); + this.addOne(model); + }, + + addOne: function(model) { + var view = new Generate_Sections.sectionView({ + model: model + }); + this.$el.append(view.render().el); + }, + + render: function() { + this.$el.children().remove(); + this.collection.each(this.addOne, this); + return this; + }, + + updateSort: function(event, model, position) { + this.collection.remove(model); + + // renumber remaining models around missing model + this.collection.each(function(model, index) { + + var new_index = index; + if (index >= position) { + new_index += 1; + } + model.set('index', new_index); + }); + + // set the index of the missing model + model.set('index', position); + + // add the model back to the collection + this.collection.add(model, { + at: position + }); + + this.render(); + + }, + + }); + + + // The Buttons & Nonce + Generate_Sections.ButtonControls = Backbone.View.extend({ + + attributes: { + class: "generate_sections_buttons" + }, + + tagName: 'p', + + el: "#_generate_sections_metabox", + + template: wp.template("generate-sections-buttons"), + + // Attach events + events: { + "click .button-primary": "newSection", + "click #generate-delete-sections": "clearAll", + 'click .edit-section': 'editSection', + }, + + // create new + newSection: function(e) { + e.preventDefault(); + var newSection = new Generate_Sections.Section(); + Generate_Sections.sectionList.addSection(newSection); + }, + + // clear all models + clearAll: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + Generate_Sections.sectionCollection.reset(); + Generate_Sections.sectionList.render(); + } + }, + + render: function() { + this.$el.find(".generate_sections_control").append(this.template); + return this; + }, + + }); + + + // init + Generate_Sections.initApplication = function() { + + // Create Collection From Existing Meta + Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); + + // Create the List View + Generate_Sections.sectionList = new Generate_Sections.sectionListView({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.sectionList.render(); + + // Buttons + Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.Buttons.render(); + + }; + + + /*-----------------------------------------------------------------------------------*/ + /* Execute the above methods in the Generate_Sections object. + /*-----------------------------------------------------------------------------------*/ + + jQuery(document).ready(function($) { + + Generate_Sections.initApplication(); + + $( '#generate_sections_container' ).sortable({ + axis: "y", + opacity: 0.5, + grid: [20, 10], + tolerance: "pointer", + handle: ".move-section", + update: function(event, ui) { + ui.item.trigger("reorder", ui.item.index()); + } + } ); + + if ( $( '.use-sections-switch' ).is( ':checked' ) ) { + setTimeout( function() { + generateShowSections(); + }, 200 ); + } else { + generateHideSections(); + } + + $( '.use-sections-switch' ).on( 'change', function( e ) { + var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; + + if ( 'checked' == status ) { + generateShowSections(); + } else if ( 'unchecked' == status ) { + generateHideSections(); + } + } ); + + function generateShowSections() { + + // Hide send to editor button + $('.send-to-editor').css('display', 'none'); + + // Hide the editor + $('#postdivrich').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + // Show the sections + $('#_generate_sections_metabox').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Remove and add the default editor - this removes any visible toolbars etc.. + // We need to set a timeout for this to work + // if (typeof tinyMCE != "undefined") { + // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); + // $( '.use-sections-cover' ).css( 'z-index','10000' ); + // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); + // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); + // } + + // Set a trigger + $('body').trigger('generate_show_sections'); + + } + + function generateHideSections() { + + // Show send to editor button + $('.send-to-editor').css('display', 'inline-block'); + + // Show the editor + $('#postdivrich').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Hide the sections + $('#_generate_sections_metabox').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $('body').trigger('generate_hide_sections'); + + } + + $( document ).on( 'click', '.edit-section.edit-settings', function() { + $( 'body' ).trigger( 'generate_section_show_settings' ); + }); + + }); + + +})(jQuery, Generate_Sections); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js new file mode 100644 index 00000000..4c498070 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js @@ -0,0 +1,858 @@ +/*-----------------------------------------------------------------------------------*/ +/* Generate Sections Metabox +/* +/* © Kathy Darling http://www.kathyisawesome.com +/* 2016-07-19. */ +/*-----------------------------------------------------------------------------------*/ + +/** + * @type {Object} JavaScript namespace for our application. + */ +var Generate_Sections = { + backbone_modal: { + __instance: undefined + } +}; + +(function($, Generate_Sections) { + + + // Model + Generate_Sections.Section = Backbone.Model.extend({ + defaults: { + "title": "", + "box_type": "", + "inner_box_type": "", + "custom_classes": "", + "custom_id": "", + "top_padding": "", + "bottom_padding": "", + "top_padding_unit": "", + "bottom_padding_unit": "", + "background_color": "", + "background_image": "", + "background_image_preview": "", + "parallax_effect": "", + "background_color_overlay": "", + "text_color": "", + "link_color": "", + "link_color_hover": "", + "content": "" + } + }); + + + // Collection + Generate_Sections.SectionsCollection = Backbone.Collection.extend({ + model: Generate_Sections.Section, + el: "#generate_sections_container", + comparator: function(model) { + return model.get('index'); + } + }); + + + /** + * Primary Modal Application Class + */ + Generate_Sections.backbone_modal.Application = Backbone.View.extend({ + + attributes: { + id: "generate-sections-modal-dialog", + class: "generate-sections-modal", + role: "dialog" + }, + + template: wp.template("generate-sections-modal-window"), + + mediaUploader: null, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE settings + /*-----------------------------------------------------------------------------------*/ + + tmc_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE defaults + /*-----------------------------------------------------------------------------------*/ + + tmc_defaults: { + theme: "modern", + menubar: false, + wpautop: true, + indent: false, + toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", + plugins: "fullscreen,image,wordpress,wpeditimage,wplink", + max_height: 500 + }, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags settings + /*-----------------------------------------------------------------------------------*/ + + qt_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags defaults + /*-----------------------------------------------------------------------------------*/ + + qt_defaults: { + buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" + }, + + model: Generate_Sections.Section, + + events: { + "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", + "click .media-button-insert": "saveModal", + "click .media-menu-item": "switchTab", + "keydown": "keydown", + "click .generate-sections-upload-button": "openMediaUploader", + "click .generate-sections-remove-image": "removeImage", + "click div.media-frame-title h1": "toggleMenu" + }, + + + + /** + * Simple object to store any UI elements we need to use over the life of the application. + */ + ui: { + nav: undefined, + content: undefined + }, + + + /** + * Instantiates the Template object and triggers load. + */ + initialize: function() { + _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); + + this.focusManager = new wp.media.view.FocusManager({ + el: this.el + }); + + this.changeInsertText(); + //this.tinyMCEsettings(); + this.render(); + }, + + /** + * switch the insert button text to "insert section" + */ + changeInsertText: function(restore) { + + var restore = typeof restore !== 'undefined' && restore == true ? true : false; + + if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { + this.insertIntoPost = wp.media.view.l10n.insertIntoPost; + wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; + // switch the insert button text back + } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { + wp.media.view.l10n.insertIntoPost = this.insertIntoPost; + } + }, + + /** + * Assembles the UI from loaded template. + * @internal Obviously, if the template fail to load, our modal never launches. + */ + render: function() { + + "use strict"; + + // Build the base window and backdrop, attaching them to the $el. + // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus + this.$el.attr("tabindex", "0").html(this.template); + + // Handle any attempt to move focus out of the modal. + //jQuery(document).on("focusin", this.preserveFocus); + + // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active + // and append the modal to the body. + jQuery("body").addClass("generate-modal-open").prepend(this.$el); + + // aria hide the background + jQuery("#wpwrap").attr("aria-hidden", "true"); + + this.renderContent(); + + this.renderPreview(); + + this.selected(); + this.colorPicker(); + //this.startTinyMCE(); + this.launchEditor(); + + // Set focus on the modal to prevent accidental actions in the underlying page + this.$el.focus(); + + return this; + }, + + launchEditor: function() { + var id = this.ui.panels.find( ".generate-sections-editor-wrap" ).find( 'textarea' ).attr( 'id' ), + customButtonsContainer = this.ui.panels.find( '.generate-sections-editor-wrap' ).find( '#custom-media-buttons' ); + + customButtonsContainer.find( '.insert-media' ).remove(); + var customButtons = customButtonsContainer.html(); + customButtonsContainer.remove(); + + var init_settings = true; + + if ( typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ) { + init_settings = tinyMCEPreInit.mceInit.content; + } else if ( typeof window.wpEditorL10n !== "undefined" ) { + init_settings = window.wpEditorL10n.tinymce.settings; + } else { + init_settings = this.tmc_defaults; + } + + var thisPanel = this.ui.panels; + + var custom_settings = { + wp_autoresize_on: false, + cache_suffix: "", + min_height: 400, + wp_keep_scroll_position: false, + setup: function( editor ) { + editor.on( 'init', function( e ) { + if ( 'html-active' === generate_sections_metabox_i18n.default_editor && generate_sections_metabox_i18n.user_can_richedit ) { + thisPanel.find( '#wp-generate-sections-editor-wrap' ).removeClass( 'tmce-active' ).addClass( 'html-active' ); + editor.hidden = true; + } + } ); + } + } + + init_settings = $.extend({}, init_settings, custom_settings); + + var qt_settings = true; + + if ( typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ) { + qt_settings = tinyMCEPreInit.qtInit.content; + } else { + qt_settings = this.qt_defaults; + } + + if ( ! generate_sections_metabox_i18n.user_can_richedit ) { + init_settings = false; + } + + wp.sectionsEditor.initialize( id, { + tinymce: init_settings, + quicktags: qt_settings, + mediaButtons: true + } ); + + var buttonsElement = this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).find( '.wp-media-buttons' ); + buttonsElement.attr( 'id', 'custom-media-buttons' ); + $( customButtons ).appendTo( buttonsElement ); + + if ( ! generate_sections_metabox_i18n.user_can_richedit ) { + this.ui.panels.find( '#generate-sections-editor' ).addClass( 'no-rich-edit' ); + } + }, + + /** + * Make the menu mobile-friendly + */ + toggleMenu: function() { + this.$el.find('.media-menu').toggleClass('visible'); + }, + + /** + * Create the nav tabs & panels + */ + renderContent: function() { + + var model = this.model; + + var menu_item = wp.template("generate-sections-modal-menu-item"); + + // Save a reference to the navigation bar"s unordered list and populate it with items. + this.ui.nav = this.$el.find(".media-menu"); + + // reference to content area + this.ui.panels = this.$el.find(".media-frame-content"); + + // loop through the tabs + if (generate_sections_metabox_i18n.tabs.length) { + + // for...of is nicer, but not supported by minify, so stay with for...in for now + for (var tab in generate_sections_metabox_i18n.tabs) { + + if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { + + tab = generate_sections_metabox_i18n.tabs[tab]; + + var $new_tab = $(menu_item({ + target: tab.target, + name: tab.title + })); + + var panel = wp.template("generate-sections-edit-" + tab.target); + + var $new_panel = $(panel(model.toJSON())); + + if (tab.active == "true") { + $new_tab.addClass("active"); + $new_panel.addClass("active"); + } + + jQuery( 'body' ).on( 'generate_section_show_settings', function() { + jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); + jQuery( '.generate-sections-modal .panel' ).removeClass('active'); + jQuery( '.generate-section-item-style' ).addClass('active'); + jQuery( '.generate-section-settings' ).addClass('active'); + }); + + this.ui.nav.append($new_tab); + this.ui.panels.append($new_panel); + } + } + } + + }, + + + /** + * Render the background image preview + */ + renderPreview: function(image_id) { + + var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); + + var $preview = $("#generate-section-image-preview"); + $preview.children().remove(); + + if (image_id > 0) { + this.background = new wp.media.model.Attachment.get(image_id); + + this.background.fetch({ + success: function(att) { + if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { + $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); + $preview.next().find(".generate-sections-remove-image").show(); + } + } + }); + } + + }, + + + /** + * Set the default option for the select boxes + */ + selected: function() { + + var _this = this; + + this.$el.find("select").each(function(index, select) { + + var attribute = jQuery(select).attr("name"); + var selected = _this.model.get(attribute); + jQuery(select).val(selected); + + }); + }, + + /** + * Start the colorpicker + */ + colorPicker: function() { + this.$el.find(".generate-sections-color").wpColorPicker(); + }, + + /** + * Launch Media Uploader + */ + openMediaUploader: function(e) { + + var _this = this; + + $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); + + e.preventDefault(); + + // If the uploader object has already been created, reopen the dialog + if (this.mediaUploader) { + this.mediaUploader.open(); + return; + } + // Extend the wp.media object + this.mediaUploader = wp.media.frames.file_frame = wp.media({ + title: generate_sections_metabox_i18n.media_library_title, + button: { + text: generate_sections_metabox_i18n.media_library_button + }, + multiple: false + }); + + + // When a file is selected, grab the URL and set it as the text field"s value + this.mediaUploader.on("select", function() { + + attachment = _this.mediaUploader.state().get("selection").first().toJSON(); + + $input.val(attachment.id); + + _this.renderPreview(attachment.id); + }); + // Open the uploader dialog + this.mediaUploader.open(); + + }, + + /** + * Remove the background image + */ + removeImage: function(e) { + e.preventDefault(); + $("#generate-section-image-preview").children().remove(); + $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); + $("#generate-sections-background-image").val(""); + }, + + + /** + * Closes the modal and cleans up after the instance. + * @param e {object} A jQuery-normalized event object. + */ + closeModal: function(e) { + "use strict"; + + e.preventDefault(); + this.undelegateEvents(); + jQuery(document).off("focusin"); + jQuery("body").removeClass("generate-modal-open"); + jQuery("body").removeClass("generate-section-content"); + + // remove restricted media modal tab focus once it's closed + this.$el.undelegate('keydown'); + + // remove the tinymce editor + // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) + if (typeof tinyMCE != "undefined") { + tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); + } + + // remove modal and unset instances + this.remove(); + Generate_Sections.backbone_modal.__instance = undefined; + this.mediaUploader = null; + Generate_Sections.modalOpen = null; + + // switch the insert button text back + this.changeInsertText(true); + + // send focus back to where it was prior to modal open + Generate_Sections.lastFocus.focus(); + + // aria unhide the background + jQuery("#wpwrap").attr("aria-hidden", "false"); + + // Fix bug where the window scrolls down 50px on close + var topDistance = jQuery("body").offset().top; + if ( topDistance >= jQuery("body").scrollTop() ) { + jQuery("body").scrollTop(0); + } + + }, + + /** + * Responds to the btn-ok.click event + * @param e {object} A jQuery-normalized event object. + * @todo You should make this your own. + */ + saveModal: function(e) { + "use strict"; + + this.model.get("index"); + + var model = this.model; + + // send the tinymce content to the textarea + if (typeof tinyMCE != "undefined") { + tinymce.triggerSave(); + } + + var $inputs = this.ui.panels.find("input, select, textarea"); + + $inputs.each(function(index, input) { + + var name = $(input).attr("name"); + + if (model.attributes.hasOwnProperty(name)) { + var value = $(input).val(); + model.set(name, value); + } + + }); + + this.closeModal(e); + }, + + /** + * Handles tab clicks and switches to corresponding panel + * @param e {object} A jQuery-normalized event object. + */ + switchTab: function(e) { + "use strict"; + e.preventDefault(); + + // close lingering wp link windows + if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { + tinyMCE.activeEditor.execCommand('wp_link_cancel'); + tinyMCE.activeEditor.execCommand('wp_media_cancel'); + } + + this.ui.nav.children().removeClass("active"); + this.ui.panels.children().removeClass("active"); + + var target = jQuery(e.currentTarget).addClass("active").data("target"); + + this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); + }, + + /** + * close on keyboard shortcuts + * @param {Object} event + */ + keydown: function(e) { + // Close the modal when escape is pressed. + if (27 === e.which && this.$el.is(':visible')) { + this.closeModal(e); + e.stopImmediatePropagation(); + } + } + + }); + + + // Singular View + Generate_Sections.sectionView = Backbone.View.extend({ + + model: Generate_Sections.Section, + tagName: 'div', + + initialize: function() { + // re-render on all changes EXCEPT index + this.listenTo(this.model, "change", this.maybeRender); + }, + + attributes: { + class: "ui-state-default section" + }, + + // Get the template from the DOM + template: wp.template("generate-sections-section"), + + events: { + 'click .edit-section': 'editSection', + 'click .section-title > span': 'editSection', + 'click .delete-section': 'removeSection', + 'click .toggle-section': 'toggleSection', + 'reorder': 'reorder', + }, + + maybeRender: function(e) { + if (this.model.hasChanged('index')) return; + this.render(); + }, + + // Render the single model - include an index. + render: function() { + this.model.set('index', this.model.collection.indexOf(this.model)); + this.$el.html(this.template(this.model.toJSON())); + + if (!this.model.get('title')) { + this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); + } + this.$el.find('textarea').val(JSON.stringify(this.model)); + + return this; + }, + + + // launch the edit modal + editSection: function(e) { + + // stash the current focus + Generate_Sections.lastFocus = document.activeElement; + Generate_Sections.modalOpen = true; + + e.preventDefault(); + if (Generate_Sections.backbone_modal.__instance === undefined) { + Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ + model: this.model + }); + } + + }, + + // reorder after sort + reorder: function(event, index) { + this.$el.trigger('update-sort', [this.model, index]); + }, + + // remove/destroy a model + removeSection: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + this.model.destroy(); + Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting + } + }, + }); + + + // List View + Generate_Sections.sectionListView = Backbone.View.extend({ + + el: "#generate_sections_container", + events: { + 'update-sort': 'updateSort', + // 'add-section': 'addOne' + }, + + // callback for clone button + addSection: function(model) { + this.collection.add(model); + this.addOne(model); + }, + + addOne: function(model) { + var view = new Generate_Sections.sectionView({ + model: model + }); + this.$el.append(view.render().el); + }, + + render: function() { + this.$el.children().remove(); + this.collection.each(this.addOne, this); + return this; + }, + + updateSort: function(event, model, position) { + this.collection.remove(model); + + // renumber remaining models around missing model + this.collection.each(function(model, index) { + + var new_index = index; + if (index >= position) { + new_index += 1; + } + model.set('index', new_index); + }); + + // set the index of the missing model + model.set('index', position); + + // add the model back to the collection + this.collection.add(model, { + at: position + }); + + this.render(); + + }, + + }); + + + // The Buttons & Nonce + Generate_Sections.ButtonControls = Backbone.View.extend({ + + attributes: { + class: "generate_sections_buttons" + }, + + tagName: 'p', + + el: "#_generate_sections_metabox", + + template: wp.template("generate-sections-buttons"), + + // Attach events + events: { + "click .button-primary": "newSection", + "click #generate-delete-sections": "clearAll", + 'click .edit-section': 'editSection', + }, + + // create new + newSection: function(e) { + e.preventDefault(); + var newSection = new Generate_Sections.Section(); + Generate_Sections.sectionList.addSection(newSection); + }, + + // clear all models + clearAll: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + Generate_Sections.sectionCollection.reset(); + Generate_Sections.sectionList.render(); + } + }, + + render: function() { + this.$el.find(".generate_sections_control").append(this.template); + return this; + }, + + }); + + + // init + Generate_Sections.initApplication = function() { + + // Create Collection From Existing Meta + Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); + + // Create the List View + Generate_Sections.sectionList = new Generate_Sections.sectionListView({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.sectionList.render(); + + // Buttons + Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.Buttons.render(); + + }; + + + /*-----------------------------------------------------------------------------------*/ + /* Execute the above methods in the Generate_Sections object. + /*-----------------------------------------------------------------------------------*/ + + jQuery( function( $ ) { + + Generate_Sections.initApplication(); + + $( '#generate_sections_container' ).sortable({ + axis: "y", + opacity: 0.5, + grid: [20, 10], + tolerance: "pointer", + handle: ".move-section", + update: function(event, ui) { + ui.item.trigger("reorder", ui.item.index()); + } + } ); + + if ( $( '.use-sections-switch' ).is( ':checked' ) ) { + setTimeout( function() { + generateShowSections(); + }, 200 ); + } else { + generateHideSections(); + } + + $( '.use-sections-switch' ).on( 'change', function( e ) { + var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; + + if ( 'checked' == status ) { + generateShowSections(); + } else if ( 'unchecked' == status ) { + generateHideSections(); + } + } ); + + function generateShowSections() { + + // Hide send to editor button + $('.send-to-editor').css('display', 'none'); + + // Hide the editor + $('#postdivrich').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $( '.block-editor-block-list__layout' ).hide(); + + $( '.edit-post-layout .edit-post-visual-editor' ).css( { + 'flex-grow': 'unset', + 'flex-basis': '0' + } ); + + $( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( { + 'min-height': '0' + } ); + + $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '0' ); + + // Show the sections + $('#_generate_sections_metabox').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Remove and add the default editor - this removes any visible toolbars etc.. + // We need to set a timeout for this to work + // if (typeof tinyMCE != "undefined") { + // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); + // $( '.use-sections-cover' ).css( 'z-index','10000' ); + // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); + // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); + // } + + // Set a trigger + $('body').trigger('generate_show_sections'); + + } + + function generateHideSections() { + + // Show send to editor button + $('.send-to-editor').css('display', 'inline-block'); + + // Show the editor + $('#postdivrich').css({ + 'opacity': '1', + 'height': 'auto' + }); + + $( '.block-editor-block-list__layout' ).show(); + + $( '.edit-post-layout .edit-post-visual-editor' ).css( { + 'flex-grow': '', + 'flex-basis': '' + } ); + + $( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( { + 'min-height': '' + } ); + + $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '' ); + + // Hide the sections + $('#_generate_sections_metabox').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $('body').trigger('generate_hide_sections'); + + } + + $( document ).on( 'click', '.edit-section.edit-settings', function() { + $( 'body' ).trigger( 'generate_section_show_settings' ); + }); + + }); + + +})(jQuery, Generate_Sections); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php new file mode 100644 index 00000000..402614ec --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/metabox-functions.php @@ -0,0 +1,396 @@ +ID, '_generate_use_sections', TRUE) : ''; + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + $classes .= ' generate-sections-enabled'; + } + + return $classes; + } +} + +if ( ! function_exists( 'generate_sections_content_width' ) ) { + add_action( 'wp', 'generate_sections_content_width', 50 ); + /** + * Set our content width when sections are enabled + */ + function generate_sections_content_width() { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + global $content_width; + $content_width = 2000; + } + } +} + +if ( ! function_exists( 'generate_sections_add_metaboxes' ) ) { + add_action( 'add_meta_boxes', 'generate_sections_add_metaboxes', 5 ); + /* + * Functions for creating the metaboxes + */ + function generate_sections_add_metaboxes() { + + $post_types = apply_filters( 'generate_sections_post_types', array( 'page', 'post' ) ); + + add_meta_box( + '_generate_use_sections_metabox', + __( 'Sections', 'gp-premium' ), + 'generate_sections_use_sections_metabox', + $post_types, + 'side', + 'high' + ); + + add_meta_box( + '_generate_sections_metabox', + __( 'Sections', 'gp-premium' ), + 'generate_sections_sections_metabox', + $post_types, + 'normal', + 'high' + ); + + } +} + +if ( ! function_exists( 'generate_sections_sanitize_function' ) ) { + /* + * Sanitize our settings + */ + function generate_sections_sanitize_function( $data, $post_id ) { + + $section = array(); + + if ( isset( $data['title'] ) ) { + $section['title'] = sanitize_text_field( $data['title'] ); + } + + if ( isset( $data['content'] ) ) { + $section['content'] = sanitize_post_field( 'post_content', $data['content'], $post_id, 'db' ); + } + + if ( isset( $data['custom_classes'] ) ) { + $section['custom_classes'] = sanitize_text_field( $data['custom_classes'] ); + } + + if ( isset( $data['custom_id'] ) ) { + $section['custom_id'] = sanitize_text_field( $data['custom_id'] ); + } + + if ( isset( $data['top_padding'] ) ) { + $section['top_padding'] = '' == $data['top_padding'] ? $data['top_padding'] : absint( $data['top_padding'] ); + } + + if ( isset( $data['bottom_padding'] ) ) { + $section['bottom_padding'] = '' == $data['bottom_padding'] ? $data['bottom_padding'] : absint( $data['bottom_padding'] ); + } + + if ( isset( $data['top_padding_unit'] ) ) { + $section['top_padding_unit'] = $data['top_padding_unit'] == '%' ? '%' : ''; + } + + if ( isset( $data['bottom_padding_unit'] ) ) { + $section['bottom_padding_unit'] = $data['bottom_padding_unit'] == '%' ? '%' : ''; + } + + if ( isset( $data['background_image'] ) ) { + $section['background_image'] = absint( $data['background_image'] ); + } + + if ( isset( $data['background_color'] ) ) { + $section['background_color'] = generate_sections_sanitize_rgba( $data['background_color'] ); + } + + if ( isset( $data['text_color'] ) ) { + $section['text_color'] = generate_sections_sanitize_hex_color( $data['text_color'] ); + } + + if ( isset( $data['link_color'] ) ) { + $section['link_color'] = generate_sections_sanitize_hex_color( $data['link_color'] ); + } + + if ( isset( $data['link_color_hover'] ) ) { + $section['link_color_hover'] = generate_sections_sanitize_hex_color( $data['link_color_hover'] ); + } + + if ( isset( $data['box_type'] ) ) { + $section['box_type'] = $data['box_type'] == 'contained' ? 'contained' : ''; + } + + if ( isset( $data['inner_box_type'] ) ) { + $section['inner_box_type'] = $data['inner_box_type'] == 'fluid' ? 'fluid' : ''; + } + + if ( isset( $data['parallax_effect'] ) ) { + $section['parallax_effect'] = $data['parallax_effect'] == 'enable' ? 'enable' : ''; + } + + if ( isset( $data['background_color_overlay'] ) ) { + $section['background_color_overlay'] = $data['background_color_overlay'] == 'enable' ? 'enable' : ''; + } + + return $section; + + } +} + +if ( ! function_exists( 'generate_sections_metabox_scripts' ) ) { + add_action( 'admin_enqueue_scripts', 'generate_sections_metabox_scripts', 20 ); + /* + * Enqueue styles and scripts specific to metaboxs + */ + function generate_sections_metabox_scripts( $hook ) { + // I prefer to enqueue the styles only on pages that are using the metaboxes + if ( in_array( $hook, array( "post.php", "post-new.php" ) ) ) { + + $post_types = apply_filters( 'generate_sections_post_types', array( 'page', 'post' ) ); + + $screen = get_current_screen(); + $post_type = $screen->id; + + if ( in_array( $post_type, (array) $post_types ) ) { + wp_enqueue_style( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'css/generate-sections-metabox.css', false, GENERATE_SECTIONS_VERSION ); + wp_enqueue_style( 'generate-lc-switch', plugin_dir_url( __FILE__ ) . 'css/lc_switch.css', false, GENERATE_SECTIONS_VERSION ); + + //make sure we enqueue some scripts just in case ( only needed for repeating metaboxes ) + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'jquery-ui-core' ); + wp_enqueue_script( 'jquery-ui-widget' ); + wp_enqueue_script( 'jquery-ui-mouse' ); + wp_enqueue_script( 'jquery-ui-sortable' ); + wp_enqueue_script( 'editor' ); + wp_enqueue_script( 'media-upload' ); + wp_enqueue_script( 'wp-color-picker' ); + wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_script( 'wp-color-picker-alpha', GP_LIBRARY_DIRECTORY_URL . 'alpha-color-picker/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); + + wp_add_inline_script( + 'wp-color-picker-alpha', + 'jQuery( function() { jQuery( ".color-picker" ).wpColorPicker(); } );' + ); + + wp_enqueue_media(); + + if ( function_exists( 'wp_enqueue_editor' ) ) { + wp_enqueue_editor(); + + wp_add_inline_script( + 'editor', + 'window.wp.sectionsEditor = window.wp.editor;', + 'after' + ); + } + + if ( version_compare( get_bloginfo( 'version' ), '5.0', '<' ) ) { + wp_enqueue_script( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'js/generate-sections-metabox-4.9.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'editor', 'media-upload', 'wp-color-picker' ), GENERATE_SECTIONS_VERSION, true ); + } else { + wp_enqueue_script( 'generate-sections-metabox', plugin_dir_url( __FILE__ ) . 'js/generate-sections-metabox.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'editor', 'media-upload', 'wp-color-picker' ), GENERATE_SECTIONS_VERSION, true ); + } + + if ( function_exists( 'wp_add_inline_script' ) ) { + if ( function_exists( 'generate_get_default_color_palettes' ) ) { + // Grab our palette array and turn it into JS + $palettes = json_encode( generate_get_default_color_palettes() ); + + // Add our custom palettes + // json_encode takes care of escaping + wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' ); + } + } + } + } + } +} + +if ( ! function_exists( 'generate_sections_admin_footer_scripts' ) ) { + add_action( 'admin_footer', 'generate_sections_admin_footer_scripts' ); + + function generate_sections_admin_footer_scripts() { + // We don't need this if wp_add_inline_script exists + if ( function_exists( 'wp_add_inline_script' ) ) { + return; + } + ?> + + ID, '_generate_sections', true ); + + $sections = isset( $meta['sections'] ) && is_array( $meta['sections' ] ) ? $meta['sections'] : array(); + + $translation_array = array( + 'confirm' => __( 'This action can not be undone, are you sure?', 'gp-premium' ), + 'post_id' => $post->ID, + 'sections' => $sections, + 'default_title' => __( 'Section', 'gp-premium' ), + 'default_content_title' => __( 'Content', 'gp-premium' ), + 'tabs' => array( + array( 'title' => __( 'Settings', 'gp-premium' ), 'target' => 'style', 'active' => 'false' ), + array( 'title' => __( 'Content', 'gp-premium' ), 'target' => 'content', 'active' => 'true' ), + //array( 'title' => __( 'Layout', 'gp-premium' ), 'target' => 'layout', 'active' => 'false' ), + ), + 'top_padding' => apply_filters( 'generate_sections_default_padding_top','40' ), + 'bottom_padding' => apply_filters( 'generate_sections_default_padding_bottom','40' ), + 'media_library_title' => __('Section Background', 'gp-premium' ), + 'media_library_button' => __( 'Set as Section Background', 'gp-premium' ), + 'generate_nonce' => wp_create_nonce( 'generate_sections_nonce' ), + 'default_editor' => user_can_richedit() && wp_default_editor() == 'tinymce' ? 'tmce-active' : 'html-active', + 'user_can_richedit' => user_can_richedit(), + 'insert_into_section' => __( 'Insert into Section', 'gp-premium' ), + 'edit_section' => __( 'Edit Section', 'gp-premium' ) + + ); + wp_localize_script( 'generate-sections-metabox', 'generate_sections_metabox_i18n', $translation_array ); + + include_once( plugin_dir_path( __FILE__ ) . 'views/sections.php' ); + include_once( plugin_dir_path( __FILE__ ) . 'views/sections-template.php' ); + add_action( 'print_media_templates', 'generate_sections_print_templates' ); + + do_action( 'generate_sections_metabox' ); + } +} + +if ( ! function_exists( 'generate_sections_save_use_metabox' ) ) { + add_action( 'save_post', 'generate_sections_save_use_metabox' ); + /* + * Save the "use" metabox + */ + function generate_sections_save_use_metabox( $post_id ) { + if ( ! isset( $_POST['_generate_sections_use_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_use_sections_nonce'], 'generate_sections_use_sections_nonce' ) ) { + return $post_id; + } + + if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { + return $post_id; + } + + if ( ! current_user_can('edit_post', $post_id ) ) { + return $post_id; + } + + if ( isset ( $_POST['_generate_use_sections'] ) && isset ( $_POST['_generate_use_sections']['use_sections'] ) && $_POST['_generate_use_sections']['use_sections'] == 'true' ) { + update_post_meta( $post_id, '_generate_use_sections', array( 'use_sections' => 'true' ) ); + } else { + delete_post_meta( $post_id, '_generate_use_sections' ); + } + } +} + +if ( ! function_exists( 'generate_sections_save_sections_metabox' ) ) { + add_action( 'save_post', 'generate_sections_save_sections_metabox', 20 ); + /* + * Save the sections metabox + */ + function generate_sections_save_sections_metabox( $post_id ) { + + if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) { + return $post_id; + } + + if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { + return $post_id; + } + + if ( ! current_user_can('edit_post', $post_id ) ) { + return $post_id; + } + + $clean = array(); + + if ( isset ( $_POST['_generate_sections'] ) && isset( $_POST['_generate_sections']['sections'] ) && is_array( $_POST['_generate_sections']['sections'] ) ) { + + foreach( $_POST['_generate_sections']['sections'] as $section ) { + + $section = json_decode( stripslashes( trim($section) ), true); + + $section = generate_sections_sanitize_function( $section, $post_id ); + if ( ! empty( $section ) ){ + $clean[] = $section; + } + + } + + } + + // save data + if ( ! empty( $clean ) ) { + // this maintains data structure of previous version + $meta = array( 'sections' => $clean ); + update_post_meta( $post_id, '_generate_sections', $meta ); + } else { + delete_post_meta( $post_id, '_generate_sections' ); + } + + } +} + +if ( ! function_exists( 'generate_sections_sanitize_hex_color' ) ) { + /* + * Sanitize colors + * We don't use the built in function so we can use empty values + */ + function generate_sections_sanitize_hex_color( $color ) { + if ( '' === $color ) { + return ''; + } + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { + return $color; + } + + return null; + } +} + +if ( ! function_exists( 'generate_sections_sanitize_rgba' ) ) { + /** + * Sanitize RGBA colors + * @since 1.3.42 + */ + function generate_sections_sanitize_rgba( $color ) { + if ( '' === $color ) { + return ''; + } + + // If string does not start with 'rgba', then treat as hex + // sanitize the hex color and finally convert hex to rgba + if ( false === strpos( $color, 'rgba' ) ) { + return generate_sections_sanitize_hex_color( $color ); + } + + // By now we know the string is formatted as an rgba color so we need to further sanitize it. + $color = str_replace( ' ', '', $color ); + sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; + + return ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php new file mode 100644 index 00000000..4fd904bf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/sections-template.php @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + +
        \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php new file mode 100644 index 00000000..d2aa993f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/metaboxes/views/use-sections.php @@ -0,0 +1,17 @@ + +
        + + ID, '_generate_use_sections', true ); + //$use_sections = isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ? true : false; + wp_nonce_field( 'generate_sections_use_sections_nonce', '_generate_sections_use_sections_nonce' ); + ?> + +
        diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php new file mode 100644 index 00000000..daf0d21e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/sections/functions/templates/template.php @@ -0,0 +1,122 @@ +ID, '_generate_sections', TRUE) : ''; +$sidebars = apply_filters( 'generate_sections_sidebars', false ); +?> + +
        > +
        > + + + +
        > +
        +
        + +
        +
        +
        + + + + '; + $container['after'] = '
        '; + else : + $container['before'] = '
        '; + $container['after'] = '
        '; + endif; + + // Create inner container + if ( 'fluid' == $inner_box_type ) : + $inner_container['before'] = '
        '; + $inner_container['after'] = '
        '; + else : + $inner_container['before'] = '
        '; + $inner_container['after'] = '
        '; + endif; + + // Output the container + $return .= $container['before']; + $return .= $inner_container['before']; + + // Output the content + // Add \n\n to fix issue where paragraph wrapping was off + $return .= "\n\n" . $content; + + // Output the closing containers + $return .= $container['after']; + $return .= $inner_container['after']; + + endforeach; + + // Return our sections through the_content filter + echo apply_filters( 'the_content', $return ); + else : + ?> +
        +
        + +
        +
        + + + + + + + + + $widgets ) { + // Skip inactive widgets (should not be in export file). + if ( 'wp_inactive_widgets' === $sidebar_id ) { + continue; + } + + if ( is_array( $widgets ) ) { + foreach ( $widgets as $widget_instance_id => $widget ) { + $all_widgets[] = $widget; + } + } + } + + $results['wp_inactive_widgets'] = $all_widgets; + + update_option( 'sidebars_widgets', $results ); + + } + + /** + * Checks to see whether options exist or not. + * + * @since 1.8 + * + * @return bool + */ + public static function do_options_exist() { + $theme_mods = self::get_theme_mods(); + $settings = self::get_theme_settings(); + + $has_data = array( + 'mods' => array(), + 'options' => array(), + ); + + foreach ( $theme_mods as $theme_mod ) { + if ( get_theme_mod( $theme_mod ) ) { + $has_data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); + } + } + + foreach ( $settings as $setting ) { + if ( get_option( $setting ) ) { + + // The blog module runs a migration script on activation for now. This checks if those migrated values have been changed. + if ( 'generate_blog_settings' === $setting && function_exists( 'generate_blog_get_defaults' ) ) { + $defaults = generate_blog_get_defaults(); + $options = get_option( $setting ); + $diff = array(); + + foreach ( $options as $option => $value ) { + if ( isset( $defaults[ $option ] ) && $value !== $defaults[ $option ] ) { + $diff[ $option ] = $value; + } + } + + if ( empty( $diff ) ) { + continue; + } + } + + $has_data['options'][ $setting ] = get_option( $setting ); + } + } + + if ( ! array_filter( $has_data ) ) { + return false; + } else { + return true; + } + } + + /** + * Imports our content and custom CSS. + * + * @since 1.6 + * @param string $path Path to the file. + * @param string $slug File slug. + */ + public static function import_xml( $path, $slug ) { + if ( ! class_exists( 'WP_Importer' ) ) { + require_once ABSPATH . '/wp-admin/includes/class-wp-importer.php'; + } + + require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WXRImporter.php'; + require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WPImporterLogger.php'; + require_once GP_PREMIUM_DIR_PATH . 'site-library/libs/wxr-importer/WXRImportInfo.php'; + require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-content-importer.php'; + + if ( ! function_exists( 'wp_crop_image' ) ) { + require_once ABSPATH . 'wp-admin/includes/image.php'; + } + + add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + + $options = array( + 'fetch_attachments' => true, + 'default_author' => 0, + ); + + $current_css = wp_get_custom_css_post(); + + $logger = new GeneratePress\WPContentImporter2\WPImporterLogger(); + $importer = new GeneratePress_Sites_Content_Importer( $options ); + $importer->set_logger( $logger ); + $result = $importer->import( $path ); + + // Get all mapped post and term data. + $existing_data = self::get_mapped_post_ids( $slug ); + $mapped_data = $importer->get_importer_data(); + $mapped_posts = $mapped_data['mapping']['post']; + + // Merge exiting mapped posts with any new ones. Existing posts don't get mapped, so we need to preserve them. + $all_data = $mapped_posts + $existing_data; + + // Set our site specific mapped posts with all of our data. + update_option( 'generatepress_sites_mapped_ids_' . $slug, $all_data, false ); + + // Set mapped term IDs. + // These are always the same, even if the site has been imported before. No fancy stuff needed. + $term_mapping = $mapped_data['mapping']['term_id']; + set_transient( 'generatepress_sites_mapped_term_ids', $term_mapping, 0.1 * HOUR_IN_SECONDS ); + + wp_update_custom_css_post( $current_css->post_content ); + + // Page builders need so much extra work. + self::update_page_builder_content(); + + remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + } + + /** + * List plugins that have a pro version. + * + * We want to check to see if these exist before installing or activating + * the free versions. + * + * @since 1.6 + * + * @return array + */ + public static function check_for_pro_plugins() { + return apply_filters( + 'generate_sites_pro_plugins', + array( + 'beaver-builder-lite-version/fl-builder.php' => 'bb-plugin/fl-builder.php', + 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' => 'bb-ultimate-addon/bb-ultimate-addon.php', + 'powerpack-addon-for-beaver-builder/bb-powerpack-lite.php' => 'bbpowerpack/bb-powerpack.php', + ) + ); + } + + /** + * Check to see if required plugins are active. + * + * @since 1.6 + * + * @param string $plugin The plugin to check for. + */ + public static function is_plugin_installed( $plugin ) { + $pro_plugins = self::check_for_pro_plugins(); + + // Check to see if this plugin has a pro version. + if ( array_key_exists( $plugin, $pro_plugins ) ) { + if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[ $plugin ] ) ) { + return true; + } + } + + if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) { + return true; + } + + return false; + + } + + /** + * Allow SVG images. + * + * @since 1.6 + * + * @param array $response Attachment response. + * @param object $attachment Attachment object. + * @param array $meta Attachment meta data. + */ + public static function add_svg_image_support( $response, $attachment, $meta ) { + if ( ! function_exists( 'simplexml_load_file' ) ) { + return $response; + } + + if ( ! empty( $response['sizes'] ) ) { + return $response; + } + + if ( 'image/svg+xml' !== $response['mime'] ) { + return $response; + } + + $svg_path = get_attached_file( $attachment->ID ); + + $dimensions = self::get_svg_dimensions( $svg_path ); + + $response['sizes'] = array( + 'full' => array( + 'url' => $response['url'], + 'width' => $dimensions->width, + 'height' => $dimensions->height, + 'orientation' => $dimensions->width > $dimensions->height ? 'landscape' : 'portrait', + ), + ); + + return $response; + } + + /** + * Get the dimensions of the uploaded SVG. + * + * @since 1.6 + * + * @param string $svg SVG file path. + * @return array Return SVG file height & width for valid SVG file. + */ + public static function get_svg_dimensions( $svg ) { + $svg = simplexml_load_file( $svg ); + + if ( false === $svg ) { + $width = '0'; + $height = '0'; + } else { + $attributes = $svg->attributes(); + $width = (string) $attributes->width; + $height = (string) $attributes->height; + } + + return (object) array( + 'width' => $width, + 'height' => $height, + ); + } + + /** + * Taken from the core media_sideload_image function and + * modified to return an array of data instead of html. + * + * @since 1.6 + * + * @param string $file The image file path. + * @return array An array of image data. + */ + public static function sideload_image( $file ) { + + $data = new stdClass(); + + if ( ! function_exists( 'media_handle_sideload' ) ) { + require_once ABSPATH . 'wp-admin/includes/media.php'; + require_once ABSPATH . 'wp-admin/includes/file.php'; + require_once ABSPATH . 'wp-admin/includes/image.php'; + } + + add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + + if ( ! empty( $file ) ) { + + // Set variables for storage, fix file filename for query strings. + preg_match( '/[^\?]+\.(jpe?g|jpe|svg|gif|png)\b/i', $file, $matches ); + $file_array = array(); + $file_array['name'] = basename( $matches[0] ); + + // Download file to temp location. + $file_array['tmp_name'] = download_url( $file ); + + // If error storing temporarily, return the error. + if ( is_wp_error( $file_array['tmp_name'] ) ) { + return $file_array['tmp_name']; + } + + // Do the validation and storage stuff. + $id = media_handle_sideload( $file_array, 0 ); + + // If error storing permanently, unlink. + if ( is_wp_error( $id ) ) { + @unlink( $file_array['tmp_name'] ); // phpcs:ignore + return $id; + } + + // Build the object to return. + $meta = wp_get_attachment_metadata( $id ); + $data->attachment_id = $id; + $data->url = wp_get_attachment_url( $id ); + $data->thumbnail_url = wp_get_attachment_thumb_url( $id ); + + if ( isset( $meta['height'] ) ) { + $data->height = $meta['height']; + } + + if ( isset( $meta['width'] ) ) { + $data->width = $meta['width']; + } + } + + remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + + return $data; + + } + + /** + * Re-maps menu locations. + * + * @since 1.6 + * + * @param array $locations Incoming locations. + */ + public static function set_nav_menu_locations( $locations = array() ) { + $menu_locations = array(); + + $term_ids = self::get_mapped_term_ids(); + + if ( isset( $locations ) ) { + self::log( '== Start mapping menu locations ==' ); + + foreach ( $locations as $menu => $value ) { + if ( empty( $value ) ) { + continue; + } + + $menu_locations[ $menu ] = $term_ids[ $value ]; + self::log( $value . ' -> ' . $term_ids[ $value ] ); + } + + set_theme_mod( 'nav_menu_locations', $menu_locations ); + } + } + + /** + * Re-maps the front page and posts page. + * + * @since 1.6 + * + * @param string $name Name of the option to update. + * @param string $value Title of the page. + * @param string $slug Slug of the page. + */ + public static function set_reading_pages( $name, $value, $slug ) { + if ( empty( $value ) ) { + return; + } + + self::log( '== Start mapping front and blog pages ==' ); + + // Get import data, with new menu IDs. + $post_ids = self::get_mapped_post_ids( $slug ); + + update_option( $name, $post_ids[ $value ] ); + self::log( $value . ' -> ' . $post_ids[ $value ] ); + } + + /** + * Re-maps WooCommerce pages. + * + * @since 1.6 + * + * @param string $name Name of the option to update. + * @param string $value Title of the page. + * @param string $slug Slug of the page. + */ + public static function set_woocommerce_pages( $name, $value, $slug ) { + if ( empty( $value ) ) { + return; + } + + self::log( '== Start mapping WooCommerce pages ==' ); + + $post_ids = self::get_mapped_post_ids( $slug ); + + update_option( $name, $post_ids[ $value ] ); + self::log( $value . ' -> ' . $post_ids[ $value ] ); + } + + /** + * Change the menu IDs in the custom menu widgets in the widget import data. + * This solves the issue with custom menu widgets not having the correct (new) menu ID, because they + * have the old menu ID from the export site. + * + * @param array $widget The widget settings array. + */ + public static function fix_custom_menu_widget_ids( $widget ) { + // Skip (no changes needed), if this is not a custom menu widget. + if ( ! array_key_exists( 'nav_menu', $widget ) || empty( $widget['nav_menu'] ) || ! is_int( $widget['nav_menu'] ) ) { + return $widget; + } + + // Get import data, with new menu IDs. + $term_ids = self::get_mapped_term_ids(); + + if ( ! isset( $term_ids[ $widget['nav_menu'] ] ) ) { + return $widget; + } + + self::log( '== Start mapping navigation widgets ==' ); + self::log( $widget['nav_menu'] . ' -> ' . $term_ids[ $widget['nav_menu'] ] ); + + // Set the new menu ID for the widget. + $widget['nav_menu'] = $term_ids[ $widget['nav_menu'] ]; + + return $widget; + } + + /** + * Re-maps the element locations. + * + * @since 1.7 + * + * @param array $locations Incoming locations. + * @param string $slug Element slug. + */ + public static function set_element_locations( $locations, $slug ) { + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $locations ) && ! empty( $locations ) ) { + self::log( '== Start mapping element locations ==' ); + + foreach ( (array) $locations as $key => $value ) { + $new_locations = array(); + if ( empty( $value ) ) { + continue; + } + + foreach ( (array) $value as $data ) { + if ( $data['object'] ) { + self::log( $data['object'] . ' -> ' . $post_ids[ $data['object'] ] ); + $data['object'] = $post_ids[ $data['object'] ]; + } + + $new_locations[] = $data; + } + + update_post_meta( $post_ids[ $key ], '_generate_element_display_conditions', $new_locations ); + } + } + } + + /** + * Re-maps the element exclusions. + * + * @since 1.7 + * + * @param array $locations Incoming locations. + * @param string $slug Element slug. + */ + public static function set_element_exclusions( $locations, $slug ) { + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $locations ) && ! empty( $locations ) ) { + self::log( '== Start mapping element exclusions ==' ); + + foreach ( (array) $locations as $key => $value ) { + $new_locations = array(); + if ( empty( $value ) ) { + continue; + } + + foreach ( (array) $value as $data ) { + if ( $data['object'] ) { + self::log( $data['object'] . ' -> ' . $post_ids[ $data['object'] ] ); + $data['object'] = $post_ids[ $data['object'] ]; + } + + $new_locations[] = $data; + } + + update_post_meta( $post_ids[ $key ], '_generate_element_exclude_conditions', $new_locations ); + } + } + } + + /** + * Update menu URLs. + * + * @since 1.7.3 + * @param string $url Preview URL. + */ + public static function update_menu_urls( $url ) { + $args = array( + 'post_type' => 'nav_menu_item', + 'fields' => 'ids', + 'no_found_rows' => true, + 'post_status' => 'any', + 'numberposts' => 50, + ); + + $items = get_posts( $args ); + + foreach ( $items as $item_id ) { + $item_type = get_post_meta( $item_id, '_menu_item_type', true ); + + if ( 'custom' === $item_type ) { + $item_url = get_post_meta( $item_id, '_menu_item_url', true ); + + if ( $item_url && '#' !== $item_url ) { + $item_url = str_replace( $url, site_url(), $item_url ); + + update_post_meta( $item_id, '_menu_item_url', $item_url ); + } + } + } + } + + /** + * Allow other files types to be uploaded. + * + * @since 1.6 + * + * @param array $mimes Existing types. + * @return array Merged types. + */ + public static function mime_types( $mimes ) { + $mimes = array_merge( + $mimes, + array( + 'xml' => 'text/xml', + 'wie' => 'text/plain', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + ) + ); + + return $mimes; + } + + /** + * Different MIME type of different PHP version + * + * Filters the "real" file type of the given file. + * + * @since 1.8 + * + * @param array $defaults Default file types. + * @param string $file Full path to the file. + * @param string $filename The name of the file (may differ from $file due to $file being in a tmp directory). + * @param array $mimes Key is the file extension with value as the mime type. + */ + public static function check_real_mime_type( $defaults, $file, $filename, $mimes ) { + if ( 'content.xml' === $filename ) { + $defaults['ext'] = 'xml'; + $defaults['type'] = 'text/xml'; + } + + if ( 'widgets.wie' === $filename ) { + $defaults['ext'] = 'wie'; + $defaults['type'] = 'text/plain'; + } + + return $defaults; + } + + /** + * Download a file to WordPress from a URL. + * + * @since 1.6 + * + * @param string $file URL of the file. + * @return array + */ + public static function download_file( $file ) { + add_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + add_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + + // Gives us access to the download_url() and wp_handle_sideload() functions. + require_once ABSPATH . 'wp-admin/includes/file.php'; + + // URL to the WordPress logo. + $url = $file; + $timeout_seconds = 10; + + // Download file to temp dir. + $temp_file = download_url( $url, $timeout_seconds ); + + if ( is_wp_error( $temp_file ) ) { + + return array( + 'success' => false, + 'data' => $temp_file->get_error_message(), + ); + + } + + // Array based on $_FILE as seen in PHP file uploads. + $file = array( + 'name' => basename( $url ), + 'tmp_name' => $temp_file, + 'error' => 0, + 'size' => filesize( $temp_file ), + ); + + $overrides = array( + 'test_form' => false, + 'test_size' => true, + ); + + // Move the temporary file into the uploads directory. + $results = wp_handle_sideload( $file, $overrides ); + + // Clean up. + remove_filter( 'upload_mimes', array( __CLASS__, 'mime_types' ) ); + remove_filter( 'wp_check_filetype_and_ext', array( __CLASS__, 'check_real_mime_type' ), 10, 4 ); + remove_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'add_svg_image_support' ), 10, 3 ); + + if ( empty( $results['error'] ) ) { + + return array( + 'success' => true, + 'data' => $results, + ); + + } else { + + return array( + 'success' => false, + 'error' => $results['error'], + ); + + } + + } + + /** + * Get data from the options.json file. + * + * @since 1.6 + * + * @param string $url URL of the file. + * @return array + */ + public static function get_options( $url ) { + $url = wp_safe_remote_get( esc_url( $url ) ); + + if ( is_wp_error( $url ) ) { + return false; + } + + return json_decode( wp_remote_retrieve_body( $url ), true ); + } + + /** + * Check to see if a remote file exists. + * + * @since 1.6 + * + * @param string $url URL of the file. + * @return bool + */ + public static function file_exists( $url ) { + $response = wp_safe_remote_get( esc_url( $url ) ); + + if ( is_wp_error( $response ) ) { + self::log( $response->get_error_message() ); + return false; + } + + return strlen( $response['body'] ) > 100 && ( '200' === (string) $response['response']['code'] || '301' === (string) $response['response']['code'] ) ? true : false; + } + + /** + * Log events to the debug.log file. + * + * @since 1.6 + * @param mixed $log Log data. + * @return void + */ + public static function log( $log ) { + if ( ! WP_DEBUG_LOG ) { + return; + } + + if ( is_array( $log ) || is_object( $log ) ) { + error_log( print_r( $log, true ) ); // phpcs:ignore -- Needed to log events. + } else { + error_log( $log ); // phpcs:ignore -- Needed to log events. + } + } + + /** + * Get all posts to run through batch processing. + * + * @since 1.6 + * + * @return object All posts. + */ + public static function get_all_posts() { + $args = array( + 'post_type' => 'any', + 'fields' => 'ids', + 'no_found_rows' => true, + 'post_status' => 'publish', + 'numberposts' => -1, + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => '_fl_builder_data', + 'compare' => 'EXISTS', + ), + array( + 'key' => '_elementor_data', + 'compare' => 'EXISTS', + ), + ), + ); + + $posts = get_posts( $args ); + + if ( $posts ) { + return $posts; + } + + return false; + } + + /** + * Searches Elementor and Beaver Builder content for images to download. + * + * @since 1.6 + */ + public static function update_page_builder_content() { + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + + // Add "bb-plugin" in import [queue]. + // Add "beaver-builder-lite-version" in import [queue]. + if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { + require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-beaver-builder-batch-processing.php'; + require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-site-import-image.php'; + + $beaver_builder = new GeneratePress_Sites_Process_Beaver_Builder(); + $beaver_builder->import(); + } + } + + /** + * Clear Elementor & Beaver Builder caches when needed. + * + * @since 1.6 + */ + public static function clear_page_builder_cache() { + + if ( class_exists( 'FLBuilderModel' ) && method_exists( 'FLBuilderModel', 'delete_asset_cache_for_all_posts' ) ) { + // Clear all cache. + FLBuilderModel::delete_asset_cache_for_all_posts(); + self::log( 'Cleared Beaver Builder cache.' ); + } + + if ( class_exists( 'Elementor\Plugin' ) && method_exists( 'Elementor\Posts_CSS_Manager', 'clear_cache' ) ) { + // !important, Clear the cache after images import. + Elementor\Plugin::instance()->posts_css_manager->clear_cache(); + self::log( 'Cleared Elementor cache.' ); + } + + } + + /** + * List out GP option names. + * + * @since 1.6 + * + * @return array + */ + public static function get_theme_settings() { + return array( + 'generate_settings', + 'generate_background_settings', + 'generate_blog_settings', + 'generate_page_header_settings', + 'generate_secondary_nav_settings', + 'generate_spacing_settings', + 'generate_menu_plus_settings', + 'generate_woocommerce_settings', + ); + } + + /** + * List out GP theme mods. + * + * @since 1.6 + * + * @return array + */ + public static function get_theme_mods() { + return array( + 'font_body_variants', + 'font_body_category', + 'font_site_title_variants', + 'font_site_title_category', + 'font_site_tagline_variants', + 'font_site_tagline_category', + 'font_navigation_variants', + 'font_navigation_category', + 'font_secondary_navigation_variants', + 'font_secondary_navigation_category', + 'font_buttons_variants', + 'font_buttons_category', + 'font_heading_1_variants', + 'font_heading_1_category', + 'font_heading_2_variants', + 'font_heading_2_category', + 'font_heading_3_variants', + 'font_heading_3_category', + 'font_heading_4_variants', + 'font_heading_4_category', + 'font_heading_5_variants', + 'font_heading_5_category', + 'font_heading_6_variants', + 'font_heading_6_category', + 'font_widget_title_variants', + 'font_widget_title_category', + 'font_footer_variants', + 'font_footer_category', + 'generate_copyright', + ); + } + + /** + * Build the loading icon. + * + * @since 1.6 + */ + public static function loading_icon() { + ?> + + + + + + + + + + + + + 'generate_package_backgrounds', + 'Blog' => 'generate_package_blog', + 'Colors' => 'generate_package_colors', + 'Copyright' => 'generate_package_copyright', + 'Elements' => 'generate_package_elements', + 'Disable Elements' => 'generate_package_disable_elements', + 'Hooks' => 'generate_package_hooks', + 'Menu Plus' => 'generate_package_menu_plus', + 'Page Header' => 'generate_package_page_header', + 'Secondary Nav' => 'generate_package_secondary_nav', + 'Sections' => 'generate_package_sections', + 'Spacing' => 'generate_package_spacing', + 'Typography' => 'generate_package_typography', + 'WooCommerce' => 'generate_package_woocommerce', + ); + } + + /** + * A list of options we shouldn't be able to touch. + */ + public static function disallowed_options() { + return array( + 'admin_email', + 'siteurl', + 'home', + 'blog_charset', + 'blog_public', + 'current_theme', + 'stylesheet', + 'template', + 'default_role', + 'mailserver_login', + 'mailserver_pass', + 'mailserver_port', + 'mailserver_url', + 'permalink_structure', + 'rewrite_rules', + 'users_can_register', + ); + } + + /** + * Track Imported Post + * + * @param int $post_id Post ID. + * @return void + */ + public static function track_post( $post_id ) { + update_post_meta( $post_id, '_generatepress_sites_imported_post', true ); + } + + /** + * Track Imported Term + * + * @param int $term_id Term ID. + * @return void + */ + public static function track_term( $term_id ) { + $term = get_term( $term_id ); + + update_term_meta( $term_id, '_generatepress_sites_imported_term', true ); + } + + /** + * Prevent WooCommerce from creating new pages if we're importing them. + * generate_woocommerce_no_create_pages is set during Site Library import. + */ + public static function woocommerce_no_new_pages() { + if ( ! function_exists( 'is_woocommerce' ) ) { + return; + } + + $woocommerce_version = get_option( 'woocommerce_db_version' ); + + if ( empty( $woocommerce_version ) ) { + $no_new_pages = get_option( 'generate_woocommerce_no_create_pages', false ); + + if ( $no_new_pages ) { + add_filter( 'woocommerce_create_pages', '__return_empty_array' ); + delete_option( 'generate_woocommerce_no_create_pages' ); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php new file mode 100644 index 00000000..2f8e9284 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library-rest.php @@ -0,0 +1,922 @@ +namespace . $this->version; + + // Get Templates. + register_rest_route( + $namespace, + '/get_sites/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'get_sites' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/get_site_data/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'get_site_data' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/import_theme_options/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'import_options' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/activate_plugins/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'activate_plugins' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/import_content/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'import_content' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/import_site_options/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'import_site_options' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/import_widgets/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'import_widgets' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/restore_theme_options/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'restore_theme_options' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + + // Get Templates. + register_rest_route( + $namespace, + '/restore_content/', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'restore_content' ), + 'permission_callback' => array( $this, 'update_settings_permission' ), + ) + ); + } + + /** + * Get edit options permissions. + * + * @return bool + */ + public function update_settings_permission() { + return current_user_can( 'manage_options' ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function get_sites( WP_REST_Request $request ) { + $force_refresh = $request->get_param( 'forceRefresh' ); + $sites = get_option( 'generatepress_sites', array() ); + + $time_now = strtotime( 'now' ); + $sites_expire = get_option( 'generatepress_sites_expiration', sanitize_text_field( $time_now ) ); + + if ( $force_refresh || empty( $sites ) || $sites_expire < $time_now ) { + $sites = array(); + + $data = wp_safe_remote_get( 'https://gpsites.co/wp-json/wp/v2/sites?per_page=100' ); + + if ( is_wp_error( $data ) ) { + update_option( 'generatepress_sites', 'no results', false ); + update_option( 'generatepress_sites_expiration', strtotime( '+5 minutes' ), false ); + return $this->failed( 'no results' ); + } + + $data = json_decode( wp_remote_retrieve_body( $data ), true ); + + if ( ! is_array( $data ) ) { + update_option( 'generatepress_sites', 'no results', false ); + update_option( 'generatepress_sites_expiration', strtotime( '+5 minutes' ), false ); + return $this->failed( 'no results' ); + } + + foreach ( (array) $data as $site ) { + $sites[ $site['name'] ] = array( + 'name' => $site['name'], + 'directory' => $site['directory'], + 'preview_url' => $site['preview_url'], + 'author_name' => $site['author_name'], + 'author_url' => $site['author_url'], + 'description' => $site['description'], + 'page_builder' => $site['page_builder'], + 'category' => $site['category'], + 'min_version' => $site['min_version'], + 'min_theme_version' => $site['min_theme_version'], + 'min_generateblocks_version' => $site['min_generateblocks_version'], + 'uploads_url' => $site['uploads_url'], + 'plugins' => $site['plugins'], + 'documentation' => $site['documentation'], + 'image_width' => ! empty( $site['image_width'] ) ? $site['image_width'] : 600, + 'image_height' => ! empty( $site['image_height'] ) ? $site['image_height'] : 600, + ); + } + + update_option( 'generatepress_sites', $sites, false ); + update_option( 'generatepress_sites_expiration', strtotime( '+1 day' ), false ); + } + + $sites = apply_filters( 'generate_add_sites', $sites ); + + return $this->success( $sites ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function get_site_data( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + + if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/options.json' ) ) { + $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); + + $data['options'] = true; + $data['modules'] = $settings['modules']; + $data['plugins'] = $settings['plugins']; + + if ( is_array( $data['plugins'] ) ) { + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + $plugin_data = array(); + + foreach ( $data['plugins'] as $name => $slug ) { + $basename = strtok( $slug, '/' ); + $plugin_data[ $name ] = array( + 'name' => $name, + 'slug' => $slug, + 'installed' => GeneratePress_Site_Library_Helper::is_plugin_installed( $slug ) ? true : false, + 'active' => is_plugin_active( $slug ) ? true : false, + 'repo' => GeneratePress_Site_Library_Helper::file_exists( 'https://api.wordpress.org/plugins/info/1.0/' . $basename ) ? true : false, + ); + } + + $data['plugin_data'] = $plugin_data; + } + } + + if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/content.xml' ) ) { + $data['content'] = true; + } else { + $data['content'] = false; + } + + if ( GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/widgets.wie' ) ) { + $data['widgets'] = true; + } else { + $data['widgets'] = false; + } + + return $this->success( $data ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function import_options( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + + if ( ! GeneratePress_Site_Library_Helper::file_exists( $site_data['directory'] . '/options.json' ) ) { + return $this->failed( 'No theme options exist.' ); + } + + // Delete existing backup. + delete_option( '_generatepress_site_library_backup' ); + + // Backup options. + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + $theme_mods = GeneratePress_Site_Library_Helper::get_theme_mods(); + $settings = GeneratePress_Site_Library_Helper::get_theme_settings(); + + $data = array( + 'mods' => array(), + 'options' => array(), + ); + + foreach ( $theme_mods as $theme_mod ) { + $data['mods'][ $theme_mod ] = get_theme_mod( $theme_mod ); + } + + foreach ( $settings as $setting ) { + $data['options'][ $setting ] = get_option( $setting ); + } + + $backup_data['theme_options'] = $data; + + $modules = GeneratePress_Site_Library_Helper::premium_modules(); + + $active_modules = array(); + foreach ( $modules as $name => $key ) { + if ( 'activated' === get_option( $key ) ) { + $active_modules[ $name ] = $key; + } + } + + $backup_data['modules'] = $active_modules; + + $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); + + // Remove all existing theme options. + $option_keys = array( + 'generate_settings', + 'generate_background_settings', + 'generate_blog_settings', + 'generate_hooks', + 'generate_page_header_settings', + 'generate_secondary_nav_settings', + 'generate_spacing_settings', + 'generate_menu_plus_settings', + 'generate_woocommerce_settings', + ); + + foreach ( $option_keys as $key ) { + delete_option( $key ); + } + + // Need to backup these items before we remove all theme mods. + $backup_data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); + $backup_data['site_options']['custom_logo'] = get_theme_mod( 'custom_logo' ); + + // Remove existing theme mods. + remove_theme_mods(); + + // Remove existing activated premium modules. + $premium_modules = GeneratePress_Site_Library_Helper::premium_modules(); + + foreach ( $premium_modules as $name => $key ) { + delete_option( $key ); + } + + // Activate necessary modules. + foreach ( $settings['modules'] as $name => $key ) { + // Only allow valid premium modules. + if ( ! in_array( $key, $premium_modules ) ) { + GeneratePress_Site_Library_Helper::log( 'Bad premium module key: ' . $key ); + continue; + } + + update_option( $key, 'activated' ); + } + + // Set theme mods. + foreach ( $settings['mods'] as $key => $val ) { + // Only allow valid theme mods. + if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_mods() ) ) { + GeneratePress_Site_Library_Helper::log( 'Bad theme mod key: ' . $key ); + continue; + } + + set_theme_mod( $key, $val ); + } + + // Set theme options. + foreach ( $settings['options'] as $key => $val ) { + // Only allow valid options. + if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_settings() ) ) { + GeneratePress_Site_Library_Helper::log( 'Bad theme setting key: ' . $key ); + continue; + } + + if ( is_array( $val ) || is_object( $val ) ) { + foreach ( $val as $option_name => $option_value ) { + // Import any images. + if ( is_string( $option_value ) && preg_match( '/\.(jpg|jpeg|png|gif)/i', $option_value ) ) { + $data = GeneratePress_Site_Library_Helper::sideload_image( $option_value ); + + if ( ! is_wp_error( $data ) ) { + $val[ $option_name ] = $data->url; + } + } + + // Set these options if we import content. + unset( $val['hide_title'] ); + unset( $val['hide_tagline'] ); + unset( $val['logo_width'] ); + } + } + + update_option( $key, $val ); + } + + // Re-add non-theme option related theme mods. + set_theme_mod( 'nav_menu_locations', $backup_data['site_options']['nav_menu_locations'] ); + set_theme_mod( 'custom_logo', $backup_data['site_options']['custom_logo'] ); + + $existing_settings = get_option( 'generate_settings', array() ); + + if ( isset( $backup_data['theme_options']['options']['generate_settings']['hide_title'] ) ) { + $existing_settings['hide_title'] = $backup_data['theme_options']['options']['generate_settings']['hide_title']; + } + + if ( isset( $backup_data['theme_options']['options']['generate_settings']['hide_tagline'] ) ) { + $existing_settings['hide_tagline'] = $backup_data['theme_options']['options']['generate_settings']['hide_tagline']; + } + + if ( isset( $backup_data['theme_options']['options']['generate_settings']['logo_width'] ) ) { + $existing_settings['logo_width'] = $backup_data['theme_options']['options']['generate_settings']['logo_width']; + } + + update_option( 'generate_settings', $existing_settings ); + + // Remove dynamic CSS cache. + delete_option( 'generate_dynamic_css_output' ); + delete_option( 'generate_dynamic_css_cached_version' ); + + $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); + + if ( isset( $dynamic_css_data['updated_time'] ) ) { + unset( $dynamic_css_data['updated_time'] ); + } + + update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); + + // Custom CSS. + $css = $settings['custom_css']; + $css = '/* GeneratePress Site CSS */ ' . $css . ' /* End GeneratePress Site CSS */'; + + $current_css = wp_get_custom_css_post(); + + if ( isset( $current_css->post_content ) ) { + $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); + $css = $current_css->post_content . $css; + } + + wp_update_custom_css_post( $css ); + + update_option( '_generatepress_site_library_backup', $backup_data ); + + return $this->success( __( 'Options imported', 'gp-premium' ) ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function activate_plugins( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); + $plugins = $settings['plugins']; + + // Backup plugins. + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + $backup_data['plugins'] = get_option( 'active_plugins', array() ); + update_option( '_generatepress_site_library_backup', $backup_data ); + + if ( ! empty( $plugins ) ) { + $pro_plugins = GeneratePress_Site_Library_Helper::check_for_pro_plugins(); + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + + foreach ( $plugins as $plugin ) { + // If the plugin has a pro version and it exists, activate it instead. + if ( array_key_exists( $plugin, $pro_plugins ) ) { + if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[ $plugin ] ) ) { + $plugin = $pro_plugins[ $plugin ]; + } + } + + // Install BB lite if pro doesn't exist. + if ( 'bb-plugin/fl-builder.php' === $plugin && ! file_exists( WP_PLUGIN_DIR . '/bb-plugin/fl-builder.php' ) ) { + $plugin = 'beaver-builder-lite-version/fl-builder.php'; + } + + if ( ! is_plugin_active( $plugin ) ) { + activate_plugin( $plugin, '', false, true ); + + if ( 'woocommerce/woocommerce.php' === $plugin ) { + add_option( 'generate_woocommerce_no_create_pages', true ); + } + } + } + + return $this->success( __( 'Plugins activated', 'gp-premium' ) ); + } + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function import_content( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + $site_slug = $request->get_param( 'siteSlug' ); + $import_options = $request->get_param( 'importOptions' ); + $import_content = $request->get_param( 'importContent' ); + + // Increase PHP max execution time. + set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); + + $xml_path = $site_data['directory'] . '/content.xml'; + $xml_file = GeneratePress_Site_Library_Helper::download_file( $xml_path ); + $xml_path = $xml_file['data']['file']; + + if ( ! $xml_path ) { + return $this->failed( 'No content found.' ); + } + + // Increase PHP max execution time. + set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); + + // Disable import of authors. + add_filter( 'wxr_importer.pre_process.user', '__return_false' ); + + // Keep track of our progress. + add_action( 'wxr_importer.processed.post', array( 'GeneratePress_Site_Library_Helper', 'track_post' ) ); + add_action( 'wxr_importer.processed.term', array( 'GeneratePress_Site_Library_Helper', 'track_term' ) ); + + // Disables generation of multiple image sizes (thumbnails) in the content import step. + if ( ! apply_filters( 'generate_sites_regen_thumbnails', true ) ) { + add_filter( 'intermediate_image_sizes_advanced', '__return_null' ); + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + $backup_data['content'] = true; + update_option( '_generatepress_site_library_backup', $backup_data ); + + GeneratePress_Site_Library_Helper::import_xml( $xml_path, $site_slug ); + + return $this->success( 'Content imported' ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function import_site_options( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + $site_slug = $request->get_param( 'siteSlug' ); + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + $settings = GeneratePress_Site_Library_Helper::get_options( $site_data['directory'] . '/options.json' ); + + foreach ( $settings['site_options'] as $key => $val ) { + switch ( $key ) { + case 'page_for_posts': + case 'page_on_front': + $backup_data['site_options'][ $key ] = get_option( $key ); + GeneratePress_Site_Library_Helper::set_reading_pages( $key, $val, $site_slug ); + break; + + case 'woocommerce_shop_page_id': + case 'woocommerce_cart_page_id': + case 'woocommerce_checkout_page_id': + case 'woocommerce_myaccount_page_id': + $backup_data['site_options'][ $key ] = get_option( $key ); + GeneratePress_Site_Library_Helper::set_woocommerce_pages( $key, $val, $site_slug ); + break; + + case 'nav_menu_locations': + if ( ! isset( $backup_data['site_options']['nav_menu_location'] ) ) { + $backup_data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); + } + + GeneratePress_Site_Library_Helper::set_nav_menu_locations( $val ); + break; + + case 'element_locations': + GeneratePress_Site_Library_Helper::set_element_locations( $val, $site_slug ); + break; + + case 'element_exclusions': + GeneratePress_Site_Library_Helper::set_element_exclusions( $val, $site_slug ); + break; + + case 'custom_logo': + if ( ! isset( $backup_data['site_options']['custom_logo'] ) ) { + $backup_data['site_options']['custom_logo'] = get_theme_mod( 'custom_logo' ); + } + + $data = GeneratePress_Site_Library_Helper::sideload_image( $val ); + + if ( ! is_wp_error( $data ) && isset( $data->attachment_id ) ) { + set_theme_mod( 'custom_logo', $data->attachment_id ); + update_post_meta( $data->attachment_id, '_wp_attachment_is_custom_header', get_option( 'stylesheet' ) ); + } else { + remove_theme_mod( 'custom_logo' ); + } + + break; + + default: + if ( in_array( $key, (array) GeneratePress_Site_Library_Helper::disallowed_options() ) ) { + GeneratePress_Site_Library_Helper::log( 'Disallowed option: ' . $key ); + } else { + $backup_data['site_options'][ $key ] = get_option( $key ); + delete_option( $key ); + update_option( $key, $val ); + } + break; + } + } + + // Set theme options. + $theme_settings = get_option( 'generate_settings', array() ); + $update_theme_settings = false; + + foreach ( $settings['options'] as $key => $val ) { + if ( 'generate_settings' !== $key ) { + continue; + } + + if ( is_array( $val ) || is_object( $val ) ) { + foreach ( $val as $option_name => $option_value ) { + if ( 'hide_title' === $option_name ) { + $theme_settings['hide_title'] = $option_value; + $update_theme_settings = true; + } + + if ( 'hide_tagline' === $option_name ) { + $theme_settings['hide_tagline'] = $option_value; + $update_theme_settings = true; + } + + if ( 'logo_width' === $option_name ) { + $theme_settings['logo_width'] = $option_value; + $update_theme_settings = true; + } + } + } + } + + if ( $update_theme_settings ) { + update_option( 'generate_settings', $theme_settings ); + + // Remove dynamic CSS cache. + delete_option( 'generate_dynamic_css_output' ); + delete_option( 'generate_dynamic_css_cached_version' ); + + $dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() ); + + if ( isset( $dynamic_css_data['updated_time'] ) ) { + unset( $dynamic_css_data['updated_time'] ); + } + + update_option( 'generatepress_dynamic_css_data', $dynamic_css_data ); + } + + // Set our backed up options. + update_option( '_generatepress_site_library_backup', $backup_data ); + + // Update any custom menu link URLs. + GeneratePress_Site_Library_Helper::update_menu_urls( $site_data['preview_url'] ); + + // Clear page builder cache. + GeneratePress_Site_Library_Helper::clear_page_builder_cache(); + + return $this->success( 'Site options imported' ); + } + + /** + * Export a group of assets. + * + * @param WP_REST_Request $request request object. + * + * @return mixed + */ + public function import_widgets( WP_REST_Request $request ) { + $site_data = $request->get_param( 'siteData' ); + + require_once GP_PREMIUM_DIR_PATH . 'site-library/classes/class-site-widget-importer.php'; + + $widgets_path = $site_data['directory'] . '/widgets.wie'; + + $wie_file = GeneratePress_Site_Library_Helper::download_file( $widgets_path ); + $wie_path = $wie_file['data']['file']; + + $data = implode( '', file( $wie_path ) ); + $data = json_decode( $data ); + + GeneratePress_Site_Library_Helper::clear_widgets(); + + add_filter( 'wie_widget_settings_array', array( 'GeneratePress_Site_Library_Helper', 'fix_custom_menu_widget_ids' ) ); + $widgets_importer = GeneratePress_Sites_Widget_Importer::instance(); + $widgets_importer->wie_import_data( $data ); + remove_filter( 'wie_widget_settings_array', array( 'GeneratePress_Site_Library_Helper', 'fix_custom_menu_widget_ids' ) ); + + return $this->success( 'Widgets imported' ); + } + + /** + * Restore our theme options. + */ + public function restore_theme_options() { + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data ) ) { + if ( ! empty( $backup_data['theme_options']['mods'] ) ) { + remove_theme_mods(); + } + + if ( ! empty( $backup_data['theme_options']['options'] ) ) { + $option_keys = array( + 'generate_settings', + 'generate_background_settings', + 'generate_blog_settings', + 'generate_hooks', + 'generate_page_header_settings', + 'generate_secondary_nav_settings', + 'generate_spacing_settings', + 'generate_menu_plus_settings', + 'generate_woocommerce_settings', + ); + + foreach ( $option_keys as $key ) { + delete_option( $key ); + } + } + + if ( ! empty( $backup_data['modules'] ) ) { + $modules = GeneratePress_Site_Library_Helper::premium_modules(); + + foreach ( $modules as $name => $key ) { + delete_option( $key ); + } + + foreach ( (array) $backup_data['modules'] as $name => $key ) { + update_option( $key, 'activated' ); + } + } + + if ( ! empty( $backup_data['theme_options']['mods'] ) ) { + foreach ( $backup_data['theme_options']['mods'] as $key => $val ) { + // Only allow valid theme mods. + if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_mods() ) ) { + GeneratePress_Site_Library_Helper::log( 'Bad theme mod key: ' . $key ); + continue; + } + + set_theme_mod( $key, $val ); + } + } + + if ( ! empty( $backup_data['theme_options']['options'] ) ) { + foreach ( $backup_data['theme_options']['options'] as $key => $val ) { + // Only allow valid options. + if ( ! in_array( $key, GeneratePress_Site_Library_Helper::get_theme_settings() ) ) { + GeneratePress_Site_Library_Helper::log( 'Bad theme setting key: ' . $key ); + continue; + } + + update_option( $key, $val ); + } + } + + // Re-add non-theme option related theme mods. + if ( isset( $backup_data['site_options']['nav_menu_locations'] ) ) { + set_theme_mod( 'nav_menu_locations', $backup_data['site_options']['nav_menu_locations'] ); + } + + if ( isset( $backup_data['site_options']['custom_logo'] ) ) { + set_theme_mod( 'custom_logo', $backup_data['site_options']['custom_logo'] ); + } + } + + return $this->success( __( 'Theme options restored.', 'gp-premium' ) ); + } + + /** + * Restore content. + */ + public function restore_content() { + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + // Plugins. + if ( ! empty( $backup_data['plugins'] ) && ! empty( $backup_data['site_options'] ) ) { + update_option( 'active_plugins', $backup_data['plugins'] ); + } + + // Content. + if ( ! empty( $backup_data ) ) { + global $wpdb; + $post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_generatepress_sites_imported_post'" ); + $term_ids = $wpdb->get_col( "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='_generatepress_sites_imported_term'" ); + + foreach ( $post_ids as $id ) { + wp_delete_post( $id, true ); + } + } + + // Site options. + if ( ! empty( $backup_data['site_options'] ) ) { + foreach ( $backup_data['site_options'] as $key => $val ) { + if ( in_array( $key, (array) GeneratePress_Site_Library_Helper::disallowed_options() ) ) { + GeneratePress_Site_Library_Helper::log( 'Disallowed option: ' . $key ); + continue; + } + + if ( 'nav_menu_locations' === $key || 'custom_logo' === $key ) { + set_theme_mod( $key, $val ); + } else { + if ( ! $val && ! is_numeric( $val ) ) { + delete_option( $key ); + } else { + update_option( $key, $val ); + } + } + } + } + + // Widgets. + if ( ! empty( $backup_data['widgets'] ) ) { + update_option( 'sidebars_widgets', $backup_data['widgets'] ); + } + + // CSS. + $current_css = wp_get_custom_css_post(); + + if ( isset( $current_css->post_content ) ) { + // Remove existing library CSS. + $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); + } + + wp_update_custom_css_post( $current_css->post_content ); + + // Clean up. + delete_option( 'generate_dynamic_css_output' ); + delete_option( 'generate_dynamic_css_cached_version' ); + delete_option( '_generatepress_site_library_backup' ); + + return $this->success( __( 'Content restored.', 'gp-premium' ) ); + } + + /** + * Success rest. + * + * @param mixed $response response data. + * @return mixed + */ + public function success( $response ) { + return new WP_REST_Response( + array( + 'success' => true, + 'response' => $response, + ), + 200 + ); + } + + /** + * Failed rest. + * + * @param mixed $response response data. + * @return mixed + */ + public function failed( $response ) { + return new WP_REST_Response( + array( + 'success' => false, + 'response' => $response, + ), + 200 + ); + } + + /** + * Error rest. + * + * @param mixed $code error code. + * @param mixed $response response data. + * @return mixed + */ + public function error( $code, $response ) { + return new WP_REST_Response( + array( + 'error' => true, + 'success' => false, + 'error_code' => $code, + 'response' => $response, + ), + 401 + ); + } +} + +GeneratePress_Site_Library_Rest::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php new file mode 100644 index 00000000..e29438c6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/class-site-library.php @@ -0,0 +1,412 @@ +id ) { + $parent_file = 'themes.php'; // phpcs:ignore -- Override necessary. + $submenu_file = 'generate-options'; // phpcs:ignore -- Override necessary. + } + + remove_submenu_page( 'themes.php', 'generatepress-library' ); + } + + /** + * Add our scripts. + */ + public function enqueue_scripts() { + $screen = get_current_screen(); + + if ( 'appearance_page_generatepress-library' === $screen->id ) { + wp_enqueue_script( + 'generatepress-pro-site-library', + GP_PREMIUM_DIR_URL . 'dist/site-library.js', + array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch', 'wp-util', 'wp-html-entities', 'updates' ), + GP_PREMIUM_VERSION, + true + ); + + if ( function_exists( 'wp_set_script_translations' ) ) { + wp_set_script_translations( 'generatepress-pro-site-library', 'gp-premium', GP_PREMIUM_DIR_PATH . 'langs' ); + } + + if ( function_exists( 'wp_get_upload_dir' ) ) { + $uploads_url = wp_get_upload_dir(); + } else { + $uploads_url = wp_upload_dir( null, false ); + } + + wp_localize_script( + 'generatepress-pro-site-library', + 'gppSiteLibrary', + array( + 'homeUrl' => esc_url( home_url() ), + 'hasBackup' => ! empty( get_option( '_generatepress_site_library_backup', array() ) ), + 'gppVersion' => GP_PREMIUM_VERSION, + 'gpVersion' => generate_premium_get_theme_version(), + 'generateblocksVersion' => defined( 'GENERATEBLOCKS_VERSION' ) ? GENERATEBLOCKS_VERSION : '', + 'elementorReplaceUrls' => esc_url( admin_url( 'admin.php?page=elementor-tools#tab-replace_url' ) ), + 'uploadsUrl' => $uploads_url['baseurl'], + 'isDebugEnabled' => defined( 'WP_DEBUG' ) && true === WP_DEBUG, + ) + ); + + wp_enqueue_style( + 'generatepress-pro-site-library', + GP_PREMIUM_DIR_URL . 'dist/site-library.css', + array( 'wp-components' ), + GP_PREMIUM_VERSION + ); + + if ( ! class_exists( 'GeneratePress_Dashboard' ) ) { + wp_enqueue_style( + 'generate-premium-dashboard', + GP_PREMIUM_DIR_URL . 'inc/legacy/assets/dashboard.css', + array(), + GP_PREMIUM_VERSION + ); + } + } + } + + /** + * Add our page. + */ + public function library_page() { + if ( ! class_exists( 'GeneratePress_Dashboard' ) ) : + ?> +
        +
        +
        + +
        + + +
        +
        + + +
        + __( 'Site Library', 'gp-premium' ), + 'url' => admin_url( 'themes.php?page=generatepress-library' ), + 'class' => 'appearance_page_generatepress-library' === $screen->id ? 'active' : '', + ); + + return $tabs; + } + + /** + * Tell GeneratePress this is an admin page. + * + * @param array $screens Existing screens. + */ + public function add_dashboard_screen( $screens ) { + $screens[] = 'appearance_page_generatepress-library'; + + return $screens; + } + + /** + * Add our GeneratePress Site export checkbox to the Export module. + */ + public function add_export_checkbox() { + if ( ! apply_filters( 'generate_show_generatepress_site_export_option', false ) ) { + return; + } + ?> +
        + + + $key ) { + if ( 'activated' === get_option( $key ) ) { + $data['modules'][ $name ] = $key; + } + } + + // Site options. + $data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); + $data['site_options']['custom_logo'] = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ); + $data['site_options']['show_on_front'] = get_option( 'show_on_front' ); + $data['site_options']['page_on_front'] = get_option( 'page_on_front' ); + $data['site_options']['page_for_posts'] = get_option( 'page_for_posts' ); + + // Elements. + $data['site_options']['element_locations'] = $this->get_elements_locations(); + $data['site_options']['element_exclusions'] = $this->get_elements_exclusions(); + + // Custom CSS. + if ( function_exists( 'wp_get_custom_css_post' ) ) { + $data['custom_css'] = wp_get_custom_css_post()->post_content; + } + + // WooCommerce. + if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { + $data['site_options']['woocommerce_shop_page_id'] = get_option( 'woocommerce_shop_page_id' ); + $data['site_options']['woocommerce_cart_page_id'] = get_option( 'woocommerce_cart_page_id' ); + $data['site_options']['woocommerce_checkout_page_id'] = get_option( 'woocommerce_checkout_page_id' ); + $data['site_options']['woocommerce_myaccount_page_id'] = get_option( 'woocommerce_myaccount_page_id' ); + $data['site_options']['woocommerce_single_image_width'] = get_option( 'woocommerce_single_image_width' ); + $data['site_options']['woocommerce_thumbnail_image_width'] = get_option( 'woocommerce_thumbnail_image_width' ); + $data['site_options']['woocommerce_thumbnail_cropping'] = get_option( 'woocommerce_thumbnail_cropping' ); + $data['site_options']['woocommerce_shop_page_display'] = get_option( 'woocommerce_shop_page_display' ); + $data['site_options']['woocommerce_category_archive_display'] = get_option( 'woocommerce_category_archive_display' ); + $data['site_options']['woocommerce_default_catalog_orderby'] = get_option( 'woocommerce_default_catalog_orderby' ); + } + + // Elementor. + if ( is_plugin_active( 'elementor/elementor.php' ) ) { + $data['site_options']['elementor_container_width'] = get_option( 'elementor_container_width' ); + $data['site_options']['elementor_cpt_support'] = get_option( 'elementor_cpt_support' ); + $data['site_options']['elementor_css_print_method'] = get_option( 'elementor_css_print_method' ); + $data['site_options']['elementor_default_generic_fonts'] = get_option( 'elementor_default_generic_fonts' ); + $data['site_options']['elementor_disable_color_schemes'] = get_option( 'elementor_disable_color_schemes' ); + $data['site_options']['elementor_disable_typography_schemes'] = get_option( 'elementor_disable_typography_schemes' ); + $data['site_options']['elementor_editor_break_lines'] = get_option( 'elementor_editor_break_lines' ); + $data['site_options']['elementor_exclude_user_roles'] = get_option( 'elementor_exclude_user_roles' ); + $data['site_options']['elementor_global_image_lightbox'] = get_option( 'elementor_global_image_lightbox' ); + $data['site_options']['elementor_page_title_selector'] = get_option( 'elementor_page_title_selector' ); + $data['site_options']['elementor_scheme_color'] = get_option( 'elementor_scheme_color' ); + $data['site_options']['elementor_scheme_color-picker'] = get_option( 'elementor_scheme_color-picker' ); + $data['site_options']['elementor_scheme_typography'] = get_option( 'elementor_scheme_typography' ); + $data['site_options']['elementor_space_between_widgets'] = get_option( 'elementor_space_between_widgets' ); + $data['site_options']['elementor_stretched_section_container'] = get_option( 'elementor_stretched_section_container' ); + $data['site_options']['elementor_load_fa4_shim'] = get_option( 'elementor_load_fa4_shim' ); + $data['site_options']['elementor_active_kit'] = get_option( 'elementor_active_kit' ); + } + + // Beaver Builder. + if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { + $data['site_options']['_fl_builder_enabled_icons'] = get_option( '_fl_builder_enabled_icons' ); + $data['site_options']['_fl_builder_enabled_modules'] = get_option( '_fl_builder_enabled_modules' ); + $data['site_options']['_fl_builder_post_types'] = get_option( '_fl_builder_post_types' ); + $data['site_options']['_fl_builder_color_presets'] = get_option( '_fl_builder_color_presets' ); + $data['site_options']['_fl_builder_services'] = get_option( '_fl_builder_services' ); + $data['site_options']['_fl_builder_settings'] = get_option( '_fl_builder_settings' ); + $data['site_options']['_fl_builder_user_access'] = get_option( '_fl_builder_user_access' ); + $data['site_options']['_fl_builder_enabled_templates'] = get_option( '_fl_builder_enabled_templates' ); + } + + // Menu Icons. + if ( is_plugin_active( 'menu-icons/menu-icons.php' ) ) { + $data['site_options']['menu-icons'] = get_option( 'menu-icons' ); + } + + // Ninja Forms. + if ( is_plugin_active( 'ninja-forms/ninja-forms.php' ) ) { + $data['site_options']['ninja_forms_settings'] = get_option( 'ninja_forms_settings' ); + } + + // Social Warfare. + if ( is_plugin_active( 'social-warfare/social-warfare.php' ) ) { + $data['site_options']['socialWarfareOptions'] = get_option( 'socialWarfareOptions' ); + } + + // Elements Plus. + if ( is_plugin_active( 'elements-plus/elements-plus.php' ) ) { + $data['site_options']['elements_plus_settings'] = get_option( 'elements_plus_settings' ); + } + + // Ank Google Map. + if ( is_plugin_active( 'ank-google-map/ank-google-map.php' ) ) { + $data['site_options']['ank_google_map'] = get_option( 'ank_google_map' ); + } + + // GP Social Share. + if ( is_plugin_active( 'gp-social-share-svg/gp-social-share.php' ) ) { + $data['site_options']['gp_social_settings'] = get_option( 'gp_social_settings' ); + } + + // Active plugins. + $active_plugins = get_option( 'active_plugins' ); + $all_plugins = get_plugins(); + + $ignore = apply_filters( + 'generate_sites_ignore_plugins', + array( + 'gp-premium/gp-premium.php', + 'widget-importer-exporter/widget-importer-exporter.php', + ) + ); + + foreach ( $ignore as $plugin ) { + unset( $all_plugins[ $plugin ] ); + } + + $activated_plugins = array(); + + foreach ( $active_plugins as $p ) { + if ( isset( $all_plugins[ $p ] ) ) { + $activated_plugins[ $all_plugins[ $p ]['Name'] ] = $p; + } + } + + $data['plugins'] = $activated_plugins; + + return $data; + + } + + /** + * Get our Element display locations. + * + * @return array + */ + public function get_elements_locations() { + $args = array( + 'post_type' => 'gp_elements', + 'showposts' => -1, + ); + + $posts = get_posts( $args ); + $new_values = array(); + + foreach ( $posts as $post ) { + $display_conditions = get_post_meta( $post->ID, '_generate_element_display_conditions', true ); + + if ( $display_conditions ) { + $new_values[ $post->ID ] = $display_conditions; + } + } + + return $new_values; + } + + /** + * Get our Element display locations. + * + * @return array + */ + public function get_elements_exclusions() { + $args = array( + 'post_type' => 'gp_elements', + 'showposts' => -1, + ); + + $posts = get_posts( $args ); + $new_values = array(); + + foreach ( $posts as $post ) { + $display_conditions = get_post_meta( $post->ID, '_generate_element_exclude_conditions', true ); + + if ( $display_conditions ) { + $new_values[ $post->ID ] = $display_conditions; + } + } + + return $new_values; + } +} + +GeneratePress_Site_Library::get_instance(); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php new file mode 100644 index 00000000..6ec1cbdc --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-beaver-builder-batch-processing.php @@ -0,0 +1,163 @@ +image_importer = new GeneratePress_Sites_Image_Importer(); + } + + /** + * Import + * + * @since 1.6 + * @return void + */ + public function import() { + GeneratePress_Site_Library_Helper::log( '== Start Processing Beaver Builder Images ==' ); + + $post_ids = GeneratePress_Site_Library_Helper::get_all_posts(); + + if ( is_array( $post_ids ) ) { + foreach ( $post_ids as $post_id ) { + $this->import_single_post( $post_id ); + } + } + } + + /** + * Update post meta. + * + * @param integer $post_id Post ID. + * @return void + */ + public function import_single_post( $post_id = 0 ) { + + if ( ! empty( $post_id ) ) { + + // Get page builder data. + $data = get_post_meta( $post_id, '_fl_builder_data', true ); + + if ( ! empty( $data ) ) { + foreach ( $data as $key => $el ) { + // Import background images. + if ( 'row' === $el->type || 'column' === $el->type ) { + $data[ $key ]->settings = $this->import_background_images( $el->settings ); + } + + // Import module images. + if ( 'module' === $el->type ) { + $data[ $key ]->settings = $this->import_module_images( $el->settings ); + } + } + + // Update page builder data. + update_post_meta( $post_id, '_fl_builder_data', $data ); + update_post_meta( $post_id, '_fl_builder_draft', $data ); + + // Clear all cache. + FLBuilderModel::delete_asset_cache_for_all_posts(); + } + } + } + + /** + * Import Module Images. + * + * @param object $settings Module settings object. + * @return object + */ + public function import_module_images( $settings ) { + + /** + * 1) Set photos. + */ + $settings = $this->import_photo( $settings ); + + /** + * 2) Set `$settings->data` for Only type 'image-icon' + * + * @todo Remove the condition `'image-icon' === $settings->type` if `$settings->data` is used only for the Image Icon. + */ + if ( isset( $settings->data ) && isset( $settings->photo ) && ! empty( $settings->photo ) && 'image-icon' === $settings->type ) { + $settings->data = FLBuilderPhoto::get_attachment_data( $settings->photo ); + } + + /** + * 3) Set `list item` module images + */ + if ( isset( $settings->add_list_item ) ) { + foreach ( $settings->add_list_item as $key => $value ) { + $settings->add_list_item[ $key ] = $this->import_photo( $value ); + } + } + + return $settings; + } + + /** + * Helper: Import BG Images. + * + * @param object $settings Row settings object. + * @return object + */ + public function import_background_images( $settings ) { + + if ( ! empty( $settings->bg_image ) && ! empty( $settings->bg_image_src ) ) { + $image = array( + 'url' => $settings->bg_image_src, + 'id' => $settings->bg_image, + ); + + $downloaded_image = $this->image_importer->import( $image ); + + $settings->bg_image_src = $downloaded_image['url']; + $settings->bg_image = $downloaded_image['id']; + } + + return $settings; + } + + /** + * Helper: Import Photo. + * + * @param object $settings Row settings object. + * @return object + */ + public function import_photo( $settings ) { + + if ( ! empty( $settings->photo ) && ! empty( $settings->photo_src ) ) { + $image = array( + 'url' => $settings->photo_src, + 'id' => $settings->photo, + ); + + $downloaded_image = $this->image_importer->import( $image ); + + $settings->photo_src = $downloaded_image['url']; + $settings->photo = $downloaded_image['id']; + } + + return $settings; + } + + +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php new file mode 100644 index 00000000..f2198499 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-content-importer.php @@ -0,0 +1,49 @@ +mapping['user_slug'][ $current_user_obj->user_login ] = $current_user_obj->ID; + } + + /** + * Get all protected variables from the WXR_Importer needed for continuing the import. + */ + public function get_importer_data() { + return array( + 'mapping' => $this->mapping, + ); + } + + /** + * Sets all protected variables from the WXR_Importer needed for continuing the import. + * + * @param array $data with set variables. + */ + public function set_importer_data( $data ) { + // phpcs:ignore -- Commented out code for now. + // $this->mapping = empty( $data['mapping'] ) ? array() : $data['mapping']; + // $this->requires_remapping = empty( $data['requires_remapping'] ) ? array() : $data['requires_remapping']; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php new file mode 100644 index 00000000..bd8226fe --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-import-image.php @@ -0,0 +1,200 @@ + $attachment ) { + $downloaded_images[] = $this->import( $attachment ); + } + + return $downloaded_images; + } + + /** + * Get Hash Image. + * + * @since 1.6 + * @param string $attachment_url Attachment URL. + * @return string Hash string. + */ + private function get_hash_image( $attachment_url ) { + return sha1( $attachment_url ); + } + + /** + * Get Saved Image. + * + * @since 1.6 + * @param string $attachment Attachment Data. + * @return string Hash string. + */ + private function get_saved_image( $attachment ) { + + global $wpdb; + + // Already imported? Then return! + if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) { + GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + + return $this->already_imported_ids[ $attachment['id'] ]; + } + + // 1. Is already imported in Batch Import Process? + $post_id = $wpdb->get_var( + $wpdb->prepare( + 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` + WHERE `meta_key` = \'_generatepress_sites_image_hash\' + AND `meta_value` = %s + ;', + $this->get_hash_image( $attachment['url'] ) + ) + ); + + // 2. Is image already imported though XML? + if ( empty( $post_id ) ) { + // Get file name without extension. + // To check it exist in attachment. + $filename = preg_replace( '/\\.[^.\\s]{3,4}$/', '', basename( $attachment['url'] ) ); + + $post_id = $wpdb->get_var( + $wpdb->prepare( + 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` + WHERE `meta_key` = \'_wp_attached_file\' + AND `meta_value` LIKE %s + ;', + '%' . $filename . '%' + ) + ); + + GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + } + + if ( $post_id ) { + $new_attachment = array( + 'id' => $post_id, + 'url' => wp_get_attachment_url( $post_id ), + ); + + $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; + + return $new_attachment; + } + + return false; + } + + /** + * Import Image + * + * @since 1.6 + * @param array $attachment Attachment array. + * @return array Attachment array. + */ + public function import( $attachment ) { + + $saved_image = $this->get_saved_image( $attachment ); + + if ( $saved_image ) { + return $saved_image; + } + + $file_content = wp_remote_retrieve_body( wp_safe_remote_get( $attachment['url'] ) ); + + // Empty file content? + if ( empty( $file_content ) ) { + GeneratePress_Site_Library_Helper::log( 'Failed to replace: ' . $attachment['url'] ); + GeneratePress_Site_Library_Helper::log( 'Error: Failed wp_remote_retrieve_body().' ); + + return $attachment; + } + + // Extract the file name and extension from the URL. + $filename = basename( $attachment['url'] ); + + $upload = wp_upload_bits( + $filename, + null, + $file_content + ); + + $post = array( + 'post_title' => $filename, + 'guid' => $upload['url'], + ); + + $info = wp_check_filetype( $upload['file'] ); + + if ( $info ) { + $post['post_mime_type'] = $info['type']; + } else { + // For now just return the origin attachment. + return $attachment; + } + + $post_id = wp_insert_attachment( $post, $upload['file'] ); + + wp_update_attachment_metadata( + $post_id, + wp_generate_attachment_metadata( $post_id, $upload['file'] ) + ); + + update_post_meta( $post_id, '_generatepress_sites_image_hash', $this->get_hash_image( $attachment['url'] ) ); + + $new_attachment = array( + 'id' => $post_id, + 'url' => $upload['url'], + ); + + GeneratePress_Site_Library_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + + $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; + + return $new_attachment; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php new file mode 100644 index 00000000..ed1b611a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/classes/class-site-widget-importer.php @@ -0,0 +1,275 @@ + true, + ) + ); + } + + // Hook before import. + do_action( 'wie_before_import' ); // phpcs:ignore -- Keep the plugin prefix. + + $data = apply_filters( 'wie_import_data', $data ); // phpcs:ignore -- Keep the plugin prefix. + + // Get all available widgets site supports. + $available_widgets = $this->wie_available_widgets(); + + // Get all existing widget instances. + $widget_instances = array(); + + foreach ( $available_widgets as $widget_data ) { + $widget_instances[ $widget_data['id_base'] ] = get_option( 'widget_' . $widget_data['id_base'] ); + } + + // Begin results. + $results = array(); + + // Loop import data's sidebars. + foreach ( $data as $sidebar_id => $widgets ) { + // Skip inactive widgets (should not be in export file). + if ( 'wp_inactive_widgets' === $sidebar_id ) { + continue; + } + + // Check if sidebar is available on this site. + // Otherwise add widgets to inactive, and say so. + if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) { + $sidebar_available = true; + $use_sidebar_id = $sidebar_id; + $sidebar_message_type = 'success'; + $sidebar_message = ''; + } else { + $sidebar_available = false; + $use_sidebar_id = 'wp_inactive_widgets'; // Add to inactive if sidebar does not exist in theme. + $sidebar_message_type = 'error'; + $sidebar_message = esc_html__( 'Widget area does not exist in theme (using Inactive)', 'widget-importer-exporter' ); + } + + // Result for sidebar + // Sidebar name if theme supports it; otherwise ID. + $results[ $sidebar_id ]['name'] = ! empty( $wp_registered_sidebars[ $sidebar_id ]['name'] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : $sidebar_id; + $results[ $sidebar_id ]['message_type'] = $sidebar_message_type; + $results[ $sidebar_id ]['message'] = $sidebar_message; + $results[ $sidebar_id ]['widgets'] = array(); + + // Loop widgets. + foreach ( $widgets as $widget_instance_id => $widget ) { + $fail = false; + + // Get id_base (remove -# from end) and instance ID number. + $id_base = preg_replace( '/-[0-9]+$/', '', $widget_instance_id ); + $instance_id_number = str_replace( $id_base . '-', '', $widget_instance_id ); + + // Does site support this widget? + if ( ! $fail && ! isset( $available_widgets[ $id_base ] ) ) { + $fail = true; + $widget_message_type = 'error'; + $widget_message = esc_html__( 'Site does not support widget', 'widget-importer-exporter' ); // Explain why widget not imported. + } + + // Filter to modify settings object before conversion to array and import + // Leave this filter here for backwards compatibility with manipulating objects (before conversion to array below) + // Ideally the newer wie_widget_settings_array below will be used instead of this. + $widget = apply_filters( 'wie_widget_settings', $widget ); // phpcs:ignore -- Keep the plugin prefix. + + // Convert multidimensional objects to multidimensional arrays + // Some plugins like Jetpack Widget Visibility store settings as multidimensional arrays + // Without this, they are imported as objects and cause fatal error on Widgets page + // If this creates problems for plugins that do actually intend settings in objects then may need to consider other approach: https://wordpress.org/support/topic/problem-with-array-of-arrays + // It is probably much more likely that arrays are used than objects, however. + $widget = json_decode( wp_json_encode( $widget ), true ); + + // Filter to modify settings array + // This is preferred over the older wie_widget_settings filter above + // Do before identical check because changes may make it identical to end result (such as URL replacements). + $widget = apply_filters( 'wie_widget_settings_array', $widget ); // phpcs:ignore -- Keep the plugin prefix. + + // Does widget with identical settings already exist in same sidebar? + if ( ! $fail && isset( $widget_instances[ $id_base ] ) ) { + // Get existing widgets in this sidebar. + $sidebars_widgets = get_option( 'sidebars_widgets' ); + $sidebar_widgets = isset( $sidebars_widgets[ $use_sidebar_id ] ) ? $sidebars_widgets[ $use_sidebar_id ] : array(); // Check Inactive if that's where will go. + + // Loop widgets with ID base. + $single_widget_instances = ! empty( $widget_instances[ $id_base ] ) ? $widget_instances[ $id_base ] : array(); + + foreach ( $single_widget_instances as $check_id => $check_widget ) { + // Is widget in same sidebar and has identical settings? + if ( in_array( "$id_base-$check_id", $sidebar_widgets, true ) && (array) $widget === $check_widget ) { + $fail = true; + $widget_message_type = 'warning'; + // Explain why widget not imported. + $widget_message = esc_html__( 'Widget already exists', 'widget-importer-exporter' ); + break; + } + } + } + + // No failure. + if ( ! $fail ) { + // Add widget instance. + $single_widget_instances = get_option( 'widget_' . $id_base ); // All instances for that widget ID base, get fresh every time. + + $single_widget_instances = ! empty( $single_widget_instances ) ? $single_widget_instances : array( + '_multiwidget' => 1, // Start fresh if have to. + ); + + $single_widget_instances[] = $widget; // Add it. + + // Get the key it was given. + end( $single_widget_instances ); + + $new_instance_id_number = key( $single_widget_instances ); + + // If key is 0, make it 1 + // When 0, an issue can occur where adding a widget causes data from other widget to load, + // and the widget doesn't stick (reload wipes it). + if ( '0' === strval( $new_instance_id_number ) ) { + $new_instance_id_number = 1; + $single_widget_instances[ $new_instance_id_number ] = $single_widget_instances[0]; + unset( $single_widget_instances[0] ); + } + + // Move _multiwidget to end of array for uniformity. + if ( isset( $single_widget_instances['_multiwidget'] ) ) { + $multiwidget = $single_widget_instances['_multiwidget']; + unset( $single_widget_instances['_multiwidget'] ); + $single_widget_instances['_multiwidget'] = $multiwidget; + } + + // Update option with new widget. + update_option( 'widget_' . $id_base, $single_widget_instances ); + + // Assign widget instance to sidebar. + // Which sidebars have which widgets, get fresh every time. + $sidebars_widgets = get_option( 'sidebars_widgets' ); + + // Avoid rarely fatal error when the option is an empty string + // https://github.com/stevengliebe/widget-importer-exporter/pull/11. + if ( ! $sidebars_widgets ) { + $sidebars_widgets = array(); + } + + // Use ID number from new widget instance. + $new_instance_id = $id_base . '-' . $new_instance_id_number; + + // Add new instance to sidebar. + $sidebars_widgets[ $use_sidebar_id ][] = $new_instance_id; + + // Save the amended data. + update_option( 'sidebars_widgets', $sidebars_widgets ); + + // After widget import action. + $after_widget_import = array( + 'sidebar' => $use_sidebar_id, + 'sidebar_old' => $sidebar_id, + 'widget' => $widget, + 'widget_type' => $id_base, + 'widget_id' => $new_instance_id, + 'widget_id_old' => $widget_instance_id, + 'widget_id_num' => $new_instance_id_number, + 'widget_id_num_old' => $instance_id_number, + ); + + do_action( 'wie_after_widget_import', $after_widget_import ); // phpcs:ignore -- Keep the plugin prefix. + + // Success message. + if ( $sidebar_available ) { + $widget_message_type = 'success'; + $widget_message = esc_html__( 'Imported', 'widget-importer-exporter' ); + } else { + $widget_message_type = 'warning'; + $widget_message = esc_html__( 'Imported to Inactive', 'widget-importer-exporter' ); + } + } + + // Result for widget instance. + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['name'] = isset( $available_widgets[ $id_base ]['name'] ) ? $available_widgets[ $id_base ]['name'] : $id_base; // Widget name or ID if name not available (not supported by site). + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['title'] = ! empty( $widget['title'] ) ? $widget['title'] : esc_html__( 'No Title', 'widget-importer-exporter' ); // Show "No Title" if widget instance is untitled. + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message_type'] = $widget_message_type; + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message'] = $widget_message; + } + } + + // Hook after import. + do_action( 'wie_after_import' ); // phpcs:ignore -- Keep the plugin prefix. + + // Return results. + return apply_filters( 'wie_import_results', $results ); // phpcs:ignore -- Keep the plugin prefix. + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php new file mode 100644 index 00000000..08183915 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WPImporterLogger.php @@ -0,0 +1,138 @@ +log( 'emergency', $message, $context ); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert( $message, array $context = array() ) { + return $this->log( 'alert', $message, $context ); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical( $message, array $context = array() ) { + return $this->log( 'critical', $message, $context ); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error( $message, array $context = array()) { + return $this->log( 'error', $message, $context ); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning( $message, array $context = array() ) { + return $this->log( 'warning', $message, $context ); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice( $message, array $context = array() ) { + return $this->log( 'notice', $message, $context ); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info( $message, array $context = array() ) { + return $this->log( 'info', $message, $context ); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug( $message, array $context = array() ) { + return $this->log( 'debug', $message, $context ); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + public function log( $level, $message, array $context = array() ) { + $this->messages[] = array( + 'timestamp' => time(), + 'level' => $level, + 'message' => $message, + 'context' => $context, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php new file mode 100644 index 00000000..a7e75aa0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/site-library/libs/wxr-importer/WXRImportInfo.php @@ -0,0 +1,16 @@ +` tag at the start of the file. + * + * @var string + */ + protected $version = '1.0'; + + // information to import from WXR file + protected $categories = array(); + protected $tags = array(); + protected $base_url = ''; + + // TODO: REMOVE THESE + protected $processed_terms = array(); + protected $processed_posts = array(); + protected $processed_menu_items = array(); + protected $menu_item_orphans = array(); + protected $missing_menu_items = array(); + + // NEW STYLE + protected $mapping = array(); + protected $requires_remapping = array(); + protected $exists = array(); + protected $user_slug_override = array(); + + protected $url_remap = array(); + protected $featured_images = array(); + + /** + * Logger instance. + * + * @var WP_Importer_Logger + */ + protected $logger; + + /** + * Constructor + * + * @param array $options { + * @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.) + * @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.) + * @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.) + * @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.) + * @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.) + * @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `` only. Default is false.) + * @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.) + * } + */ + public function __construct( $options = array() ) { + // Initialize some important variables + $empty_types = array( + 'post' => array(), + 'comment' => array(), + 'term' => array(), + 'user' => array(), + ); + + $this->mapping = $empty_types; + $this->mapping['user_slug'] = array(); + $this->mapping['term_id'] = array(); + $this->requires_remapping = $empty_types; + $this->exists = $empty_types; + + $this->options = wp_parse_args( $options, array( + 'prefill_existing_posts' => true, + 'prefill_existing_comments' => true, + 'prefill_existing_terms' => true, + 'update_attachment_guids' => false, + 'fetch_attachments' => false, + 'aggressive_url_search' => false, + 'default_author' => null, + ) ); + } + + public function set_logger( $logger ) { + $this->logger = $logger; + } + + /** + * Get a stream reader for the file. + * + * @param string $file Path to the XML file. + * @return XMLReader|WP_Error Reader instance on success, error otherwise. + */ + protected function get_reader( $file ) { + // Avoid loading external entities for security + $old_value = null; + if ( function_exists( 'libxml_disable_entity_loader' ) ) { + // $old_value = libxml_disable_entity_loader( true ); + } + + $reader = new \XMLReader(); + $status = $reader->open( $file ); + + if ( ! is_null( $old_value ) ) { + // libxml_disable_entity_loader( $old_value ); + } + + if ( ! $status ) { + return new \WP_Error( 'wxr_importer.cannot_parse', __( 'Could not open the file for parsing', 'wordpress-importer' ) ); + } + + return $reader; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function get_preliminary_information( $file ) { + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Start parsing! + $data = new WXRImportInfo(); + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'generator': + $data->generator = $reader->readString(); + $reader->next(); + break; + + case 'title': + $data->title = $reader->readString(); + $reader->next(); + break; + + case 'wp:base_site_url': + $data->siteurl = $reader->readString(); + $reader->next(); + break; + + case 'wp:base_blog_url': + $data->home = $reader->readString(); + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $data->users[] = $parsed; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'item': + $node = $reader->expand(); + $parsed = $this->parse_post_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + if ( $parsed['data']['post_type'] === 'attachment' ) { + $data->media_count++; + } else { + $data->post_count++; + } + $data->comment_count += count( $parsed['comments'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:category': + case 'wp:tag': + case 'wp:term': + $data->term_count++; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + } + } + + $data->version = $this->version; + + return $data; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function parse_authors( $file ) { + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Start parsing! + $authors = array(); + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $authors[] = $parsed; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + } + } + + return $authors; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function import( $file ) { + add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) ); + add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); + + /* + * Elementor fix for excessive use of `wp_slash` after our update v3.0.2. + * Method in Elementor: \Elementor\Compatibility::register_actions + * https://wordpress.org/support/topic/version-2-6-0-breaks-every-elementor-theme/ + * + * This can be removed after Elementor skips the functionality in above method if our plugin is in use. + */ + if ( method_exists( '\Elementor\Compatibility', 'on_wxr_importer_pre_process_post_meta' ) ) { + remove_action( 'wxr_importer.pre_process.post_meta', array( 'Elementor\Compatibility', 'on_wxr_importer_pre_process_post_meta' ) ); + } + + $result = $this->import_start( $file ); + if ( is_wp_error( $result ) ) { + return $result; + } + + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Reset other variables + $this->base_url = ''; + + // Start parsing! + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:base_site_url': + $this->base_url = $reader->readString(); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'item': + $node = $reader->expand(); + $parsed = $this->parse_post_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $this->process_post( $parsed['data'], $parsed['meta'], $parsed['comments'], $parsed['terms'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_author( $parsed['data'], $parsed['meta'] ); + if ( is_wp_error( $status ) ) { + $this->log_error( $status ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:category': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node, 'category' ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:tag': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node, 'tag' ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:term': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + default: + // Skip this node, probably handled by something already + break; + } + } + + // Now that we've done the main processing, do any required + // post-processing and remapping. + $this->post_process(); + + if ( $this->options['aggressive_url_search'] ) { + $this->replace_attachment_urls_in_content(); + } + + $this->remap_featured_images(); + + $this->import_end(); + } + + /** + * Log an error instance to the logger. + * + * @param WP_Error $error Error instance to log. + */ + protected function log_error( WP_Error $error ) { + $this->logger->warning( $error->get_error_message() ); + + // Log the data as debug info too + $data = $error->get_error_data(); + if ( ! empty( $data ) ) { + $this->logger->debug( var_export( $data, true ) ); + } + } + + /** + * Parses the WXR file and prepares us for the task of processing parsed data + * + * @param string $file Path to the WXR file for importing + */ + protected function import_start( $file ) { + if ( ! is_file( $file ) ) { + return new \WP_Error( 'wxr_importer.file_missing', __( 'The file does not exist, please try again.', 'wordpress-importer' ) ); + } + + // Suspend bunches of stuff in WP core + wp_defer_term_counting( true ); + wp_defer_comment_counting( true ); + wp_suspend_cache_invalidation( true ); + + // Prefill exists calls if told to + if ( $this->options['prefill_existing_posts'] ) { + $this->prefill_existing_posts(); + } + if ( $this->options['prefill_existing_comments'] ) { + $this->prefill_existing_comments(); + } + if ( $this->options['prefill_existing_terms'] ) { + $this->prefill_existing_terms(); + } + + /** + * Begin the import. + * + * Fires before the import process has begun. If you need to suspend + * caching or heavy processing on hooks, do so here. + */ + do_action( 'generate_import_start' ); + } + + /** + * Performs post-import cleanup of files and the cache + */ + protected function import_end() { + // Re-enable stuff in core + wp_suspend_cache_invalidation( false ); + wp_cache_flush(); + foreach ( get_taxonomies() as $tax ) { + delete_option( "{$tax}_children" ); + _get_term_hierarchy( $tax ); + } + + wp_defer_term_counting( false ); + wp_defer_comment_counting( false ); + + /** + * Complete the import. + * + * Fires after the import process has finished. If you need to update + * your cache or re-enable processing, do so here. + */ + do_action( 'generate_import_end' ); + } + + /** + * Set the user mapping. + * + * @param array $mapping List of map arrays (containing `old_slug`, `old_id`, `new_id`) + */ + public function set_user_mapping( $mapping ) { + foreach ( $mapping as $map ) { + if ( empty( $map['old_slug'] ) || empty( $map['old_id'] ) || empty( $map['new_id'] ) ) { + $this->logger->warning( __( 'Invalid author mapping', 'wordpress-importer' ) ); + $this->logger->debug( var_export( $map, true ) ); + continue; + } + + $old_slug = $map['old_slug']; + $old_id = $map['old_id']; + $new_id = $map['new_id']; + + $this->mapping['user'][ $old_id ] = $new_id; + $this->mapping['user_slug'][ $old_slug ] = $new_id; + } + } + + /** + * Set the user slug overrides. + * + * Allows overriding the slug in the import with a custom/renamed version. + * + * @param string[] $overrides Map of old slug to new slug. + */ + public function set_user_slug_overrides( $overrides ) { + foreach ( $overrides as $original => $renamed ) { + $this->user_slug_override[ $original ] = $renamed; + } + } + + /** + * Parse a post node into post data. + * + * @param DOMElement $node Parent node of post data (typically `item`). + * @return array|WP_Error Post data array on success, error otherwise. + */ + protected function parse_post_node( $node ) { + $data = array(); + $meta = array(); + $comments = array(); + $terms = array(); + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:post_type': + $data['post_type'] = $child->textContent; + break; + + case 'title': + $data['post_title'] = $child->textContent; + break; + + case 'guid': + $data['guid'] = $child->textContent; + break; + + case 'dc:creator': + $data['post_author'] = $child->textContent; + break; + + case 'content:encoded': + $data['post_content'] = $child->textContent; + break; + + case 'excerpt:encoded': + $data['post_excerpt'] = $child->textContent; + break; + + case 'wp:post_id': + $data['post_id'] = $child->textContent; + break; + + case 'wp:post_date': + $data['post_date'] = $child->textContent; + break; + + case 'wp:post_date_gmt': + $data['post_date_gmt'] = $child->textContent; + break; + + case 'wp:comment_status': + $data['comment_status'] = $child->textContent; + break; + + case 'wp:ping_status': + $data['ping_status'] = $child->textContent; + break; + + case 'wp:post_name': + $data['post_name'] = $child->textContent; + break; + + case 'wp:status': + $data['post_status'] = $child->textContent; + + if ( $data['post_status'] === 'auto-draft' ) { + // Bail now + return new \WP_Error( + 'wxr_importer.post.cannot_import_draft', + __( 'Cannot import auto-draft posts' ), + $data + ); + } + break; + + case 'wp:post_parent': + $data['post_parent'] = $child->textContent; + break; + + case 'wp:menu_order': + $data['menu_order'] = $child->textContent; + break; + + case 'wp:post_password': + $data['post_password'] = $child->textContent; + break; + + case 'wp:is_sticky': + $data['is_sticky'] = $child->textContent; + break; + + case 'wp:attachment_url': + $data['attachment_url'] = $child->textContent; + break; + + case 'wp:postmeta': + $meta_item = $this->parse_meta_node( $child ); + if ( ! empty( $meta_item ) ) { + $meta[] = $meta_item; + } + break; + + case 'wp:comment': + $comment_item = $this->parse_comment_node( $child ); + if ( ! empty( $comment_item ) ) { + $comments[] = $comment_item; + } + break; + + case 'category': + $term_item = $this->parse_category_node( $child ); + if ( ! empty( $term_item ) ) { + $terms[] = $term_item; + } + break; + } + } + + return compact( 'data', 'meta', 'comments', 'terms' ); + } + + /** + * Create new posts based on import information + * + * Posts marked as having a parent which doesn't exist will become top level items. + * Doesn't create a new post if: the post type doesn't exist, the given post ID + * is already noted as imported or a post with the same title and date already exists. + * Note that new/updated terms, comments and meta are imported for the last of the above. + */ + protected function process_post( $data, $meta, $comments, $terms ) { + /** + * Pre-process post data. + * + * @param array $data Post data. (Return empty to skip.) + * @param array $meta Meta data. + * @param array $comments Comments on the post. + * @param array $terms Terms on the post. + */ + $data = apply_filters( 'wxr_importer.pre_process.post', $data, $meta, $comments, $terms ); + if ( empty( $data ) ) { + return false; + } + + $original_id = isset( $data['post_id'] ) ? (int) $data['post_id'] : 0; + $parent_id = isset( $data['post_parent'] ) ? (int) $data['post_parent'] : 0; + $author_id = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0; + + // Have we already processed this? + if ( isset( $this->mapping['post'][ $original_id ] ) ) { + return; + } + + $post_type_object = get_post_type_object( $data['post_type'] ); + + // Is this type even valid? + if ( ! $post_type_object ) { + $this->logger->warning( sprintf( + __( 'Failed to import "%s": Invalid post type %s', 'wordpress-importer' ), + $data['post_title'], + $data['post_type'] + ) ); + return false; + } + + $post_exists = $this->post_exists( $data ); + if ( $post_exists ) { + $this->logger->info( sprintf( + __( '%s "%s" already exists.', 'wordpress-importer' ), + $post_type_object->labels->singular_name, + $data['post_title'] + ) ); + + /** + * Post processing already imported. + * + * @param array $data Raw data imported for the post. + */ + do_action( 'wxr_importer.process_already_imported.post', $data ); + + // Even though this post already exists, new comments might need importing + $this->process_comments( $comments, $original_id, $data, $post_exists ); + + return false; + } + + // Map the parent post, or mark it as one we need to fix + $requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['post'][ $parent_id ] ) ) { + $data['post_parent'] = $this->mapping['post'][ $parent_id ]; + } else { + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + $data['post_parent'] = 0; + } + } + + // Map the author, or mark it as one we need to fix + $author = sanitize_user( $data['post_author'], true ); + if ( empty( $author ) ) { + // Missing or invalid author, use default if available. + $data['post_author'] = $this->options['default_author']; + } elseif ( isset( $this->mapping['user_slug'][ $author ] ) ) { + $data['post_author'] = $this->mapping['user_slug'][ $author ]; + } else { + $meta[] = array( 'key' => '_wxr_import_user_slug', 'value' => $author ); + $requires_remapping = true; + + $data['post_author'] = (int) get_current_user_id(); + } + + // Does the post look like it contains attachment images? + if ( preg_match( self::REGEX_HAS_ATTACHMENT_REFS, $data['post_content'] ) ) { + $meta[] = array( 'key' => '_wxr_import_has_attachment_refs', 'value' => true ); + $requires_remapping = true; + } + + // Whitelist to just the keys we allow + $postdata = array( + 'import_id' => $data['post_id'], + ); + $allowed = array( + 'post_author' => true, + 'post_date' => true, + 'post_date_gmt' => true, + 'post_content' => true, + 'post_excerpt' => true, + 'post_title' => true, + 'post_status' => true, + 'post_name' => true, + 'comment_status' => true, + 'ping_status' => true, + 'guid' => true, + 'post_parent' => true, + 'menu_order' => true, + 'post_type' => true, + 'post_password' => true, + ); + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $postdata[ $key ] = $data[ $key ]; + } + + $postdata = apply_filters( 'wp_import_post_data_processed', wp_slash( $postdata ), $data ); + + if ( 'attachment' === $postdata['post_type'] ) { + if ( ! $this->options['fetch_attachments'] ) { + $this->logger->notice( sprintf( + __( 'Skipping attachment "%s", fetching attachments disabled' ), + $data['post_title'] + ) ); + /** + * Post processing skipped. + * + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + */ + do_action( 'wxr_importer.process_skipped.post', $data, $meta ); + return false; + } + $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid']; + $post_id = $this->process_attachment( $postdata, $meta, $remote_url ); + } else { + $post_id = wp_insert_post( $postdata, true ); + do_action( 'wp_import_insert_post', $post_id, $original_id, $postdata, $data ); + } + + if ( is_wp_error( $post_id ) ) { + $this->logger->error( sprintf( + __( 'Failed to import "%s" (%s)', 'wordpress-importer' ), + $data['post_title'], + $post_type_object->labels->singular_name + ) ); + $this->logger->debug( $post_id->get_error_message() ); + + /** + * Post processing failed. + * + * @param WP_Error $post_id Error object. + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $comments Raw comment data, already processed by {@see process_comments}. + * @param array $terms Raw term data, already processed. + */ + do_action( 'wxr_importer.process_failed.post', $post_id, $data, $meta, $comments, $terms ); + return false; + } + + // Ensure stickiness is handled correctly too + if ( $data['is_sticky'] === '1' ) { + stick_post( $post_id ); + } + + // map pre-import ID to local ID + $this->mapping['post'][ $original_id ] = (int) $post_id; + if ( $requires_remapping ) { + $this->requires_remapping['post'][ $post_id ] = true; + } + $this->mark_post_exists( $data, $post_id ); + + $this->logger->info( sprintf( + __( 'Imported "%s" (%s)', 'wordpress-importer' ), + $data['post_title'], + $post_type_object->labels->singular_name + ) ); + $this->logger->debug( sprintf( + __( 'Post %d remapped to %d', 'wordpress-importer' ), + $original_id, + $post_id + ) ); + + // Handle the terms too + $terms = apply_filters( 'wp_import_post_terms', $terms, $post_id, $data ); + + if ( ! empty( $terms ) ) { + $term_ids = array(); + foreach ( $terms as $term ) { + $taxonomy = $term['taxonomy']; + $key = sha1( $taxonomy . ':' . $term['slug'] ); + + if ( isset( $this->mapping['term'][ $key ] ) ) { + $term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ]; + } else { + $meta[] = array( 'key' => '_wxr_import_term', 'value' => $term ); + $requires_remapping = true; + } + } + + foreach ( $term_ids as $tax => $ids ) { + $tt_ids = wp_set_post_terms( $post_id, $ids, $tax ); + do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $data ); + } + } + + $this->process_comments( $comments, $post_id, $data ); + $this->process_post_meta( $meta, $post_id, $data ); + + if ( 'nav_menu_item' === $data['post_type'] ) { + $this->process_menu_item_meta( $post_id, $data, $meta ); + } + + /** + * Post processing completed. + * + * @param int $post_id New post ID. + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $comments Raw comment data, already processed by {@see process_comments}. + * @param array $terms Raw term data, already processed. + */ + do_action( 'wxr_importer.processed.post', $post_id, $data, $meta, $comments, $terms ); + } + + /** + * Attempt to create a new menu item from import data + * + * Fails for draft, orphaned menu items and those without an associated nav_menu + * or an invalid nav_menu term. If the post type or term object which the menu item + * represents doesn't exist then the menu item will not be imported (waits until the + * end of the import to retry again before discarding). + * + * @param array $item Menu item details from WXR file + */ + protected function process_menu_item_meta( $post_id, $data, $meta ) { + + $item_type = get_post_meta( $post_id, '_menu_item_type', true ); + $original_object_id = get_post_meta( $post_id, '_menu_item_object_id', true ); + $object_id = null; + + $this->logger->debug( sprintf( 'Processing menu item %s', $item_type ) ); + + $requires_remapping = false; + switch ( $item_type ) { + case 'taxonomy': + if ( isset( $this->mapping['term_id'][ $original_object_id ] ) ) { + $object_id = $this->mapping['term_id'][ $original_object_id ]; + } else { + add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); + $requires_remapping = true; + } + break; + + case 'post_type': + if ( isset( $this->mapping['post'][ $original_object_id ] ) ) { + $object_id = $this->mapping['post'][ $original_object_id ]; + } else { + add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); + $requires_remapping = true; + } + break; + + case 'custom': + // Custom refers to itself, wonderfully easy. + $object_id = $post_id; + break; + + default: + // associated object is missing or not imported yet, we'll retry later + $this->missing_menu_items[] = $item; + $this->logger->debug( 'Unknown menu item type' ); + break; + } + + if ( $requires_remapping ) { + $this->requires_remapping['post'][ $post_id ] = true; + } + + if ( empty( $object_id ) ) { + // Nothing needed here. + return; + } + + $this->logger->debug( sprintf( 'Menu item %d mapped to %d', $original_object_id, $object_id ) ); + update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $object_id ) ); + } + + /** + * If fetching attachments is enabled then attempt to create a new attachment + * + * @param array $post Attachment post details from WXR + * @param string $url URL to fetch attachment from + * @return int|WP_Error Post ID on success, WP_Error otherwise + */ + protected function process_attachment( $post, $meta, $remote_url ) { + // try to use _wp_attached file for upload folder placement to ensure the same location as the export site + // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload() + $post['upload_date'] = $post['post_date']; + foreach ( $meta as $meta_item ) { + if ( $meta_item['key'] !== '_wp_attached_file' ) { + continue; + } + + if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta_item['value'], $matches ) ) { + $post['upload_date'] = $matches[0]; + } + break; + } + + // if the URL is absolute, but does not contain address, then upload it assuming base_site_url + if ( preg_match( '|^/[\w\W]+$|', $remote_url ) ) { + $remote_url = rtrim( $this->base_url, '/' ) . $remote_url; + } + + $upload = $this->fetch_remote_file( $remote_url, $post ); + if ( is_wp_error( $upload ) ) { + return $upload; + } + + $info = wp_check_filetype( $upload['file'] ); + if ( ! $info ) { + return new \WP_Error( 'attachment_processing_error', __( 'Invalid file type', 'wordpress-importer' ) ); + } + + $post['post_mime_type'] = $info['type']; + + // WP really likes using the GUID for display. Allow updating it. + // See https://core.trac.wordpress.org/ticket/33386 + if ( $this->options['update_attachment_guids'] ) { + $post['guid'] = $upload['url']; + } + + // as per wp-admin/includes/upload.php + $post_id = wp_insert_attachment( $post, $upload['file'] ); + if ( is_wp_error( $post_id ) ) { + return $post_id; + } + + $attachment_metadata = wp_generate_attachment_metadata( $post_id, $upload['file'] ); + wp_update_attachment_metadata( $post_id, $attachment_metadata ); + + // Map this image URL later if we need to + $this->url_remap[ $remote_url ] = $upload['url']; + + // If we have a HTTPS URL, ensure the HTTP URL gets replaced too + if ( substr( $remote_url, 0, 8 ) === 'https://' ) { + $insecure_url = 'http' . substr( $remote_url, 5 ); + $this->url_remap[ $insecure_url ] = $upload['url']; + } + + if ( $this->options['aggressive_url_search'] ) { + // remap resized image URLs, works by stripping the extension and remapping the URL stub. + /*if ( preg_match( '!^image/!', $info['type'] ) ) { + $parts = pathinfo( $remote_url ); + $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2 + + $parts_new = pathinfo( $upload['url'] ); + $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" ); + + $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new; + }*/ + } + + return $post_id; + } + + /** + * Parse a meta node into meta data. + * + * @param DOMElement $node Parent node of meta data (typically `wp:postmeta` or `wp:commentmeta`). + * @return array|null Meta data array on success, or null on error. + */ + protected function parse_meta_node( $node ) { + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:meta_key': + $key = $child->textContent; + break; + + case 'wp:meta_value': + $value = $child->textContent; + break; + } + } + + if ( empty( $key ) || empty( $value ) ) { + return null; + } + + return compact( 'key', 'value' ); + } + + /** + * Process and import post meta items. + * + * @param array $meta List of meta data arrays + * @param int $post_id Post to associate with + * @param array $post Post data + * @return int|WP_Error Number of meta items imported on success, error otherwise. + */ + protected function process_post_meta( $meta, $post_id, $post ) { + if ( empty( $meta ) ) { + return true; + } + + foreach ( $meta as $meta_item ) { + /** + * Pre-process post meta data. + * + * @param array $meta_item Meta data. (Return empty to skip.) + * @param int $post_id Post the meta is attached to. + */ + $meta_item = apply_filters( 'wxr_importer.pre_process.post_meta', $meta_item, $post_id ); + if ( empty( $meta_item ) ) { + return false; + } + + $key = apply_filters( 'import_post_meta_key', $meta_item['key'], $post_id, $post ); + $value = false; + + if ( '_edit_last' === $key ) { + $value = intval( $meta_item['value'] ); + if ( ! isset( $this->mapping['user'][ $value ] ) ) { + // Skip! + continue; + } + + $value = $this->mapping['user'][ $value ]; + } + + if ( $key ) { + // export gets meta straight from the DB so could have a serialized string + if ( ! $value ) { + $value = maybe_unserialize( $meta_item['value'] ); + } + + if ( function_exists( 'wp_slash_strings_only' ) ) { + add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) ); + } else { + add_post_meta( $post_id, $key, $value ); + } + + do_action( 'import_post_meta', $post_id, $key, $value ); + + // if the post has a featured image, take note of this in case of remap + if ( '_thumbnail_id' === $key ) { + $this->featured_images[ $post_id ] = (int) $value; + } + } + } + + return true; + } + + /** + * Parse a comment node into comment data. + * + * @param DOMElement $node Parent node of comment data (typically `wp:comment`). + * @return array Comment data array. + */ + protected function parse_comment_node( $node ) { + $data = array( + 'commentmeta' => array(), + ); + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:comment_id': + $data['comment_id'] = $child->textContent; + break; + case 'wp:comment_author': + $data['comment_author'] = $child->textContent; + break; + + case 'wp:comment_author_email': + $data['comment_author_email'] = $child->textContent; + break; + + case 'wp:comment_author_IP': + $data['comment_author_IP'] = $child->textContent; + break; + + case 'wp:comment_author_url': + $data['comment_author_url'] = $child->textContent; + break; + + case 'wp:comment_user_id': + $data['comment_user_id'] = $child->textContent; + break; + + case 'wp:comment_date': + $data['comment_date'] = $child->textContent; + break; + + case 'wp:comment_date_gmt': + $data['comment_date_gmt'] = $child->textContent; + break; + + case 'wp:comment_content': + $data['comment_content'] = $child->textContent; + break; + + case 'wp:comment_approved': + $data['comment_approved'] = $child->textContent; + break; + + case 'wp:comment_type': + $data['comment_type'] = $child->textContent; + break; + + case 'wp:comment_parent': + $data['comment_parent'] = $child->textContent; + break; + + case 'wp:commentmeta': + $meta_item = $this->parse_meta_node( $child ); + if ( ! empty( $meta_item ) ) { + $data['commentmeta'][] = $meta_item; + } + break; + } + } + + return $data; + } + + /** + * Process and import comment data. + * + * @param array $comments List of comment data arrays. + * @param int $post_id Post to associate with. + * @param array $post Post data. + * @return int|WP_Error Number of comments imported on success, error otherwise. + */ + protected function process_comments( $comments, $post_id, $post, $post_exists = false ) { + + $comments = apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ); + if ( empty( $comments ) ) { + return 0; + } + + $num_comments = 0; + + // Sort by ID to avoid excessive remapping later + usort( $comments, array( $this, 'sort_comments_by_id' ) ); + + foreach ( $comments as $key => $comment ) { + /** + * Pre-process comment data + * + * @param array $comment Comment data. (Return empty to skip.) + * @param int $post_id Post the comment is attached to. + */ + $comment = apply_filters( 'wxr_importer.pre_process.comment', $comment, $post_id ); + if ( empty( $comment ) ) { + return false; + } + + $original_id = isset( $comment['comment_id'] ) ? (int) $comment['comment_id'] : 0; + $parent_id = isset( $comment['comment_parent'] ) ? (int) $comment['comment_parent'] : 0; + $author_id = isset( $comment['comment_user_id'] ) ? (int) $comment['comment_user_id'] : 0; + + // if this is a new post we can skip the comment_exists() check + // TODO: Check comment_exists for performance + if ( $post_exists ) { + $existing = $this->comment_exists( $comment ); + if ( $existing ) { + + /** + * Comment processing already imported. + * + * @param array $comment Raw data imported for the comment. + */ + do_action( 'wxr_importer.process_already_imported.comment', $comment ); + + $this->mapping['comment'][ $original_id ] = $existing; + continue; + } + } + + // Remove meta from the main array + $meta = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array(); + unset( $comment['commentmeta'] ); + + // Map the parent comment, or mark it as one we need to fix + $requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { + $comment['comment_parent'] = $this->mapping['comment'][ $parent_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + // Wipe the parent for now + $comment['comment_parent'] = 0; + } + } + + // Map the author, or mark it as one we need to fix + if ( $author_id ) { + if ( isset( $this->mapping['user'][ $author_id ] ) ) { + $comment['user_id'] = $this->mapping['user'][ $author_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_user', 'value' => $author_id ); + $requires_remapping = true; + + // Wipe the user for now + $comment['user_id'] = 0; + } + } + + // Run standard core filters + $comment['comment_post_ID'] = $post_id; + $comment = wp_filter_comment( $comment ); + + // wp_insert_comment expects slashed data + $comment_id = wp_insert_comment( wp_slash( $comment ) ); + $this->mapping['comment'][ $original_id ] = $comment_id; + if ( $requires_remapping ) { + $this->requires_remapping['comment'][ $comment_id ] = true; + } + $this->mark_comment_exists( $comment, $comment_id ); + + /** + * Comment has been imported. + * + * @param int $comment_id New comment ID + * @param array $comment Comment inserted (`comment_id` item refers to the original ID) + * @param int $post_id Post parent of the comment + * @param array $post Post data + */ + do_action( 'wp_import_insert_comment', $comment_id, $comment, $post_id, $post ); + + // Process the meta items + foreach ( $meta as $meta_item ) { + $value = maybe_unserialize( $meta_item['value'] ); + add_comment_meta( $comment_id, wp_slash( $meta_item['key'] ), wp_slash( $value ) ); + } + + /** + * Post processing completed. + * + * @param int $post_id New post ID. + * @param array $comment Raw data imported for the comment. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $post_id Parent post ID. + */ + do_action( 'wxr_importer.processed.comment', $comment_id, $comment, $meta, $post_id ); + + $num_comments++; + } + + return $num_comments; + } + + protected function parse_category_node( $node ) { + $data = array( + // Default taxonomy to "category", since this is a `` tag + 'taxonomy' => 'category', + ); + $meta = array(); + + if ( $node->hasAttribute( 'domain' ) ) { + $data['taxonomy'] = $node->getAttribute( 'domain' ); + } + if ( $node->hasAttribute( 'nicename' ) ) { + $data['slug'] = $node->getAttribute( 'nicename' ); + } + + $data['name'] = $node->textContent; + + if ( empty( $data['slug'] ) ) { + return null; + } + + // Just for extra compatibility + if ( $data['taxonomy'] === 'tag' ) { + $data['taxonomy'] = 'post_tag'; + } + + return $data; + } + + /** + * Callback for `usort` to sort comments by ID + * + * @param array $a Comment data for the first comment + * @param array $b Comment data for the second comment + * @return int + */ + public static function sort_comments_by_id( $a, $b ) { + if ( empty( $a['comment_id'] ) ) { + return 1; + } + + if ( empty( $b['comment_id'] ) ) { + return -1; + } + + return $a['comment_id'] - $b['comment_id']; + } + + protected function parse_author_node( $node ) { + $data = array(); + $meta = array(); + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:author_login': + $data['user_login'] = $child->textContent; + break; + + case 'wp:author_id': + $data['ID'] = $child->textContent; + break; + + case 'wp:author_email': + $data['user_email'] = $child->textContent; + break; + + case 'wp:author_display_name': + $data['display_name'] = $child->textContent; + break; + + case 'wp:author_first_name': + $data['first_name'] = $child->textContent; + break; + + case 'wp:author_last_name': + $data['last_name'] = $child->textContent; + break; + } + } + + return compact( 'data', 'meta' ); + } + + protected function process_author( $data, $meta ) { + /** + * Pre-process user data. + * + * @param array $data User data. (Return empty to skip.) + * @param array $meta Meta data. + */ + $data = apply_filters( 'wxr_importer.pre_process.user', $data, $meta ); + if ( empty( $data ) ) { + return false; + } + + // Have we already handled this user? + $original_id = isset( $data['ID'] ) ? $data['ID'] : 0; + $original_slug = $data['user_login']; + + if ( isset( $this->mapping['user'][ $original_id ] ) ) { + $existing = $this->mapping['user'][ $original_id ]; + + // Note the slug mapping if we need to too + if ( ! isset( $this->mapping['user_slug'][ $original_slug ] ) ) { + $this->mapping['user_slug'][ $original_slug ] = $existing; + } + + return false; + } + + if ( isset( $this->mapping['user_slug'][ $original_slug ] ) ) { + $existing = $this->mapping['user_slug'][ $original_slug ]; + + // Ensure we note the mapping too + $this->mapping['user'][ $original_id ] = $existing; + + return false; + } + + // Allow overriding the user's slug + $login = $original_slug; + if ( isset( $this->user_slug_override[ $login ] ) ) { + $login = $this->user_slug_override[ $login ]; + } + + $userdata = array( + 'user_login' => sanitize_user( $login, true ), + 'user_pass' => wp_generate_password(), + ); + + $allowed = array( + 'user_email' => true, + 'display_name' => true, + 'first_name' => true, + 'last_name' => true, + ); + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $userdata[ $key ] = $data[ $key ]; + } + + $user_id = wp_insert_user( wp_slash( $userdata ) ); + if ( is_wp_error( $user_id ) ) { + $this->logger->error( sprintf( + __( 'Failed to import user "%s"', 'wordpress-importer' ), + $userdata['user_login'] + ) ); + $this->logger->debug( $user_id->get_error_message() ); + + /** + * User processing failed. + * + * @param WP_Error $user_id Error object. + * @param array $userdata Raw data imported for the user. + */ + do_action( 'wxr_importer.process_failed.user', $user_id, $userdata ); + return false; + } + + if ( $original_id ) { + $this->mapping['user'][ $original_id ] = $user_id; + } + $this->mapping['user_slug'][ $original_slug ] = $user_id; + + $this->logger->info( sprintf( + __( 'Imported user "%s"', 'wordpress-importer' ), + $userdata['user_login'] + ) ); + $this->logger->debug( sprintf( + __( 'User %d remapped to %d', 'wordpress-importer' ), + $original_id, + $user_id + ) ); + + // TODO: Implement meta handling once WXR includes it + /** + * User processing completed. + * + * @param int $user_id New user ID. + * @param array $userdata Raw data imported for the user. + */ + do_action( 'wxr_importer.processed.user', $user_id, $userdata ); + } + + protected function parse_term_node( $node, $type = 'term' ) { + $data = array(); + $meta = array(); + + $tag_name = array( + 'id' => 'wp:term_id', + 'taxonomy' => 'wp:term_taxonomy', + 'slug' => 'wp:term_slug', + 'parent' => 'wp:term_parent', + 'name' => 'wp:term_name', + 'description' => 'wp:term_description', + ); + $taxonomy = null; + + // Special casing! + switch ( $type ) { + case 'category': + $tag_name['slug'] = 'wp:category_nicename'; + $tag_name['parent'] = 'wp:category_parent'; + $tag_name['name'] = 'wp:cat_name'; + $tag_name['description'] = 'wp:category_description'; + $tag_name['taxonomy'] = null; + + $data['taxonomy'] = 'category'; + break; + + case 'tag': + $tag_name['slug'] = 'wp:tag_slug'; + $tag_name['parent'] = null; + $tag_name['name'] = 'wp:tag_name'; + $tag_name['description'] = 'wp:tag_description'; + $tag_name['taxonomy'] = null; + + $data['taxonomy'] = 'post_tag'; + break; + } + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + $key = array_search( $child->tagName, $tag_name ); + if ( $key ) { + $data[ $key ] = $child->textContent; + } + } + + if ( empty( $data['taxonomy'] ) ) { + return null; + } + + // Compatibility with WXR 1.0 + if ( $data['taxonomy'] === 'tag' ) { + $data['taxonomy'] = 'post_tag'; + } + + return compact( 'data', 'meta' ); + } + + protected function process_term( $data, $meta ) { + /** + * Pre-process term data. + * + * @param array $data Term data. (Return empty to skip.) + * @param array $meta Meta data. + */ + $data = apply_filters( 'wxr_importer.pre_process.term', $data, $meta ); + if ( empty( $data ) ) { + return false; + } + + $original_id = isset( $data['id'] ) ? (int) $data['id'] : 0; + $parent_id = isset( $data['parent'] ) ? (int) $data['parent'] : 0; + + $mapping_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + $existing = $this->term_exists( $data ); + if ( $existing ) { + + /** + * Term processing already imported. + * + * @param array $data Raw data imported for the term. + */ + do_action( 'wxr_importer.process_already_imported.term', $data ); + + $this->mapping['term'][ $mapping_key ] = $existing; + $this->mapping['term_id'][ $original_id ] = $existing; + return false; + } + + // WP really likes to repeat itself in export files + if ( isset( $this->mapping['term'][ $mapping_key ] ) ) { + return false; + } + + $termdata = array(); + $allowed = array( + 'slug' => true, + 'description' => true, + ); + + // Map the parent comment, or mark it as one we need to fix + // TODO: add parent mapping and remapping + /*$requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['term'][ $parent_id ] ) ) { + $data['parent'] = $this->mapping['term'][ $parent_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + // Wipe the parent for now + $data['parent'] = 0; + } + }*/ + + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $termdata[ $key ] = $data[ $key ]; + } + + $result = wp_insert_term( $data['name'], $data['taxonomy'], $termdata ); + if ( is_wp_error( $result ) ) { + $this->logger->warning( sprintf( + __( 'Failed to import %s %s', 'wordpress-importer' ), + $data['taxonomy'], + $data['name'] + ) ); + $this->logger->debug( $result->get_error_message() ); + do_action( 'wp_import_insert_term_failed', $result, $data ); + + /** + * Term processing failed. + * + * @param WP_Error $result Error object. + * @param array $data Raw data imported for the term. + * @param array $meta Meta data supplied for the term. + */ + do_action( 'wxr_importer.process_failed.term', $result, $data, $meta ); + return false; + } + + $term_id = $result['term_id']; + + $this->mapping['term'][ $mapping_key ] = $term_id; + $this->mapping['term_id'][ $original_id ] = $term_id; + + $this->logger->info( sprintf( + __( 'Imported "%s" (%s)', 'wordpress-importer' ), + $data['name'], + $data['taxonomy'] + ) ); + $this->logger->debug( sprintf( + __( 'Term %d remapped to %d', 'wordpress-importer' ), + $original_id, + $term_id + ) ); + + do_action( 'wp_import_insert_term', $term_id, $data ); + + /** + * Term processing completed. + * + * @param int $term_id New term ID. + * @param array $data Raw data imported for the term. + */ + do_action( 'wxr_importer.processed.term', $term_id, $data ); + } + + /** + * Attempt to download a remote file attachment + * + * @param string $url URL of item to fetch + * @param array $post Attachment details + * @return array|WP_Error Local file location details on success, WP_Error otherwise + */ + protected function fetch_remote_file( $url, $post ) { + // extract the file name and extension from the url + $file_name = basename( $url ); + + // get placeholder file in the upload dir with a unique, sanitized filename + $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); + if ( $upload['error'] ) { + return new \WP_Error( 'upload_dir_error', $upload['error'] ); + } + + // fetch the remote url and write it to the placeholder file + $response = wp_remote_get( $url, array( + 'stream' => true, + 'filename' => $upload['file'], + ) ); + + // request failed + if ( is_wp_error( $response ) ) { + unlink( $upload['file'] ); + return $response; + } + + $code = (int) wp_remote_retrieve_response_code( $response ); + + // make sure the fetch was successful + if ( $code !== 200 ) { + unlink( $upload['file'] ); + return new \WP_Error( + 'import_file_error', + sprintf( + __( 'Remote server returned %1$d %2$s for %3$s', 'wordpress-importer' ), + $code, + get_status_header_desc( $code ), + $url + ) + ); + } + + $filesize = filesize( $upload['file'] ); + $headers = wp_remote_retrieve_headers( $response ); + + if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) { + unlink( $upload['file'] ); + return new \WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) ); + } + + if ( 0 === $filesize ) { + unlink( $upload['file'] ); + return new \WP_Error( 'import_file_error', __( 'Zero size file downloaded', 'wordpress-importer' ) ); + } + + $max_size = (int) $this->max_attachment_size(); + if ( ! empty( $max_size ) && $filesize > $max_size ) { + unlink( $upload['file'] ); + $message = sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), size_format( $max_size ) ); + return new \WP_Error( 'import_file_error', $message ); + } + + return $upload; + } + + protected function post_process() { + // Time to tackle any left-over bits + if ( ! empty( $this->requires_remapping['post'] ) ) { + $this->post_process_posts( $this->requires_remapping['post'] ); + } + if ( ! empty( $this->requires_remapping['comment'] ) ) { + $this->post_process_comments( $this->requires_remapping['comment'] ); + } + } + + protected function post_process_posts( $todo ) { + foreach ( $todo as $post_id => $_ ) { + $this->logger->debug( sprintf( + // Note: title intentionally not used to skip extra processing + // for when debug logging is off + __( 'Running post-processing for post %d', 'wordpress-importer' ), + $post_id + ) ); + + $data = array(); + + $parent_id = get_post_meta( $post_id, '_wxr_import_parent', true ); + if ( ! empty( $parent_id ) ) { + // Have we imported the parent now? + if ( isset( $this->mapping['post'][ $parent_id ] ) ) { + $data['post_parent'] = $this->mapping['post'][ $parent_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the post parent for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with parent %d, but could not be found', 'wordpress-importer' ), + $post_id, + $parent_id + ) ); + } + } + + $author_slug = get_post_meta( $post_id, '_wxr_import_user_slug', true ); + if ( ! empty( $author_slug ) ) { + // Have we imported the user now? + if ( isset( $this->mapping['user_slug'][ $author_slug ] ) ) { + $data['post_author'] = $this->mapping['user_slug'][ $author_slug ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the author for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with author "%s", but could not be found', 'wordpress-importer' ), + $post_id, + $author_slug + ) ); + } + } + + $has_attachments = get_post_meta( $post_id, '_wxr_import_has_attachment_refs', true ); + if ( ! empty( $has_attachments ) ) { + $post = get_post( $post_id ); + $content = $post->post_content; + + // Replace all the URLs we've got + $new_content = str_replace( array_keys( $this->url_remap ), $this->url_remap, $content ); + if ( $new_content !== $content ) { + $data['post_content'] = $new_content; + } + } + + if ( get_post_type( $post_id ) === 'nav_menu_item' ) { + $this->post_process_menu_item( $post_id ); + } + + // Do we have updates to make? + if ( empty( $data ) ) { + $this->logger->debug( sprintf( + __( 'Post %d was marked for post-processing, but none was required.', 'wordpress-importer' ), + $post_id + ) ); + continue; + } + + // Run the update + $data['ID'] = $post_id; + + if ( isset( $data['post_content'] ) ) { + $data['post_content'] = wp_slash( $data['post_content'] ); + } + + $result = wp_update_post( $data, true ); + + if ( is_wp_error( $result ) ) { + $this->logger->warning( sprintf( + __( 'Could not update "%s" (post #%d) with mapped data', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( $result->get_error_message() ); + continue; + } + + // Clear out our temporary meta keys + delete_post_meta( $post_id, '_wxr_import_parent' ); + delete_post_meta( $post_id, '_wxr_import_user_slug' ); + delete_post_meta( $post_id, '_wxr_import_has_attachment_refs' ); + } + } + + protected function post_process_menu_item( $post_id ) { + $menu_object_id = get_post_meta( $post_id, '_wxr_import_menu_item', true ); + if ( empty( $menu_object_id ) ) { + // No processing needed! + return; + } + + $menu_item_type = get_post_meta( $post_id, '_menu_item_type', true ); + switch ( $menu_item_type ) { + case 'taxonomy': + if ( isset( $this->mapping['term_id'][ $menu_object_id ] ) ) { + $menu_object = $this->mapping['term_id'][ $menu_object_id ]; + } + break; + + case 'post_type': + if ( isset( $this->mapping['post'][ $menu_object_id ] ) ) { + $menu_object = $this->mapping['post'][ $menu_object_id ]; + } + break; + + default: + // Cannot handle this. + return; + } + + if ( ! empty( $menu_object ) ) { + update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $menu_object ) ); + } else { + $this->logger->warning( sprintf( + __( 'Could not find the menu object for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with object "%d" of type "%s", but could not be found', 'wordpress-importer' ), + $post_id, + $menu_object_id, + $menu_item_type + ) ); + } + + delete_post_meta( $post_id, '_wxr_import_menu_item' ); + } + + + protected function post_process_comments( $todo ) { + foreach ( $todo as $comment_id => $_ ) { + $data = array(); + + $parent_id = get_comment_meta( $comment_id, '_wxr_import_parent', true ); + if ( ! empty( $parent_id ) ) { + // Have we imported the parent now? + if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { + $data['comment_parent'] = $this->mapping['comment'][ $parent_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the comment parent for comment #%d', 'wordpress-importer' ), + $comment_id + ) ); + $this->logger->debug( sprintf( + __( 'Comment %d was imported with parent %d, but could not be found', 'wordpress-importer' ), + $comment_id, + $parent_id + ) ); + } + } + + $author_id = get_comment_meta( $comment_id, '_wxr_import_user', true ); + if ( ! empty( $author_id ) ) { + // Have we imported the user now? + if ( isset( $this->mapping['user'][ $author_id ] ) ) { + $data['user_id'] = $this->mapping['user'][ $author_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the author for comment #%d', 'wordpress-importer' ), + $comment_id + ) ); + $this->logger->debug( sprintf( + __( 'Comment %d was imported with author %d, but could not be found', 'wordpress-importer' ), + $comment_id, + $author_id + ) ); + } + } + + // Do we have updates to make? + if ( empty( $data ) ) { + continue; + } + + // Run the update + $data['comment_ID'] = $comment_ID; + $result = wp_update_comment( wp_slash( $data ) ); + if ( empty( $result ) ) { + $this->logger->warning( sprintf( + __( 'Could not update comment #%d with mapped data', 'wordpress-importer' ), + $comment_id + ) ); + continue; + } + + // Clear out our temporary meta keys + delete_comment_meta( $comment_id, '_wxr_import_parent' ); + delete_comment_meta( $comment_id, '_wxr_import_user' ); + } + } + + /** + * Use stored mapping information to update old attachment URLs + */ + protected function replace_attachment_urls_in_content() { + global $wpdb; + // make sure we do the longest urls first, in case one is a substring of another + uksort( $this->url_remap, array( $this, 'cmpr_strlen' ) ); + + foreach ( $this->url_remap as $from_url => $to_url ) { + // remap urls in post_content + $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ); + $wpdb->query( $query ); + + // remap enclosure urls + $query = $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ); + $result = $wpdb->query( $query ); + } + } + + /** + * Update _thumbnail_id meta to new, imported attachment IDs + */ + function remap_featured_images() { + + if ( empty( $this->featured_images ) ) { + return; + } + + // cycle through posts that have a featured image + $this->logger->info( 'Starting remapping of featured images' ); + + foreach ( $this->featured_images as $post_id => $value ) { + if ( isset( $this->mapping['post'][ $value ] ) ) { + $new_id = $this->mapping['post'][ $value ]; + + // only update if there's a difference + if ( $new_id !== $value ) { + $this->logger->info( sprintf( 'Remapping featured image ID %d to new ID %d for post ID %d',$value, $new_id, $post_id ) ); + update_post_meta( $post_id, '_thumbnail_id', $new_id ); + } + } + } + } + + /** + * Decide if the given meta key maps to information we will want to import + * + * @param string $key The meta key to check + * @return string|bool The key if we do want to import, false if not + */ + public function is_valid_meta_key( $key ) { + // skip attachment metadata since we'll regenerate it from scratch + // skip _edit_lock as not relevant for import + if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) { + return false; + } + + return $key; + } + + /** + * Decide what the maximum file size for downloaded attachments is. + * Default is 0 (unlimited), can be filtered via import_attachment_size_limit + * + * @return int Maximum attachment file size to import + */ + protected function max_attachment_size() { + return apply_filters( 'import_attachment_size_limit', 0 ); + } + + /** + * Added to http_request_timeout filter to force timeout at 60 seconds during import + * + * @access protected + * @return int 60 + */ + function bump_request_timeout($val) { + return 60; + } + + // return the difference in length between two strings + function cmpr_strlen( $a, $b ) { + return strlen( $b ) - strlen( $a ); + } + + /** + * Prefill existing post data. + * + * This preloads all GUIDs into memory, allowing us to avoid hitting the + * database when we need to check for existence. With larger imports, this + * becomes prohibitively slow to perform SELECT queries on each. + * + * By preloading all this data into memory, it's a constant-time lookup in + * PHP instead. However, this does use a lot more memory, so for sites doing + * small imports onto a large site, it may be a better tradeoff to use + * on-the-fly checking instead. + */ + protected function prefill_existing_posts() { + global $wpdb; + $posts = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts}" ); + + foreach ( $posts as $item ) { + $this->exists['post'][ $item->guid ] = $item->ID; + } + } + + /** + * Does the post exist? + * + * @param array $data Post data to check against. + * @return int|bool Existing post ID if it exists, false otherwise. + */ + protected function post_exists( $data ) { + // Constant-time lookup if we prefilled + $exists_key = $data['guid']; + + $exists = null; + + if ( $this->options['prefill_existing_posts'] ) { + // Sites: fix for custom post types. The guids in the prefilled section are escaped, so these ones should be as well. + $exists_key = htmlentities( $exists_key ); + $exists = isset( $this->exists['post'][ $exists_key ] ) ? $this->exists['post'][ $exists_key ] : false; + } else if ( isset( $this->exists['post'][ $exists_key ] ) ) { + // No prefilling, but might have already handled it + $exists = $this->exists['post'][ $exists_key ]; + } else { + // Still nothing, try post_exists, and cache it + $exists = post_exists( $data['post_title'], $data['post_content'], $data['post_date'] ); + } + + /** + * Filter ID of the existing post corresponding to post currently importing. + * + * Return 0 to force the post to be imported. Filter the ID to be something else + * to override which existing post is mapped to the imported post. + * + * @see post_exists() + * + * @param int $post_exists Post ID, or 0 if post did not exist. + * @param array $data The post array to be inserted. + */ + $exists = apply_filters( 'wp_import_existing_post', $exists, $data ); + + $this->exists['post'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the post as existing. + * + * @param array $data Post data to mark as existing. + * @param int $post_id Post ID. + */ + protected function mark_post_exists( $data, $post_id ) { + $exists_key = $data['guid']; + $this->exists['post'][ $exists_key ] = $post_id; + } + + /** + * Prefill existing comment data. + * + * @see self::prefill_existing_posts() for justification of why this exists. + */ + protected function prefill_existing_comments() { + global $wpdb; + $posts = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_date FROM {$wpdb->comments}" ); + + foreach ( $posts as $item ) { + $exists_key = sha1( $item->comment_author . ':' . $item->comment_date ); + $this->exists['comment'][ $exists_key ] = $item->comment_ID; + } + } + + /** + * Does the comment exist? + * + * @param array $data Comment data to check against. + * @return int|bool Existing comment ID if it exists, false otherwise. + */ + protected function comment_exists( $data ) { + $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); + + // Constant-time lookup if we prefilled + if ( $this->options['prefill_existing_comments'] ) { + return isset( $this->exists['comment'][ $exists_key ] ) ? $this->exists['comment'][ $exists_key ] : false; + } + + // No prefilling, but might have already handled it + if ( isset( $this->exists['comment'][ $exists_key ] ) ) { + return $this->exists['comment'][ $exists_key ]; + } + + // Still nothing, try comment_exists, and cache it + $exists = comment_exists( $data['comment_author'], $data['comment_date'] ); + $this->exists['comment'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the comment as existing. + * + * @param array $data Comment data to mark as existing. + * @param int $comment_id Comment ID. + */ + protected function mark_comment_exists( $data, $comment_id ) { + $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); + $this->exists['comment'][ $exists_key ] = $comment_id; + } + + /** + * Prefill existing term data. + * + * @see self::prefill_existing_posts() for justification of why this exists. + */ + protected function prefill_existing_terms() { + global $wpdb; + $query = "SELECT t.term_id, tt.taxonomy, t.slug FROM {$wpdb->terms} AS t"; + $query .= " JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id"; + $terms = $wpdb->get_results( $query ); + + foreach ( $terms as $item ) { + $exists_key = sha1( $item->taxonomy . ':' . $item->slug ); + $this->exists['term'][ $exists_key ] = $item->term_id; + } + } + + /** + * Does the term exist? + * + * @param array $data Term data to check against. + * @return int|bool Existing term ID if it exists, false otherwise. + */ + protected function term_exists( $data ) { + $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + + // Constant-time lookup if we prefilled + if ( $this->options['prefill_existing_terms'] ) { + return isset( $this->exists['term'][ $exists_key ] ) ? $this->exists['term'][ $exists_key ] : false; + } + + // No prefilling, but might have already handled it + if ( isset( $this->exists['term'][ $exists_key ] ) ) { + return $this->exists['term'][ $exists_key ]; + } + + // Still nothing, try comment_exists, and cache it + $exists = term_exists( $data['slug'], $data['taxonomy'] ); + if ( is_array( $exists ) ) { + $exists = $exists['term_id']; + } + + $this->exists['term'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the term as existing. + * + * @param array $data Term data to mark as existing. + * @param int $term_id Term ID. + */ + protected function mark_term_exists( $data, $term_id ) { + $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + $this->exists['term'][ $exists_key ] = $term_id; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php new file mode 100644 index 00000000..3b90e405 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/content-spacing.php @@ -0,0 +1,244 @@ +add_section( + 'generate_spacing_content', + array( + 'title' => __( 'Content', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 10, + 'panel' => 'generate_spacing_panel', + ) +); + +// If we don't have a layout panel, use our old spacing section. +if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $content_section = 'generate_layout_container'; +} else { + $content_section = 'generate_spacing_content'; +} + +// Take control of the container width control. +// This control is handled by the free theme, but we take control of it here for consistency between control styles. +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[container_width]', + array( + 'label' => __( 'Container Width', 'gp-premium' ), + 'section' => 'generate_layout_container', + 'settings' => array( + 'desktop' => 'generate_settings[container_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 700, + 'max' => 2000, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 0, + ) + ) +); + +// Separating space. +$wp_customize->add_setting( + 'generate_spacing_settings[separator]', + array( + 'default' => $defaults['separator'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[separator]', + array( + 'label' => __( 'Separating Space', 'gp-premium' ), + 'section' => $content_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[separator]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) +); + +// Content padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[content_top]', + array( + 'default' => $defaults['content_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Content padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[content_right]', + array( + 'default' => $defaults['content_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Content padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[content_bottom]', + array( + 'default' => $defaults['content_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Content padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[content_left]', + array( + 'default' => $defaults['content_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$content_padding_settings = array( + 'desktop_top' => 'generate_spacing_settings[content_top]', + 'desktop_right' => 'generate_spacing_settings[content_right]', + 'desktop_bottom' => 'generate_spacing_settings[content_bottom]', + 'desktop_left' => 'generate_spacing_settings[content_left]', +); + +// If mobile_content_top is set, the rest of them are too. +// We have to check as these defaults are set in the theme. +if ( isset( $defaults['mobile_content_top'] ) ) { + $content_padding_settings['mobile_top'] = 'generate_spacing_settings[mobile_content_top]'; + $content_padding_settings['mobile_right'] = 'generate_spacing_settings[mobile_content_right]'; + $content_padding_settings['mobile_bottom'] = 'generate_spacing_settings[mobile_content_bottom]'; + $content_padding_settings['mobile_left'] = 'generate_spacing_settings[mobile_content_left]'; + + // Mobile content padding top. + $wp_customize->add_setting( + 'generate_spacing_settings[mobile_content_top]', + array( + 'default' => $defaults['mobile_content_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + // Content padding right. + $wp_customize->add_setting( + 'generate_spacing_settings[mobile_content_right]', + array( + 'default' => $defaults['mobile_content_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + // Content padding bottom. + $wp_customize->add_setting( + 'generate_spacing_settings[mobile_content_bottom]', + array( + 'default' => $defaults['mobile_content_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + // Content padding left. + $wp_customize->add_setting( + 'generate_spacing_settings[mobile_content_left]', + array( + 'default' => $defaults['mobile_content_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); +} + +// Make use of the content padding settings. +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'content_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Content Padding', 'gp-premium' ), + 'section' => $content_section, + 'settings' => $content_padding_settings, + 'element' => 'content', + 'priority' => 99, + ) + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[content_element_separator]', + array( + 'default' => $defaults['content_element_separator'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[content_element_separator]', + array( + 'label' => __( 'Content Separator', 'gp-premium' ), + 'sub_description' => __( 'The content separator controls the space between the featured image, title, content and entry meta.', 'gp-premium' ), + 'section' => $content_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[content_element_separator]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 10, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) +); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php new file mode 100644 index 00000000..3ffc54af --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php @@ -0,0 +1,207 @@ +add_section( + 'generate_spacing_footer', + array( + 'title' => __( 'Footer', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 20, + 'panel' => 'generate_spacing_panel', + ) +); + +// Use our layout panel if it exists. +if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $footer_section = 'generate_layout_footer'; +} else { + $footer_section = 'generate_spacing_footer'; +} + +// Footer widget area padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_widget_container_top]', + array( + 'default' => $defaults['footer_widget_container_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_widget_container_right]', + array( + 'default' => $defaults['footer_widget_container_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_widget_container_bottom]', + array( + 'default' => $defaults['footer_widget_container_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_widget_container_left]', + array( + 'default' => $defaults['footer_widget_container_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_footer_widget_container_top]', + array( + 'default' => $defaults['mobile_footer_widget_container_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_footer_widget_container_right]', + array( + 'default' => $defaults['mobile_footer_widget_container_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_footer_widget_container_bottom]', + array( + 'default' => $defaults['mobile_footer_widget_container_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer widget area padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_footer_widget_container_left]', + array( + 'default' => $defaults['mobile_footer_widget_container_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Make use of the Footer widget area padding settings. +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'footer_widget_area_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Footer Widget Area Padding', 'gp-premium' ), + 'section' => $footer_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[footer_widget_container_top]', + 'desktop_right' => 'generate_spacing_settings[footer_widget_container_right]', + 'desktop_bottom' => 'generate_spacing_settings[footer_widget_container_bottom]', + 'desktop_left' => 'generate_spacing_settings[footer_widget_container_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_footer_widget_container_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_footer_widget_container_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_footer_widget_container_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_footer_widget_container_left]', + ), + 'element' => 'footer_widget_area', + 'priority' => 99, + ) + ) +); + +// Footer padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_top]', + array( + 'default' => $defaults['footer_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_right]', + array( + 'default' => $defaults['footer_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_bottom]', + array( + 'default' => $defaults['footer_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Footer padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[footer_left]', + array( + 'default' => $defaults['footer_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Make use of the footer padding settings. +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'footer_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Footer Padding', 'gp-premium' ), + 'section' => $footer_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[footer_top]', + 'desktop_right' => 'generate_spacing_settings[footer_right]', + 'desktop_bottom' => 'generate_spacing_settings[footer_bottom]', + 'desktop_left' => 'generate_spacing_settings[footer_left]', + ), + 'element' => 'footer', + 'priority' => 105, + ) + ) +); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php new file mode 100644 index 00000000..f937d91b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/header-spacing.php @@ -0,0 +1,135 @@ +add_section( + 'generate_spacing_header', + array( + 'title' => __( 'Header', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 5, + 'panel' => 'generate_spacing_panel', + ) +); + +// If we don't have a layout panel, use our old spacing section. +$header_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_header' : 'generate_spacing_header'; + +// Header top. +$wp_customize->add_setting( + 'generate_spacing_settings[header_top]', + array( + 'default' => $defaults['header_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header right. +$wp_customize->add_setting( + 'generate_spacing_settings[header_right]', + array( + 'default' => $defaults['header_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[header_bottom]', + array( + 'default' => $defaults['header_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header left. +$wp_customize->add_setting( + 'generate_spacing_settings[header_left]', + array( + 'default' => $defaults['header_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_header_top]', + array( + 'default' => $defaults['mobile_header_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header right. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_header_right]', + array( + 'default' => $defaults['mobile_header_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_header_bottom]', + array( + 'default' => $defaults['mobile_header_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Header left. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_header_left]', + array( + 'default' => $defaults['mobile_header_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Do something with our header controls. +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'header_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Header Padding', 'gp-premium' ), + 'section' => $header_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[header_top]', + 'desktop_right' => 'generate_spacing_settings[header_right]', + 'desktop_bottom' => 'generate_spacing_settings[header_bottom]', + 'desktop_left' => 'generate_spacing_settings[header_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_header_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_header_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_header_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_header_left]', + ), + 'element' => 'header', + ) + ) +); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js new file mode 100644 index 00000000..966c3eaa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/js/customizer.js @@ -0,0 +1,661 @@ +function generate_spacing_live_update( name, id, selector, property, negative, divide, media, unit ) { + settings = typeof settings !== 'undefined' ? settings : 'generate_spacing_settings'; + wp.customize( settings + '[' + id + ']', function( value ) { + value.bind( function( newval ) { + negative = typeof negative !== 'undefined' ? negative : false; + media = typeof media !== 'undefined' ? media : ''; + divide = typeof divide !== 'undefined' ? divide : false; + unit = typeof unit !== 'undefined' ? unit : 'px'; + + // Get new value + newval = ( divide ) ? newval / 2 : newval; + + // Check if negative integer + negative = ( negative ) ? '-' : ''; + + var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, + isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; + + if ( isTablet ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'tablet_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( isMobile ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'mobile_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + // We're using a desktop value + if ( ! isTablet && ! isMobile ) { + + var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', + mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; + + // The tablet setting exists, mobile doesn't + if ( '' !== tabletValue && '' == mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.mobile; + } + + // The tablet setting doesn't exist, mobile does + if ( '' == tabletValue && '' !== mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.tablet; + } + + // The tablet setting doesn't exist, neither does mobile + if ( '' == tabletValue && '' == mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.tablet + ', ' + gp_spacing.mobile; + } + + } + + // Check if media query + media_query = ( '' !== media ) ? 'media="' + media + '"' : ''; + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + name ).not( ':last' ).remove(); + }, 50 ); + + jQuery('body').trigger('generate_spacing_updated'); + } ); + } ); +} + +/** + * Top bar padding + */ +generate_spacing_live_update( 'top_bar_top', 'top_bar_top', '.inside-top-bar', 'padding-top' ); +generate_spacing_live_update( 'top_bar_right', 'top_bar_right', '.inside-top-bar', 'padding-right' ); +generate_spacing_live_update( 'top_bar_bottom', 'top_bar_bottom', '.inside-top-bar', 'padding-bottom' ); +generate_spacing_live_update( 'top_bar_left', 'top_bar_left', '.inside-top-bar', 'padding-left' ); + +/** + * Header padding + */ +generate_spacing_live_update( 'header_top', 'header_top', '.inside-header', 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_right', 'header_right', '.inside-header', 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_bottom', 'header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_left', 'header_left', '.inside-header', 'padding-left', false, false, gp_spacing.desktop ); + +generate_spacing_live_update( 'mobile_header_top', 'mobile_header_top', '.inside-header', 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_right', 'mobile_header_right', '.inside-header', 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_bottom', 'mobile_header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_left', 'mobile_header_left', '.inside-header', 'padding-left', false, false, gp_spacing.mobile ); + +jQuery( window ).on( 'load', function() { + var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ); + + if ( gp_spacing.isFlex && containerAlignment && 'text' === containerAlignment.get() ) { + generate_spacing_live_update( 'header_left_sticky_nav', 'header_left', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'header_right_sticky_nav', 'header_right', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.desktop ); + + generate_spacing_live_update( 'mobile_header_left_sticky_nav', 'mobile_header_left', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_header_right_sticky_nav', 'mobile_header_right', '.main-navigation.navigation-stick:not(.has-branding) .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.mobile ); + } +} ); + +/** + * Content padding + */ +var content_areas = '.separate-containers .inside-article, \ + .separate-containers .comments-area, \ + .separate-containers .page-header, \ + .separate-containers .paging-navigation, \ + .one-container .site-content, \ + .inside-page-header, \ + .wp-block-group__inner-container'; + +generate_spacing_live_update( 'content_top', 'content_top', content_areas, 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_right', 'content_right', content_areas, 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_bottom', 'content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_left', 'content_left', content_areas, 'padding-left', false, false, gp_spacing.desktop ); + +jQuery( window ).on( 'load', function() { + var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ); + + if ( gp_spacing.isFlex && containerAlignment && 'text' === containerAlignment.get() ) { + generate_spacing_live_update( 'content_left_nav_as_header', 'content_left', '.main-navigation.has-branding .inside-navigation.grid-container, .main-navigation.has-branding .inside-navigation.grid-container', 'padding-left', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'content_right_nav_as_header', 'content_right', '.main-navigation.has-branding .inside-navigation.grid-container, .main-navigation.has-branding .inside-navigation.grid-container', 'padding-right', false, false, gp_spacing.desktop ); + } +} ); + +generate_spacing_live_update( 'one_container_post_content_bottom', 'content_bottom', '.one-container.archive .post:not(:last-child):not(.is-loop-template-item),.one-container.blog .post:not(:last-child):not(.is-loop-template-item)', 'padding-bottom' ); + +/* Mobile content padding */ +generate_spacing_live_update( 'mobile_content_top', 'mobile_content_top', content_areas, 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_right', 'mobile_content_right', content_areas, 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_bottom', 'mobile_content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_left', 'mobile_content_left', content_areas, 'padding-left', false, false, gp_spacing.mobile ); + +generate_spacing_live_update( 'content-margin-right', 'content_right', '.one-container.right-sidebar .site-main,.one-container.both-right .site-main', 'margin-right' ); +generate_spacing_live_update( 'content-margin-left', 'content_left', '.one-container.left-sidebar .site-main,.one-container.both-left .site-main', 'margin-left' ); +generate_spacing_live_update( 'content-margin-right-both', 'content_right', '.one-container.both-sidebars .site-main', 'margin-right' ); +generate_spacing_live_update( 'content-margin-left-both', 'content_left', '.one-container.both-sidebars .site-main', 'margin-left' ); + +/* Content element separator */ + +generate_spacing_live_update( 'content_element_separator_top', 'content_element_separator', '.post-image:not(:first-child), .page-content:not(:first-child), .entry-content:not(:first-child), .entry-summary:not(:first-child), footer.entry-meta', 'margin-top', false, false, false, 'em' ); +generate_spacing_live_update( 'content_element_separator_bottom', 'content_element_separator', '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image', 'margin-bottom', false, false, false, 'em' ); + +/** + * Featured image padding + */ +var featured_image_no_padding_x = '.post-image-below-header.post-image-aligned-center .no-featured-image-padding .post-image, \ + .post-image-below-header.post-image-aligned-center .no-featured-image-padding .featured-image'; + +generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.mobile ); + +var featured_image_no_padding_y = '.post-image-above-header.post-image-aligned-center .no-featured-image-padding .post-image, \ + .post-image-above-header.post-image-aligned-center .no-featured-image-padding .featured-image'; + +generate_spacing_live_update( 'featured_image_padding_top', 'content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_featured_image_padding_top', 'mobile_content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.mobile ); + +/** + * Main navigation spacing + */ +var menu_items = '.main-navigation .main-nav ul li a,\ + .main-navigation .menu-toggle,\ + .main-navigation .mobile-bar-items a,\ + .main-navigation .menu-bar-item > a'; + +// Menu item width +generate_spacing_live_update( 'menu_item_padding_left', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-left', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'menu_item_padding_right', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-right', false, false, gp_spacing.desktop ); + +// Tablet menu item width +//generate_spacing_live_update( 'tablet_menu_item_padding_left', 'tablet_menu_item', menu_items, 'padding-left', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_menu_item_padding_right', 'tablet_menu_item', menu_items, 'padding-right', false, false, gp_spacing.tablet ); + +// Mobile menu item width +generate_spacing_live_update( 'mobile_menu_item_padding_left', 'mobile_menu_item', '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a, .main-navigation .menu-bar-item > a', 'padding-left', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_menu_item_padding_right', 'mobile_menu_item', '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a, .main-navigation .menu-bar-item > a', 'padding-right', false, false, gp_spacing.mobile ); + +// Menu item height +generate_spacing_live_update( 'menu_item_height', 'menu_item_height', menu_items, 'line-height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'navigation_logo_height', 'menu_item_height', '.main-navigation .navigation-logo img, .main-navigation .site-logo img', 'height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_header_logo_height', 'menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.desktop ); + +//generate_spacing_live_update( 'tablet_menu_item_height', 'tablet_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_navigation_logo_height', 'tablet_menu_item_height', '.main-navigation .navigation-logo img', 'height', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_mobile_header_logo_height', 'tablet_menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.tablet ); + +generate_spacing_live_update( 'mobile_menu_item_height', 'mobile_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_navigation_logo_height', 'mobile_menu_item_height', '.main-navigation .site-logo.navigation-logo img, .main-navigation .site-logo img, .main-navigation .navigation-branding img', 'height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_mobile_header_logo_height', 'mobile_menu_item_height', '.mobile-header-navigation .site-logo.mobile-header-logo img', 'height', false, false, gp_spacing.mobile ); + +// Off canvas menu item height +wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + if ( '' == newval ) { + newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); + } + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#off_canvas_menu_item_height' ).not( ':last' ).remove(); + }, 200 ); + + } ); +} ); + +/** + * Main sub-navigation spacing + */ +generate_spacing_live_update( 'sub_menu_item_height_top', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-top' ); +generate_spacing_live_update( 'sub_menu_item_height_right', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_sub_menu_item_height_right', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.tablet ); +generate_spacing_live_update( 'sub_menu_item_height_bottom', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-bottom' ); +generate_spacing_live_update( 'sub_menu_item_height_left', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_sub_menu_item_height_left', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.tablet ); +generate_spacing_live_update( 'sub_menu_item_offset', 'menu_item_height', '.main-navigation ul ul', 'top' ); + +/** + * Main navigation RTL arrow spacing + */ +generate_spacing_live_update( 'dropdown_menu_arrow', 'menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_dropdown_menu_arrow', 'tablet_menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.tablet ); + +/** + * Main sub-navigation arrow spacing + */ +generate_spacing_live_update( 'dropdown_submenu_arrow_top', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-top' ); +generate_spacing_live_update( 'dropdown_submenu_arrow_bottom', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-bottom' ); +generate_spacing_live_update( 'dropdown_submenu_arrow_margin', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'margin-top', true ); + +/** + * Sub-Menu Width + */ +generate_spacing_live_update( 'sub_menu_width', 'sub_menu_width', '.main-navigation ul ul', 'width' ); + +/** + - * Sticky menu item height + - */ +wp.customize( 'generate_spacing_settings[sticky_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + if ( '' == newval ) { + newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); + } + + jQuery( 'head' ).append( '' ); + jQuery( 'head' ).append( '' ); + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#sticky_menu_item_height' ).not( ':last' ).remove(); + jQuery( 'style#sticky_menu_item_logo_height' ).not( ':last' ).remove(); + jQuery( 'style#sticky_menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +// Disable the transition while we resize +wp.customize( 'generate_spacing_settings[menu_item_height]', function( value ) { + value.bind( function( newval ) { + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#off_canvas_menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +/** + * Widget padding + */ +generate_spacing_live_update( 'widget_top', 'widget_top', '.widget-area .widget, .one-container .widget-area .widget', 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_right', 'widget_right', '.widget-area .widget, .one-container .widget-area .widget', 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_bottom', 'widget_bottom', '.widget-area .widget, .one-container .widget-area .widget', 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_left', 'widget_left', '.widget-area .widget, .one-container .widget-area .widget', 'padding-left', false, false, gp_spacing.desktop ); + +generate_spacing_live_update( 'mobile_widget_top', 'mobile_widget_top', '.widget-area .widget', 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_right', 'mobile_widget_right', '.widget-area .widget', 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_bottom', 'mobile_widget_bottom', '.widget-area .widget', 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_left', 'mobile_widget_left', '.widget-area .widget', 'padding-left', false, false, gp_spacing.mobile ); + + +if ( gp_spacing.isFlex ) { + /** + * Footer widget area + */ + generate_spacing_live_update( 'footer_widget_container_top', 'footer_widget_container_top', '.footer-widgets-container', 'padding-top', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_right', 'footer_widget_container_right', '.footer-widgets-container', 'padding-right', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_bottom', 'footer_widget_container_bottom', '.footer-widgets-container', 'padding-bottom', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_left', 'footer_widget_container_left', '.footer-widgets-container', 'padding-left', false, false, gp_spacing.desktop ); + + generate_spacing_live_update( 'mobile_footer_widget_container_top', 'mobile_footer_widget_container_top', '.footer-widgets-container', 'padding-top', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_right', 'mobile_footer_widget_container_right', '.footer-widgets-container', 'padding-right', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_bottom', 'mobile_footer_widget_container_bottom', '.footer-widgets-container', 'padding-bottom', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_left', 'mobile_footer_widget_container_left', '.footer-widgets-container', 'padding-left', false, false, gp_spacing.mobile ); + + /** + * Footer + */ + generate_spacing_live_update( 'footer_top', 'footer_top', '.inside-site-info', 'padding-top' ); + generate_spacing_live_update( 'footer_right', 'footer_right', '.inside-site-info', 'padding-right' ); + generate_spacing_live_update( 'footer_bottom', 'footer_bottom', '.inside-site-info', 'padding-bottom' ); + generate_spacing_live_update( 'footer_left', 'footer_left', '.inside-site-info', 'padding-left' ); +} else { + /** + * Footer widget area + */ + generate_spacing_live_update( 'footer_widget_container_top', 'footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_right', 'footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_bottom', 'footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.desktop ); + generate_spacing_live_update( 'footer_widget_container_left', 'footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.desktop ); + + generate_spacing_live_update( 'mobile_footer_widget_container_top', 'mobile_footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_right', 'mobile_footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_bottom', 'mobile_footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.mobile ); + generate_spacing_live_update( 'mobile_footer_widget_container_left', 'mobile_footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.mobile ); + + /** + * Footer + */ + generate_spacing_live_update( 'footer_top', 'footer_top', '.site-info', 'padding-top' ); + generate_spacing_live_update( 'footer_right', 'footer_right', '.site-info', 'padding-right' ); + generate_spacing_live_update( 'footer_bottom', 'footer_bottom', '.site-info', 'padding-bottom' ); + generate_spacing_live_update( 'footer_left', 'footer_left', '.site-info', 'padding-left' ); +} + + +/** + * Separator + */ + +/* Masonry */ +if ( jQuery( 'body' ).hasClass( 'masonry-enabled' ) ) { + generate_spacing_live_update( 'masonry_separator', 'separator', '.masonry-post .inside-article', 'margin-left' ); + generate_spacing_live_update( 'masonry_separator_bottom', 'separator', '.masonry-container > article', 'margin-bottom' ); + generate_spacing_live_update( 'masonry_separator_container', 'separator', '.masonry-container', 'margin-left', 'negative' ); + generate_spacing_live_update( 'masonry_separator_page_header_left', 'separator', '.masonry-enabled .page-header', 'margin-left' ); + generate_spacing_live_update( 'masonry_separator_page_header_bottom', 'separator', '.masonry-enabled .page-header', 'margin-bottom' ); + generate_spacing_live_update( 'masonry_separator_load_more', 'separator', '.separate-containers .site-main > .masonry-load-more', 'margin-bottom' ); +} + +/* Columns */ +if ( jQuery( 'body' ).hasClass( 'generate-columns-activated' ) ) { + generate_spacing_live_update( 'columns_bottom', 'separator', '.generate-columns', 'margin-bottom' ); + generate_spacing_live_update( 'columns_left', 'separator', '.generate-columns', 'padding-left' ); + generate_spacing_live_update( 'columns_container', 'separator', '.generate-columns-container', 'margin-left', 'negative' ); + generate_spacing_live_update( 'columns_page_header_bottom', 'separator', '.generate-columns-container .page-header', 'margin-bottom' ); + generate_spacing_live_update( 'columns_page_header_left', 'separator', '.generate-columns-container .page-header', 'margin-left' ); + generate_spacing_live_update( 'columns_pagination', 'separator', '.separate-containers .generate-columns-container > .paging-navigation', 'margin-left' ); +} + +/* Right sidebar */ +if ( jQuery( 'body' ).hasClass( 'right-sidebar' ) ) { + generate_spacing_live_update( 'right_sidebar_sepatator_top', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'right_sidebar_sepatator_right', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-right' ); + generate_spacing_live_update( 'right_sidebar_sepatator_bottom', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-bottom' ); +} + +/* Left sidebar */ +if ( jQuery( 'body' ).hasClass( 'left-sidebar' ) ) { + generate_spacing_live_update( 'left_sidebar_sepatator_top', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'left_sidebar_sepatator_left', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-left' ); + generate_spacing_live_update( 'left_sidebar_sepatator_bottom', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-bottom' ); +} + +/* Both sidebars */ +if ( jQuery( 'body' ).hasClass( 'both-sidebars' ) ) { + generate_spacing_live_update( 'both_sidebars_sepatator', 'separator', '.both-sidebars.separate-containers .site-main', 'margin' ); +} + +/* Both sidebars right */ +if ( jQuery( 'body' ).hasClass( 'both-right' ) ) { + generate_spacing_live_update( 'both_right_sidebar_sepatator_top', 'separator', '.both-right.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'both_right_sidebar_sepatator_right', 'separator', '.both-right.separate-containers .site-main', 'margin-right' ); + generate_spacing_live_update( 'both_right_sidebar_sepatator_bottom', 'separator', '.both-right.separate-containers .site-main', 'margin-bottom' ); + + if ( gp_spacing.isFlex ) { + generate_spacing_live_update( 'both_right_left_sidebar', 'separator', '.both-right .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_right_right_sidebar', 'separator', '.both-right .inside-right-sidebar', 'margin-left', false, true ); + } else { + generate_spacing_live_update( 'both_right_left_sidebar', 'separator', '.both-right.separate-containers .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_right_right_sidebar', 'separator', '.both-right.separate-containers .inside-right-sidebar', 'margin-left', false, true ); + } +} + +/* Both sidebars left */ +if ( jQuery( 'body' ).hasClass( 'both-left' ) ) { + generate_spacing_live_update( 'both_left_sidebar_sepatator_top', 'separator', '.both-left.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'both_left_sidebar_sepatator_right', 'separator', '.both-left.separate-containers .site-main', 'margin-bottom' ); + generate_spacing_live_update( 'both_left_sidebar_sepatator_bottom', 'separator', '.both-left.separate-containers .site-main', 'margin-left' ); + + if ( gp_spacing.isFlex ) { + generate_spacing_live_update( 'both_left_left_sidebar', 'separator', '.both-left .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_left_right_sidebar', 'separator', '.both-left .inside-right-sidebar', 'margin-left', false, true ); + } else { + generate_spacing_live_update( 'both_left_left_sidebar', 'separator', '.both-left.separate-containers .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_left_right_sidebar', 'separator', '.both-left.separate-containers .inside-right-sidebar', 'margin-left', false, true ); + } +} + +/* Main element margin */ +generate_spacing_live_update( 'site_main_separator_top', 'separator', '.separate-containers .site-main', 'margin-top' ); +generate_spacing_live_update( 'site_main_separator_bottom', 'separator', '.separate-containers .site-main', 'margin-bottom' ); + +/* Page header element */ +if ( gp_spacing.isFlex ) { + generate_spacing_live_update( 'page_header_separator_top', 'separator', '.separate-containers .featured-image', 'margin-top' ); +} else { + generate_spacing_live_update( 'page_header_separator_top', 'separator', + '.separate-containers .page-header-image, \ + .separate-containers .page-header-contained, \ + .separate-containers .page-header-image-single, \ + .separate-containers .page-header-content-single', 'margin-top' ); +} + +/* Top and bottom sidebar margin */ +generate_spacing_live_update( 'right_sidebar_separator_top', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-top' ); +generate_spacing_live_update( 'right_sidebar_separator_bottom', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-bottom' ); + +/* Element separators */ +if ( gp_spacing.isFlex ) { + generate_spacing_live_update( 'content_separator', 'separator', + '.sidebar .widget, \ + .site-main > *, \ + .page-header, \ + .widget-area .main-navigation', 'margin-bottom' ); +} else { + generate_spacing_live_update( 'content_separator', 'separator', + '.separate-containers .widget, \ + .separate-containers .site-main > *, \ + .separate-containers .page-header, \ + .widget-area .main-navigation', 'margin-bottom' ); +} + +/** + * Right sidebar width + */ +wp.customize( 'generate_spacing_settings[right_sidebar_width]', function( value ) { + value.bind( function( newval ) { + var body = jQuery( 'body' ); + + if ( jQuery( '#right-sidebar' ).length ) { + if ( gp_spacing.isFlex ) { + var contentWidth = 100, + leftSidebar = jQuery( '#left-sidebar' ).length ? wp.customize.value('generate_spacing_settings[left_sidebar_width]')() : 0; + + if ( body.hasClass( 'right-sidebar' ) ) { + contentWidth = ( Number( contentWidth ) - Number( newval ) ); + } else if ( ! body.hasClass( 'left-sidebar' ) && ! body.hasClass( 'no-sidebar' ) ) { + var totalSidebarWidth = ( Number( leftSidebar ) + Number( newval ) ); + + contentWidth = ( Number( contentWidth ) - Number( totalSidebarWidth ) ); + } + + jQuery( 'head' ).append( '' ); + + setTimeout(function() { + jQuery( 'style#right_sidebar_width' ).not( ':last' ).remove(); + }, 200 ); + } else { + // Left sidebar width + var left_sidebar = ( jQuery( '#left-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[left_sidebar_width]')() : 0; + + // Right sidebar class + jQuery( "#right-sidebar" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); + + // Content area class + jQuery( ".content-area" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'grid-parent' ); + + if ( body.hasClass( 'both-sidebars' ) ) { + var content_width = ( 100 - newval - left_sidebar ); + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); + } + + if ( body.hasClass( 'both-left' ) ) { + var total_sidebar_width = ( parseInt( left_sidebar ) + parseInt( newval ) ); + + jQuery( '#right-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); + } + } + jQuery('body').trigger('generate_spacing_updated'); + } + } ); +} ); + +/** + * Left sidebar width + */ +wp.customize( 'generate_spacing_settings[left_sidebar_width]', function( value ) { + value.bind( function( newval ) { + var body = jQuery( 'body' ); + if ( jQuery( '#left-sidebar' ).length ) { + if ( gp_spacing.isFlex ) { + var contentWidth = 100, + rightSidebar = jQuery( '#right-sidebar' ).length ? wp.customize.value('generate_spacing_settings[right_sidebar_width]')() : 0; + + if ( body.hasClass( 'left-sidebar' ) ) { + contentWidth = ( Number( contentWidth ) - Number( newval ) ); + } else if ( ! body.hasClass( 'right-sidebar' ) && ! body.hasClass( 'no-sidebar' ) ) { + var totalSidebarWidth = ( Number( rightSidebar ) + Number( newval ) ); + + contentWidth = ( Number( contentWidth ) - Number( totalSidebarWidth ) ); + } + + jQuery( 'head' ).append( '' ); + + setTimeout(function() { + jQuery( 'style#left_sidebar_width' ).not( ':last' ).remove(); + }, 200 ); + } else { + // Right sidebar width + var right_sidebar = ( jQuery( '#right-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[right_sidebar_width]')() : 0; + + // Right sidebar class + jQuery( "#left-sidebar" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); + + // Content area class + jQuery( ".content-area" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'grid-parent' ); + + if ( body.hasClass( 'left-sidebar' ) ) { + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - newval ) ).addClass( 'tablet-pull-' + ( 100 - newval ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + newval ).addClass( 'tablet-push-' + newval ).addClass( 'grid-' + ( 100 - newval ) ).addClass( 'tablet-grid-' + ( 100 - newval ) ); + } + + if ( body.hasClass( 'both-sidebars' ) ) { + var content_width = ( 100 - newval - right_sidebar ); + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( newval ) ).addClass( 'tablet-push-' + ( newval ) ); + } + + if ( body.hasClass( 'both-left' ) ) { + var content_width = ( 100 - newval - right_sidebar ); + var total_sidebar_width = ( parseInt( right_sidebar ) + parseInt( newval ) ); + + jQuery( '#right-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); + } + } + jQuery('body').trigger('generate_spacing_updated'); + } + } ); +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php new file mode 100644 index 00000000..09884e67 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php @@ -0,0 +1,281 @@ +add_section( + 'generate_spacing_navigation', + array( + 'title' => __( 'Primary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 15, + 'panel' => 'generate_spacing_panel', + ) +); + +// If our new Layout section doesn't exist, use the old navigation section. +$navigation_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_navigation' : 'generate_spacing_navigation'; + +// Menu item width. +$wp_customize->add_setting( + 'generate_spacing_settings[menu_item]', + array( + 'default' => $defaults['menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_menu_item]', + array( + 'default' => $defaults['mobile_menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[menu_item]', + array( + 'label' => __( 'Menu Item Width', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[menu_item]', + 'mobile' => 'generate_spacing_settings[mobile_menu_item]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 220, + ) + ) +); + +// Menu item height. +$wp_customize->add_setting( + 'generate_spacing_settings[menu_item_height]', + array( + 'default' => $defaults['menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_menu_item_height]', + array( + 'default' => $defaults['mobile_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[menu_item_height]', + 'mobile' => 'generate_spacing_settings[mobile_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 240, + ) + ) +); + +// Sub-menu item height. +$wp_customize->add_setting( + 'generate_spacing_settings[sub_menu_item_height]', + array( + 'default' => $defaults['sub_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sub_menu_item_height]', + array( + 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sub_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 260, + ) + ) +); + +if ( isset( $defaults['sub_menu_width'] ) ) { + $wp_customize->add_setting( + 'generate_spacing_settings[sub_menu_width]', + array( + 'default' => $defaults['sub_menu_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sub_menu_width]', + array( + 'label' => __( 'Sub-Menu Width', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sub_menu_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 100, + 'max' => 500, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 265, + ) + ) + ); +} + +// Sticky menu height. +$wp_customize->add_setting( + 'generate_spacing_settings[sticky_menu_item_height]', + array( + 'default' => $defaults['sticky_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sticky_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'menu_plus_sticky_menu', + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sticky_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 150, + 'active_callback' => 'generate_sticky_navigation_activated', + ) + ) +); + +// Off canvas menu height. +$wp_customize->add_setting( + 'generate_spacing_settings[off_canvas_menu_item_height]', + array( + 'default' => $defaults['off_canvas_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[off_canvas_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'menu_plus_slideout_menu', + 'settings' => array( + 'desktop' => 'generate_spacing_settings[off_canvas_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 200, + 'active_callback' => 'generate_slideout_navigation_activated', + ) + ) +); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php new file mode 100644 index 00000000..dd565a57 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php @@ -0,0 +1,159 @@ +get_section( 'secondary_nav_section' ) ) { + return; + } + + // Get our controls. + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + // Get our defaults. + $defaults = generate_secondary_nav_get_defaults(); + + // Remove our old label control if it exists. + // It only would if the user is using an old Secondary Nav add-on version. + if ( $wp_customize->get_control( 'generate_secondary_navigation_spacing_title' ) ) { + $wp_customize->remove_control( 'generate_secondary_navigation_spacing_title' ); + } + + // Menu item width. + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_menu_item]', + array( + 'default' => $defaults['secondary_menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_menu_item]', + array( + 'label' => __( 'Menu Item Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 220, + ) + ) + ); + + // Menu item height. + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_menu_item_height]', + array( + 'default' => $defaults['secondary_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 240, + ) + ) + ); + + // Sub-menu height. + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', + array( + 'default' => $defaults['secondary_sub_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', + array( + 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 260, + ) + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php new file mode 100644 index 00000000..b8c3b0c7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php @@ -0,0 +1,211 @@ +add_section( + 'generate_spacing_sidebar', + array( + 'title' => __( 'Sidebars', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 15, + 'panel' => 'generate_spacing_panel', + ) +); + +// Add our controls to the Layout panel if it exists. +// If not, use the old section. +$widget_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_sidebars' : 'generate_spacing_sidebar'; + +// Widget padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[widget_top]', + array( + 'default' => $defaults['widget_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[widget_right]', + array( + 'default' => $defaults['widget_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[widget_bottom]', + array( + 'default' => $defaults['widget_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[widget_left]', + array( + 'default' => $defaults['widget_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding top. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_widget_top]', + array( + 'default' => $defaults['mobile_widget_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding right. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_widget_right]', + array( + 'default' => $defaults['mobile_widget_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding bottom. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_widget_bottom]', + array( + 'default' => $defaults['mobile_widget_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Widget padding left. +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_widget_left]', + array( + 'default' => $defaults['mobile_widget_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +// Make use of the widget padding settings. +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'widget_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Widget Padding', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[widget_top]', + 'desktop_right' => 'generate_spacing_settings[widget_right]', + 'desktop_bottom' => 'generate_spacing_settings[widget_bottom]', + 'desktop_left' => 'generate_spacing_settings[widget_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_widget_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_widget_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_widget_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_widget_left]', + ), + 'element' => 'widget', + 'priority' => 99, + ) + ) +); + +// Left sidebar width. +$wp_customize->add_setting( + 'generate_spacing_settings[left_sidebar_width]', + array( + 'default' => $defaults['left_sidebar_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[left_sidebar_width]', + array( + 'label' => esc_html__( 'Left Sidebar Width', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[left_sidebar_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 50, + 'step' => 5, + 'edit' => false, + 'unit' => '%', + ), + ), + 'priority' => 125, + ) + ) +); + +// Right sidebar width. +$wp_customize->add_setting( + 'generate_spacing_settings[right_sidebar_width]', + array( + 'default' => $defaults['right_sidebar_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[right_sidebar_width]', + array( + 'label' => esc_html__( 'Right Sidebar Width', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[right_sidebar_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 50, + 'step' => 5, + 'edit' => false, + 'unit' => '%', + ), + ), + 'priority' => 125, + ) + ) +); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php new file mode 100644 index 00000000..ecc0f085 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php @@ -0,0 +1,73 @@ +add_setting( + 'generate_spacing_settings[top_bar_top]', + array( + 'default' => $defaults['top_bar_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_spacing_settings[top_bar_right]', + array( + 'default' => $defaults['top_bar_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_spacing_settings[top_bar_bottom]', + array( + 'default' => $defaults['top_bar_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_spacing_settings[top_bar_left]', + array( + 'default' => $defaults['top_bar_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'top_bar_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Top Bar Padding', 'gp-premium' ), + 'section' => 'generate_top_bar', + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[top_bar_top]', + 'desktop_right' => 'generate_spacing_settings[top_bar_right]', + 'desktop_bottom' => 'generate_spacing_settings[top_bar_bottom]', + 'desktop_left' => 'generate_spacing_settings[top_bar_left]', + ), + 'element' => 'top_bar', + 'priority' => 99, + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php new file mode 100644 index 00000000..a428989c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/functions.php @@ -0,0 +1,362 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Spacing_Control' ); + } + + // Add our Spacing panel. + // This is only used if the Layout panel in the free theme doesn't exist. + if ( class_exists( 'WP_Customize_Panel' ) ) { + if ( ! $wp_customize->get_panel( 'generate_spacing_panel' ) ) { + $wp_customize->add_panel( + 'generate_spacing_panel', + array( + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Spacing', 'gp-premium' ), + 'description' => __( 'Change the spacing for various elements using pixels.', 'gp-premium' ), + 'priority' => 35, + ) + ); + } + } + + require_once plugin_dir_path( __FILE__ ) . 'customizer/top-bar-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/header-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/content-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/sidebar-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/navigation-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/footer-spacing.php'; + + } +} + +if ( ! function_exists( 'generate_right_sidebar_width' ) ) { + add_filter( 'generate_right_sidebar_width', 'generate_right_sidebar_width' ); + /** + * Set our right sidebar width. + * + * @param int $width The sidebar width. + */ + function generate_right_sidebar_width( $width ) { + // Bail if we don't have our defaults. + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return $width; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + return absint( $spacing_settings['right_sidebar_width'] ); + } +} + +if ( ! function_exists( 'generate_left_sidebar_width' ) ) { + add_filter( 'generate_left_sidebar_width', 'generate_left_sidebar_width' ); + /** + * Set our left sidebar width. + * + * @param int $width The sidebar width. + */ + function generate_left_sidebar_width( $width ) { + // Bail if we don't have our defaults. + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return $width; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + return absint( $spacing_settings['left_sidebar_width'] ); + } +} + +if ( ! function_exists( 'generate_spacing_customizer_live_preview' ) ) { + add_action( 'customize_preview_init', 'generate_spacing_customizer_live_preview' ); + /** + * Add our live preview JS + */ + function generate_spacing_customizer_live_preview() { + wp_enqueue_script( + 'generate-spacing-customizer', + trailingslashit( plugin_dir_url( __FILE__ ) ) . 'customizer/js/customizer.js', + array( 'jquery', 'customize-preview' ), + GENERATE_SPACING_VERSION, + true + ); + + wp_localize_script( + 'generate-spacing-customizer', + 'gp_spacing', + array( + 'mobile' => generate_premium_get_media_query( 'mobile' ), + 'tablet' => generate_premium_get_media_query( 'tablet' ), + 'desktop' => generate_premium_get_media_query( 'desktop' ), + 'isFlex' => function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox(), + ) + ); + } +} + +if ( ! function_exists( 'generate_include_spacing_defaults' ) ) { + /** + * Check if we should include our default.css file. + * + * @since 1.3.42 + */ + function generate_include_spacing_defaults() { + return true; + } +} + +if ( ! function_exists( 'generate_spacing_premium_defaults' ) ) { + add_filter( 'generate_spacing_option_defaults', 'generate_spacing_premium_defaults' ); + /** + * Add premium spacing defaults. + * + * @since 1.3 + * @param array $defaults The existing defaults. + */ + function generate_spacing_premium_defaults( $defaults ) { + $defaults['mobile_menu_item'] = ''; + $defaults['mobile_menu_item_height'] = ''; + $defaults['sticky_menu_item_height'] = ''; + $defaults['off_canvas_menu_item_height'] = ''; + $defaults['content_element_separator'] = '2'; // em. + + // These defaults were added to GeneratePress (free) in 3.0.0. + if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) { + $defaults['mobile_header_top'] = ''; + $defaults['mobile_header_right'] = ''; + $defaults['mobile_header_bottom'] = ''; + $defaults['mobile_header_left'] = ''; + + $defaults['mobile_widget_top'] = ''; + $defaults['mobile_widget_right'] = ''; + $defaults['mobile_widget_bottom'] = ''; + $defaults['mobile_widget_left'] = ''; + + $defaults['mobile_footer_widget_container_top'] = ''; + $defaults['mobile_footer_widget_container_right'] = ''; + $defaults['mobile_footer_widget_container_bottom'] = ''; + $defaults['mobile_footer_widget_container_left'] = ''; + } + + return $defaults; + } +} + +/** + * Build our premium CSS. + */ +function generate_spacing_do_premium_css() { + // Bail if we don't have our defaults. + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; + $premium_css = new GeneratePress_Pro_CSS(); + $css_output = ''; + + // Mobile spacing. + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + + if ( '' !== $spacing_settings['mobile_menu_item'] ) { + $premium_css->set_selector( '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a,.main-navigation .menu-bar-item > a' ); + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_menu_item_height'] ) { + $premium_css->set_selector( '.main-navigation .main-nav ul li a,.main-navigation .menu-toggle,.main-navigation .mobile-bar-items a,.main-navigation .menu-bar-item > a' ); + $premium_css->add_property( 'line-height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); + + $premium_css->set_selector( '.main-navigation .site-logo.navigation-logo img, .mobile-header-navigation .site-logo.mobile-header-logo img, .navigation-search input[type="search"]' ); + $premium_css->add_property( 'height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + // This CSS was added to GeneratePress (free) in 3.0.0. + if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) { + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + + $premium_css->set_selector( '.inside-header' ); + + if ( '' !== $spacing_settings['mobile_header_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_header_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_header_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_header_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_header_left'] ), false, 'px' ); + } + + $premium_css->set_selector( '.widget-area .widget' ); + + if ( '' !== $spacing_settings['mobile_widget_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_widget_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_widget_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_widget_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_widget_left'] ), false, 'px' ); + } + + $premium_css->set_selector( '.footer-widgets' ); + + if ( '' !== $spacing_settings['mobile_footer_widget_container_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_footer_widget_container_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_footer_widget_container_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_footer_widget_container_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_footer_widget_container_left'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + $premium_css->set_selector( '.post-image, .page-content, .entry-content, .entry-summary, footer.entry-meta' ); + $premium_css->add_property( 'margin-top', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); + } else { + $premium_css->set_selector( '.post-image:not(:first-child), .page-content:not(:first-child), .entry-content:not(:first-child), .entry-summary:not(:first-child), footer.entry-meta' ); + $premium_css->add_property( 'margin-top', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); + } + + $premium_css->set_selector( '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image' ); + $premium_css->add_property( 'margin-bottom', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); + + if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { + $menu_plus = wp_parse_args( + get_option( 'generate_menu_plus_settings', array() ), + generate_menu_plus_get_defaults() + ); + + if ( 'false' !== $menu_plus['sticky_menu'] && '' !== $spacing_settings['sticky_menu_item_height'] ) { + $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) . ',' . generate_premium_get_media_query( 'desktop' ) ); + + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .main-nav > ul > li > a,.sticky-navigation-transition .menu-toggle,.main-navigation.sticky-navigation-transition .menu-bar-item > a, .sticky-navigation-transition .navigation-branding .main-title' ); + } else { + $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .main-nav > ul > li > a,.sticky-navigation-transition .menu-toggle,.main-navigation.sticky-navigation-transition .mobile-bar-items a, .sticky-navigation-transition .navigation-branding .main-title' ); + } + + $premium_css->add_property( 'line-height', absint( $spacing_settings['sticky_menu_item_height'] ), false, 'px' ); + + $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .site-logo img, .main-navigation.sticky-navigation-transition .navigation-search input[type="search"], .main-navigation.sticky-navigation-transition .navigation-branding img' ); + $premium_css->add_property( 'height', absint( $spacing_settings['sticky_menu_item_height'] ), false, 'px' ); + + $premium_css->stop_media_query(); + } + + if ( 'false' !== $menu_plus['slideout_menu'] ) { + $premium_css->set_selector( '.main-navigation.slideout-navigation .main-nav > ul > li > a' ); + if ( '' !== $spacing_settings['off_canvas_menu_item_height'] ) { + $premium_css->add_property( 'line-height', absint( $spacing_settings['off_canvas_menu_item_height'] ), false, 'px' ); + } + } + } + + if ( '' !== $premium_css->css_output() ) { + $css_output = $premium_css->css_output(); + } + + return $css_output; +} + +if ( ! function_exists( 'generate_spacing_premium_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_spacing_premium_css', 105 ); + /** + * Add premium spacing CSS + * + * @since 1.3 + */ + function generate_spacing_premium_css() { + $css = generate_spacing_do_premium_css(); + + if ( 'inline' === generate_get_css_print_method() && $css ) { + wp_add_inline_style( 'generate-style', $css ); + } + } +} + +add_filter( 'generate_external_dynamic_css_output', 'generate_spacing_add_to_external_stylesheet' ); +/** + * Add CSS to the external stylesheet. + * + * @since 1.11.0 + * @param string $css Existing CSS. + */ +function generate_spacing_add_to_external_stylesheet( $css ) { + if ( 'inline' === generate_get_css_print_method() ) { + return $css; + } + + $css .= generate_spacing_do_premium_css(); + + return $css; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php new file mode 100644 index 00000000..1eac04b6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/spacing/functions/migration.php @@ -0,0 +1,102 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Add the typography panel. + if ( class_exists( 'WP_Customize_Panel' ) ) { + $wp_customize->add_panel( + 'generate_typography_panel', + array( + 'priority' => 30, + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Typography', 'gp-premium' ), + 'description' => '', + ) + ); + } + + // Body section. + $wp_customize->add_section( + 'font_section', + array( + 'title' => __( 'Body', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 30, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_body_typography_shortcuts', + array( + 'section' => 'font_section', + 'element' => __( 'Body', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'body_section', + 'backgrounds' => 'generate_backgrounds_body', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_body]', + array( + 'default' => $defaults['font_body'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_body_variants', + array( + 'default' => $defaults['font_body_variants'], + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'font_body_category', + array( + 'default' => $defaults['font_body_category'], + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_weight]', + array( + 'default' => $defaults['body_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_transform]', + array( + 'default' => $defaults['body_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'body_typography', + array( + 'section' => 'font_section', + 'priority' => 1, + 'settings' => array( + 'family' => 'generate_settings[font_body]', + 'variant' => 'font_body_variants', + 'category' => 'font_body_category', + 'weight' => 'generate_settings[body_font_weight]', + 'transform' => 'generate_settings[body_font_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_size]', + array( + 'default' => $defaults['body_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 40, + 'settings' => array( + 'desktop' => 'generate_settings[body_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 25, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_line_height]', + array( + 'default' => $defaults['body_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 45, + 'settings' => array( + 'desktop' => 'generate_settings[body_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => '', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[paragraph_margin]', + array( + 'default' => $defaults['paragraph_margin'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[paragraph_margin]', + array( + 'description' => __( 'Paragraph margin', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 47, + 'settings' => array( + 'desktop' => 'generate_settings[paragraph_margin]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_section( + 'generate_top_bar_typography', + array( + 'title' => __( 'Top Bar', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 30, + 'panel' => 'generate_typography_panel', + ) + ); + + if ( isset( $defaults['font_top_bar'] ) && function_exists( 'generate_is_top_bar_active' ) ) { + $wp_customize->add_setting( + 'generate_settings[font_top_bar]', + array( + 'default' => $defaults['font_top_bar'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_top_bar_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_top_bar_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[top_bar_font_weight]', + array( + 'default' => $defaults['top_bar_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[top_bar_font_transform]', + array( + 'default' => $defaults['top_bar_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'top_bar_typography', + array( + 'section' => 'generate_top_bar_typography', + 'settings' => array( + 'family' => 'generate_settings[font_top_bar]', + 'variant' => 'font_top_bar_variants', + 'category' => 'font_top_bar_category', + 'weight' => 'generate_settings[top_bar_font_weight]', + 'transform' => 'generate_settings[top_bar_font_transform]', + ), + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); + + } + + if ( isset( $defaults['top_bar_font_size'] ) && function_exists( 'generate_is_top_bar_active' ) ) { + $wp_customize->add_setting( + 'generate_settings[top_bar_font_size]', + array( + 'default' => $defaults['top_bar_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[top_bar_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_top_bar_typography', + 'priority' => 75, + 'settings' => array( + 'desktop' => 'generate_settings[top_bar_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 25, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); + } + + $wp_customize->add_section( + 'font_header_section', + array( + 'title' => __( 'Header', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 40, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_header_typography_shortcuts', + array( + 'section' => 'font_header_section', + 'element' => __( 'Header', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_header', + 'colors' => 'header_color_section', + 'backgrounds' => 'generate_backgrounds_header', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_site_title]', + array( + 'default' => $defaults['font_site_title'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_site_title_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_site_title_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_title_font_weight]', + array( + 'default' => $defaults['site_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_title_font_transform]', + array( + 'default' => $defaults['site_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'site_title_typography', + array( + 'label' => __( 'Site Title', 'gp-premium' ), + 'section' => 'font_header_section', + 'settings' => array( + 'family' => 'generate_settings[font_site_title]', + 'variant' => 'font_site_title_variants', + 'category' => 'font_site_title_category', + 'weight' => 'generate_settings[site_title_font_weight]', + 'transform' => 'generate_settings[site_title_font_transform]', + ), + 'priority' => 50, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_title_font_size]', + array( + 'default' => $defaults['site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[tablet_site_title_font_size]', + array( + 'default' => $defaults['tablet_site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_site_title_font_size]', + array( + 'default' => $defaults['mobile_site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[site_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_header_section', + 'priority' => 75, + 'settings' => array( + 'desktop' => 'generate_settings[site_title_font_size]', + 'tablet' => 'generate_settings[tablet_site_title_font_size]', + 'mobile' => 'generate_settings[mobile_site_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_site_tagline]', + array( + 'default' => $defaults['font_site_tagline'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_site_tagline_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_site_tagline_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_weight]', + array( + 'default' => $defaults['site_tagline_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_transform]', + array( + 'default' => $defaults['site_tagline_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_site_tagline_control', + array( + 'label' => __( 'Site Tagline', 'gp-premium' ), + 'section' => 'font_header_section', + 'settings' => array( + 'family' => 'generate_settings[font_site_tagline]', + 'variant' => 'font_site_tagline_variants', + 'category' => 'font_site_tagline_category', + 'weight' => 'generate_settings[site_tagline_font_weight]', + 'transform' => 'generate_settings[site_tagline_font_transform]', + ), + 'priority' => 80, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_size]', + array( + 'default' => $defaults['site_tagline_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[site_tagline_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_header_section', + 'priority' => 105, + 'settings' => array( + 'desktop' => 'generate_settings[site_tagline_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_section( + 'font_navigation_section', + array( + 'title' => __( 'Primary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 50, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_primary_navigation_typography_shortcuts', + array( + 'section' => 'font_navigation_section', + 'element' => __( 'Primary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_navigation', + 'colors' => 'navigation_color_section', + 'backgrounds' => 'generate_backgrounds_navigation', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_navigation]', + array( + 'default' => $defaults['font_navigation'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_navigation_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_navigation_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_font_weight]', + array( + 'default' => $defaults['navigation_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_font_transform]', + array( + 'default' => $defaults['navigation_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_site_navigation_control', + array( + 'section' => 'font_navigation_section', + 'settings' => array( + 'family' => 'generate_settings[font_navigation]', + 'variant' => 'font_navigation_variants', + 'category' => 'font_navigation_category', + 'weight' => 'generate_settings[navigation_font_weight]', + 'transform' => 'generate_settings[navigation_font_transform]', + ), + 'priority' => 120, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_font_size]', + array( + 'default' => $defaults['navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[tablet_navigation_font_size]', + array( + 'default' => $defaults['tablet_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_navigation_font_size]', + array( + 'default' => $defaults['mobile_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[navigation_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_navigation_section', + 'priority' => 165, + 'settings' => array( + 'desktop' => 'generate_settings[navigation_font_size]', + 'tablet' => 'generate_settings[tablet_navigation_font_size]', + 'mobile' => 'generate_settings[mobile_navigation_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_section( + 'font_buttons_section', + array( + 'title' => __( 'Buttons', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 55, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_buttons_typography_shortcuts', + array( + 'section' => 'font_buttons_section', + 'element' => __( 'Button', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'buttons_color_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + if ( isset( $defaults['font_buttons'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_buttons]', + array( + 'default' => $defaults['font_buttons'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_buttons_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_buttons_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_weight]', + array( + 'default' => $defaults['buttons_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_transform]', + array( + 'default' => $defaults['buttons_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_buttons_control', + array( + 'section' => 'font_buttons_section', + 'settings' => array( + 'family' => 'generate_settings[font_buttons]', + 'variant' => 'font_buttons_variants', + 'category' => 'font_buttons_category', + 'weight' => 'generate_settings[buttons_font_weight]', + 'transform' => 'generate_settings[buttons_font_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_size]', + array( + 'default' => $defaults['buttons_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'buttons_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_buttons_section', + 'settings' => array( + 'desktop' => 'generate_settings[buttons_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 5, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_section( + 'font_content_section', + array( + 'title' => __( 'Headings', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 60, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_headings_typography_shortcuts', + array( + 'section' => 'font_content_section', + 'element' => __( 'Content', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_container', + 'colors' => 'content_color_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_1]', + array( + 'default' => $defaults['font_heading_1'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_weight]', + array( + 'default' => $defaults['heading_1_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_transform]', + array( + 'default' => $defaults['heading_1_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_1_control', + array( + 'label' => __( 'Heading 1 (H1)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_1]', + 'variant' => 'font_heading_1_variants', + 'category' => 'font_heading_1_category', + 'weight' => 'generate_settings[heading_1_weight]', + 'transform' => 'generate_settings[heading_1_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_font_size]', + array( + 'default' => $defaults['heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_1_font_size]', + array( + 'default' => $defaults['mobile_heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h1_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_font_size]', + 'mobile' => 'generate_settings[mobile_heading_1_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['heading_1_line_height'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_1_line_height]', + array( + 'default' => $defaults['heading_1_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_1_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_1_margin_bottom'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_1_margin_bottom]', + array( + 'default' => $defaults['heading_1_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_1_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[single_post_title_weight]', + array( + 'default' => $defaults['single_post_title_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_transform]', + array( + 'default' => $defaults['single_post_title_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'single_content_title_control', + array( + 'label' => __( 'Single Content Title (H1)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'weight' => 'generate_settings[single_post_title_weight]', + 'transform' => 'generate_settings[single_post_title_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_font_size]', + array( + 'default' => $defaults['single_post_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_font_size_mobile]', + array( + 'default' => $defaults['single_post_title_font_size_mobile'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'single_post_title_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[single_post_title_font_size]', + 'mobile' => 'generate_settings[single_post_title_font_size_mobile]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_line_height]', + array( + 'default' => $defaults['single_post_title_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[single_post_title_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[single_post_title_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_2]', + array( + 'default' => $defaults['font_heading_2'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_weight]', + array( + 'default' => $defaults['heading_2_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_transform]', + array( + 'default' => $defaults['heading_2_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_2_control', + array( + 'label' => __( 'Heading 2 (H2)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_2]', + 'variant' => 'font_heading_2_variants', + 'category' => 'font_heading_2_category', + 'weight' => 'generate_settings[heading_2_weight]', + 'transform' => 'generate_settings[heading_2_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_font_size]', + array( + 'default' => $defaults['heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_2_font_size]', + array( + 'default' => $defaults['mobile_heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h2_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_font_size]', + 'mobile' => 'generate_settings[mobile_heading_2_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['heading_2_line_height'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_2_line_height]', + array( + 'default' => $defaults['heading_2_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_2_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_2_margin_bottom'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_2_margin_bottom]', + array( + 'default' => $defaults['heading_2_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_2_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_weight]', + array( + 'default' => $defaults['archive_post_title_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_transform]', + array( + 'default' => $defaults['archive_post_title_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'archive_content_title_control', + array( + 'label' => __( 'Archive Content Title (H2)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'weight' => 'generate_settings[archive_post_title_weight]', + 'transform' => 'generate_settings[archive_post_title_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_font_size]', + array( + 'default' => $defaults['archive_post_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_font_size_mobile]', + array( + 'default' => $defaults['archive_post_title_font_size_mobile'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'archive_post_title_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[archive_post_title_font_size]', + 'mobile' => 'generate_settings[archive_post_title_font_size_mobile]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_line_height]', + array( + 'default' => $defaults['archive_post_title_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[archive_post_title_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[archive_post_title_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_3]', + array( + 'default' => $defaults['font_heading_3'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_weight]', + array( + 'default' => $defaults['heading_3_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_transform]', + array( + 'default' => $defaults['heading_3_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_3_control', + array( + 'label' => __( 'Heading 3 (H3)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_3]', + 'variant' => 'font_heading_3_variants', + 'category' => 'font_heading_3_category', + 'weight' => 'generate_settings[heading_3_weight]', + 'transform' => 'generate_settings[heading_3_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_font_size]', + array( + 'default' => $defaults['heading_3_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $h3_font_size_options = array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ); + + $h3_font_size_settings = array( + 'desktop' => 'generate_settings[heading_3_font_size]', + ); + + if ( isset( $defaults['mobile_heading_3_font_size'] ) ) { + $wp_customize->add_setting( + 'generate_settings[mobile_heading_3_font_size]', + array( + 'default' => $defaults['mobile_heading_3_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $h3_font_size_options['mobile'] = array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ); + + $h3_font_size_settings['mobile'] = 'generate_settings[mobile_heading_3_font_size]'; + } + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h3_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => $h3_font_size_settings, + 'choices' => $h3_font_size_options, + ) + ) + ); + + if ( isset( $defaults['heading_3_line_height'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_3_line_height]', + array( + 'default' => $defaults['heading_3_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_3_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_3_margin_bottom'] ) ) { + $wp_customize->add_setting( + 'generate_settings[heading_3_margin_bottom]', + array( + 'default' => $defaults['heading_3_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_3_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_4'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_heading_4]', + array( + 'default' => $defaults['font_heading_4'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_4_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_4_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_weight]', + array( + 'default' => $defaults['heading_4_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_transform]', + array( + 'default' => $defaults['heading_4_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_4_control', + array( + 'label' => __( 'Heading 4 (H4)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_4]', + 'variant' => 'font_heading_4_variants', + 'category' => 'font_heading_4_category', + 'weight' => 'generate_settings[heading_4_weight]', + 'transform' => 'generate_settings[heading_4_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_font_size]', + array( + 'default' => $defaults['heading_4_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $h4_font_size_options = array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ); + + $h4_font_size_settings = array( + 'desktop' => 'generate_settings[heading_4_font_size]', + ); + + if ( isset( $defaults['mobile_heading_4_font_size'] ) ) { + $wp_customize->add_setting( + 'generate_settings[mobile_heading_4_font_size]', + array( + 'default' => $defaults['mobile_heading_4_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $h4_font_size_options['mobile'] = array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ); + + $h4_font_size_settings['mobile'] = 'generate_settings[mobile_heading_4_font_size]'; + } + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h4_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => $h4_font_size_settings, + 'choices' => $h4_font_size_options, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_line_height]', + array( + 'default' => $defaults['heading_4_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_4_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_4_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_5'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_heading_5]', + array( + 'default' => $defaults['font_heading_5'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_5_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_5_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_weight]', + array( + 'default' => $defaults['heading_5_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_transform]', + array( + 'default' => $defaults['heading_5_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_5_control', + array( + 'label' => __( 'Heading 5 (H5)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_5]', + 'variant' => 'font_heading_5_variants', + 'category' => 'font_heading_5_category', + 'weight' => 'generate_settings[heading_5_weight]', + 'transform' => 'generate_settings[heading_5_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_font_size]', + array( + 'default' => $defaults['heading_5_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $h5_font_size_options = array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ); + + $h5_font_size_settings = array( + 'desktop' => 'generate_settings[heading_5_font_size]', + ); + + if ( isset( $defaults['mobile_heading_5_font_size'] ) ) { + $wp_customize->add_setting( + 'generate_settings[mobile_heading_5_font_size]', + array( + 'default' => $defaults['mobile_heading_5_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $h5_font_size_options['mobile'] = array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ); + + $h5_font_size_settings['mobile'] = 'generate_settings[mobile_heading_5_font_size]'; + } + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h5_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => $h5_font_size_settings, + 'choices' => $h5_font_size_options, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_line_height]', + array( + 'default' => $defaults['heading_5_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_5_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_5_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_6'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_heading_6]', + array( + 'default' => $defaults['font_heading_6'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_6_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_heading_6_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_weight]', + array( + 'default' => $defaults['heading_6_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_transform]', + array( + 'default' => $defaults['heading_6_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_6_control', + array( + 'label' => __( 'Heading 6 (H6)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_6]', + 'variant' => 'font_heading_6_variants', + 'category' => 'font_heading_6_category', + 'weight' => 'generate_settings[heading_6_weight]', + 'transform' => 'generate_settings[heading_6_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_font_size]', + array( + 'default' => $defaults['heading_6_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h6_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_6_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_line_height]', + array( + 'default' => $defaults['heading_6_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_6_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_6_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + $wp_customize->add_section( + 'font_widget_section', + array( + 'title' => __( 'Widgets', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 60, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_widgets_typography_shortcuts', + array( + 'section' => 'font_widget_section', + 'element' => __( 'Widgets', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_sidebars', + 'colors' => 'sidebar_widget_color_section', + 'backgrounds' => 'generate_backgrounds_sidebars', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_widget_title]', + array( + 'default' => $defaults['font_widget_title'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_widget_title_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_widget_title_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[widget_title_font_weight]', + array( + 'default' => $defaults['widget_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[widget_title_font_transform]', + array( + 'default' => $defaults['widget_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_widget_title_control', + array( + 'label' => __( 'Widget Titles', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'family' => 'generate_settings[font_widget_title]', + 'variant' => 'font_widget_title_variants', + 'category' => 'font_widget_title_category', + 'weight' => 'generate_settings[widget_title_font_weight]', + 'transform' => 'generate_settings[widget_title_font_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[widget_title_font_size]', + array( + 'default' => $defaults['widget_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'desktop' => 'generate_settings[widget_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['widget_title_separator'] ) ) { + $wp_customize->add_setting( + 'generate_settings[widget_title_separator]', + array( + 'default' => $defaults['widget_title_separator'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_title_separator]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'desktop' => 'generate_settings[widget_title_separator]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[widget_content_font_size]', + array( + 'default' => $defaults['widget_content_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_content_font_size]', + array( + 'description' => __( 'Content font size', 'gp-premium' ), + 'section' => 'font_widget_section', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[widget_content_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_section( + 'font_footer_section', + array( + 'title' => __( 'Footer', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 70, + 'panel' => 'generate_typography_panel', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_footer_typography_shortcuts', + array( + 'section' => 'font_footer_section', + 'element' => __( 'Footer', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_footer', + 'colors' => 'footer_color_section', + 'backgrounds' => 'generate_backgrounds_footer', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + if ( isset( $defaults['font_footer'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_footer]', + array( + 'default' => $defaults['font_footer'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_footer_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_footer_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_weight]', + array( + 'default' => $defaults['footer_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_transform]', + array( + 'default' => $defaults['footer_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_footer_control', + array( + 'section' => 'font_footer_section', + 'settings' => array( + 'family' => 'generate_settings[font_footer]', + 'variant' => 'font_footer_variants', + 'category' => 'font_footer_category', + 'weight' => 'generate_settings[footer_weight]', + 'transform' => 'generate_settings[footer_transform]', + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[footer_font_size]', + array( + 'default' => $defaults['footer_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[footer_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_footer_section', + 'settings' => array( + 'desktop' => 'generate_settings[footer_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} + +if ( ! function_exists( 'generate_enqueue_google_fonts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_enqueue_google_fonts', 0 ); + /** + * Enqueue Google Fonts. + * + * @since 0.1 + */ + function generate_enqueue_google_fonts() { + // Bail if we don't have our defaults function. + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // List our non-Google fonts. + $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); + + // Grab our font family settings. + $font_settings = array( + 'font_body', + 'font_top_bar', + 'font_site_title', + 'font_site_tagline', + 'font_navigation', + 'font_widget_title', + 'font_buttons', + 'font_heading_1', + 'font_heading_2', + 'font_heading_3', + 'font_heading_4', + 'font_heading_5', + 'font_heading_6', + 'font_footer', + ); + + // Create our Google Fonts array. + $google_fonts = array(); + if ( ! empty( $font_settings ) ) { + foreach ( $font_settings as $key ) { + // If the key isn't set, move on. + if ( ! isset( $generate_settings[ $key ] ) ) { + continue; + } + + // If our value is still using the old format, fix it. + if ( strpos( $generate_settings[ $key ], ':' ) !== false ) { + $generate_settings[ $key ] = current( explode( ':', $generate_settings[ $key ] ) ); + } + + // Replace the spaces in the names with a plus. + $value = str_replace( ' ', '+', $generate_settings[ $key ] ); + + // Grab the variants using the plain name. + $variants = generate_get_google_font_variants( $generate_settings[ $key ], $key, generate_get_default_fonts() ); + + // If we have variants, add them to our value. + $value = ! empty( $variants ) ? $value . ':' . $variants : $value; + + // Make sure we don't add the same font twice. + if ( ! in_array( $value, $google_fonts ) ) { + $google_fonts[] = $value; + } + } + } + + // Ignore any non-Google fonts. + $google_fonts = array_diff( $google_fonts, $not_google ); + + // Separate each different font with a bar. + $google_fonts = implode( '|', $google_fonts ); + + // Apply a filter to the output. + $google_fonts = apply_filters( 'generate_typography_google_fonts', $google_fonts ); + + // Get the subset. + $subset = apply_filters( 'generate_fonts_subset', '' ); + + // Set up our arguments. + $font_args = array(); + $font_args['family'] = $google_fonts; + if ( '' !== $subset ) { + $font_args['subset'] = urlencode( $subset ); // phpcs:ignore -- Keeping legacy urlencode(). + } + + $display = apply_filters( 'generate_google_font_display', '' ); + + if ( $display ) { + $font_args['display'] = $display; + } + + // Create our URL using the arguments. + $fonts_url = add_query_arg( $font_args, '//fonts.googleapis.com/css' ); + + // Enqueue our fonts. + if ( $google_fonts ) { + wp_enqueue_style( 'generate-fonts', $fonts_url, array(), null, 'all' ); // phpcs:ignore -- Version not needed. + } + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts' ) ) { + /** + * Return an array of all of our Google Fonts. + * + * @since 1.3.0 + * @param string $amount The number of fonts to load. + */ + function generate_get_all_google_fonts( $amount = 'all' ) { + ob_start(); + include wp_normalize_path( dirname( __FILE__ ) . '/google-fonts.json' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude + $fonts_json = ob_get_clean(); + $google_fonts = json_decode( $fonts_json ); + + // Loop through them and put what we need into our fonts array. + $fonts = array(); + foreach ( (array) $google_fonts as $item ) { + + // Grab what we need from our big list. + $atts = array( + 'name' => $item->family, + 'category' => $item->category, + 'variants' => $item->variants, + ); + + // Create an ID using our font family name. + $id = strtolower( str_replace( ' ', '_', $item->family ) ); + + // Add our attributes to our new array. + $fonts[ $id ] = $atts; + } + + if ( 'all' !== $amount ) { + $fonts = array_slice( $fonts, 0, $amount ); + } + + // Alphabetize our fonts. + if ( apply_filters( 'generate_alphabetize_google_fonts', true ) ) { + asort( $fonts ); + } + + // Filter to allow us to modify the fonts array. + return apply_filters( 'generate_google_fonts_array', $fonts ); + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts_ajax' ) ) { + add_action( 'wp_ajax_generate_get_all_google_fonts_ajax', 'generate_get_all_google_fonts_ajax' ); + /** + * Return an array of all of our Google Fonts. + * + * @since 1.3.0 + */ + function generate_get_all_google_fonts_ajax() { + // Bail if the nonce doesn't check out. + if ( ! isset( $_POST['gp_customize_nonce'] ) || ! wp_verify_nonce( $_POST['gp_customize_nonce'], 'gp_customize_nonce' ) ) { + wp_die(); + } + + // Do another nonce check. + check_ajax_referer( 'gp_customize_nonce', 'gp_customize_nonce' ); + + // Bail if user can't edit theme options. + if ( ! current_user_can( 'edit_theme_options' ) ) { + wp_die(); + } + + // Get all of our fonts. + $fonts = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts() ); + + // Send all of our fonts in JSON format. + echo wp_json_encode( $fonts ); + + die(); + } +} + +if ( ! function_exists( 'generate_get_google_font_variants' ) ) { + /** + * Wrapper function to find variants for chosen Google Fonts + * Example: generate_get_google_font_variation( 'Open Sans' ) + * + * @since 1.3.0 + * @param string $font The font we're checking. + * @param string $key The key we're checking. + * @param array $default The defaults we're checking. + */ + function generate_get_google_font_variants( $font, $key = '', $default = '' ) { + // Bail if we don't have our defaults function. + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Don't need variants if we're using a system font. + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved. + if ( '' !== $key && get_theme_mod( $key . '_variants' ) ) { + return get_theme_mod( $key . '_variants' ); + } + + // Make sure we have defaults. + if ( '' == $default ) { // phpcs:ignore -- Non-strict allowed. + $default = generate_get_default_fonts(); + } + + // If our default font is selected and the category isn't saved, we already know the category. + if ( $default[ $key ] == $font ) { // phpcs:ignore -- Non-strict allowed. + return $default[ $key . '_variants' ]; + } + + // Grab all of our fonts. + // It's a big list, so hopefully we're not even still reading. + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font. + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail. + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Grab all of the variants associated with our font. + $variants = $fonts[ $id ]['variants']; + + // Loop through them and put them into an array, then turn them into a comma separated list. + $output = array(); + if ( $variants ) { + foreach ( $variants as $variant ) { + $output[] = $variant; + } + + return implode( ',', apply_filters( 'generate_typography_variants', $output ) ); + } + } +} + +if ( ! function_exists( 'generate_get_google_font_category' ) ) { + /** + * Wrapper function to find the category for chosen Google Font + * Example: generate_get_google_font_category( 'Open Sans' ) + * + * @since 1.3.0 + * @param string $font The font we're checking. + * @param string $key The key we're checking. + * @param array $default The defaults we're checking. + */ + function generate_get_google_font_category( $font, $key = '', $default = '' ) { + // Bail if we don't have our defaults function. + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Don't need a category if we're using a system font. + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved. + if ( '' !== $key && get_theme_mod( $key . '_category' ) ) { + return ', ' . get_theme_mod( $key . '_category' ); + } + + // Make sure we have defaults. + if ( '' == $default ) { // phpcs:ignore -- Non-strict allowed. + $default = generate_get_default_fonts(); + } + + // If our default font is selected and the category isn't saved, we already know the category. + if ( $default[ $key ] == $font ) { // phpcs:ignore -- Non-strict allowed. + return ', ' . $default[ $key . '_category' ]; + } + + // Get all of our fonts. + // It's a big list, so hopefully we're not even still reading. + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font. + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail. + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Let's grab our category to go with our font. + $category = ! empty( $fonts[ $id ]['category'] ) ? ', ' . $fonts[ $id ]['category'] : ''; + + // Return it to be used by our function. + return $category; + + } +} + +if ( ! function_exists( 'generate_get_font_family_css' ) ) { + /** + * Wrapper function to create font-family value for CSS. + * + * @since 1.3.0 + * @param string $font The font we're checking. + * @param array $settings The settings we're checking. + * @param array $default The defaults we're checking. + */ + function generate_get_font_family_css( $font, $settings, $default ) { + $generate_settings = wp_parse_args( + get_option( $settings, array() ), + $default + ); + + // We don't want to wrap quotes around these values. + $no_quotes = array( + 'inherit', + 'Arial, Helvetica, sans-serif', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ), + ); + + // Get our font. + $font_family = $generate_settings[ $font ]; + + if ( 'System Stack' === $font_family ) { + $font_family = apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ); + } + + // If our value is still using the old format, fix it. + if ( strpos( $font_family, ':' ) !== false ) { + $font_family = current( explode( ':', $font_family ) ); + } + + // Set up our wrapper. + if ( in_array( $font_family, $no_quotes ) ) { + $wrapper_start = null; + $wrapper_end = null; + } else { + $wrapper_start = '"'; + $wrapper_end = '"' . generate_get_google_font_category( $font_family, $font, $default ); + } + + // Output the CSS. + $output = ( 'inherit' === $font_family ) ? 'inherit' : $wrapper_start . $font_family . $wrapper_end; + return $output; + } +} + +if ( ! function_exists( 'generate_typography_customizer_live_preview' ) ) { + add_action( 'customize_preview_init', 'generate_typography_customizer_live_preview' ); + /** + * Add our live preview JS + */ + function generate_typography_customizer_live_preview() { + wp_enqueue_script( + 'generate-typography-customizer', + trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js', + array( 'jquery', 'customize-preview' ), + GENERATE_FONT_VERSION, + true + ); + + wp_localize_script( + 'generate-typography-customizer', + 'gp_typography', + array( + 'mobile' => generate_premium_get_media_query( 'mobile' ), + 'tablet' => generate_premium_get_media_query( 'tablet' ), + 'desktop' => generate_premium_get_media_query( 'desktop' ), + ) + ); + } +} + +if ( ! function_exists( 'generate_typography_default_fonts' ) ) { + /** + * Get our system fonts + */ + function generate_typography_default_fonts() { + $fonts = array( + 'inherit', + 'System Stack', + 'Arial, Helvetica, sans-serif', + 'Century Gothic', + 'Comic Sans MS', + 'Courier New', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Lucida Console', + 'Lucida Sans Unicode', + 'Palatino Linotype', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + ); + + return apply_filters( 'generate_typography_default_fonts', $fonts ); + } +} + +if ( ! function_exists( 'generate_include_typography_defaults' ) ) { + /** + * Check if we should include our default.css file. + * + * @since 1.3.42 + */ + function generate_include_typography_defaults() { + return true; + } +} + +if ( ! function_exists( 'generate_typography_premium_css_defaults' ) ) { + add_filter( 'generate_font_option_defaults', 'generate_typography_premium_css_defaults' ); + /** + * Add premium control defaults + * + * @since 1.3 + * @param array $defaults The existing defaults. + */ + function generate_typography_premium_css_defaults( $defaults ) { + $defaults['tablet_site_title_font_size'] = ''; + $defaults['tablet_navigation_font_size'] = ''; + $defaults['mobile_navigation_font_size'] = ''; + + $defaults['single_post_title_weight'] = ''; + $defaults['single_post_title_transform'] = ''; + $defaults['single_post_title_font_size'] = ''; + $defaults['single_post_title_font_size_mobile'] = ''; + $defaults['single_post_title_line_height'] = ''; + + $defaults['archive_post_title_weight'] = ''; + $defaults['archive_post_title_transform'] = ''; + $defaults['archive_post_title_font_size'] = ''; + $defaults['archive_post_title_font_size_mobile'] = ''; + $defaults['archive_post_title_line_height'] = ''; + + return $defaults; + } +} + +/** + * Premium typography CSS output. + */ +function generate_typography_get_premium_css() { + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // Initiate our CSS class. + require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; + + $premium_css = new GeneratePress_Pro_CSS(); + + $site_title_family = false; + if ( function_exists( 'generate_get_font_family_css' ) ) { + $site_title_family = generate_get_font_family_css( 'font_site_title', 'generate_settings', generate_get_default_fonts() ); + } + + $premium_css->set_selector( 'h1.entry-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['single_post_title_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['single_post_title_transform'] ) ); + + if ( '' !== $generate_settings['single_post_title_font_size'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size'] ), false, 'px' ); + } + + if ( '' !== $generate_settings['single_post_title_line_height'] ) { + $premium_css->add_property( 'line-height', floatval( $generate_settings['single_post_title_line_height'] ), false, 'em' ); + } + + $premium_css->set_selector( 'h2.entry-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['archive_post_title_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['archive_post_title_transform'] ) ); + + if ( '' !== $generate_settings['archive_post_title_font_size'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size'] ), false, 'px' ); + } + + if ( '' !== $generate_settings['archive_post_title_line_height'] ) { + $premium_css->add_property( 'line-height', floatval( $generate_settings['archive_post_title_line_height'] ), false, 'em' ); + } + + if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { + $menu_settings = wp_parse_args( + get_option( 'generate_menu_plus_settings', array() ), + generate_menu_plus_get_defaults() + ); + + if ( $menu_settings['navigation_as_header'] || $menu_settings['sticky_navigation_logo'] || 'enable' === $menu_settings['mobile_header'] ) { + $premium_css->set_selector( '.navigation-branding .main-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['site_title_font_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['site_title_font_transform'] ) ); + $premium_css->add_property( 'font-size', absint( $generate_settings['site_title_font_size'] ), false, 'px' ); + + if ( $site_title_family ) { + $premium_css->add_property( 'font-family', 'inherit' !== $generate_settings['font_site_title'] ? $site_title_family : null ); + } + } + } + + $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); + + if ( '' !== $generate_settings['tablet_navigation_font_size'] ) { + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['tablet_navigation_font_size'] ), false, 'px' ); + + $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 1; + + if ( $generate_settings['tablet_navigation_font_size'] >= 17 ) { + $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 3; + } + + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); + $premium_css->add_property( 'font-size', absint( $tablet_subnav_font_size ), false, 'px' ); + } + + if ( '' !== $generate_settings['tablet_site_title_font_size'] ) { + $premium_css->set_selector( '.main-title, .navigation-branding .main-title' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['tablet_site_title_font_size'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + + $premium_css->set_selector( 'h1.entry-title' ); + + if ( '' !== $generate_settings['single_post_title_font_size_mobile'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size_mobile'] ), false, 'px' ); + } + + $premium_css->set_selector( 'h2.entry-title' ); + + if ( '' !== $generate_settings['archive_post_title_font_size_mobile'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size_mobile'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + + if ( ! empty( $generate_settings['mobile_navigation_font_size'] ) ) { + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['mobile_navigation_font_size'] ), false, 'px' ); + + $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 1; + + if ( $generate_settings['mobile_navigation_font_size'] >= 17 ) { + $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 3; + } + + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); + $premium_css->add_property( 'font-size', absint( $mobile_subnav_font_size ), false, 'px' ); + } + + if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { + $menu_settings = wp_parse_args( + get_option( 'generate_menu_plus_settings', array() ), + generate_menu_plus_get_defaults() + ); + + if ( $menu_settings['navigation_as_header'] || $menu_settings['sticky_navigation_logo'] || 'enable' === $menu_settings['mobile_header'] ) { + if ( ! empty( $generate_settings['mobile_site_title_font_size'] ) ) { + $premium_css->set_selector( '.navigation-branding .main-title' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['mobile_site_title_font_size'] ), false, 'px' ); + } + } + } + + $premium_css->stop_media_query(); + + return $premium_css->css_output(); +} + +if ( ! function_exists( 'generate_typography_premium_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_typography_premium_css', 100 ); + /** + * Add premium control CSS + * + * @since 1.3 + */ + function generate_typography_premium_css() { + if ( 'inline' === generate_get_css_print_method() ) { + wp_add_inline_style( 'generate-style', generate_typography_get_premium_css() ); + } + } +} + +add_filter( 'generate_external_dynamic_css_output', 'generate_typography_add_to_external_stylesheet' ); +/** + * Add CSS to the external stylesheet. + * + * @since 1.11.0 + * @param string $css Existing CSS. + */ +function generate_typography_add_to_external_stylesheet( $css ) { + if ( 'inline' === generate_get_css_print_method() ) { + return $css; + } + + $css .= generate_typography_get_premium_css(); + + return $css; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json new file mode 100644 index 00000000..a574abcf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/google-fonts.json @@ -0,0 +1,6835 @@ +[ + { + "family": "Roboto", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Open Sans", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "Lato", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Slabo 27px", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oswald", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Roboto Condensed", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Source Sans Pro", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Montserrat", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Raleway", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "PT Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Roboto Slab", + "category": "serif", + "variants": [ + "100", + "300", + "regular", + "700" + ] + }, + { + "family": "Merriweather", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Open Sans Condensed", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "700" + ] + }, + { + "family": "Droid Sans", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lora", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Ubuntu", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Droid Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Playfair Display", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Arimo", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Noto Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "PT Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Titillium Web", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "900" + ] + }, + { + "family": "PT Sans Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Muli", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Indie Flower", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bitter", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Poppins", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Inconsolata", + "category": "monospace", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Dosis", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Fjalla One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oxygen", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Hind", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Cabin", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Anton", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Arvo", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Noto Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Crimson Text", + "category": "serif", + "variants": [ + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Lobster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yanone Kaffeesatz", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "700" + ] + }, + { + "family": "Nunito", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Bree Serif", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Catamaran", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Libre Baskerville", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Abel", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Josefin Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Fira Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Gloria Hallelujah", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Abril Fatface", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Exo 2", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Merriweather Sans", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "Pacifico", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Roboto Mono", + "category": "monospace", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Varela Round", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Asap", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Amatic SC", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quicksand", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "700" + ] + }, + { + "family": "Karla", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Ubuntu Condensed", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Signika", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Alegreya", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Questrial", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rubik", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Shadows Into Light", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "PT Sans Caption", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Archivo Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Play", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Cuprum", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Dancing Script", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Rokkitt", + "category": "serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Work Sans", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Francois One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vollkorn", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Source Code Pro", + "category": "monospace", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "900" + ] + }, + { + "family": "Exo", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Maven Pro", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Architects Daughter", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Orbitron", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Pathway Gothic One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Acme", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ropa Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Patua One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "EB Garamond", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lobster Two", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Crete Round", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Cinzel", + "category": "serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Josefin Slab", + "category": "serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Source Serif Pro", + "category": "serif", + "variants": [ + "regular", + "600", + "700" + ] + }, + { + "family": "Alegreya Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Comfortaa", + "category": "display", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Russo One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "News Cycle", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "ABeeZee", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Yellowtail", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Noticia Text", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Monda", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quattrocento Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Hammersmith One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Libre Franklin", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Satisfy", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Pontano Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Righteous", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Poiret One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BenchNine", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Arapey", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Kaushan Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Economica", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Kanit", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Old Standard TT", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Sanchez", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Courgette", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Quattrocento", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Domine", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Gudea", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Permanent Marker", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Armata", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cantarell", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Archivo Black", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Istok Web", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cardo", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Playfair Display SC", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Passion One", + "category": "display", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Tinos", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cookie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Garamond", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Philosopher", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Yantramanav", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Chewy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Antic Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Handlee", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Teko", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Boogaloo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Vidaloka", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Audiowide", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Coming Soon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Alfa Slab One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cabin Condensed", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Ruda", + "category": "sans-serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Ek Mukta", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Changa One", + "category": "display", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Tangerine", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Great Vibes", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sintony", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Khand", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bevan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kalam", + "category": "handwriting", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Days One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bangers", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rajdhani", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Droid Sans Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Kreon", + "category": "serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Rambla", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Shrikhand", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fredoka One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shadows Into Light Two", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Playball", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Neuton", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "italic", + "700", + "800" + ] + }, + { + "family": "Copse", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Didact Gothic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Signika Negative", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Amiri", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Gentium Book Basic", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Glegoo", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Oleo Script", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Voltaire", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Actor", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Amaranth", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Paytone One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Volkhov", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Sorts Mill Goudy", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Bad Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Coda", + "category": "display", + "variants": [ + "regular", + "800" + ] + }, + { + "family": "Damion", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sacramento", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Squada One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rock Salt", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Adamina", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alice", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cantata One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Luckiest Guy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rochester", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Covered By Your Grace", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Heebo", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "500", + "700", + "800", + "900" + ] + }, + { + "family": "VT323", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Nothing You Could Do", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Patrick Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Gentium Basic", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Nobile", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Rancho", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Marck Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Special Elite", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Julius Sans One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Varela", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "PT Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Alex Brush", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Homemade Apple", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Scada", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Jura", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600" + ] + }, + { + "family": "Antic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gochi Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sarala", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Electrolize", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sigmar One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Candal", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Prata", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Homenaje", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pinyon Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Unica One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Basic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Neucha", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Convergence", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Molengo", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Caveat Brush", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Monoton", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Calligraffitti", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Kameron", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Share", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Alegreya Sans SC", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Enriqueta", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Martel", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Black Ops One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Just Another Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Caveat", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "PT Serif Caption", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Ultra", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ubuntu Mono", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Carme", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cousine", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cherry Cream Soda", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Reenie Beanie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Siliguri", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bubblegum Sans", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Aldrich", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lustria", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alef", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Freckle Face", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fanwood Text", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Advent Pro", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Allura", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Ceviche One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Press Start 2P", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overlock", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Niconne", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Limelight", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Frank Ruhl Libre", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Allerta Stencil", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Marcellus", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pragati Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Michroma", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fauna One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Syncopate", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Telex", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Marvel", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cabin Sketch", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Hanuman", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Cairo", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "900" + ] + }, + { + "family": "Chivo", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Allerta", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fugaz One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Viga", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ruslan Display", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nixie One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marmelad", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Average", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Spinnaker", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Leckerli One", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Judson", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Lusitana", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Montserrat Alternates", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Contrail One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Oranienbaum", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Vadodara", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Rufina", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quantico", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Concert One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marcellus SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jockey One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Parisienne", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Carter One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arbutus Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Slabo 13px", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Tauri", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Goudy Bookletter 1911", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Carrois Gothic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sue Ellen Francisco", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Walter Turncoat", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Annie Use Your Telescope", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Puritan", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Grand Hotel", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Yesteryear", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Jaldi", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Khula", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700", + "800" + ] + }, + { + "family": "Cinzel Decorative", + "category": "display", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Crafty Girls", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Merienda", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Hind Guntur", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Cutive", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Prompt", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Coustard", + "category": "serif", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Arima Madurai", + "category": "display", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "700", + "800", + "900" + ] + }, + { + "family": "Doppio One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Radley", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Fontdiner Swanky", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Iceland", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Alegreya SC", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Halant", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Schoolbell", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Waiting for the Sunrise", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Italianno", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fredericka the Great", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Average Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rosario", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Mr Dafoe", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Port Lligat Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aclonica", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Graduate", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Racing Sans One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Berkshire Swash", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Forum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Anonymous Pro", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Love Ya Like A Sister", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nunito Sans", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Magra", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lateef", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Assistant", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800" + ] + }, + { + "family": "Six Caps", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gilda Display", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oregano", + "category": "display", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Metrophobic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lalezar", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Caudex", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Kelly Slab", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Reem Kufi", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cambay", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Gruppo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Give You Glory", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "GFS Didot", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Duru Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Andika", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Tenor Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Knewave", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Serif Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Eczar", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Inder", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Martel Sans", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Trocchi", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Wire One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Petit Formal Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mako", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Frijole", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Zeyada", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Slackey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Karma", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Mate", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Belleza", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Montez", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Quando", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Capriola", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lilita One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trirong", + "category": "serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Lekton", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Just Me Again Down Here", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bowlby One SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "The Girl Next Door", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Happy Monkey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Merienda One", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Alike", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Chelsea Market", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Unkempt", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Anaheim", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Strait", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Brawler", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Clicker Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Delius", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mouse Memoirs", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Double Pica", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Crushed", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rammetto One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Prosto One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kranky", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell English", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Aladin", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mr De Haviland", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "NTR", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Solid", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Skranji", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Allan", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Baumans", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ovo", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Changa", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Lemon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Federo", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Herr Von Muellerhoff", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Arizonia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bowlby One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Orienta", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Short Stack", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Inline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Andada", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Paaji", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Oxygen Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Yeseva One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "UnifrakturMaguntia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bentham", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pompiere", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gabriela", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Qwigley", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Square", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Poly", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Sniglet", + "category": "display", + "variants": [ + "regular", + "800" + ] + }, + { + "family": "Patrick Hand SC", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Gravitas One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Khmer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shojumaru", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kurale", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gafata", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Biryani", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Cambo", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Titan One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Carrois Gothic SC", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "La Belle Aurore", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Holtwood One SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oleo Script Swash Caps", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Headland One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cherry Swash", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Belgrano", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Norican", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mountains of Christmas", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Julee", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Ramabhadra", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mallanna", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Kristi", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Imprima", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lily Script One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chau Philomene One", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Bilbo Swash Caps", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Finger Paint", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Voces", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Itim", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Megrim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Simonetta", + "category": "display", + "variants": [ + "regular", + "italic", + "900", + "900italic" + ] + }, + { + "family": "Cutive Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Stardos Stencil", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "IM Fell DW Pica", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Unna", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Loved by the King", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Prociono", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Corben", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Amiko", + "category": "sans-serif", + "variants": [ + "regular", + "600", + "700" + ] + }, + { + "family": "Denk One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Palanquin", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Baloo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fondamento", + "category": "handwriting", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Seaweed Script", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shanti", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Wendy One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Raleway Dots", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Amethysta", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vast Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Stalemate", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Mono", + "category": "monospace", + "variants": [ + "regular", + "500", + "700" + ] + }, + { + "family": "Expletus Sans", + "category": "display", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Scheherazade", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Fenix", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Delius Swash Caps", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Rouge Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Life Savers", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "IM Fell English SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Meddon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Tienne", + "category": "serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Over the Rainbow", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Share Tech Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Abhaya Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Kotta One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pridi", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Euphoria Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Engagement", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Podkova", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Salsa", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sofia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Suranna", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mada", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "900" + ] + }, + { + "family": "Chonburi", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ledger", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Italiana", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Dawning of a New Day", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nokora", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Angkor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Medula One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Taviraj", + "category": "serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Vampiro One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Englebert", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Dorsa", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Sans Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cedarville Cursive", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Geo", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Rationale", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Balthazar", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sunshiney", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Aguafina Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mystery Quest", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fjord One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Sans Extra Condensed", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Kadwa", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "McLaren", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rye", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sail", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Athiti", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Rosarivo", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Kite One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Odor Mean Chey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Numans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Artifika", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Poller One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gurajada", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Inika", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Mandali", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Shade", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Suwannaphum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mate SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Creepster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arsenal", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Montserrat Subrayada", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Metamorphous", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Palanquin Dark", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Coda Caption", + "category": "sans-serif", + "variants": [ + "800" + ] + }, + { + "family": "Dynalight", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Maitree", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "IM Fell French Canon", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Amarante", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Quintessential", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Codystar", + "category": "display", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Cantora One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aref Ruqaa", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Griffy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Revalia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Buenard", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Donegal One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell DW Pica SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Habibi", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Share Tech", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Flamenco", + "category": "display", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Mitr", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Maiden Orange", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Diplomata SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Delius Unicase", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Stoke", + "category": "serif", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Vibur", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sarpanch", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Baloo Bhaina", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Tamma", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Esteban", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Battambang", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Bokor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Wallpoet", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Great Primer", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Tulpen One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Proza Libre", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "IM Fell French Canon SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vesper Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Rozha One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sansita", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Kavoon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Della Respira", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Milonga", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Condiment", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Junge", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "New Rocker", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chicle", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mrs Saint Delafield", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "League Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miniver", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Galindo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Moul", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Amatica SC", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Stint Ultra Expanded", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yrsa", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Stint Ultra Condensed", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Suez One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Text Me One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Buda", + "category": "display", + "variants": [ + "300" + ] + }, + { + "family": "Ruluko", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sonsie One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Krona One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Elsie", + "category": "display", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Pangolin", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Linden Hill", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Secular One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Double Pica SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alike Angular", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sancreek", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bilbo", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Antic Didone", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Paprika", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asul", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "David Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "700" + ] + }, + { + "family": "Almendra", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Sriracha", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miriam Libre", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Ribeye", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Swanky and Moo Moo", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Trade Winds", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overlock SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Round", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cagliostro", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Glass Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Offside", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "El Messiri", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bigshot One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Great Primer SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Akronim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Sans Condensed", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Nosifer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Autour One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pirata One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Port Lligat Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Scope One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sumana", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lemonada", + "category": "display", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Montaga", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Iceberg", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ruthie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Content", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Henny Penny", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Slim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Madurai", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Harmattan", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "UnifrakturCook", + "category": "display", + "variants": [ + "700" + ] + }, + { + "family": "Sarina", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bubbler One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Dekko", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Redressed", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Laila", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Faster One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arya", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Peralta", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Meie Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Overpass", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Monsieur La Doulaise", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Snippet", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Emilys Candy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trykker", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "MedievalSharp", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Space Mono", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Croissant One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Monofett", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lovers Quarrel", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Oldenburg", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Galdeano", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Spicy Rice", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Wellfleet", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Germania One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "GFS Neohellenic", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Baloo Thambi", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jolly Lodger", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rubik Mono One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pattaya", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Joti One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Siemreap", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ranga", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Chango", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Miltonian Tattoo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Koulen", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Eagle Lake", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Flat", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Petrona", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jacques Francois", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Amita", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Plaster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ramaraja", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sura", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Kenia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fresca", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jomhuria", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lancelot", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pavanam", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rum Raisin", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Almendra SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Purple Purse", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kumar One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Modern Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Piedra", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Irish Grover", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Molle", + "category": "handwriting", + "variants": [ + "italic" + ] + }, + { + "family": "Cormorant Infant", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Margarine", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sahitya", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Mukta Vaani", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Astloch", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Snowburst One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rhodium Libre", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Smythe", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asset", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ewert", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Keania One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ranchers", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gorditas", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Sirin Stencil", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Gruesa Libre", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trochut", + "category": "display", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Baloo Chettan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kdam Thmor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Timmana", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Original Surfer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Supermercado One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mirza", + "category": "display", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Passero One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Oval", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Caesar Dressing", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Taprom", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fascinate", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Seymour One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Freehand", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ravi Prakash", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Coiny", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Atomic Age", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jacques Francois Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Diplomata", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dr Sugiyama", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miltonian", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ribeye Marrow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Elsie Swash Caps", + "category": "display", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Felipa", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Galada", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Script", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bayon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Underdog", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Devonshire", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Atma", + "category": "display", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Londrina Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sofadi One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Tillana", + "category": "handwriting", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Inknut Antiqua", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Goblin One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rakkas", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Metal", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Farsan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Sketch", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Cut", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BioRhyme", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "700", + "800" + ] + }, + { + "family": "Warnes", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Romanesco", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fascinate Inline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mrs Sheppards", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Princess Sofia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Modak", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Spirax", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Upright", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Geostar Fill", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant SC", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Baloo Bhai", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sree Krushnadevaraya", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Smokum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arbutus", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fruktur", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Geostar", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marko One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Erica One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yatra One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Uncial Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Combo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gidugu", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aubrey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jim Nightshade", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Butterfly Kids", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Metal Mania", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Macondo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chenla", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Miss Fajardose", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Macondo Swash Caps", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Barrio", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sevillana", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bigelow Rules", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rasa", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Risque", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Federant", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dangrek", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chathura", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "700", + "800" + ] + }, + { + "family": "Almendra Display", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chela One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bonbon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Stalinist One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mr Bedfort", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Eater", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fasthand", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mogra", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Padauk", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Preahvihear", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Flavors", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ruge Boogie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Tenali Ramakrishna", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Unlock", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Butcherman", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Da", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lakki Reddy", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Unicase", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Katibeh", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asar", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Emblema One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Moulpali", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Meera Inimai", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Kantumruy", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Suravaram", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Hairline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overpass Mono", + "category": "monospace", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Peddana", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bahiana", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kumar One Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Hanalei Fill", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dhurjati", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Hanalei", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kavivanar", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BioRhyme Expanded", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "700", + "800" + ] + } +] diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js new file mode 100644 index 00000000..f214b655 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/js/customizer.js @@ -0,0 +1,250 @@ +function gp_premium_typography_live_update( id, selector, property, unit, media, settings ) { + settings = typeof settings !== 'undefined' ? settings : 'generate_settings'; + wp.customize( settings + '[' + id + ']', function( value ) { + value.bind( function( newval ) { + // Get our unit if applicable + unit = typeof unit !== 'undefined' ? unit : ''; + + var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, + isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; + + if ( isTablet ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'tablet_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( isMobile ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'mobile_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( 'buttons_font_size' == id && '' == wp.customize('generate_settings[buttons_font_size]').get() ) { + newval = wp.customize('generate_settings[body_font_size]').get(); + } + + if ( 'single_post_title_weight' == id && '' == wp.customize('generate_settings[single_post_title_weight]').get() ) { + newval = wp.customize('generate_settings[heading_1_weight]').get(); + } + + if ( 'single_post_title_transform' == id && '' == wp.customize('generate_settings[single_post_title_transform]').get() ) { + newval = wp.customize('generate_settings[heading_1_transform]').get(); + } + + if ( 'archive_post_title_weight' == id && '' == wp.customize('generate_settings[archive_post_title_weight]').get() ) { + newval = wp.customize('generate_settings[heading_2_weight]').get(); + } + + if ( 'archive_post_title_transform' == id && '' == wp.customize('generate_settings[archive_post_title_transform]').get() ) { + newval = wp.customize('generate_settings[heading_2_transform]').get(); + } + + // We're using a desktop value + if ( ! isTablet && ! isMobile ) { + + var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', + mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; + + // The tablet setting exists, mobile doesn't + if ( '' !== tabletValue && '' == mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.mobile; + } + + // The tablet setting doesn't exist, mobile does + if ( '' == tabletValue && '' !== mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.tablet; + } + + // The tablet setting doesn't exist, neither does mobile + if ( '' == tabletValue && '' == mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.tablet + ', ' + gp_typography.mobile; + } + + } + + // Check if media query + media_query = typeof media !== 'undefined' ? 'media="' + media + '"' : ''; + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + id ).not( ':last' ).remove(); + }, 1000); + + setTimeout("jQuery('body').trigger('generate_spacing_updated');", 1000); + } ); + } ); +} + +/** + * Body font size, weight and transform + */ +gp_premium_typography_live_update( 'body_font_size', 'body, button, input, select, textarea', 'font-size', 'px' ); +gp_premium_typography_live_update( 'body_line_height', 'body', 'line-height', '' ); +gp_premium_typography_live_update( 'paragraph_margin', 'p, .entry-content > [class*="wp-block-"]:not(:last-child)', 'margin-bottom', 'em' ); +gp_premium_typography_live_update( 'body_font_weight', 'body, button, input, select, textarea', 'font-weight' ); +gp_premium_typography_live_update( 'body_font_transform', 'body, button, input, select, textarea', 'text-transform' ); + +/** + * Top bar font size, weight and transform + */ +gp_premium_typography_live_update( 'top_bar_font_size', '.top-bar', 'font-size', 'px' ); +gp_premium_typography_live_update( 'top_bar_font_weight', '.top-bar', 'font-weight' ); +gp_premium_typography_live_update( 'top_bar_font_transform', '.top-bar', 'text-transform' ); + +/** + * Site title font size, weight and transform + */ +gp_premium_typography_live_update( 'site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'tablet_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); +gp_premium_typography_live_update( 'mobile_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'site_title_font_weight', '.main-title, .navigation-branding .main-title', 'font-weight' ); +gp_premium_typography_live_update( 'site_title_font_transform', '.main-title, .navigation-branding .main-title', 'text-transform' ); + +/** + * Site description font size, weight and transform + */ +gp_premium_typography_live_update( 'site_tagline_font_size', '.site-description', 'font-size', 'px' ); +gp_premium_typography_live_update( 'site_tagline_font_weight', '.site-description', 'font-weight' ); +gp_premium_typography_live_update( 'site_tagline_font_transform', '.site-description', 'text-transform' ); + +/** + * Main navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'navigation_font_size', '.main-navigation a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'tablet_navigation_font_size', '.main-navigation a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.tablet ); +gp_premium_typography_live_update( 'mobile_navigation_font_size', '.main-navigation:not(.slideout-navigation) a, .menu-toggle, .main-navigation .menu-bar-items', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'navigation_font_weight', '.main-navigation a, .menu-toggle', 'font-weight' ); +gp_premium_typography_live_update( 'navigation_font_transform', '.main-navigation a, .menu-toggle', 'text-transform' ); + +/** + * Site title when in navigation. + */ + gp_premium_typography_live_update( 'navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); + gp_premium_typography_live_update( 'tablet_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); + gp_premium_typography_live_update( 'mobile_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); + +/** + * Secondary navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'secondary_navigation_font_size', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar, .secondary-navigation .secondary-menu-bar-items', 'font-size', 'px', '', 'generate_secondary_nav_settings' ); +gp_premium_typography_live_update( 'secondary_navigation_font_weight', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'font-weight', '', '', 'generate_secondary_nav_settings' ); +gp_premium_typography_live_update( 'secondary_navigation_font_transform', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'text-transform', '', '', 'generate_secondary_nav_settings' ); + +/** + * Buttons + */ +gp_premium_typography_live_update( 'buttons_font_size', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-size', 'px' ); +gp_premium_typography_live_update( 'buttons_font_weight', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-weight' ); +gp_premium_typography_live_update( 'buttons_font_transform', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'text-transform' ); + +/** + * H1 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_1_weight', 'h1', 'font-weight' ); +gp_premium_typography_live_update( 'heading_1_transform', 'h1', 'text-transform' ); +gp_premium_typography_live_update( 'heading_1_line_height', 'h1', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_1_margin_bottom', 'h1', 'margin-bottom', 'px' ); + +/** + * Single content title (h1) + */ +gp_premium_typography_live_update( 'single_post_title_font_size', 'h1.entry-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'single_post_title_font_size_mobile', 'h1.entry-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'single_post_title_weight', 'h1.entry-title', 'font-weight' ); +gp_premium_typography_live_update( 'single_post_title_transform', 'h1.entry-title', 'text-transform' ); +gp_premium_typography_live_update( 'single_post_title_line_height', 'h1.entry-title', 'line-height', 'em' ); + +/** + * H2 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_2_weight', 'h2', 'font-weight' ); +gp_premium_typography_live_update( 'heading_2_transform', 'h2', 'text-transform' ); +gp_premium_typography_live_update( 'heading_2_line_height', 'h2', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_2_margin_bottom', 'h2', 'margin-bottom', 'px' ); + +/** + * Archive post title (h1) + */ +gp_premium_typography_live_update( 'archive_post_title_font_size', 'h2.entry-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'archive_post_title_font_size_mobile', 'h2.entry-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'archive_post_title_weight', 'h2.entry-title', 'font-weight' ); +gp_premium_typography_live_update( 'archive_post_title_transform', 'h2.entry-title', 'text-transform' ); +gp_premium_typography_live_update( 'archive_post_title_line_height', 'h2.entry-title', 'line-height', 'em' ); + +/** + * H3 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_3_font_size', 'h3', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_3_font_size', 'h3', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_3_weight', 'h3', 'font-weight' ); +gp_premium_typography_live_update( 'heading_3_transform', 'h3', 'text-transform' ); +gp_premium_typography_live_update( 'heading_3_line_height', 'h3', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_3_margin_bottom', 'h3', 'margin-bottom', 'px' ); + +/** + * H4 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_4_font_size', 'h4', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_4_font_size', 'h4', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_4_weight', 'h4', 'font-weight' ); +gp_premium_typography_live_update( 'heading_4_transform', 'h4', 'text-transform' ); +gp_premium_typography_live_update( 'heading_4_line_height', 'h4', 'line-height', 'em' ); + +/** + * H5 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_5_font_size', 'h5', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_5_font_size', 'h5', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_5_weight', 'h5', 'font-weight' ); +gp_premium_typography_live_update( 'heading_5_transform', 'h5', 'text-transform' ); +gp_premium_typography_live_update( 'heading_5_line_height', 'h5', 'line-height', 'em' ); + +/** + * H6 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_6_font_size', 'h6', 'font-size', 'px' ); +gp_premium_typography_live_update( 'heading_6_weight', 'h6', 'font-weight' ); +gp_premium_typography_live_update( 'heading_6_transform', 'h6', 'text-transform' ); +gp_premium_typography_live_update( 'heading_6_line_height', 'h6', 'line-height', 'em' ); + +/** + * Widget title font size, weight and transform + */ +gp_premium_typography_live_update( 'widget_title_font_size', '.widget-title', 'font-size', 'px' ); +gp_premium_typography_live_update( 'widget_title_font_weight', '.widget-title', 'font-weight' ); +gp_premium_typography_live_update( 'widget_title_font_transform', '.widget-title', 'text-transform' ); +gp_premium_typography_live_update( 'widget_title_separator', '.widget-title', 'margin-bottom', 'px' ); +gp_premium_typography_live_update( 'widget_content_font_size', '.sidebar .widget, .footer-widgets .widget', 'font-size', 'px' ); + +/** + * Footer font size, weight and transform + */ +gp_premium_typography_live_update( 'footer_font_size', '.site-info', 'font-size', 'px' ); +gp_premium_typography_live_update( 'footer_weight', '.site-info', 'font-weight' ); +gp_premium_typography_live_update( 'footer_transform', '.site-info', 'text-transform' ); +gp_premium_typography_live_update( 'footer_line_height', '.site-info', 'line-height', 'em' ); + +/** + * WooCommerce product title + */ +gp_premium_typography_live_update( 'wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'wc_product_title_font_weight', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-weight' ); +gp_premium_typography_live_update( 'wc_product_title_font_transform', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'text-transform' ); + +gp_premium_typography_live_update( 'wc_related_product_title_font_size', '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2', 'font-size', 'px' ); + +/** + * Slideout navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'slideout_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'slideout_mobile_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'slideout_font_weight', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-weight' ); +gp_premium_typography_live_update( 'slideout_font_transform', '.slideout-navigation.main-navigation .main-nav ul li a', 'text-transform' ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php new file mode 100644 index 00000000..c2ea0e08 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/migration.php @@ -0,0 +1,359 @@ + $generate_settings[ $setting ], + 'variants' => $variants, + 'category' => $category ? $category : 'sans-serif', + ); + } + + if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { + $secondary_nav_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $secondary_nav_id = strtolower( str_replace( ' ', '_', $secondary_nav_settings[ 'font_secondary_navigation' ] ) ); + + if ( ! array_key_exists( $secondary_nav_id, $select_fonts ) && ! in_array( $secondary_nav_settings[ 'font_secondary_navigation' ], generate_typography_default_fonts() ) ) { + $variants = get_theme_mod( 'font_secondary_navigation_variants', array() ); + $category = get_theme_mod( 'font_secondary_navigation_category' ); + + if ( ! empty( $variants ) && ! is_array( $variants ) ) { + $variants = explode( ',', $variants ); + } + + if ( ! $variants ) { + if ( ! $all_fonts ) { + $all_fonts = generate_get_all_google_fonts(); + } + + if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { + $variants = $all_fonts[ $secondary_nav_id ]['variants']; + } + } + + if ( ! $category ) { + if ( ! $all_fonts ) { + $all_fonts = generate_get_all_google_fonts(); + } + + if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { + $category = $all_fonts[ $secondary_nav_id ]['category']; + } + } + + $fonts[ $secondary_nav_id ] = array( + 'name' => $secondary_nav_settings[ 'font_secondary_navigation' ], + 'variants' => $variants, + 'category' => $category ? $category : 'sans-serif', + ); + } + } + + return $fonts; + } +} + +if ( ! function_exists( 'generate_typography_set_font_data' ) ) { + add_action( 'admin_init', 'generate_typography_set_font_data' ); + /** + * This function will check to see if your category and variants are saved + * If not, it will set them for you, and won't run again + * + * @since 1.2.90 + */ + function generate_typography_set_font_data() { + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Get our defaults + $defaults = generate_get_default_fonts(); + + // Get our settings + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // We need to loop through these settings + $font_settings = array( + 'font_body', + 'font_site_title', + 'font_site_tagline', + 'font_navigation', + 'font_widget_title', + 'font_heading_1', + 'font_heading_2', + 'font_heading_3' + ); + + // Add secondary navigation to the array last if it exists + if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { + $font_settings[ 'font_secondary_navigation' ] = 'font_secondary_navigation'; + } + + // Start looping + foreach( $font_settings as $setting ) { + + // Change our variables for the secondary navigation - this will run last + if ( function_exists( 'generate_secondary_nav_get_defaults' ) && 'font_secondary_navigation' == $setting ) { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + $defaults = generate_secondary_nav_get_defaults(); + } + + // We don't need to do this if we're using the default font, as these values have defaults already + if ( $defaults[ $setting ] == $generate_settings[ $setting ] ) { + continue; + } + + // Don't need to continue if we're using a system font or our default font + if ( in_array( $generate_settings[ $setting ], generate_typography_default_fonts() ) || 'Open Sans' == $generate_settings[ $setting ] ) { + continue; + } + + // Don't continue if our category and variants are already set + if ( get_theme_mod( $setting . '_category' ) && get_theme_mod( $setting . '_variants' ) ) { + continue; + } + + // Get all of our fonts + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $generate_settings[ $setting ] ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + continue; + } + + // Let's grab our category to go with our font + $category = ! empty( $fonts[$id]['category'] ) ? $fonts[$id]['category'] : ''; + + // Grab all of the variants associated with our font + $variants = $fonts[$id]['variants']; + + // Loop through our variants and put them into an array, then turn them into a comma separated list + $output = array(); + if ( $variants ) { + foreach ( $variants as $variant ) { + $output[] = $variant; + } + + $variants = implode( ',', $output ); + } + + // Set our theme mods with our new settings + if ( '' !== $category ) { + set_theme_mod( $setting . '_category', $category ); + } + + if ( '' !== $variants ) { + set_theme_mod( $setting . '_variants', $variants ); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php new file mode 100644 index 00000000..76081000 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/secondary-nav-fonts.php @@ -0,0 +1,176 @@ +get_section( 'secondary_nav_section' ) ) { + return; + } + + // Get our controls + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + // Get our defaults + $defaults = generate_secondary_nav_get_defaults(); + + // Register our custom controls + if ( method_exists( $wp_customize,'register_control_type' ) ) { + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Add our section + $wp_customize->add_section( + 'secondary_font_section', + array( + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 51, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_secondary_navigation_typography_shortcuts', + array( + 'section' => 'secondary_font_section', + 'element' => __( 'Secondary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'secondary_nav_section', + 'colors' => 'secondary_navigation_color_section', + 'backgrounds' => 'secondary_bg_images_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_secondary_nav_settings[font_secondary_navigation]', + array( + 'default' => $defaults['font_secondary_navigation'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_secondary_navigation_category', + array( + 'default' => $defaults['font_secondary_navigation_category'], + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_secondary_navigation_variants', + array( + 'default' => $defaults['font_secondary_navigation_variants'], + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_weight]', + array( + 'default' => $defaults['secondary_navigation_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Font transform + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_transform]', + array( + 'default' => $defaults['secondary_navigation_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_site_secondary_navigation_control', + array( + 'section' => 'secondary_font_section', + 'settings' => array( + 'family' => 'generate_secondary_nav_settings[font_secondary_navigation]', + 'variant' => 'font_secondary_navigation_variants', + 'category' => 'font_secondary_navigation_category', + 'weight' => 'generate_secondary_nav_settings[secondary_navigation_font_weight]', + 'transform' => 'generate_secondary_nav_settings[secondary_navigation_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_size]', + array( + 'default' => $defaults['secondary_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_navigation_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'secondary_font_section', + 'priority' => 165, + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_navigation_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php new file mode 100644 index 00000000..a6619549 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/slideout-nav-fonts.php @@ -0,0 +1,149 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Bail if Menu Plus isn't activated + if ( ! $wp_customize->get_section( 'menu_plus_slideout_menu' ) ) { + return; + } + + $wp_customize->add_section( + 'generate_slideout_typography', + array( + 'title' => __( 'Off Canvas Panel', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 52, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_off_canvas_panel_typography_shortcuts', + array( + 'section' => 'generate_slideout_typography', + 'element' => esc_html__( 'Off Canvas Panel', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'slideout_color_section', + 'layout' => 'menu_plus_slideout_menu', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[slideout_font_weight]', + array( + 'default' => $defaults['slideout_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[slideout_font_transform]', + array( + 'default' => $defaults['slideout_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'slideout_navigation_typography', + array( + 'label' => esc_html__( 'Menu Items', 'gp-premium' ), + 'section' => 'generate_slideout_typography', + 'settings' => array( + 'weight' => 'generate_settings[slideout_font_weight]', + 'transform' => 'generate_settings[slideout_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[slideout_font_size]', + array( + 'default' => $defaults['slideout_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[slideout_mobile_font_size]', + array( + 'default' => $defaults['slideout_mobile_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[slideout_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_slideout_typography', + 'settings' => array( + 'desktop' => 'generate_settings[slideout_font_size]', + 'mobile' => 'generate_settings[slideout_mobile_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php new file mode 100644 index 00000000..b1d0b3c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/functions/woocommerce-fonts.php @@ -0,0 +1,179 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Bail if WooCommerce isn't activated + if ( ! $wp_customize->get_section( 'generate_woocommerce_typography' ) ) { + return; + } + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_woocommerce_typography_shortcuts', + array( + 'section' => 'generate_woocommerce_typography', + 'element' => __( 'WooCommerce', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_woocommerce_layout', + 'colors' => 'generate_woocommerce_colors', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + // WooCommerce + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_weight]', + array( + 'default' => $defaults['wc_product_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_transform]', + array( + 'default' => $defaults['wc_product_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_wc_product_title_control', + array( + 'label' => __( 'Shop Product Titles', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'settings' => array( + 'weight' => 'generate_settings[wc_product_title_font_weight]', + 'transform' => 'generate_settings[wc_product_title_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_size]', + array( + 'default' => $defaults['wc_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_wc_product_title_font_size]', + array( + 'default' => $defaults['mobile_wc_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[wc_product_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[wc_product_title_font_size]', + 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[wc_related_product_title_font_size]', + array( + 'default' => $defaults['wc_related_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[wc_related_product_title_font_size]', + array( + 'description' => __( 'Related/upsell title font size', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[wc_related_product_title_font_size]', + 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php new file mode 100644 index 00000000..fd8a9939 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/typography/generate-fonts.php @@ -0,0 +1,20 @@ +add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_woocommerce_colors_shortcuts', + array( + 'section' => 'generate_woocommerce_colors', + 'element' => __( 'WooCommerce', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_woocommerce_layout', + 'typography' => 'generate_woocommerce_typography', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + $color_defaults = generate_get_color_defaults(); + + $wp_customize->add_section( + 'generate_woocommerce_colors', + array( + 'title' => __( 'Colors', 'gp-premium' ), + 'priority' => 40, + 'panel' => 'woocommerce', + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_button_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Buttons', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-button-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_alt_button_background', + 'generate_woocommerce_colors', + 'woocommerce-button-colors', + array( + 'generate_settings[wc_alt_button_background]' => array( + 'default_value' => $color_defaults['wc_alt_button_background'], + 'label' => __( 'Alt Button Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover', + 'property' => 'background-color', + 'hide_label' => false, + ), + 'generate_settings[wc_alt_button_background_hover]' => array( + 'default_value' => $color_defaults['wc_alt_button_background_hover'], + 'label' => __( 'Alt Button Background Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover', + 'property' => 'background-color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_alt_button_text', + 'generate_woocommerce_colors', + 'woocommerce-button-colors', + array( + 'generate_settings[wc_alt_button_text]' => array( + 'default_value' => $color_defaults['wc_alt_button_text'], + 'label' => __( 'Alt Button Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_settings[wc_alt_button_text_hover]' => array( + 'default_value' => $color_defaults['wc_alt_button_text_hover'], + 'label' => __( 'Alt Button Text Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover', + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_product_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Products', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-product-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_product_title', + 'generate_woocommerce_colors', + 'woocommerce-product-colors', + array( + 'generate_settings[wc_product_title_color]' => array( + 'default_value' => $color_defaults['wc_product_title_color'], + 'label' => __( 'Product Title', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_settings[wc_product_title_color_hover]' => array( + 'default_value' => $color_defaults['wc_product_title_color_hover'], + 'label' => __( 'Product Title Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover', + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_rating_stars', + 'generate_woocommerce_colors', + 'woocommerce-product-colors', + array( + 'generate_settings[wc_rating_stars]' => array( + 'default_value' => $color_defaults['wc_rating_stars'], + 'label' => __( 'Star Ratings', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_sale_sticker_background', + 'generate_woocommerce_colors', + 'woocommerce-product-colors', + array( + 'generate_settings[wc_sale_sticker_background]' => array( + 'default_value' => $color_defaults['wc_sale_sticker_background'], + 'label' => __( 'Sale Sticker Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce span.onsale', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_sale_sticker_text', + 'generate_woocommerce_colors', + 'woocommerce-product-colors', + array( + 'generate_settings[wc_sale_sticker_text]' => array( + 'default_value' => $color_defaults['wc_sale_sticker_text'], + 'label' => __( 'Sale Sticker Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce span.onsale', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_price_text', + 'generate_woocommerce_colors', + 'woocommerce-product-colors', + array( + 'generate_settings[wc_price_color]' => array( + 'default_value' => $color_defaults['wc_price_color'], + 'label' => __( 'Price', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce ul.products li.product .price, .woocommerce div.product p.price', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_panel_cart_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Sticky Panel Cart', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-panel-cart-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_panel_cart_background', + 'generate_woocommerce_colors', + 'woocommerce-panel-cart-colors', + array( + 'generate_settings[wc_panel_cart_background_color]' => array( + 'default_value' => $color_defaults['wc_panel_cart_background_color'], + 'label' => __( 'Background Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.add-to-cart-panel', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_panel_cart_text', + 'generate_woocommerce_colors', + 'woocommerce-panel-cart-colors', + array( + 'generate_settings[wc_panel_cart_text_color]' => array( + 'default_value' => $color_defaults['wc_panel_cart_text_color'], + 'label' => __( 'Text Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.add-to-cart-panel, .add-to-cart-panel a:not(.button)', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_panel_cart_button_background', + 'generate_woocommerce_colors', + 'woocommerce-panel-cart-colors', + array( + 'generate_settings[wc_panel_cart_button_background]' => array( + 'default_value' => $color_defaults['wc_panel_cart_button_background'], + 'label' => __( 'Button Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '#wc-sticky-cart-panel .button', + 'property' => 'background-color', + 'hide_label' => false, + ), + 'generate_settings[wc_panel_cart_button_background_hover]' => array( + 'default_value' => $color_defaults['wc_panel_cart_button_background_hover'], + 'label' => __( 'Button Background Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', + 'property' => 'background-color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_panel_cart_button_text', + 'generate_woocommerce_colors', + 'woocommerce-panel-cart-colors', + array( + 'generate_settings[wc_panel_cart_button_text]' => array( + 'default_value' => $color_defaults['wc_panel_cart_button_text'], + 'label' => __( 'Button Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '#wc-sticky-cart-panel .button', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_settings[wc_panel_cart_button_text_hover]' => array( + 'default_value' => $color_defaults['wc_panel_cart_button_text_hover'], + 'label' => __( 'Button Text Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_mini_cart_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Menu Mini Cart', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-mini-cart-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_mini_cart_background', + 'generate_woocommerce_colors', + 'woocommerce-mini-cart-colors', + array( + 'generate_settings[wc_mini_cart_background_color]' => array( + 'default_value' => $color_defaults['wc_mini_cart_background_color'], + 'label' => __( 'Background Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '#wc-mini-cart', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_mini_cart_text', + 'generate_woocommerce_colors', + 'woocommerce-mini-cart-colors', + array( + 'generate_settings[wc_mini_cart_text_color]' => array( + 'default_value' => $color_defaults['wc_mini_cart_text_color'], + 'label' => __( 'Text Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '#wc-mini-cart', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_mini_cart_button_background', + 'generate_woocommerce_colors', + 'woocommerce-mini-cart-colors', + array( + 'generate_settings[wc_mini_cart_button_background]' => array( + 'default_value' => $color_defaults['wc_mini_cart_button_background'], + 'label' => __( 'Button Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '#wc-mini-cart .button', + 'property' => 'background-color', + 'hide_label' => false, + ), + 'generate_settings[wc_mini_cart_button_background_hover]' => array( + 'default_value' => $color_defaults['wc_mini_cart_button_background_hover'], + 'label' => __( 'Button Background Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active', + 'property' => 'background-color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_mini_cart_button_text', + 'generate_woocommerce_colors', + 'woocommerce-mini-cart-colors', + array( + 'generate_settings[wc_mini_cart_button_text]' => array( + 'default_value' => $color_defaults['wc_mini_cart_button_text'], + 'label' => __( 'Button Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Initial Color', 'gp-premium' ), + 'element' => '#wc-mini-cart .button', + 'property' => 'color', + 'hide_label' => false, + ), + 'generate_settings[wc_mini_cart_button_text_hover]' => array( + 'default_value' => $color_defaults['wc_mini_cart_button_text_hover'], + 'label' => __( 'Button Text Hover', 'gp-premium' ), + 'tooltip' => __( 'Choose Hover Color', 'gp-premium' ), + 'element' => '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active', + 'property' => 'color', + 'hide_label' => true, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_price_slider_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Price Slider Widget', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-price-slider-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_price_slider_background', + 'generate_woocommerce_colors', + 'woocommerce-price-slider-colors', + array( + 'generate_settings[wc_price_slider_background_color]' => array( + 'default_value' => $color_defaults['wc_price_slider_background_color'], + 'label' => __( 'Slider Background Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_price_slider_bar', + 'generate_woocommerce_colors', + 'woocommerce-price-slider-colors', + array( + 'generate_settings[wc_price_slider_bar_color]' => array( + 'default_value' => $color_defaults['wc_price_slider_bar_color'], + 'label' => __( 'Slider Bar Color', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_product_tabs_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Product Tabs', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-product-tabs-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_product_tab_text', + 'generate_woocommerce_colors', + 'woocommerce-product-tabs-colors', + array( + 'generate_settings[wc_product_tab]' => array( + 'default_value' => $color_defaults['wc_product_tab'], + 'label' => __( 'Product Tab Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_product_tab_text', + 'generate_woocommerce_colors', + 'woocommerce-product-tabs-colors', + array( + 'generate_settings[wc_product_tab_highlight]' => array( + 'default_value' => $color_defaults['wc_product_tab_highlight'], + 'label' => __( 'Product Tab Active', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_woocommerce_messages_colors_title', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Messages', 'gp-premium' ), + 'choices' => array( + 'toggleId' => 'woocommerce-messages-colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_success_message_background', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_success_message_background]' => array( + 'default_value' => $color_defaults['wc_success_message_background'], + 'label' => __( 'Success Message Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-message', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_success_message_text', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_success_message_text]' => array( + 'default_value' => $color_defaults['wc_success_message_text'], + 'label' => __( 'Success Message Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-message', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_info_message_background', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_info_message_background]' => array( + 'default_value' => $color_defaults['wc_info_message_background'], + 'label' => __( 'Info Message Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-info', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_info_message_text', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_info_message_text]' => array( + 'default_value' => $color_defaults['wc_info_message_text'], + 'label' => __( 'Info Message Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-info', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_error_message_background', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_error_message_background]' => array( + 'default_value' => $color_defaults['wc_error_message_background'], + 'label' => __( 'Error Message Background', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-error', + 'property' => 'background-color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_color_field_group( + 'woocommerce_error_message_text', + 'generate_woocommerce_colors', + 'woocommerce-messages-colors', + array( + 'generate_settings[wc_error_message_text]' => array( + 'default_value' => $color_defaults['wc_error_message_text'], + 'label' => __( 'Error Message Text', 'gp-premium' ), + 'tooltip' => __( 'Choose Color', 'gp-premium' ), + 'element' => '.woocommerce-error', + 'property' => 'color', + 'hide_label' => false, + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'woocommerce_colors_redirect', + array( + 'section' => 'generate_colors_section', + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'choices' => array( + 'sectionRedirect' => true, + 'toggleId' => 'generate_woocommerce_colors', + ), + ) + ); + + GeneratePress_Customize_Field::add_title( + 'generate_colors_redirect', + array( + 'section' => 'generate_woocommerce_colors', + 'title' => __( 'Other Theme Colors', 'gp-premium' ), + 'choices' => array( + 'sectionRedirect' => true, + 'toggleId' => 'generate_colors_section', + ), + ) + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css new file mode 100644 index 00000000..bb3462da --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.css @@ -0,0 +1,201 @@ +.woocommerce-product-gallery { + margin-right: 0; +} + +.woocommerce .woocommerce-ordering, +.woocommerce-page .woocommerce-ordering { + float: none; +} + +.woocommerce .woocommerce-ordering select { + max-width: 100%; +} + +.woocommerce #wc-column-container.wc-mobile-columns-1 .products, +.wc-related-upsell-mobile-columns-1 .related ul.products, +.wc-related-upsell-mobile-columns-1 .up-sells ul.products { + -ms-grid-columns: 1fr; + grid-template-columns: repeat(1, minmax(0, 1fr)); +} + +.woocommerce #wc-column-container.wc-mobile-columns-2 .products, +.wc-related-upsell-mobile-columns-2 .related ul.products, +.wc-related-upsell-mobile-columns-2 .up-sells ul.products { + -ms-grid-columns: 1fr 1fr; + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.woocommerce #wc-column-container.wc-mobile-columns-3 .products, +.wc-related-upsell-mobile-columns-3 .related ul.products, +.wc-related-upsell-mobile-columns-3 .up-sells ul.products { + -ms-grid-columns: 1fr 1fr 1fr; + grid-template-columns: repeat(3, minmax(0, 1fr)); +} + +.woocommerce ul.products li.product a img { + width: auto; + margin-left: auto; + margin-right: auto; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs, +.woocommerce div.product .woocommerce-tabs .panel { + float: none; + width: 100%; +} + +.woocommerce div.product .woocommerce-tabs .panel { + margin-top: 20px; +} + +.wc-tabs .active a:after { + transform: rotate(90deg); + padding-right: 3px; +} + +.woocommerce .col2-set, +.woocommerce-page .col2-set { + width: 100%; + float: none; + margin-right: 0; +} + +#customer_details + #wc_checkout_add_ons, +#order_review, +#order_review_heading { + width: 100%; + float: none; + margin-right: 0; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image, +.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image { + float: none; + margin: 0; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img, +.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img { + width: 100%; +} + +.woocommerce .related ul.products li.product, +.woocommerce-page .related ul.products li.product, +.woocommerce-page[class*=columns-] .related ul.products li.product, +.woocommerce[class*=columns-] .related ul.products li.product, +.woocommerce .up-sells ul.products li.product, +.woocommerce-page .up-sells ul.products li.product, +.woocommerce-page[class*=columns-] .up-sells ul.products li.product, +.woocommerce[class*=columns-] .up-sells ul.products li.product { + width: 100%; + margin-left: 0; + margin-right: 0; +} + +.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first, +.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last, +.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first, +.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last { + float: none; + width: 100%; +} + +.woocommerce-account .woocommerce-MyAccount-navigation { + width: 100%; +} + +.woocommerce-MyAccount-navigation li.is-active a:after { + content: "\e901"; +} + +#wc-mini-cart { + display: none; +} + +.do-quantity-buttons div.quantity { + justify-content: flex-end; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs { + flex-direction: column; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li { + border-left-width: 1px; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child { + border-bottom-color: rgba(0, 0, 0, 0.08); + border-bottom-width: 1px; +} + +.woocommerce .coupon .button { + font-size: 14px; + padding: 10px; +} + +.woocommerce .woocommerce-ordering { + margin-bottom: 0; +} + +.add-to-cart-panel { + bottom: 0; + top: auto; + transform: translateY(0px) !important; +} + +.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before { + content: "\f00d"; + font-family: 'GP Premium'; + line-height: 1em; + width: 1.28571429em; + text-align: center; + display: inline-block; + padding: 10px; +} + +#wc-sticky-cart-panel .quantity, +.add-to-cart-panel .continue-shopping-link { + display: none; +} + +.add-to-cart-panel .continue-shopping { + order: 5; + margin-left: auto; + margin-right: 0; + position: absolute; + top: -20px; + left: 10px; + height: 50px; + width: 50px; + text-align: center; + border-radius: 50%; + line-height: 50px; + cursor: pointer; +} + +.add-to-cart-panel .continue-shopping .gp-icon { + display: block; +} + +.add-to-cart-panel .product-image, +.add-to-cart-panel .cart { + flex-shrink: 0; +} + +.add-to-cart-panel .product-title { + padding-right: 20px; + margin-left: 10px; +} + +.add-to-cart-panel .cart-info { + margin-right: auto; +} + +.add-to-cart-panel .product-price { + font-size: 13px; +} + +.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart) { + pointer-events: none; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css new file mode 100644 index 00000000..489a04fd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce-mobile.min.css @@ -0,0 +1 @@ +.woocommerce-product-gallery{margin-right:0}.woocommerce .woocommerce-ordering,.woocommerce-page .woocommerce-ordering{float:none}.woocommerce .woocommerce-ordering select{max-width:100%}.wc-related-upsell-mobile-columns-1 .related ul.products,.wc-related-upsell-mobile-columns-1 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-1 .products{-ms-grid-columns:1fr;grid-template-columns:repeat(1,minmax(0,1fr))}.wc-related-upsell-mobile-columns-2 .related ul.products,.wc-related-upsell-mobile-columns-2 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-2 .products{-ms-grid-columns:1fr 1fr;grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-mobile-columns-3 .related ul.products,.wc-related-upsell-mobile-columns-3 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-3 .products{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:repeat(3,minmax(0,1fr))}.woocommerce ul.products li.product a img{width:auto;margin-left:auto;margin-right:auto}.woocommerce div.product .woocommerce-tabs .panel,.woocommerce div.product .woocommerce-tabs ul.tabs{float:none;width:100%}.woocommerce div.product .woocommerce-tabs .panel{margin-top:20px}.wc-tabs .active a:after{transform:rotate(90deg);padding-right:3px}.woocommerce .col2-set,.woocommerce-page .col2-set{width:100%;float:none;margin-right:0}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:100%;float:none;margin-right:0}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product,.woocommerce-page .related ul.products li.product,.woocommerce-page .up-sells ul.products li.product,.woocommerce-page[class*=columns-] .related ul.products li.product,.woocommerce-page[class*=columns-] .up-sells ul.products li.product,.woocommerce[class*=columns-] .related ul.products li.product,.woocommerce[class*=columns-] .up-sells ul.products li.product{width:100%;margin-left:0;margin-right:0}.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last{float:none;width:100%}.woocommerce-account .woocommerce-MyAccount-navigation{width:100%}.woocommerce-MyAccount-navigation li.is-active a:after{content:"\e901"}#wc-mini-cart{display:none}.do-quantity-buttons div.quantity{justify-content:flex-end}.woocommerce div.product .woocommerce-tabs ul.tabs{flex-direction:column}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-left-width:1px}.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child{border-bottom-color:rgba(0,0,0,.08);border-bottom-width:1px}.woocommerce .coupon .button{font-size:14px;padding:10px}.woocommerce .woocommerce-ordering{margin-bottom:0}.add-to-cart-panel{bottom:0;top:auto;transform:translateY(0)!important}.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before{content:"\f00d";font-family:'GP Premium';line-height:1em;width:1.28571429em;text-align:center;display:inline-block;padding:10px}#wc-sticky-cart-panel .quantity,.add-to-cart-panel .continue-shopping-link{display:none}.add-to-cart-panel .continue-shopping{order:5;margin-left:auto;margin-right:0;position:absolute;top:-20px;left:10px;height:50px;width:50px;text-align:center;border-radius:50%;line-height:50px;cursor:pointer}.add-to-cart-panel .continue-shopping .gp-icon{display:block}.add-to-cart-panel .cart,.add-to-cart-panel .product-image{flex-shrink:0}.add-to-cart-panel .product-title{padding-right:20px;margin-left:10px}.add-to-cart-panel .cart-info{margin-right:auto}.add-to-cart-panel .product-price{font-size:13px}.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart){pointer-events:none} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css new file mode 100644 index 00000000..a7eb7ad8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.css @@ -0,0 +1,1284 @@ +@supports (display: grid) { + .woocommerce ul.products li.product { + display: flex; + flex-direction: column; + } +} + +.woocommerce ul.products li.product.woocommerce-image-align-left, +.woocommerce ul.products li.product.woocommerce-image-align-right { + display: block; +} + +.woocommerce ul.products li.product .woocommerce-LoopProduct-link { + display: block; + margin-bottom: auto; +} + +.woocommerce ul.products li.product .button { + margin-left: auto; + margin-right: auto; +} + +.woocommerce ul.products li.product.woocommerce-text-align-left .button { + margin-left: 0; +} + +.woocommerce ul.products li.product.woocommerce-text-align-right .button { + margin-right: 0; +} + +.woocommerce ul.products li.product .woocommerce-LoopProduct-link > *:not(:first-child) { + margin-top: 10px; + margin-bottom: 0; +} + +.woocommerce ul.products li.product .woocommerce-LoopProduct-link > .secondary-image + img { + margin-top: 0; +} + +.woocommerce ul.products li.product .onsale, +.woocommerce span.onsale { + position: relative; + border-radius: 0; + min-height: 15px; + min-width: initial; + font-weight: inherit; + font-size: inherit; + padding: 8px 13px; + line-height: 1; + display: inline-block; + top: auto; + left: auto; + font-size: 80%; + text-transform: uppercase; + font-weight: bold; +} + +.woocommerce ul.products li.product.sales-flash-overlay .onsale { + position: absolute; + top: 0; + right: 0; + margin: 0; +} + +.single-product span.onsale { + margin-bottom: 15px; +} + +.woocommerce-product-gallery { + margin-right: 4%; +} + +.rtl .woocommerce-product-gallery { + margin-right: 0; + margin-left: 4%; +} + +.woocommerce div.product div.images .flex-control-thumbs li { + max-width: 100px; + padding-top: 5px; + padding-right: 5px; + box-sizing: border-box; +} + +.woocommerce ul.products li.product .woocommerce-loop-product__title { + padding: 0; +} + +.woocommerce .page-header-image-single { + display: none; +} + +.woocommerce .entry-content, +.woocommerce .product .entry-summary { + margin-top: 0; +} + +.related.products { + clear: both; +} + +.checkout-subscribe-prompt.clear { + visibility: visible; + height: initial; + width: initial; +} + +.woocommerce .add_to_cart_button + .added_to_cart { + display: none; +} + +.woocommerce-result-count { + font-size: 14px; + padding: 10px 0; + border: 1px solid transparent; +} + +.woocommerce-ordering select { + font-size: 14px; + font-weight: 500; + padding: 10px 40px 10px 12px; + -webkit-appearance: none; + -moz-appearance: none; + width: 100%; + background: transparent; + border-color: rgba(0, 0, 0, 0.1); + color: inherit; + cursor: pointer; +} + +.woocommerce-ordering select::-ms-expand { + display: none; +} + +.woocommerce-ordering:after { + content: "\e903"; + font-family: "GP Premium"; + display: inline-block; + position: absolute; + pointer-events: none; + color: inherit; + top: 10px; + right: 15px; + font-size: 16px; +} + +.woocommerce-ordering select option { + color: initial; +} + +.woocommerce .woocommerce-ordering, +.woocommerce .woocommerce-result-count { + margin-bottom: 30px; +} + +.woocommerce-variation-add-to-cart { + display: flex; + flex-wrap: wrap; +} + +/* Columns */ +@supports (display: grid) { + #wc-column-container .product { + float: none; + width: auto; + margin: 0; + } + .woocommerce .wc-columns-container .products::after, + .woocommerce .wc-columns-container .products::before, + .woocommerce .related ul.products::after, + .woocommerce .related ul.products::before, + .woocommerce .up-sells ul.products::after, + .woocommerce .up-sells ul.products::before { + display: none; + } + .wc-columns-container .products, + .woocommerce .related ul.products, + .woocommerce .up-sells ul.products { + display: -ms-grid; + display: grid; + grid-gap: 50px; + width: 100%; + } + .wc-columns-container.wc-columns-6 .products, + .wc-related-upsell-columns-6 .related ul.products, + .wc-related-upsell-columns-6 .up-sells ul.products { + grid-template-columns: repeat(6, minmax(0, 1fr)); + } + .wc-columns-container.wc-columns-5 .products, + .wc-related-upsell-columns-5 .related ul.products, + .wc-related-upsell-columns-5 .up-sells ul.products { + grid-template-columns: repeat(5, minmax(0, 1fr)); + } + .woocommerce .wc-columns-container.wc-columns-4 .products, + .wc-related-upsell-columns-4 .related ul.products, + .wc-related-upsell-columns-4 .up-sells ul.products { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + .woocommerce .wc-columns-container.wc-columns-3 .products, + .wc-related-upsell-columns-3 .related ul.products, + .wc-related-upsell-columns-3 .up-sells ul.products { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + .woocommerce .wc-columns-container.wc-columns-2 .products, + .wc-related-upsell-columns-2 .related ul.products, + .wc-related-upsell-columns-2 .up-sells ul.products { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .woocommerce .wc-columns-container.wc-columns-1 .products, + .wc-related-upsell-columns-1 .related ul.products, + .wc-related-upsell-columns-1 .up-sells ul.products { + width: 100%; + } + .woocommerce .wc-columns-1 ul.products li.product, + .woocommerce-page .wc-columns-1 ul.products li.product { + margin-left: 0; + margin-right: 0; + } +} + +/* Mini Cart */ +#wc-mini-cart ul.woocommerce-mini-cart { + position: relative; + left: auto; + right: auto; + opacity: 1; + pointer-events: auto; + height: auto; + width: auto; + float: none; + background-color: transparent; + box-shadow: 0 0 0; + visibility: visible; +} + +.wc-mini-cart { + position: absolute; + width: 300px; + right: 0; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); + z-index: 99999; + left: -99999px; + opacity: 0; + height: 0; + overflow: hidden; + pointer-events: none; + transition: opacity 80ms linear; + transition-delay: 0s; + visibility: hidden; +} + +.wc-menu-item:hover .wc-mini-cart, +.wc-menu-item.sfHover .wc-mini-cart { + left: auto; + opacity: 1; + transition-delay: 150ms; + pointer-events: auto; + height: auto; + overflow: visible; + visibility: visible; +} + +.dropdown-click ul li.wc-menu-item:hover ul { + display: block; +} + +.sidebar .wc-mini-cart { + right: 100%; + top: 0; +} + +.sidebar .wc-mini-cart .widget { + background: none; +} + +body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart { + display: none; +} + +.wc-menu-item .sub-menu { + left: auto; + right: 0; + width: 300px; +} + +.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a, +.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a { + background: none; +} + +.wc-menu-item .wc-mini-cart .widget_shopping_cart { + padding: 15px; +} + +.woocommerce.widget_shopping_cart .cart_list li { + padding: 0 0 0 4em; + margin: 0; + box-sizing: border-box; + min-height: 3em; +} + +.woocommerce.widget_shopping_cart { + font-size: 14px; +} + +.widget_shopping_cart .woocommerce-mini-cart__buttons { + margin-bottom: 0; + display: flex; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a { + margin: 0; + width: calc(50% - 10px); + text-align: center; + padding: 10px 15px; + line-height: inherit; + font-size: 14px; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child { + margin-right: 2px; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child { + margin-left: 2px; +} + +.woocommerce.widget_shopping_cart .cart_list li a.remove { + right: 0; + left: auto; + height: 20px; + width: 20px; + border-width: 1px; + border-style: solid; + border-radius: 50%; + padding: 0; + font-size: 16px; + line-height: 17px; + font-weight: normal; + position: relative; + float: right; +} + +.woocommerce ul.cart_list li img { + position: absolute; + left: 0; + width: 3em; + height: auto; + top: 0; + margin-left: 0; +} + +#wc-mini-cart .woocommerce-mini-cart-item a { + padding: 0; +} + +.woocommerce-mini-cart-item .quantity { + font-size: 12px; + display: block; +} + +.woocommerce.widget_shopping_cart .total { + margin: 15px 0; + padding: 15px; + background: rgba(0, 0, 0, 0.05); + border: 0; + font-size: 14px; +} + +#wc-mini-cart .total { + padding: 15px; + margin: 15px -15px 15px; + text-align: left; +} + +#generate-slideout-menu .total { + padding: 10px 20px; + margin: 20px -20px 20px; +} + +#generate-slideout-menu.do-overlay .total { + margin: 20px 0; +} + +.woocommerce.widget_shopping_cart a.button.wc-forward:after { + display: none; +} + +.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child) { + margin-bottom: 15px; +} + +.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li { + padding: 0 4em 0 0; +} + +.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li a.remove { + float: left; +} + +.rtl .wc-mini-cart .woocommerce ul.cart_list li img { + right: 0; +} + +.slideout-widget .widget_shopping_cart_content, +.slideout-widget .widget_shopping_cart_content a { + font-size: 14px; +} + +#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item { + text-align: left; +} + +#wc-mini-cart a:not(.button) { + font-family: inherit; +} + +.wc-menu-item:not(.has-items) .wc-mini-cart { + display: none; +} + +.woocommerce-mini-cart__empty-message { + margin-bottom: 0; +} + +.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart, +.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart { + font-size: inherit; +} + +#wc-mini-cart .widgettitle { + display: none; +} + +/* Related/Upsell products */ +@supports (display: grid) { + .woocommerce .related ul.products li.product, + .woocommerce .up-sells ul.products li.product { + width: auto; + margin-left: 0; + margin-right: 0; + margin-bottom: 0; + } +} + +.woocommerce #respond input#submit, +.woocommerce a.button, +.woocommerce button.button, +.woocommerce input.button { + border-radius: 0px; + font-weight: inherit; + font-size: inherit; + line-height: inherit; + padding: 10px 20px; +} + +ul.products .woocommerce-text-align-center { + text-align: center; +} + +ul.products li.product.woocommerce-text-align-center .price, +ul.products li.product.woocommerce-text-align-center .star-rating { + margin-left: auto; + margin-right: auto; +} + +ul.products li.product.woocommerce-text-align-right .price, +ul.products li.product.woocommerce-text-align-right .star-rating { + margin-left: auto; +} + +.woocommerce .star-rating:before { + color: rgba(0, 0, 0, 0.4); +} + +.woocommerce p.stars a { + color: rgba(0, 0, 0, 0.4); +} + +.woocommerce p.stars.selected a:before { + color: #ffa200; +} + +.woocommerce ul.products li.product .price del { + display: inline; + padding-right: 10px; +} + +ul.products .woocommerce-text-align-right { + text-align: right; +} + +/*-------------------------------------------------------------- +# Single Product +--------------------------------------------------------------*/ +.woocommerce #content div.product div.images, +.woocommerce div.product div.images, +.woocommerce-page #content div.product div.images, +.woocommerce-page div.product div.images { + width: 50%; +} + +.woocommerce #content div.product div.summary, +.woocommerce div.product div.summary, +.woocommerce-page #content div.product div.summary, +.woocommerce-page div.product div.summary { + width: auto; + float: none; + overflow: hidden; +} + +.product_meta { + font-size: 80%; + border-top: 1px solid rgba(0, 0, 0, 0.1); + padding-top: 30px; +} + +.product_meta > span { + display: block; +} + +.up-sells { + margin-top: 40px; +} + +.woocommerce div.product.do-quantity-buttons form.cart, +.add-to-cart-panel form.cart { + display: flex; + flex-wrap: wrap; +} + +.woocommerce div.product form.cart > *:not(.quantity):not(.single_add_to_cart_button) { + width: 100%; +} + +.add-to-cart-panel form.cart { + flex-shrink: 0; +} + +.woocommerce .quantity .qty { + height: 100%; + width: auto; + max-width: 80px; + background: transparent; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 0 10px; + height: 50px; +} + +.do-quantity-buttons .quantity:not(.buttons-added) .qty { + width: 50px; +} + +.do-quantity-buttons div.quantity, +.add-to-cart-panel .cart.do-quantity-buttons div.quantity { + display: flex; + align-items: center; +} + +.woocommerce form .quantity.buttons-added .qty, +.woocommerce form .quantity.buttons-added .minus, +.woocommerce form .quantity.buttons-added .plus, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { + display: block; + width: 50px; + height: 100%; + min-height: 50px; + background-color: transparent; + border: 1px solid rgba(0, 0, 0, 0.1); + margin: 0; + padding: 0; + text-align: center; + vertical-align: middle; + -moz-appearance: textfield !important; + -webkit-appearance: none; + border-radius: 0; + color: inherit; + box-sizing: border-box; + text-decoration: none; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after, +.woocommerce form .quantity.buttons-added .minus, +.woocommerce form .quantity.buttons-added .plus { + display: flex; + align-items: center; + justify-content: center; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before { + content: "-"; + border-right: 0; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { + content: "+"; + border-left: 0; +} + +.woocommerce form .quantity.buttons-added .qty:focus { + border-color: rgba(0, 0, 0, 0.1); +} + +.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button, +.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.woocommerce form .quantity.buttons-added .minus, +.do-quantity-buttons form .quantity:not(.buttons-added):before { + border-right-width: 0; +} + +.woocommerce form .quantity.buttons-added .plus, +.do-quantity-buttons form .quantity:not(.buttons-added):after { + border-left-width: 0; +} + +.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before, +.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after, +.do-quantity-buttons form .quantity.hidden { + display: none; +} + +.woocommerce div.product form.cart div.quantity.hidden { + margin: 0; +} + +/*-------------------------------------------------------------- +## Tabs +--------------------------------------------------------------*/ +.woocommerce div.product .woocommerce-tabs ul.tabs li::after, +.woocommerce div.product .woocommerce-tabs ul.tabs li::before, +.woocommerce div.product .woocommerce-tabs ul.tabs::before { + display: none; + border: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs { + display: flex; + margin-left: 0; + padding-left: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li { + background-color: rgba(0, 0, 0, 0.02); + margin: 0; + border-radius: 0; + border-width: 1px 1px 0 0; + border-color: rgba(0, 0, 0, 0.08); +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child { + border-left-width: 1px; +} + +.woocommerce-ordering { + float: left; + margin-right: 1em; + margin-bottom: 0; + position: relative; + padding: 0; +} + +/*-------------------------------------------------------------- +# Menu Item +--------------------------------------------------------------*/ +nav li.wc-menu-item { + float: right; +} + +.cart-contents > span { + line-height: 0; +} + +.cart-contents > span:not(:empty) { + margin-left: 10px; +} + +.rtl .cart-contents > span:not(:empty) { + margin-left: 0; + margin-right: 10px; +} + +.cart-contents > span.gp-icon { + margin-left: 0; +} + +.rtl .cart-contents > span.gp-icon { + margin-right: 0; +} + +nav span.count { + font-size: 0.8em; + opacity: 0.5; +} + +/*-------------------------------------------------------------- +# Cart +--------------------------------------------------------------*/ +.woocommerce a.remove { + color: inherit !important; + background: transparent !important; + border: 1px solid !important; + border-color: inherit; + font-weight: normal; + font-size: 16px; + width: 20px; + height: 20px; + line-height: 17px; + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important; +} + +.woocommerce a.remove:hover { + color: inherit !important; + background: transparent !important; + opacity: 0.7; +} + +.woocommerce .star-rating:before { + opacity: 0.25; + content: "SSSSS"; +} + +.woocommerce div.product .woocommerce-product-rating { + margin: 1em 0; +} + +.woocommerce div.product p.price, +.woocommerce div.product span.price { + color: inherit; +} + +.wc-has-gallery .secondary-image { + position: absolute; + opacity: 0; + transition: opacity 100ms ease-in-out; + left: 50%; + transform: translate(-50%, 0px); + top: 0; +} + +.wc-has-gallery picture.secondary-image { + width: 100%; + height: 100%; +} + +.wc-product-image:hover .secondary-image { + opacity: 1; +} + +.woocommerce ul.products li.product a img { + margin-bottom: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li a, +.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { + color: initial; +} + +.woocommerce ul.products li.product .price, .woocommerce div.product p.price { + font-weight: bold; +} + +div.woocommerce-message a.button, +div.woocommerce-message a.button:hover, +div.woocommerce-message a.button:focus, +div.woocommerce-info a.button, +div.woocommerce-info a.button:hover, +div.woocommerce-info a.button:focus, +div.woocommerce-error a.button, +div.woocommerce-error a.button:hover, +div.woocommerce-error a.button:focus { + background: transparent; + padding: 0; +} + +.woocommerce-error a, +.woocommerce-info a, +.woocommerce-message a { + font-weight: bold; +} + +.woocommerce-error, +.woocommerce-info, +.woocommerce-message { + padding: 20px 30px; + border: 0; + border-left: 10px solid rgba(0, 0, 0, 0.3); +} + +.woocommerce-message::before, +.woocommerce-info::before, +.woocommerce-error::before { + display: none; +} + +a.button.wc-forward:after { + content: "\e901"; + font-family: "GP Premium"; + line-height: 1em; + padding-left: 10px; + position: relative; + top: 2px; +} + +.rtl a.button.wc-forward:after { + display: none; +} + +.woocommerce-checkout .col2-set .col-2, +.woocommerce-checkout .col2-set .col-1 { + float: none; + width: 100%; + margin: 0; +} + +.woocommerce-checkout .col2-set { + width: 52.9411764706%; + float: left; + margin-right: 5.8823529412%; +} + +.rtl.woocommerce-checkout .col2-set { + float: right; + margin-right: 0; + margin-left: 5.8823529412%; +} + +#customer_details + #wc_checkout_add_ons, +#order_review, +#order_review_heading { + width: 41.1764705882%; + float: right; + margin-right: 0; +} + +.woocommerce-additional-fields > h3 { + margin-top: 20px; +} + +.woocommerce table.shop_table, +.woocommerce table.shop_table tfoot th, +.woocommerce table.shop_table tfoot td { + border: 0; + border-radius: 0; +} + +.woocommerce table.shop_table th { + background-color: rgba(0, 0, 0, 0.03); +} + +.woocommerce table.shop_table th, +.woocommerce table.shop_table td { + padding: 20px; + border: 0; +} + +.woocommerce table.shop_table td { + background-color: rgba(0, 0, 0, 0.005); + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} + +#add_payment_method .cart-collaterals .cart_totals tr td, +#add_payment_method .cart-collaterals .cart_totals tr th, +.woocommerce-cart .cart-collaterals .cart_totals tr td, +.woocommerce-cart .cart-collaterals .cart_totals tr th, +.woocommerce-checkout .cart-collaterals .cart_totals tr td, +.woocommerce-checkout .cart-collaterals .cart_totals tr th { + border-top: 0; +} + +#add_payment_method #payment, +.woocommerce-cart #payment, +.woocommerce-checkout #payment, +#add_payment_method #payment div.payment_box, +.woocommerce-cart #payment div.payment_box, +.woocommerce-checkout #payment div.payment_box { + background-color: transparent; + color: inherit; +} + +#add_payment_method #payment div.payment_box:before, +.woocommerce-cart #payment div.payment_box:before, +.woocommerce-checkout #payment div.payment_box:before { + display: none; +} + +#payment .payment_methods > .wc_payment_method > label { + padding: 20px; + background-color: rgba(0, 0, 0, 0.04); + display: block; + cursor: pointer; +} + +#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child:checked + label { + font-weight: bold; + background-color: rgba(0, 0, 0, 0.07); +} + +#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child { + clip: rect(1px, 1px, 1px, 1px); + position: absolute !important; +} + +#payment .payment_methods > .wc_payment_method > label:before { + display: inline-block; + font-size: inherit; + -webkit-font-smoothing: antialiased; + content: "\e902"; + margin-right: .5407911001em; + transition: color,ease,.2s; + font-family: "GP Premium"; +} + +#payment .payment_methods li.wc_payment_method > input[type=radio]:first-child:checked + label:before { + content: "\e904"; +} + +#add_payment_method #payment ul.payment_methods, +.woocommerce-cart #payment ul.payment_methods, +.woocommerce-checkout #payment ul.payment_methods { + padding: 0; + border: 0; +} + +.woocommerce #payment #place_order, +.woocommerce-page #payment #place_order { + float: none; + width: 100%; + padding-top: 20px; + padding-bottom: 20px; + font-weight: bold; + font-size: 150%; +} + +#add_payment_method #payment div.form-row, +.woocommerce-cart #payment div.form-row, +.woocommerce-checkout #payment div.form-row { + padding-left: 0; + padding-right: 0; + padding-top: 0; +} + +#add_payment_method #payment ul.payment_methods li img, +.woocommerce-cart #payment ul.payment_methods li img, +.woocommerce-checkout #payment ul.payment_methods li img { + float: right; +} + +#add_payment_method #payment .payment_method_paypal .about_paypal, +.woocommerce-cart #payment .payment_method_paypal .about_paypal, +.woocommerce-checkout #payment .payment_method_paypal .about_paypal { + float: none; + display: inline-block; + line-height: 1; +} + +a.checkout-button:after { + display: none; +} + +.woocommerce #content table.cart td.actions .input-text, +.woocommerce table.cart td.actions .input-text, +.woocommerce-page #content table.cart td.actions .input-text, +.woocommerce-page table.cart td.actions .input-text { + width: 150px; + padding: 10px 15px; +} + +.woocommerce .coupon .button { + border: 1px solid transparent; +} + +.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child { + margin-bottom: 0; +} + +.wc-product-image { + text-align: center; +} + +.woocommerce-text-align-left .wc-product-image { + text-align: left; +} + +.woocommerce-text-align-right .wc-product-image { + text-align: right; +} + +.inside-wc-product-image { + position: relative; + display: inline-block; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image { + float: left; + margin-right: 2em; +} + +.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image { + float: right; + margin-left: 2em; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img, +.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img { + width: auto; +} + +.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image, +.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image { + float: none; + margin: 0; +} + +.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img, +.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img { + width: 100%; +} + +.woocommerce .widget_price_filter .price_slider_amount .button { + font-size: 1em; + line-height: normal; +} + +.woocommerce .related ul.products li.product a img, +.woocommerce .up-sells ul.products li.product a img { + margin-bottom: 0; +} + +.woocommerce-review-link { + font-size: 80%; +} + +.woocommerce-Reviews .comment-reply-title { + font-size: 120%; + font-weight: bold; + display: block; + margin-bottom: 10px; +} + +.woocommerce-MyAccount-navigation ul { + margin: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.site-main .woocommerce-MyAccount-navigation li { + margin: 0; + padding: 0; +} + +.woocommerce-MyAccount-navigation li a { + display: block; + padding: 20px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + font-size: 85%; +} + +.woocommerce-MyAccount-navigation li.is-active a { + font-weight: bold; +} + +.woocommerce-MyAccount-navigation li a:hover { + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} + +.woocommerce-MyAccount-navigation li.is-active a:after { + font-family: "GP Premium"; + content: "\e901"; + float: right; + font-weight: bold; + font-size: 115%; +} + +.woocommerce-account .woocommerce-MyAccount-navigation { + width: 25%; +} + +.woocommerce #payment .terms { + padding: 20px; +} + +h2.woocommerce-loop-category__title mark { + background: none; + font-size: 80%; + opacity: 0.5; +} + +.woocommerce form.checkout_coupon, +.woocommerce form.login, +.woocommerce form.register { + padding: 0; + margin: 0 0 1.5em; + border: 0; +} + +#ship-to-different-address { + padding: 3px; + font-size: inherit; +} + +.woocommerce-image-align-left .products ul, +.woocommerce-image-align-left ul.products, +.woocommerce-image-align-left .products ul:after, +.woocommerce-image-align-left ul.products:after, +.woocommerce-image-align-right .products ul, +.woocommerce-image-align-right ul.products, +.woocommerce-image-align-right .products ul:after, +.woocommerce-image-align-right ul.products:after { + clear: none; +} + +.woocommerce nav.woocommerce-pagination { + margin-top: 60px; + clear: both; +} + +.woocommerce input.button:disabled, +.woocommerce input.button:disabled[disabled], +.woocommerce input.button:disabled:hover, +.woocommerce input.button:disabled[disabled]:hover { + background-color: transparent; + color: initial; + opacity: 0.3; +} + +.entry-summary + .up-sells { + clear: both; +} + +.woocommerce form .form-row input.input-text, +.woocommerce form .form-row textarea { + line-height: 1.5; +} + +.main-navigation a.cart-contents:not(.has-svg-icon):before, +.secondary-navigation a.cart-contents:not(.has-svg-icon):before { + content: "\f07a"; + display: inline-block; + font-family: "GP Premium"; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before, +.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before { + content: "\f290"; +} + +.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before, +.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before { + content: "\f291"; +} + +.cart-contents > span.number-of-items { + font-size: 11px; + display: inline-block; + background: rgba(255, 255, 255, 0.1); + line-height: 1.7em; + height: 1.7em; + width: 1.7em; + text-align: center; + border-radius: 50%; + margin-left: 5px; + position: relative; + top: -5px; + display: none; +} + +.cart-contents > span.number-of-items.no-items { + display: none; +} + +.woocommerce-MyAccount-navigation ul { + list-style-type: none; +} + +/* Fix BlockUI */ +form.checkout:after, +form.checkout:before { + content: ''; + display: table; +} + +form.checkout:after { + clear: both; +} + +/* Add to Cart panel */ +.add-to-cart-panel { + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + padding: 20px; + opacity: 0; + transition: opacity 500ms ease-in-out, transform 500ms ease-in-out; + box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.2); + z-index: 101; + font-size: 90%; + box-sizing: border-box; + transform: translateY(-100%); +} + +.add-to-cart-panel.item-added, +.add-to-cart-panel.show-sticky-add-to-cart { + opacity: 1; +} + +.add-to-cart-panel > div { + display: flex; + align-items: center; +} + +.add-to-cart-panel .continue-shopping { + margin-right: auto; +} + +.add-to-cart-panel .continue-shopping .gp-icon { + display: none; +} + +.add-to-cart-panel .cart-info { + margin-right: 20px; +} + +.add-to-cart-panel img { + height: 50px; + width: auto; + vertical-align: middle; +} + +.add-to-cart-panel .product-title { + margin-left: 20px; + margin-right: auto; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.add-to-cart-panel .product-price { + margin-right: 20px; +} + +.add-to-cart-panel div.quantity { + margin-right: 4px; +} + +.add-to-cart-panel .cart-data { + font-size: 12px; +} + +.add-to-cart-panel del { + opacity: 0.4; +} + +.do-quantity-buttons input.qty::-webkit-outer-spin-button, +.do-quantity-buttons input.qty::-webkit-inner-spin-button { + -webkit-appearance: none; +} + +.wc-menu-cart-activated .menu-toggle { + text-align: left; +} + +.woocommerce-order-received .woocommerce-customer-details .col2-set { + float: none; + width: auto; +} + +.woocommerce-order-received .woocommerce-customer-details .col2-set .col-1 { + margin-bottom: 1.5em; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css new file mode 100644 index 00000000..4533dae1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css @@ -0,0 +1 @@ +@supports (display:grid){.woocommerce ul.products li.product{display:flex;flex-direction:column}}.woocommerce ul.products li.product.woocommerce-image-align-left,.woocommerce ul.products li.product.woocommerce-image-align-right{display:block}.woocommerce ul.products li.product .woocommerce-LoopProduct-link{display:block;margin-bottom:auto}.woocommerce ul.products li.product .button{margin-left:auto;margin-right:auto}.woocommerce ul.products li.product.woocommerce-text-align-left .button{margin-left:0}.woocommerce ul.products li.product.woocommerce-text-align-right .button{margin-right:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>:not(:first-child){margin-top:10px;margin-bottom:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>.secondary-image+img{margin-top:0}.woocommerce span.onsale,.woocommerce ul.products li.product .onsale{position:relative;border-radius:0;min-height:15px;min-width:initial;font-weight:inherit;font-size:inherit;padding:8px 13px;line-height:1;display:inline-block;top:auto;left:auto;font-size:80%;text-transform:uppercase;font-weight:700}.woocommerce ul.products li.product.sales-flash-overlay .onsale{position:absolute;top:0;right:0;margin:0}.single-product span.onsale{margin-bottom:15px}.woocommerce-product-gallery{margin-right:4%}.rtl .woocommerce-product-gallery{margin-right:0;margin-left:4%}.woocommerce div.product div.images .flex-control-thumbs li{max-width:100px;padding-top:5px;padding-right:5px;box-sizing:border-box}.woocommerce ul.products li.product .woocommerce-loop-product__title{padding:0}.woocommerce .page-header-image-single{display:none}.woocommerce .entry-content,.woocommerce .product .entry-summary{margin-top:0}.related.products{clear:both}.checkout-subscribe-prompt.clear{visibility:visible;height:initial;width:initial}.woocommerce .add_to_cart_button+.added_to_cart{display:none}.woocommerce-result-count{font-size:14px;padding:10px 0;border:1px solid transparent}.woocommerce-ordering select{font-size:14px;font-weight:500;padding:10px 40px 10px 12px;-webkit-appearance:none;-moz-appearance:none;width:100%;background:0 0;border-color:rgba(0,0,0,.1);color:inherit;cursor:pointer}.woocommerce-ordering select::-ms-expand{display:none}.woocommerce-ordering:after{content:"\e903";font-family:"GP Premium";display:inline-block;position:absolute;pointer-events:none;color:inherit;top:10px;right:15px;font-size:16px}.woocommerce-ordering select option{color:initial}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin-bottom:30px}.woocommerce-variation-add-to-cart{display:flex;flex-wrap:wrap}@supports (display:grid){#wc-column-container .product{float:none;width:auto;margin:0}.woocommerce .related ul.products::after,.woocommerce .related ul.products::before,.woocommerce .up-sells ul.products::after,.woocommerce .up-sells ul.products::before,.woocommerce .wc-columns-container .products::after,.woocommerce .wc-columns-container .products::before{display:none}.wc-columns-container .products,.woocommerce .related ul.products,.woocommerce .up-sells ul.products{display:-ms-grid;display:grid;grid-gap:50px;width:100%}.wc-columns-container.wc-columns-6 .products,.wc-related-upsell-columns-6 .related ul.products,.wc-related-upsell-columns-6 .up-sells ul.products{grid-template-columns:repeat(6,minmax(0,1fr))}.wc-columns-container.wc-columns-5 .products,.wc-related-upsell-columns-5 .related ul.products,.wc-related-upsell-columns-5 .up-sells ul.products{grid-template-columns:repeat(5,minmax(0,1fr))}.wc-related-upsell-columns-4 .related ul.products,.wc-related-upsell-columns-4 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-4 .products{grid-template-columns:repeat(4,minmax(0,1fr))}.wc-related-upsell-columns-3 .related ul.products,.wc-related-upsell-columns-3 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-3 .products{grid-template-columns:repeat(3,minmax(0,1fr))}.wc-related-upsell-columns-2 .related ul.products,.wc-related-upsell-columns-2 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-2 .products{grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-columns-1 .related ul.products,.wc-related-upsell-columns-1 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-1 .products{width:100%}.woocommerce .wc-columns-1 ul.products li.product,.woocommerce-page .wc-columns-1 ul.products li.product{margin-left:0;margin-right:0}}#wc-mini-cart ul.woocommerce-mini-cart{position:relative;left:auto;right:auto;opacity:1;pointer-events:auto;height:auto;width:auto;float:none;background-color:transparent;box-shadow:0 0 0;visibility:visible}.wc-mini-cart{position:absolute;width:300px;right:0;box-shadow:0 2px 2px rgba(0,0,0,.1);z-index:99999;left:-99999px;opacity:0;height:0;overflow:hidden;pointer-events:none;transition:opacity 80ms linear;transition-delay:0s;visibility:hidden}.wc-menu-item.sfHover .wc-mini-cart,.wc-menu-item:hover .wc-mini-cart{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible;visibility:visible}.dropdown-click ul li.wc-menu-item:hover ul{display:block}.sidebar .wc-mini-cart{right:100%;top:0}.sidebar .wc-mini-cart .widget{background:0 0}body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart{display:none}.wc-menu-item .sub-menu{left:auto;right:0;width:300px}.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a,.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a{background:0 0}.wc-menu-item .wc-mini-cart .widget_shopping_cart{padding:15px}.woocommerce.widget_shopping_cart .cart_list li{padding:0 0 0 4em;margin:0;box-sizing:border-box;min-height:3em}.woocommerce.widget_shopping_cart{font-size:14px}.widget_shopping_cart .woocommerce-mini-cart__buttons{margin-bottom:0;display:flex}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a{margin:0;width:calc(50% - 10px);text-align:center;padding:10px 15px;line-height:inherit;font-size:14px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child{margin-right:2px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child{margin-left:2px}.woocommerce.widget_shopping_cart .cart_list li a.remove{right:0;left:auto;height:20px;width:20px;border-width:1px;border-style:solid;border-radius:50%;padding:0;font-size:16px;line-height:17px;font-weight:400;position:relative;float:right}.woocommerce ul.cart_list li img{position:absolute;left:0;width:3em;height:auto;top:0;margin-left:0}#wc-mini-cart .woocommerce-mini-cart-item a{padding:0}.woocommerce-mini-cart-item .quantity{font-size:12px;display:block}.woocommerce.widget_shopping_cart .total{margin:15px 0;padding:15px;background:rgba(0,0,0,.05);border:0;font-size:14px}#wc-mini-cart .total{padding:15px;margin:15px -15px 15px;text-align:left}#generate-slideout-menu .total{padding:10px 20px;margin:20px -20px 20px}#generate-slideout-menu.do-overlay .total{margin:20px 0}.woocommerce.widget_shopping_cart a.button.wc-forward:after{display:none}.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child){margin-bottom:15px}.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li{padding:0 4em 0 0}.rtl .wc-mini-cart .woocommerce.widget_shopping_cart .cart_list li a.remove{float:left}.rtl .wc-mini-cart .woocommerce ul.cart_list li img{right:0}.slideout-widget .widget_shopping_cart_content,.slideout-widget .widget_shopping_cart_content a{font-size:14px}#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item{text-align:left}#wc-mini-cart a:not(.button){font-family:inherit}.wc-menu-item:not(.has-items) .wc-mini-cart{display:none}.woocommerce-mini-cart__empty-message{margin-bottom:0}.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart,.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart{font-size:inherit}#wc-mini-cart .widgettitle{display:none}@supports (display:grid){.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product{width:auto;margin-left:0;margin-right:0;margin-bottom:0}}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{border-radius:0;font-weight:inherit;font-size:inherit;line-height:inherit;padding:10px 20px}ul.products .woocommerce-text-align-center{text-align:center}ul.products li.product.woocommerce-text-align-center .price,ul.products li.product.woocommerce-text-align-center .star-rating{margin-left:auto;margin-right:auto}ul.products li.product.woocommerce-text-align-right .price,ul.products li.product.woocommerce-text-align-right .star-rating{margin-left:auto}.woocommerce .star-rating:before{color:rgba(0,0,0,.4)}.woocommerce p.stars a{color:rgba(0,0,0,.4)}.woocommerce p.stars.selected a:before{color:#ffa200}.woocommerce ul.products li.product .price del{display:inline;padding-right:10px}ul.products .woocommerce-text-align-right{text-align:right}.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images{width:50%}.woocommerce #content div.product div.summary,.woocommerce div.product div.summary,.woocommerce-page #content div.product div.summary,.woocommerce-page div.product div.summary{width:auto;float:none;overflow:hidden}.product_meta{font-size:80%;border-top:1px solid rgba(0,0,0,.1);padding-top:30px}.product_meta>span{display:block}.up-sells{margin-top:40px}.add-to-cart-panel form.cart,.woocommerce div.product.do-quantity-buttons form.cart{display:flex;flex-wrap:wrap}.woocommerce div.product form.cart>:not(.quantity):not(.single_add_to_cart_button){width:100%}.add-to-cart-panel form.cart{flex-shrink:0}.woocommerce .quantity .qty{height:100%;width:auto;max-width:80px;background:0 0;border:1px solid rgba(0,0,0,.1);padding:0 10px;height:50px}.do-quantity-buttons .quantity:not(.buttons-added) .qty{width:50px}.add-to-cart-panel .cart.do-quantity-buttons div.quantity,.do-quantity-buttons div.quantity{display:flex;align-items:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus,.woocommerce form .quantity.buttons-added .qty{display:block;width:50px;height:100%;min-height:50px;background-color:transparent;border:1px solid rgba(0,0,0,.1);margin:0;padding:0;text-align:center;vertical-align:middle;-moz-appearance:textfield!important;-webkit-appearance:none;border-radius:0;color:inherit;box-sizing:border-box;text-decoration:none}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus{display:flex;align-items:center;justify-content:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before{content:"-";border-right:0}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after{content:"+";border-left:0}.woocommerce form .quantity.buttons-added .qty:focus{border-color:rgba(0,0,0,.1)}.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button,.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.do-quantity-buttons form .quantity:not(.buttons-added):before,.woocommerce form .quantity.buttons-added .minus{border-right-width:0}.do-quantity-buttons form .quantity:not(.buttons-added):after,.woocommerce form .quantity.buttons-added .plus{border-left-width:0}.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after,.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before,.do-quantity-buttons form .quantity.hidden{display:none}.woocommerce div.product form.cart div.quantity.hidden{margin:0}.woocommerce div.product .woocommerce-tabs ul.tabs li::after,.woocommerce div.product .woocommerce-tabs ul.tabs li::before,.woocommerce div.product .woocommerce-tabs ul.tabs::before{display:none;border:0}.woocommerce div.product .woocommerce-tabs ul.tabs{display:flex;margin-left:0;padding-left:0}.woocommerce div.product .woocommerce-tabs ul.tabs li{background-color:rgba(0,0,0,.02);margin:0;border-radius:0;border-width:1px 1px 0 0;border-color:rgba(0,0,0,.08)}.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child{border-left-width:1px}.woocommerce-ordering{float:left;margin-right:1em;margin-bottom:0;position:relative;padding:0}nav li.wc-menu-item{float:right}.cart-contents>span{line-height:0}.cart-contents>span:not(:empty){margin-left:10px}.rtl .cart-contents>span:not(:empty){margin-left:0;margin-right:10px}.cart-contents>span.gp-icon{margin-left:0}.rtl .cart-contents>span.gp-icon{margin-right:0}nav span.count{font-size:.8em;opacity:.5}.woocommerce a.remove{color:inherit!important;background:0 0!important;border:1px solid!important;border-color:inherit;font-weight:400;font-size:16px;width:20px;height:20px;line-height:17px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"!important}.woocommerce a.remove:hover{color:inherit!important;background:0 0!important;opacity:.7}.woocommerce .star-rating:before{opacity:.25;content:"SSSSS"}.woocommerce div.product .woocommerce-product-rating{margin:1em 0}.woocommerce div.product p.price,.woocommerce div.product span.price{color:inherit}.wc-has-gallery .secondary-image{position:absolute;opacity:0;transition:opacity .1s ease-in-out;left:50%;transform:translate(-50%,0);top:0}.wc-has-gallery picture.secondary-image{width:100%;height:100%}.wc-product-image:hover .secondary-image{opacity:1}.woocommerce ul.products li.product a img{margin-bottom:0}.woocommerce div.product .woocommerce-tabs ul.tabs li a,.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:initial}.woocommerce div.product p.price,.woocommerce ul.products li.product .price{font-weight:700}div.woocommerce-error a.button,div.woocommerce-error a.button:focus,div.woocommerce-error a.button:hover,div.woocommerce-info a.button,div.woocommerce-info a.button:focus,div.woocommerce-info a.button:hover,div.woocommerce-message a.button,div.woocommerce-message a.button:focus,div.woocommerce-message a.button:hover{background:0 0;padding:0}.woocommerce-error a,.woocommerce-info a,.woocommerce-message a{font-weight:700}.woocommerce-error,.woocommerce-info,.woocommerce-message{padding:20px 30px;border:0;border-left:10px solid rgba(0,0,0,.3)}.woocommerce-error::before,.woocommerce-info::before,.woocommerce-message::before{display:none}a.button.wc-forward:after{content:"\e901";font-family:"GP Premium";line-height:1em;padding-left:10px;position:relative;top:2px}.rtl a.button.wc-forward:after{display:none}.woocommerce-checkout .col2-set .col-1,.woocommerce-checkout .col2-set .col-2{float:none;width:100%;margin:0}.woocommerce-checkout .col2-set{width:52.9411764706%;float:left;margin-right:5.8823529412%}.rtl.woocommerce-checkout .col2-set{float:right;margin-right:0;margin-left:5.8823529412%}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:41.1764705882%;float:right;margin-right:0}.woocommerce-additional-fields>h3{margin-top:20px}.woocommerce table.shop_table,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{border:0;border-radius:0}.woocommerce table.shop_table th{background-color:rgba(0,0,0,.03)}.woocommerce table.shop_table td,.woocommerce table.shop_table th{padding:20px;border:0}.woocommerce table.shop_table td{background-color:rgba(0,0,0,.005);border-bottom:1px solid rgba(0,0,0,.1)}#add_payment_method .cart-collaterals .cart_totals tr td,#add_payment_method .cart-collaterals .cart_totals tr th,.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th,.woocommerce-checkout .cart-collaterals .cart_totals tr td,.woocommerce-checkout .cart-collaterals .cart_totals tr th{border-top:0}#add_payment_method #payment,#add_payment_method #payment div.payment_box,.woocommerce-cart #payment,.woocommerce-cart #payment div.payment_box,.woocommerce-checkout #payment,.woocommerce-checkout #payment div.payment_box{background-color:transparent;color:inherit}#add_payment_method #payment div.payment_box:before,.woocommerce-cart #payment div.payment_box:before,.woocommerce-checkout #payment div.payment_box:before{display:none}#payment .payment_methods>.wc_payment_method>label{padding:20px;background-color:rgba(0,0,0,.04);display:block;cursor:pointer}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label{font-weight:700;background-color:rgba(0,0,0,.07)}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child{clip:rect(1px,1px,1px,1px);position:absolute!important}#payment .payment_methods>.wc_payment_method>label:before{display:inline-block;font-size:inherit;-webkit-font-smoothing:antialiased;content:"\e902";margin-right:.5407911001em;transition:color,ease,.2s;font-family:"GP Premium"}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before{content:"\e904"}#add_payment_method #payment ul.payment_methods,.woocommerce-cart #payment ul.payment_methods,.woocommerce-checkout #payment ul.payment_methods{padding:0;border:0}.woocommerce #payment #place_order,.woocommerce-page #payment #place_order{float:none;width:100%;padding-top:20px;padding-bottom:20px;font-weight:700;font-size:150%}#add_payment_method #payment div.form-row,.woocommerce-cart #payment div.form-row,.woocommerce-checkout #payment div.form-row{padding-left:0;padding-right:0;padding-top:0}#add_payment_method #payment ul.payment_methods li img,.woocommerce-cart #payment ul.payment_methods li img,.woocommerce-checkout #payment ul.payment_methods li img{float:right}#add_payment_method #payment .payment_method_paypal .about_paypal,.woocommerce-cart #payment .payment_method_paypal .about_paypal,.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;display:inline-block;line-height:1}a.checkout-button:after{display:none}.woocommerce #content table.cart td.actions .input-text,.woocommerce table.cart td.actions .input-text,.woocommerce-page #content table.cart td.actions .input-text,.woocommerce-page table.cart td.actions .input-text{width:150px;padding:10px 15px}.woocommerce .coupon .button{border:1px solid transparent}.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child{margin-bottom:0}.wc-product-image{text-align:center}.woocommerce-text-align-left .wc-product-image{text-align:left}.woocommerce-text-align-right .wc-product-image{text-align:right}.inside-wc-product-image{position:relative;display:inline-block}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image{float:left;margin-right:2em}.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:right;margin-left:2em}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:auto}.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1em;line-height:normal}.woocommerce .related ul.products li.product a img,.woocommerce .up-sells ul.products li.product a img{margin-bottom:0}.woocommerce-review-link{font-size:80%}.woocommerce-Reviews .comment-reply-title{font-size:120%;font-weight:700;display:block;margin-bottom:10px}.woocommerce-MyAccount-navigation ul{margin:0;border-top:1px solid rgba(0,0,0,.1)}.site-main .woocommerce-MyAccount-navigation li{margin:0;padding:0}.woocommerce-MyAccount-navigation li a{display:block;padding:20px 0;border-bottom:1px solid rgba(0,0,0,.1);font-size:85%}.woocommerce-MyAccount-navigation li.is-active a{font-weight:700}.woocommerce-MyAccount-navigation li a:hover{border-bottom:1px solid rgba(0,0,0,.2)}.woocommerce-MyAccount-navigation li.is-active a:after{font-family:"GP Premium";content:"\e901";float:right;font-weight:700;font-size:115%}.woocommerce-account .woocommerce-MyAccount-navigation{width:25%}.woocommerce #payment .terms{padding:20px}h2.woocommerce-loop-category__title mark{background:0 0;font-size:80%;opacity:.5}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{padding:0;margin:0 0 1.5em;border:0}#ship-to-different-address{padding:3px;font-size:inherit}.woocommerce-image-align-left .products ul,.woocommerce-image-align-left .products ul:after,.woocommerce-image-align-left ul.products,.woocommerce-image-align-left ul.products:after,.woocommerce-image-align-right .products ul,.woocommerce-image-align-right .products ul:after,.woocommerce-image-align-right ul.products,.woocommerce-image-align-right ul.products:after{clear:none}.woocommerce nav.woocommerce-pagination{margin-top:60px;clear:both}.woocommerce input.button:disabled,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled],.woocommerce input.button:disabled[disabled]:hover{background-color:transparent;color:initial;opacity:.3}.entry-summary+.up-sells{clear:both}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{line-height:1.5}.main-navigation a.cart-contents:not(.has-svg-icon):before,.secondary-navigation a.cart-contents:not(.has-svg-icon):before{content:"\f07a";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before{content:"\f290"}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before{content:"\f291"}.cart-contents>span.number-of-items{font-size:11px;display:inline-block;background:rgba(255,255,255,.1);line-height:1.7em;height:1.7em;width:1.7em;text-align:center;border-radius:50%;margin-left:5px;position:relative;top:-5px;display:none}.cart-contents>span.number-of-items.no-items{display:none}.woocommerce-MyAccount-navigation ul{list-style-type:none}form.checkout:after,form.checkout:before{content:'';display:table}form.checkout:after{clear:both}.add-to-cart-panel{position:fixed;top:0;left:0;right:0;background:#fff;padding:20px;opacity:0;transition:opacity .5s ease-in-out,transform .5s ease-in-out;box-shadow:0 2px 2px -2px rgba(0,0,0,.2);z-index:101;font-size:90%;box-sizing:border-box;transform:translateY(-100%)}.add-to-cart-panel.item-added,.add-to-cart-panel.show-sticky-add-to-cart{opacity:1}.add-to-cart-panel>div{display:flex;align-items:center}.add-to-cart-panel .continue-shopping{margin-right:auto}.add-to-cart-panel .continue-shopping .gp-icon{display:none}.add-to-cart-panel .cart-info{margin-right:20px}.add-to-cart-panel img{height:50px;width:auto;vertical-align:middle}.add-to-cart-panel .product-title{margin-left:20px;margin-right:auto;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.add-to-cart-panel .product-price{margin-right:20px}.add-to-cart-panel div.quantity{margin-right:4px}.add-to-cart-panel .cart-data{font-size:12px}.add-to-cart-panel del{opacity:.4}.do-quantity-buttons input.qty::-webkit-inner-spin-button,.do-quantity-buttons input.qty::-webkit-outer-spin-button{-webkit-appearance:none}.wc-menu-cart-activated .menu-toggle{text-align:left}.woocommerce-order-received .woocommerce-customer-details .col2-set{float:none;width:auto}.woocommerce-order-received .woocommerce-customer-details .col2-set .col-1{margin-bottom:1.5em} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php new file mode 100644 index 00000000..a03e0370 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/customizer.php @@ -0,0 +1,1031 @@ +register_control_type( 'GeneratePress_Title_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + $wp_customize->add_section( + 'generate_woocommerce_layout', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 100, + 'panel' => 'generate_layout_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_woocommerce_layout_shortcuts', + array( + 'section' => 'generate_woocommerce_layout', + 'element' => __( 'WooCommerce', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'generate_woocommerce_colors', + 'typography' => 'generate_woocommerce_typography', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_general_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'General', 'gp-premium' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item]', + array( + 'default' => $defaults['cart_menu_item'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display cart in menu', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[cart_menu_item]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[menu_mini_cart]', + array( + 'default' => $defaults['menu_mini_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[menu_mini_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display mini cart sub-menu', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[menu_mini_cart]', + 'active_callback' => 'generate_premium_wc_menu_item_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item_icon]', + array( + 'default' => $defaults['cart_menu_item_icon'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item_icon]', + array( + 'type' => 'select', + 'label' => __( 'Menu Item Icon', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'shopping-cart' => __( 'Shopping Cart', 'gp-premium' ), + 'shopping-bag' => __( 'Shopping Bag', 'gp-premium' ), + 'shopping-basket' => __( 'Shopping Basket', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[cart_menu_item_icon]', + 'active_callback' => 'generatepress_wc_menu_cart_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item_content]', + array( + 'default' => $defaults['cart_menu_item_content'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item_content]', + array( + 'type' => 'select', + 'label' => __( 'Menu Item Content', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'amount' => __( 'Amount', 'gp-premium' ), + 'number' => __( 'Number of Items', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[cart_menu_item_content]', + 'active_callback' => 'generatepress_wc_menu_cart_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[breadcrumbs]', + array( + 'default' => $defaults['breadcrumbs'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[breadcrumbs]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display breadcrumbs', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[breadcrumbs]', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_shop_page_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Shop', 'gp-premium' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[sidebar_layout]', + array( + 'default' => $defaults['sidebar_layout'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[sidebar_layout]', + array( + 'type' => 'select', + 'label' => __( 'Sidebar Layout', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), + 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) + ), + 'settings' => 'generate_woocommerce_settings[sidebar_layout]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[columns]', array( + 'default' => $defaults['columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_columns]', array( + 'default' => $defaults['tablet_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_columns]', array( + 'default' => $defaults['mobile_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_columns', + array( + 'label' => __( 'Product Columns', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[columns]', + 'tablet' => 'generate_woocommerce_settings[tablet_columns]', + 'mobile' => 'generate_woocommerce_settings[mobile_columns]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 6, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'tablet' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'mobile' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[columns_gap]', array( + 'default' => $defaults['columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_columns_gap]', array( + 'default' => $defaults['tablet_columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_columns_gap]', array( + 'default' => $defaults['mobile_columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_column_gap', + array( + 'label' => __( 'Column Gap', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[columns_gap]', + 'tablet' => 'generate_woocommerce_settings[tablet_columns_gap]', + 'mobile' => 'generate_woocommerce_settings[mobile_columns_gap]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_image_alignment]', + array( + 'default' => $defaults['product_archive_image_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_image_alignment]', + array( + 'type' => 'radio', + 'label' => __( 'Image Alignment', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[product_archive_image_alignment]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[products_per_page]', + array( + 'default' => $defaults['products_per_page'], + 'type' => 'option', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[products_per_page]', + array( + 'type' => 'text', + 'label' => __( 'Products Per Page', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[products_per_page]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_alignment]', + array( + 'default' => $defaults['product_archive_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_alignment]', + array( + 'type' => 'radio', + 'label' => __( 'Text Alignment', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[product_archive_alignment]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + array( + 'default' => $defaults['off_canvas_panel_on_add_to_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display cart panel on add to cart', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[shop_page_title]', + array( + 'default' => $defaults['shop_page_title'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[shop_page_title]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display page title', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[shop_page_title]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_results_count]', + array( + 'default' => $defaults['product_results_count'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_results_count]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product results count', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_results_count]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_sorting]', + array( + 'default' => $defaults['product_sorting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_sorting]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product sorting', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_sorting]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_image]', + array( + 'default' => $defaults['product_archive_image'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_image]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product image', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_image]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_secondary_image]', + array( + 'default' => $defaults['product_secondary_image'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_secondary_image]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display secondary image on hover', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_secondary_image]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_title]', + array( + 'default' => $defaults['product_archive_title'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_title]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product title', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_title]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_sale_flash]', + array( + 'default' => $defaults['product_archive_sale_flash'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_sale_flash]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display sale flash', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + array( + 'default' => $defaults['product_archive_sale_flash_overlay'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + array( + 'type' => 'checkbox', + 'label' => __( 'Sale flash over image', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_rating]', + array( + 'default' => $defaults['product_archive_rating'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_rating]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display rating', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_rating]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_price]', + array( + 'default' => $defaults['product_archive_price'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_price]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display price', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_price]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_add_to_cart]', + array( + 'default' => $defaults['product_archive_add_to_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_add_to_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display add to cart button', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_add_to_cart]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_description]', + array( + 'default' => $defaults['product_archive_description'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_description]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display short description', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_description]', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_single_product_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Single Product', 'gp-premium' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_sidebar_layout]', + array( + 'default' => $defaults['single_sidebar_layout'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[single_sidebar_layout]', + array( + 'type' => 'select', + 'label' => __( 'Sidebar Layout', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'inherit' => __( 'Inherit', 'gp-premium' ), + 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), + 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) + ), + 'settings' => 'generate_woocommerce_settings[single_sidebar_layout]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_product_image_width]', array( + 'default' => $defaults['single_product_image_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_single_product_image_width', + array( + 'label' => __( 'Product Image Area Width', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[single_product_image_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => '%', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + array( + 'default' => $defaults['sticky_add_to_cart_panel'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display add to cart panel on scroll', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[quantity_buttons]', + array( + 'default' => $defaults['quantity_buttons'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[quantity_buttons]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display quantity buttons', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[quantity_buttons]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_product_sale_flash]', + array( + 'default' => $defaults['single_product_sale_flash'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[single_product_sale_flash]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display sale flash', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[single_product_sale_flash]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_tabs]', + array( + 'default' => $defaults['product_tabs'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_tabs]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product tabs', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_tabs]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_related]', + array( + 'default' => $defaults['product_related'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_related]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display related products', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_related]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_upsells]', + array( + 'default' => $defaults['product_upsells'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_upsells]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display upsell products', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_upsells]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[related_upsell_columns]', array( + 'default' => $defaults['related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_related_upsell_columns]', array( + 'default' => $defaults['tablet_related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_related_upsell_columns]', array( + 'default' => $defaults['mobile_related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_related_upsell_columns', + array( + 'label' => __( 'Related/Upsell Columns', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[related_upsell_columns]', + 'tablet' => 'generate_woocommerce_settings[tablet_related_upsell_columns]', + 'mobile' => 'generate_woocommerce_settings[mobile_related_upsell_columns]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 6, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'tablet' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'mobile' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_meta]', + array( + 'default' => $defaults['product_meta'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_meta]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product meta data', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_meta]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_description]', + array( + 'default' => $defaults['product_description'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_description]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display short description', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_description]', + ) + ); + + $wp_customize->add_section( + 'generate_woocommerce_colors', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 200, + 'panel' => 'generate_colors_panel' + ) + ); + + $wp_customize->add_section( + 'generate_woocommerce_typography', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 200, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_checkout_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Checkout', 'gp-premium' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[distraction_free]', + array( + 'default' => $defaults['distraction_free'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[distraction_free]', + array( + 'type' => 'checkbox', + 'label' => __( 'Distraction-free mode', 'gp-premium' ), + 'description' => __( 'Remove unnecessary distractions like sidebars, footer widgets and sticky menus.', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[distraction_free]', + ) + ); + +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js new file mode 100644 index 00000000..a455a2f7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js @@ -0,0 +1,6 @@ +jQuery( function( $ ) { + $( '#customize-control-generate_woocommerce_primary_button_message a' ).on( 'click', function( e ) { + e.preventDefault(); + wp.customize.control( 'generate_settings[form_button_background_color]' ).focus(); + } ); +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php new file mode 100644 index 00000000..7451494a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/functions.php @@ -0,0 +1,1532 @@ + true, + 'cart_menu_item_icon' => 'shopping-cart', + 'cart_menu_item_content' => 'amount', + 'menu_mini_cart' => false, + 'off_canvas_panel_on_add_to_cart' => false, + 'sticky_add_to_cart_panel' => false, + 'sidebar_layout' => 'right-sidebar', + 'single_sidebar_layout' => 'inherit', + 'products_per_page' => 9, + 'columns' => 4, + 'tablet_columns' => 2, + 'mobile_columns' => 1, + 'columns_gap' => 50, + 'tablet_columns_gap' => '', + 'mobile_columns_gap' => '', + 'related_upsell_columns' => 4, + 'tablet_related_upsell_columns' => 2, + 'mobile_related_upsell_columns' => 1, + 'product_archive_image_alignment' => 'center', + 'product_archive_alignment' => 'center', + 'shop_page_title' => true, + 'product_results_count' => true, + 'product_sorting' => true, + 'product_archive_image' => true, + 'product_secondary_image' => true, + 'product_archive_title' => true, + 'product_archive_sale_flash' => true, + 'product_archive_sale_flash_overlay' => true, + 'product_archive_rating' => true, + 'product_archive_price' => true, + 'product_archive_add_to_cart' => true, + 'single_product_sale_flash' => true, + 'single_product_image_width' => '50', + 'product_tabs' => true, + 'product_related' => true, + 'product_upsells' => true, + 'product_meta' => true, + 'product_description' => true, + 'quantity_buttons' => true, + 'breadcrumbs' => true, + 'distraction_free' => true, + 'product_archive_description' => false, + ) ); +} + +add_filter( 'generate_color_option_defaults', 'generatepress_wc_color_defaults' ); +/** + * Set the WC color option defaults. + * + * @since 1.3 + */ +function generatepress_wc_color_defaults( $defaults ) { + $defaults[ 'wc_alt_button_background' ] = '#1e73be'; + $defaults[ 'wc_alt_button_background_hover' ] = '#377fbf'; + $defaults[ 'wc_alt_button_text' ] = '#ffffff'; + $defaults[ 'wc_alt_button_text_hover' ] = '#ffffff'; + $defaults[ 'wc_rating_stars' ] = '#ffa200'; + $defaults[ 'wc_sale_sticker_background' ] = '#222222'; + $defaults[ 'wc_sale_sticker_text' ] = '#ffffff'; + $defaults[ 'wc_price_color' ] = '#222222'; + $defaults[ 'wc_product_tab' ] = '#222222'; + $defaults[ 'wc_product_tab_highlight' ] = '#1e73be'; + $defaults[ 'wc_success_message_background' ] = '#0b9444'; + $defaults[ 'wc_success_message_text' ] = '#ffffff'; + $defaults[ 'wc_info_message_background' ] = '#1e73be'; + $defaults[ 'wc_info_message_text' ] = '#ffffff'; + $defaults[ 'wc_error_message_background' ] = '#e8626d'; + $defaults[ 'wc_error_message_text' ] = '#ffffff'; + $defaults[ 'wc_product_title_color' ] = ''; + $defaults[ 'wc_product_title_color_hover' ] = ''; + + $defaults['wc_mini_cart_background_color'] = '#ffffff'; + $defaults['wc_mini_cart_text_color'] = '#000000'; + $defaults['wc_mini_cart_button_background'] = ''; + $defaults['wc_mini_cart_button_text'] = ''; + $defaults['wc_mini_cart_button_background_hover'] = ''; + $defaults['wc_mini_cart_button_text_hover'] = ''; + + $defaults['wc_panel_cart_background_color'] = '#ffffff'; + $defaults['wc_panel_cart_text_color'] = '#000000'; + $defaults['wc_panel_cart_button_background'] = ''; + $defaults['wc_panel_cart_button_text'] = ''; + $defaults['wc_panel_cart_button_background_hover'] = ''; + $defaults['wc_panel_cart_button_text_hover'] = ''; + + $defaults['wc_price_slider_background_color'] = '#dddddd'; + $defaults['wc_price_slider_bar_color'] = '#666666'; + + return $defaults; +} + +add_filter( 'generate_font_option_defaults', 'generatepress_wc_typography_defaults' ); +/** + * Set the WC typography option defaults. + * + * @since 1.3 + */ +function generatepress_wc_typography_defaults( $defaults ) { + $defaults[ 'wc_product_title_font_weight' ] = 'normal'; + $defaults[ 'wc_product_title_font_transform' ] = 'none'; + $defaults[ 'wc_product_title_font_size' ] = '20'; + $defaults[ 'mobile_wc_product_title_font_size' ] = ''; + $defaults[ 'wc_related_product_title_font_size' ] = '20'; + return $defaults; +} + +add_filter( 'generate_navigation_class', 'generatepress_wc_navigation_class' ); +/** + * Add navigation class when the menu icon is enabled. + * + * @since 1.3 + */ +function generatepress_wc_navigation_class( $classes ) { + $classes[] = ( generatepress_wc_get_setting( 'cart_menu_item' ) ) ? 'wc-menu-cart-activated' : ''; + return $classes; +} + +add_filter( 'post_class', 'generatepress_wc_post_class' ); +add_filter( 'product_cat_class', 'generatepress_wc_post_class' ); +/** + * Add post classes to the products. + * + * @since 1.3 + * + * @param array $classes Existing product classes. + * @return array + */ +function generatepress_wc_post_class( $classes ) { + if ( 'product' == get_post_type() ) { + $classes[] = ( generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ) && generatepress_wc_get_setting( 'product_archive_image' ) ) ? 'sales-flash-overlay' : ''; + $classes[] = 'woocommerce-text-align-' . generatepress_wc_get_setting( 'product_archive_alignment' ); + + if ( is_single() ) { + $classes[] = 'wc-related-upsell-columns-' . generatepress_wc_get_setting( 'related_upsell_columns' ); + $classes[] = 'wc-related-upsell-tablet-columns-' . generatepress_wc_get_setting( 'tablet_related_upsell_columns' ); + $classes[] = 'wc-related-upsell-mobile-columns-' . generatepress_wc_get_setting( 'mobile_related_upsell_columns' ); + } else { + $classes[] = 'woocommerce-image-align-' . generatepress_wc_get_setting( 'product_archive_image_alignment' ); + } + } + + if ( 'product' === get_post_type() || is_cart() ) { + if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { + $classes[] = 'do-quantity-buttons'; + $product = wc_get_product( get_the_ID() ); + + $check_stock = is_callable( array( $product, 'managing_stock' ) ) && + is_callable( array( $product, 'get_stock_quantity' ) ) && + is_callable( array( $product, 'backorders_allowed' ) ) && + is_callable( array( $product, 'is_sold_individually' ) ) && + function_exists( 'is_product' ) && + is_product() && + defined( 'WC_VERSION' ); + + if ( $check_stock && version_compare( WC_VERSION, '7.4.0', '>=' ) ) { + $managing_stock = $product->managing_stock(); + $stock_quantity = $product->get_stock_quantity(); + $backorders_allowed = $product->backorders_allowed(); + $sold_individually = $product->is_sold_individually(); + + if ( $sold_individually || ( $managing_stock && $stock_quantity < 2 && ! $backorders_allowed ) ) { + $classes = array_diff( $classes, array( 'do-quantity-buttons' ) ); + } + } + } + } + + return $classes; +} + +add_action( 'woocommerce_before_shop_loop', 'generatepress_wc_before_shop_loop' ); +/** + * Add opening element inside shop page. + * + * @since 1.3 + */ +function generatepress_wc_before_shop_loop() { + $classes = apply_filters( 'generate_woocommerce_container_classes', array( + 'wc-columns-container', + 'wc-columns-' . generatepress_wc_get_setting( 'columns' ), + 'wc-tablet-columns-' . generatepress_wc_get_setting( 'tablet_columns' ), + 'wc-mobile-columns-' . generatepress_wc_get_setting( 'mobile_columns' ), + ) ); + + $classes = array_map('esc_attr', $classes); + echo '
        '; +} + +add_action( 'woocommerce_after_shop_loop', 'generatepress_wc_after_shop_loop' ); +/** + * Add closing element inside shop page. + * + * @since 1.3 + */ +function generatepress_wc_after_shop_loop() { + echo '
        '; +} + +add_action( 'wp_enqueue_scripts', 'generatepress_wc_scripts', 100 ); +/** + * Add scripts and styles. + * + * @since 1.3 + */ +function generatepress_wc_scripts() { + if ( ! function_exists( 'is_checkout' ) ) { + return; + } + + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_style( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "css/woocommerce{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION ); + wp_enqueue_style( 'generate-woocommerce-mobile', plugin_dir_url( __FILE__ ) . "css/woocommerce-mobile{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION, generate_premium_get_media_query( 'mobile' ) ); + + if ( + generatepress_wc_get_setting( 'cart_menu_item' ) || + generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) || + generatepress_wc_show_sticky_add_to_cart() || + generatepress_wc_get_setting( 'quantity_buttons' ) + ) { + wp_enqueue_script( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "js/woocommerce{$suffix}.js", array( 'jquery' ), GENERATE_WOOCOMMERCE_VERSION, true ); + } + + $show_add_to_cart_panel = false; + + if ( ! is_singular() && generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) ) { + $show_add_to_cart_panel = true; + } + + wp_localize_script( + 'generate-woocommerce', + 'generateWooCommerce', + array( + 'quantityButtons' => generatepress_wc_get_setting( 'quantity_buttons' ), + 'stickyAddToCart' => generatepress_wc_show_sticky_add_to_cart(), + 'addToCartPanel' => apply_filters( 'generate_woocommerce_show_add_to_cart_panel', $show_add_to_cart_panel ), + ) + ); + + if ( generatepress_wc_get_setting( 'distraction_free' ) && is_checkout() ) { + wp_dequeue_script( 'generate-advanced-sticky' ); + wp_dequeue_script( 'generate-sticky' ); + } + + $font_icons = true; + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'font' !== generate_get_option( 'icons' ) ) { + $font_icons = false; + } + } + + if ( $font_icons ) { + wp_enqueue_style( 'gp-premium-icons' ); + } +} + +/** + * Wrapper class to get the options. + * + * @since 1.3 + * + * @return string $setting The option name. + * @return string The value. + */ +function generatepress_wc_get_setting( $setting ) { + $settings = wp_parse_args( + get_option( 'generate_woocommerce_settings', array() ), + generatepress_wc_defaults() + ); + + return $settings[ $setting ]; +} + +add_filter( 'generate_sidebar_layout', 'generatepress_wc_sidebar_layout' ); +/** + * Set the WC sidebars. + * + * @since 1.3 + * + * @param string Existing layout + * @return string New layout + */ +function generatepress_wc_sidebar_layout( $layout ) { + if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { + $layout = generatepress_wc_get_setting( 'sidebar_layout' ); + + if ( is_single() ) { + if ( 'inherit' !== generatepress_wc_get_setting( 'single_sidebar_layout' ) ) { + $layout = generatepress_wc_get_setting( 'single_sidebar_layout' ); + } + + if ( get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ) ) { + $layout = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ); + } + } + } + + return $layout; +} + +add_filter( 'loop_shop_columns', 'generatepress_wc_product_columns', 999 ); +/** + * Set the WC column number. + * + * @since 1.3 + */ +function generatepress_wc_product_columns() { + return generatepress_wc_get_setting( 'columns' ); +} + +add_filter( 'loop_shop_per_page', 'generatepress_wc_products_per_page', 20 ); +/** + * Set the WC products per page. + * + * @since 1.3 + */ +function generatepress_wc_products_per_page() { + return generatepress_wc_get_setting( 'products_per_page' ); +} + +add_action( 'wp', 'generatepress_wc_setup' ); +/** + * Set up WC. + * + * @since 1.3 + */ +function generatepress_wc_setup() { + + // Add support for WC features + add_theme_support( 'wc-product-gallery-zoom' ); + add_theme_support( 'wc-product-gallery-lightbox' ); + add_theme_support( 'wc-product-gallery-slider' ); + + remove_action( 'wp_enqueue_scripts', 'generate_woocommerce_css', 100 ); + + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); + add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); + + add_action( 'woocommerce_before_shop_loop_item_title', 'generatepress_wc_image_wrapper_open', 8 ); + add_action( 'woocommerce_before_subcategory_title', 'generatepress_wc_image_wrapper_open', 8 ); + add_action( 'woocommerce_shop_loop_item_title', 'generatepress_wc_image_wrapper_close', 8 ); + add_action( 'woocommerce_before_subcategory_title', 'generatepress_wc_image_wrapper_close', 20 ); + + $archive_results_count = generatepress_wc_get_setting( 'product_results_count' ); + $archive_sorting = generatepress_wc_get_setting( 'product_sorting' ); + $archive_image = generatepress_wc_get_setting( 'product_archive_image' ); + $archive_sale_flash = generatepress_wc_get_setting( 'product_archive_sale_flash' ); + $archive_sale_flash_overlay = generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ); + $archive_rating = generatepress_wc_get_setting( 'product_archive_rating' ); + $archive_price = generatepress_wc_get_setting( 'product_archive_price' ); + $archive_add_to_cart = generatepress_wc_get_setting( 'product_archive_add_to_cart' ); + $archive_title = generatepress_wc_get_setting( 'product_archive_title' ); + $single_product_sale_flash = generatepress_wc_get_setting( 'single_product_sale_flash' ); + $product_tabs = generatepress_wc_get_setting( 'product_tabs' ); + $product_related = generatepress_wc_get_setting( 'product_related' ); + $product_upsells = generatepress_wc_get_setting( 'product_upsells' ); + $product_meta = generatepress_wc_get_setting( 'product_meta' ); + $product_description = generatepress_wc_get_setting( 'product_description' ); + $breadcrumbs = generatepress_wc_get_setting( 'breadcrumbs' ); + $page_title = generatepress_wc_get_setting( 'shop_page_title' ); + $distraction_free = generatepress_wc_get_setting( 'distraction_free' ); + $archive_description = generatepress_wc_get_setting( 'product_archive_description' ); + + if ( false === $page_title ) { + add_filter( 'woocommerce_show_page_title', '__return_false' ); + } + + if ( false === $archive_results_count ) { + remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); + } + + if ( false === $archive_sorting ) { + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); + } + + if ( false === $archive_image ) { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); + } + + if ( false === $archive_sale_flash_overlay ) { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); + add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); + } + + if ( false === $archive_sale_flash ) { + if ( false === $archive_sale_flash_overlay ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); + } else { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); + } + } + + if ( false === $single_product_sale_flash ) { + remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); + } + + if ( false === $archive_rating ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); + } + + if ( false === $archive_price ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); + } + + if ( false === $archive_add_to_cart ) { + remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); + } + + if ( false === $archive_title ) { + remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); + } + + if ( false === $product_tabs ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); + } + + if ( false === $product_related ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); + } + + if ( false === $product_upsells ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); + } + + if ( false === $product_meta ) { + remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); + } + + if ( false === $product_description ) { + remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); + } + + if ( false === $breadcrumbs ) { + remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); + } + + if ( true === $distraction_free ) { + add_filter( 'generate_sidebar_layout', 'generatepress_wc_checkout_sidebar_layout' ); + add_filter( 'generate_footer_widgets', 'generatepress_wc_checkout_footer_widgets' ); + } + + if ( true === $archive_description && ! is_single() && ! is_cart() ) { + add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 5 ); + add_action( 'woocommerce_after_subcategory_title', 'generatepress_wc_category_description', 12 ); + } +} + +/** + * Set the WC checkout sidebar layout. + * + * @since 1.3 + * + * @param string $layout Existing sidebar layout. + * @return string New sidebar layout. + */ +function generatepress_wc_checkout_sidebar_layout( $layout ) { + if ( ! function_exists( 'is_checkout' ) ) { + return $layout; + } + + if ( is_checkout() ) { + return 'no-sidebar'; + } + + return $layout; +} + +/** + * Set the WC checkout footer widgets. + * + * @since 1.3 + * + * @param int $widgets Existing number of widgets. + * @return int New number of widgets. + */ +function generatepress_wc_checkout_footer_widgets( $widgets ) { + if ( ! function_exists( 'is_checkout' ) ) { + return $widgets; + } + + if ( is_checkout() ) { + return '0'; + } + + return $widgets; +} + +add_filter( 'wp_nav_menu_items', 'generatepress_wc_menu_cart', 10, 2 ); +/** + * Add the WC cart menu item. + * + * @since 1.3 + * + * @param string $nav The HTML list content for the menu items. + * @param stdClass $args An object containing wp_nav_menu() arguments. + * @return string The search icon menu item. + */ +function generatepress_wc_menu_cart( $nav, $args ) { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + return $nav; + } + + // If our primary menu is set, add the search icon. + if ( apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) === $args->theme_location && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( ! isset( WC()->cart ) ) { + return; + } + + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = 'has-items'; + } + + return sprintf( + '%1$s + ', + $nav, + generatepress_wc_cart_link(), + is_cart() ? 'current-menu-item' : '', + $has_items + ); + } + + // Our primary menu isn't set, return the regular nav. + return $nav; +} + +add_action( 'wp', 'generatepress_wc_add_menu_bar_items' ); +/** + * Add to the menu bar items. + * + * @since 1.11.0 + */ +function generatepress_wc_add_menu_bar_items() { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + if ( 'secondary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + add_action( 'generate_secondary_menu_bar_items', 'generate_wc_do_cart_secondary_menu_item', 5 ); + } + + if ( 'primary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + add_action( 'generate_menu_bar_items', 'generate_wc_do_cart_menu_item', 5 ); + } + } +} + +/** + * Add the cart menu item to the secondary navigation. + */ +function generate_wc_do_cart_secondary_menu_item() { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + if ( 'secondary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( ! isset( WC()->cart ) ) { + return; + } + + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = 'has-items'; + } + + printf( + ' + %1$s + ', + generatepress_wc_cart_link(), + is_cart() ? 'current-menu-item' : '', + $has_items + ); + } + } +} + +/** + * Add the cart menu item to the navigation. + * + * @since 1.11.0 + */ +function generate_wc_do_cart_menu_item() { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + if ( 'primary' === apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( ! isset( WC()->cart ) ) { + return; + } + + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = 'has-items'; + } + + printf( + ' + %1$s + ', + generatepress_wc_cart_link(), + is_cart() ? 'current-menu-item' : '', + $has_items + ); + } + } +} + +/** + * Build the menu cart link. + * + * @since 1.3 + */ +function generatepress_wc_cart_link() { + // Kept for backward compatibility. + $legacy_icon = apply_filters( 'generate_woocommerce_menu_cart_icon', '' ); + + // Get the icon type. + $icon_type = generatepress_wc_get_setting( 'cart_menu_item_icon' ); + + $icon = ''; + + if ( function_exists( 'generate_get_svg_icon' ) ) { + $icon = generate_get_svg_icon( $icon_type ); + } + + ob_start(); + + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( ! isset( WC()->cart ) ) { + return; + } + + $no_items = ''; + + if ( ! WC()->cart->get_cart_contents_count() > 0 ) { + $no_items = 'no-items'; + } + + printf( + '%5$s%6$s%7$s%8$s', + esc_url( wc_get_cart_url() ), + esc_attr( $icon_type ), + $icon ? 'has-svg-icon' : '', + esc_attr__( 'View your shopping cart', 'gp-premium' ), + $icon, + sprintf( + '%2$s', + $no_items, + WC()->cart->get_cart_contents_count() + ), + $legacy_icon, + WC()->cart->subtotal > 0 ? wp_kses_data( WC()->cart->get_cart_subtotal() ) : '' + ); + + if ( generatepress_wc_get_setting( 'menu_mini_cart' ) && ! is_cart() ) : ?> + + cart ) ) { + $fragments['.cart-contents span.amount'] = ( WC()->cart->subtotal > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '' : ''; + $fragments['.cart-contents span.number-of-items'] = ( WC()->cart->get_cart_contents_count() > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '' : ''; + } + + return $fragments; +} + +/** + * Add the cart icon in the mobile menu. + * + * @since 1.3 + */ +function generatepress_wc_mobile_cart_link() { + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + return; + } + + if ( ! generatepress_wc_get_setting( 'cart_menu_item' ) || 'primary' !== apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) ) { + return; + } + + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( ! isset( WC()->cart ) ) { + return; + } + + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = ' has-items'; + } + ?> +
        + + +
        + set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link' ); + $css->add_property( 'color', esc_attr( $settings['wc_product_title_color'] ) ); + + // Product title color hover. + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_product_title_color_hover'] ) ); + + if ( ! $using_dynamic_typography ) { + // Product title font size. + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); + $css->add_property( 'font-weight', esc_attr( $settings['wc_product_title_font_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $settings['wc_product_title_font_transform'] ) ); + $css->add_property( 'font-size', esc_attr( $settings['wc_product_title_font_size'] ), false, 'px' ); + + $css->set_selector( '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2' ); + if ( '' !== $settings['wc_related_product_title_font_size'] ) { + $css->add_property( 'font-size', esc_attr( $settings['wc_related_product_title_font_size'] ), false, 'px' ); + } + } + + // Primary button. + $css->set_selector( '.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button' ); + $css->add_property( 'color', esc_attr( $settings['form_button_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $settings['form_button_background_color'] ) ); + + if ( ! $using_dynamic_typography && isset( $settings['buttons_font_size'] ) ) { + $css->add_property( 'font-weight', esc_attr( $settings['buttons_font_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $settings['buttons_font_transform'] ) ); + + if ( '' !== $settings['buttons_font_size'] ) { + $css->add_property( 'font-size', absint( $settings['buttons_font_size'] ), false, 'px' ); + } + } + + if ( $using_dynamic_typography && class_exists( 'GeneratePress_Typography' ) ) { + $typography = generate_get_option( 'typography' ); + + foreach ( (array) $typography as $key => $data ) { + if ( 'buttons' === $data['selector'] ) { + $unit = isset( $data['fontSizeUnit'] ) ? $data['fontSizeUnit'] : 'px'; + + if ( ! empty( $data['fontSize'] ) ) { + $css->add_property( 'font-size', floatval( $data['fontSize'] ), false, $unit ); + } + + if ( ! empty( $data['fontWeight'] ) ) { + $css->add_property( 'font-weight', esc_attr( $data['fontWeight'] ) ); + } + + if ( ! empty( $data['textTransform'] ) ) { + $css->add_property( 'text-transform', esc_attr( $data['textTransform'] ) ); + } + + if ( ! empty( $data['fontSizeTablet'] ) ) { + $css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); + $css->add_property( 'font-size', floatval( $data['fontSizeTablet'] ), false, $unit ); + $css->stop_media_query(); + } + + if ( ! empty( $data['fontSizeMobile'] ) ) { + $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + $css->add_property( 'font-size', floatval( $data['fontSizeMobile'] ), false, $unit ); + $css->stop_media_query(); + } + } + } + } + + // Primary button hover. + $css->set_selector( '.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover' ); + $css->add_property( 'color', esc_attr( $settings['form_button_text_color_hover'] ) ); + $css->add_property( 'background-color', esc_attr( $settings['form_button_background_color_hover'] ) ); + + // Alt button. + $css->set_selector( '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_alt_button_text'] ) ); + $css->add_property( 'background-color', esc_attr( $settings['wc_alt_button_background'] ) ); + + // Alt button hover. + $css->set_selector( '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_alt_button_text_hover'] ) ); + $css->add_property( 'background-color', esc_attr( $settings['wc_alt_button_background_hover'] ) ); + + // Star rating. + $css->set_selector( '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before' ); + $css->add_property( 'color', esc_attr( $settings['wc_rating_stars'] ) ); + + // Sale sticker. + $css->set_selector( '.woocommerce span.onsale' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_sale_sticker_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_sale_sticker_text'] ) ); + + // Price. + $css->set_selector( '.woocommerce ul.products li.product .price, .woocommerce div.product p.price' ); + $css->add_property( 'color', esc_attr( $settings['wc_price_color'] ) ); + + // Product tab. + $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a' ); + $css->add_property( 'color', esc_attr( $settings['wc_product_tab'] ) ); + + // Highlight product tab. + $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a' ); + $css->add_property( 'color', esc_attr( $settings['wc_product_tab_highlight'] ) ); + + // Success message. + $css->set_selector( '.woocommerce-message' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_success_message_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_success_message_text'] ) ); + + $css->set_selector( 'div.woocommerce-message a.button, div.woocommerce-message a.button:focus, div.woocommerce-message a.button:hover, div.woocommerce-message a, div.woocommerce-message a:focus, div.woocommerce-message a:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_success_message_text'] ) ); + + // Info message. + $css->set_selector( '.woocommerce-info' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_info_message_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_info_message_text'] ) ); + + $css->set_selector( 'div.woocommerce-info a.button, div.woocommerce-info a.button:focus, div.woocommerce-info a.button:hover, div.woocommerce-info a, div.woocommerce-info a:focus, div.woocommerce-info a:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_info_message_text'] ) ); + + // Info message. + $css->set_selector( '.woocommerce-error' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_error_message_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_error_message_text'] ) ); + + $css->set_selector( 'div.woocommerce-error a.button, div.woocommerce-error a.button:focus, div.woocommerce-error a.button:hover, div.woocommerce-error a, div.woocommerce-error a:focus, div.woocommerce-error a:hover' ); + $css->add_property( 'color', esc_attr( $settings['wc_error_message_text'] ) ); + + // Archive short description. + $css->set_selector( '.woocommerce-product-details__short-description' ); + if ( '' !== $settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings['text_color'] ) ); + } + + $css->set_selector( '#wc-mini-cart' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_background_color'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); + + $css->set_selector( '#wc-mini-cart a:not(.button), #wc-mini-cart a.remove' ); + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); + + $css->set_selector( '#wc-mini-cart .button' ); + if ( $settings['wc_mini_cart_button_background'] ) { + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background'] ) ); + } + + if ( $settings['wc_mini_cart_button_text'] ) { + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text'] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings['form_button_text_color'] ) ); + } + + $css->set_selector( '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background_hover'] ) ); + + if ( $settings['wc_mini_cart_button_text_hover'] ) { + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text_hover'] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings['form_button_text_color_hover'] ) ); + } + + $css->set_selector( '.woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images' ); + $css->add_property( 'width', absint( generatepress_wc_get_setting( 'single_product_image_width' ) ), false, '%' ); + + if ( ! $using_dynamic_typography && function_exists( 'generate_get_font_family_css' ) ) { + $buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() ); + $css->set_selector( '.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a' ); + $css->add_property( 'font-family', $buttons_family ); + } + + $css->set_selector( '.add-to-cart-panel' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); + + $css->set_selector( '.add-to-cart-panel a:not(.button)' ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); + + $css->set_selector( '#wc-sticky-cart-panel .button' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text'] ) ); + + $css->set_selector( '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background_hover'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text_hover'] ) ); + + $transparent_border_color = $settings['text_color']; + + if ( $settings['content_text_color'] ) { + $transparent_border_color = $settings['content_text_color']; + } + + $transparent_border_color = generate_premium_check_text_color( $transparent_border_color ); + + if ( 'light' === $transparent_border_color ) { + $transparent_border_elements = '.woocommerce-ordering select, .variations .value select'; + + if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { + $transparent_border_elements = '.woocommerce form .quantity.buttons-added .qty, .woocommerce form .quantity.buttons-added .minus, .woocommerce form .quantity.buttons-added .plus, .do-quantity-buttons form .quantity:not(.buttons-added):before, .do-quantity-buttons form .quantity:not(.buttons-added):after, .woocommerce-ordering select, .variations .value select'; + } + + $css->set_selector( $transparent_border_elements ); + $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); + + if ( generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { + $css->set_selector( '#wc-sticky-cart-panel .quantity.buttons-added .qty, #wc-sticky-cart-panel .quantity.buttons-added .minus, #wc-sticky-cart-panel .quantity.buttons-added .plus' ); + $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); + } + } + + $css->set_selector( '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_background_color'] ) ); + + $css->set_selector( '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_bar_color'] ) ); + + if ( 'number' === generatepress_wc_get_setting( 'cart_menu_item_content' ) ) { + $nav_text_color = generate_premium_check_text_color( $settings['navigation_text_color'] ); + + $css->set_selector( '.cart-contents > span.number-of-items' ); + if ( 'light' === $nav_text_color ) { + $css->add_property( 'background-color', 'rgba(255,255,255,0.1)' ); + } else { + $css->add_property( 'background-color', 'rgba(0,0,0,0.05)' ); + } + + $css->set_selector( '.cart-contents .amount' ); + $css->add_property( 'display', 'none' ); + + $css->set_selector( '.cart-contents > span.number-of-items' ); + $css->add_property( 'display', 'inline-block' ); + } + + $font_icons = true; + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'font' !== generate_get_option( 'icons' ) ) { + $font_icons = false; + } + } + + if ( ! $font_icons ) { + $css->set_selector( '.woocommerce-MyAccount-navigation li.is-active a:after, a.button.wc-forward:after' ); + $css->add_property( 'display', 'none' ); + + $css->set_selector( '#payment .payment_methods>.wc_payment_method>label:before' ); + $css->add_property( 'font-family', 'WooCommerce' ); + $css->add_property( 'content', '"\e039"' ); + + $css->set_selector( '#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before' ); + $css->add_property( 'content', '"\e03c"' ); + + $css->set_selector( '.woocommerce-ordering:after' ); + $css->add_property( 'font-family', 'WooCommerce' ); + $css->add_property( 'content', '"\e00f"' ); + } + + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'columns_gap' ), false, 'px' ); + } + + $css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'tablet_columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'tablet_columns_gap' ), false, 'px' ); + } + + if ( 3 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-3 .products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); + $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); + } + + if ( 2 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-2 .products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); + $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); + } + + if ( 1 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-1 .products' ); + $css->add_property( 'width', '100%' ); + $css->add_property( '-ms-grid-columns', '1fr' ); + $css->add_property( 'grid-template-columns', '1fr' ); + } + + if ( 3 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-3 .related ul.products, .wc-related-upsell-tablet-columns-3 .up-sells ul.products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); + $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); + } + + if ( 2 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-2 .related ul.products, .wc-related-upsell-tablet-columns-2 .up-sells ul.products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); + $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); + } + + if ( 1 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-1 .related ul.products, .wc-related-upsell-tablet-columns-1 .up-sells ul.products' ); + $css->add_property( 'width', '100%' ); + $css->add_property( '-ms-grid-columns', '1fr' ); + $css->add_property( 'grid-template-columns', '1fr' ); + } + $css->stop_media_query(); + + $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + if ( ! $using_dynamic_typography ) { + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); + if ( '' !== $settings[ 'mobile_wc_product_title_font_size' ] ) { + $css->add_property( 'font-size', esc_attr( $settings[ 'mobile_wc_product_title_font_size' ] ), false, 'px' ); + } + } + + $css->set_selector( '.add-to-cart-panel .continue-shopping' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); + + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'mobile_columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'mobile_columns_gap' ), false, 'px' ); + } + + $css->set_selector( '.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images' ); + $css->add_property( 'width', '100%' ); + $css->stop_media_query(); + + $using_flex = false; + + if ( function_exists( 'generate_is_using_flexbox' ) && generate_is_using_flexbox() ) { + $using_flex = true; + } + + $css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + if ( ! $using_flex ) { + $css->set_selector( '.mobile-bar-items + .menu-toggle' ); + $css->add_property( 'text-align', 'left' ); + } + + $css->set_selector( 'nav.toggled .main-nav li.wc-menu-item' ); + $css->add_property( 'display', 'none !important' ); + + if ( ! $using_flex ) { + $css->set_selector( 'body.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .mobile-bar-items' ); + $css->add_property( 'float', 'right' ); + $css->add_property( 'position', 'relative' ); + + $css->set_selector( '.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .menu-toggle' ); + $css->add_property( 'float', 'left' ); + $css->add_property( 'width', 'auto' ); + } + + $css->set_selector( '.mobile-bar-items.wc-mobile-cart-items' ); + $css->add_property( 'z-index', '1' ); + $css->stop_media_query(); + + return $css->css_output(); +} + +add_action( 'wp_enqueue_scripts', 'generatepress_wc_enqueue_css', 100 ); +/** + * Enqueue our dynamic CSS. + * + * @since 1.3 + */ +function generatepress_wc_enqueue_css() { + wp_add_inline_style( 'generate-woocommerce', generatepress_wc_css() ); + + if ( class_exists( 'GeneratePress_Typography' ) ) { + wp_add_inline_style( 'generate-woocommerce', GeneratePress_Typography::get_css( 'woocommerce' ) ); + } +} + +/** + * Open WC image wrapper. + * + * @since 1.3 + */ +function generatepress_wc_image_wrapper_open() { + if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { + echo '
        '; + } +} + +/** + * Close WC image wrapper. + * + * @since 1.3 + */ +function generatepress_wc_image_wrapper_close() { + if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { + echo '
        '; + } +} + +add_filter( 'post_class', 'generatepress_wc_product_has_gallery' ); +add_filter( 'product_cat_class', 'generatepress_wc_product_has_gallery' ); +/** + * Add product image post classes to products. + * + * @since 1.3 + * + * @param array $classes Existing classes. + * @return array New classes. + */ +function generatepress_wc_product_has_gallery( $classes ) { + + $post_type = get_post_type( get_the_ID() ); + + if ( 'product' === $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { + $product = wc_get_product( get_the_ID() ); + $attachment_ids = $product->get_gallery_image_ids(); + + if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { + $classes[] = 'wc-has-gallery'; + } + } + + return $classes; +} + +add_action( 'woocommerce_before_shop_loop_item_title', 'generatepress_wc_secondary_product_image' ); +/** + * Add secondary product image. + * + * @since 1.3 + */ +function generatepress_wc_secondary_product_image() { + $post_type = get_post_type( get_the_ID() ); + + if ( 'product' === $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { + $product = wc_get_product( get_the_ID() ); + $attachment_ids = $product->get_gallery_image_ids(); + + if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { + $secondary_image_id = $attachment_ids['0']; + echo wp_get_attachment_image( $secondary_image_id, 'woocommerce_thumbnail', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) ); + } + } +} + +add_filter( 'woocommerce_product_get_rating_html', 'generatepress_wc_rating_html', 10, 2 ); +/** + * Always show ratings area to make sure products are similar heights. + * + * @since 1.3.1 + * + * @param string $rating_html + * @param int $rating + * @return string + */ +function generatepress_wc_rating_html( $rating_html, $rating ) { + if ( $rating > 0 ) { + $title = sprintf( __( 'Rated %s out of 5', 'gp-premium' ), $rating ); + } else { + $title = __( 'Not yet rated', 'gp-premium' ); + $rating = 0; + } + + $rating_html = '
        '; + $rating_html .= '' . $rating . ' ' . __( 'out of 5', 'gp-premium' ) . ''; + $rating_html .= '
        '; + + return $rating_html; +} + +/** + * Add WC category description. + * + * @since 1.3 + * + * @param array $category + * @return string + */ +function generatepress_wc_category_description( $category ) { + $prod_term = get_term( $category->term_id, 'product_cat' ); + $description = $prod_term->description; + echo '
        ' . $description . '
        '; +} + +add_action( 'generate_after_footer', 'generatepress_wc_add_to_cart_helper' ); +/** + * Adds a sticky/slide down navigation with add to cart details. + * + * @since 1.8 + */ +function generatepress_wc_add_to_cart_helper() { + if ( ! generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) && ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { + return; + } + + $outer_classes = array( + 'add-to-cart-panel', + ); + + $inner_classes = array( + 'inside-add-to-cart-panel', + ); + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'contained-nav' === generate_get_option( 'nav_layout_setting' ) ) { + $outer_classes[] = 'grid-container grid-parent'; + } + + if ( 'contained' === generate_get_option( 'nav_inner_width' ) ) { + $inner_classes[] = 'grid-container grid-parent'; + } + } + ?> +
        +
        + + +
        + + +
        + +
        +
        + +
        + +
        + cart ) ) { + echo sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ); ?> - cart->get_cart_total(); + } + ?> +
        +
        + + + %s +
        ', + esc_url( wc_get_checkout_url() ), + esc_html__( 'Checkout', 'gp-premium' ) + ) + ); + ?> + +
        + +
        + +
        + +
        + + get_price() ) : ?> +
        + get_price_html(); ?> +
        + is_type( 'simple' ) ) { + $args = array( + 'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ), + 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ), + ); + + $action = sprintf( + '
        + %3$s + +
        ', + esc_url( $product->add_to_cart_url() ), + $quantity_buttons, + woocommerce_quantity_input( $args, $product, false ), + esc_html( $product->add_to_cart_text() ) + ); + } + + if ( $product->is_type( 'variable' ) ) { + $action = sprintf( + '', + esc_html( $product->add_to_cart_text() ) + ); + } + + if ( $product->is_type( 'external' ) ) { + $action = sprintf( + '
        + +
        ', + esc_url( $product->add_to_cart_url() ), + esc_html( $product->add_to_cart_text() ) + ); + } + + echo apply_filters( 'generate_wc_sticky_add_to_cart_action', $action, $product ); // phpcs:ignore -- No escaping needed. + endif; + ?> + +
        + + cart ) ) { + $fragments['.add-to-cart-panel .cart-data'] = '
        ' . sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ) . ' - ' . WC()->cart->get_cart_total() . '
        '; + } + + return $fragments; +} + +/** + * If we should display the sticky add to cart panel. + * + * @since 1.8 + */ +function generatepress_wc_show_sticky_add_to_cart() { + if ( ! function_exists( 'wc_get_product' ) ) { + return false; + } + + $product = wc_get_product( get_the_ID() ); + $show = false; + + if ( ! $product || ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) || ! is_singular( 'product' ) ) { + return false; + } + + if ( ( $product->is_type( 'simple' ) || $product->is_type( 'variable' ) ) && $product->is_purchasable() && $product->is_in_stock() ) { + $show = true; + } + + if ( $product->is_type( 'external' ) ) { + $show = true; + } + + return apply_filters( 'generate_wc_show_sticky_add_to_cart', $show ); +} + +/** + * Checks if a color is light or dark. + * + * @since 1.8 + * @param string $color The color to check. + */ +function generate_premium_check_text_color( $color ) { + // Get the hex value if we're using variables. + if ( function_exists( 'generate_get_option' ) && strpos( $color, 'var(' ) !== false ) { + $global_colors = generate_get_option( 'global_colors' ); + $found_color = false; + + // Remove whitespace if it's been added. + $color = str_replace( ' ', '', $color ); + + foreach ( (array) $global_colors as $key => $data ) { + // Check for the full variable - var(--color) - or a variable with a fallback - var(--color,#fff). + if ( 'var(--' . $data['slug'] . ')' === $color || strpos( $color, 'var(--' . $data['slug'] . ',' ) !== false ) { + $color = $data['color']; + $found_color = true; + break; + } + } + + // If we didn't find the hex value, bail. + if ( ! $found_color ) { + return; + } + } + + $r = hexdec( substr( $color, 1, 2 ) ); + $g = hexdec( substr( $color, 3, 2 ) ); + $b = hexdec( substr( $color, 5, 2 ) ); + $yiq = ( ( $r * 299 ) + ( $g * 587 ) + ( $b * 114 ) ) / 1000; + + return ( $yiq >= 128 ) ? 'light' : 'dark'; +} + +add_filter( 'generate_typography_css_selector', 'generate_woocommerce_typography_selectors' ); +/** + * Add the WooCommerce typography CSS selectors. + * + * @since 2.1.0 + * @param string $selector The selector we're targeting. + */ +function generate_woocommerce_typography_selectors( $selector ) { + switch ( $selector ) { + case 'woocommerce-catalog-product-titles': + $selector = '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title'; + break; + + case 'woocommerce-related-product-titles': + $selector = '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2'; + break; + } + + return $selector; +} diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js new file mode 100644 index 00000000..6950977f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.js @@ -0,0 +1,285 @@ +jQuery( function( $ ) { + var debounce = function( callback, wait ) { + var timeout; + + return function() { + clearTimeout( timeout ); + + timeout = setTimeout( function() { + timeout = undefined; + callback.call(); + }, wait ); + }; + }; + + $( 'body' ).on( 'added_to_cart', function() { + if ( ! $( '.wc-menu-item' ).hasClass( 'has-items' ) ) { + $( '.wc-menu-item' ).addClass( 'has-items' ); + } + + if ( ! $( '.wc-mobile-cart-items' ).hasClass( 'has-items' ) ) { + $( '.wc-mobile-cart-items' ).addClass( 'has-items' ); + } + } ); + + $( 'body' ).on( 'removed_from_cart', function() { + var numberOfItems = $( '.number-of-items' ); + + if ( numberOfItems.length ) { + if ( numberOfItems.hasClass( 'no-items' ) ) { + $( '.wc-menu-item' ).removeClass( 'has-items' ); + $( '.wc-mobile-cart-items' ).removeClass( 'has-items' ); + } + } + } ); + + if ( generateWooCommerce.addToCartPanel ) { + $( document.body ).on( 'added_to_cart', function() { + var adminBar = $( '#wpadminbar' ), + stickyNav = $( '.navigation-stick' ), + top = 0; + + if ( adminBar.length ) { + top = adminBar.outerHeight(); + } + + if ( stickyNav.length && '0px' === stickyNav.css( 'top' ) ) { + top = top + stickyNav.outerHeight(); + } + + $( '.add-to-cart-panel' ).addClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(' + top + 'px)', + '-ms-transform': 'translateY(' + top + 'px)', + transform: 'translateY(' + top + 'px)', + } ); + } ); + + $( '.add-to-cart-panel .continue-shopping' ).on( 'click', function( e ) { + e.preventDefault(); + + $( '.add-to-cart-panel' ).removeClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(-100%)', + '-ms-transform': 'translateY(-100%)', + transform: 'translateY(-100%)', + } ); + } ); + + $( window ).on( 'scroll', debounce( function() { + var panel = $( '.add-to-cart-panel' ); + + if ( panel.hasClass( 'item-added' ) ) { + panel.removeClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(-100%)', + '-ms-transform': 'translateY(-100%)', + transform: 'translateY(-100%)', + } ); + } + }, 250 ) ); + } + + if ( generateWooCommerce.stickyAddToCart ) { + var lastScroll = 0; + var scrollDownTimeout = 300; + + $( window ).on( 'scroll', debounce( function() { + var adminBar = $( '#wpadminbar' ), + stickyNav = $( '.navigation-stick' ), + stuckElement = $( '.stuckElement' ), + top = 0, + scrollTop = $( window ).scrollTop(), + panel = $( '.add-to-cart-panel' ), + panelPosition = panel.offset().top + panel.outerHeight(), + button = $( '.single_add_to_cart_button' ), + buttonTop = button.offset().top, + buttonHeight = button.outerHeight(), + footerTop = $( '.site-footer' ).offset().top; + + if ( stuckElement.length === 0 ) { + scrollDownTimeout = 0; + } + + if ( scrollTop > ( buttonTop + buttonHeight ) && panelPosition < footerTop ) { + setTimeout( function() { + if ( adminBar.length ) { + top = adminBar.outerHeight(); + } + + if ( stickyNav.length ) { + if ( stickyNav.hasClass( 'auto-hide-sticky' ) ) { + if ( scrollTop < lastScroll && '0px' === stickyNav.css( 'top' ) ) { + top = top + stickyNav.outerHeight(); + } else { + top = top; + } + + lastScroll = scrollTop; + } else { + top = top + stickyNav.outerHeight(); + } + } + + panel.addClass( 'show-sticky-add-to-cart' ).css( { + '-webkit-transform': 'translateY(' + top + 'px)', + '-ms-transform': 'translateY(' + top + 'px)', + transform: 'translateY(' + top + 'px)', + } ); + }, scrollDownTimeout ); + } else { + panel.removeClass( 'show-sticky-add-to-cart' ).css( { + '-webkit-transform': '', + '-ms-transform': '', + transform: '', + } ); + } + }, 50 ) ); + + $( '.go-to-variables' ).on( 'click', function( e ) { + e.preventDefault(); + + var offset = 0, + stickyNav = $( '.navigation-stick' ), + adminBar = $( '#wpadminbar' ); + + if ( stickyNav.length ) { + offset = stickyNav.outerHeight(); + } + + if ( adminBar.length ) { + offset = offset + adminBar.outerHeight(); + } + + $( 'html, body' ).animate( { + scrollTop: $( '.variations' ).offset().top - offset, + }, 250 ); + } ); + } + + $( function() { + 'use strict'; + + if ( generateWooCommerce.quantityButtons ) { + generateQuantityButtons(); + } + } ); + + $( document ).ajaxComplete( function() { + 'use strict'; + + if ( generateWooCommerce.quantityButtons ) { + generateQuantityButtons(); + } + } ); + + function generateQuantityButtons() { + // Check if we have an overwrite hook for this function + try { + return generateWooCommerce.hooks.generateQuantityButtons(); + } catch ( e ) { + // No hook in place, carry on + } + + // Grab the FIRST available cart form on the page + var cart = $( '.woocommerce div.product form.cart' ).first(); + + // Check if we see elementor style classes + if ( cart.closest( '.elementor-add-to-cart' ).length ) { + // Found classes, remove them and finish here + $( '.elementor.product' ).removeClass( 'do-quantity-buttons' ); + return; + } + + // Grab all the quantity boxes that need dynamic buttons adding + var quantityBoxes; + + try { + // Is there a hook available? + quantityBoxes = generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes; + } catch ( e ) { + // Use the default plugin selector functionality + quantityBoxes = $( '.cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)' ).find( '.qty' ); + } + + // Test the elements have length and greater than 0 + // Try, catch here to provide basic error checking on hooked data + try { + // Nothing found... stop here + if ( quantityBoxes.length === 0 ) { + return false; + } + } catch ( e ) { + return false; + } + + // Allow the each loop callback to be completely overwritten + var quantityBoxesCallback; + + try { + // Try assign a hooked callback + quantityBoxesCallback = generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes; + } catch ( e ) { + // Use the default callback handler + quantityBoxesCallback = function( key, value ) { + var box = $( value ); + + // Check allowed types + if ( [ 'date', 'hidden' ].indexOf( box.prop( 'type' ) ) !== -1 ) { + return; + } + + // Add plus and minus icons + box.parent().addClass( 'buttons-added' ).prepend( '-' ); + box.after( '+' ); + + // Enforce min value on the input + var min = parseFloat( $( this ).attr( 'min' ) ); + + if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) { + $( this ).val( min ); + } + + // Add event handlers to plus and minus (within this scope) + box.parent().find( '.plus, .minus' ).on( 'click', function() { + // Get values + var currentQuantity = parseFloat( box.val() ), + maxQuantity = parseFloat( box.attr( 'max' ) ), + minQuantity = parseFloat( box.attr( 'min' ) ), + step = box.attr( 'step' ); + + // Fallback default values + if ( ! currentQuantity || '' === currentQuantity || 'NaN' === currentQuantity ) { + currentQuantity = 0; + } + + if ( '' === maxQuantity || 'NaN' === maxQuantity ) { + maxQuantity = ''; + } + + if ( '' === minQuantity || 'NaN' === minQuantity ) { + minQuantity = 0; + } + + if ( 'any' === step || '' === step || undefined === step || 'NaN' === parseFloat( step ) ) { + step = 1; + } + + if ( $( this ).is( '.plus' ) ) { + if ( maxQuantity && ( maxQuantity === currentQuantity || currentQuantity > maxQuantity ) ) { + box.val( maxQuantity ); + } else { + box.val( currentQuantity + parseFloat( step ) ); + } + } else if ( minQuantity && ( minQuantity === currentQuantity || currentQuantity < minQuantity ) ) { + box.val( minQuantity ); + } else if ( currentQuantity > 0 ) { + box.val( currentQuantity - parseFloat( step ) ); + } + + // Trigger change event + box.trigger( 'change' ); + } ); + }; + } + + $.each( quantityBoxes, quantityBoxesCallback ); + } +} ); diff --git a/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js new file mode 100644 index 00000000..97f0e7aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js @@ -0,0 +1 @@ +jQuery(function(d){function t(t,a){var e;return function(){clearTimeout(e),e=setTimeout(function(){e=void 0,t.call()},a)}}var m,u;function a(){try{return generateWooCommerce.hooks.generateQuantityButtons()}catch(t){}var a,e;if(d(".woocommerce div.product form.cart").first().closest(".elementor-add-to-cart").length)d(".elementor.product").removeClass("do-quantity-buttons");else{try{a=generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes}catch(t){a=d(".cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)").find(".qty")}try{if(0===a.length)return}catch(t){return}try{e=generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes}catch(t){e=function(t,a){var s=d(a);-1===["date","hidden"].indexOf(s.prop("type"))&&(s.parent().addClass("buttons-added").prepend('-'),s.after('+'),(a=parseFloat(d(this).attr("min")))&&0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gp_elements + + + _generate_element_content + _generate_element_type + _generate_block_type + _generate_element_display_conditions + _generate_element_exclude_conditions + _generate_element_user_conditions + _generate_hook + _generate_hook_execute_shortcodes + _generate_hook_execute_php + _generate_hook_priority + _generate_hook_disable_site_header + _generate_hook_disable_site_footer + _generate_hero_custom_classes + _generate_hero_container + _generate_hero_inner_container + _generate_hero_horizontal_alignment + _generate_hero_padding_top + _generate_hero_padding_right + _generate_hero_padding_bottom + _generate_hero_padding_left + _generate_hero_padding_top_unit + _generate_hero_padding_right_unit + _generate_hero_padding_bottom_unit + _generate_hero_padding_left_unit + _generate_hero_padding_top_mobile + _generate_hero_padding_right_mobile + _generate_hero_padding_bottom_mobile + _generate_hero_padding_left_mobile + _generate_hero_padding_top_unit_mobile + _generate_hero_padding_right_unit_mobile + _generate_hero_padding_bottom_unit_mobile + _generate_hero_padding_left_unit_mobile + _generate_hero_background_image + _generate_hero_background_position + _generate_hero_background_parallax + _generate_hero_disable_featured_image + _generate_hero_background_overlay + _generate_hero_background_color + _generate_hero_text_color + _generate_hero_link_color + _generate_hero_background_link_color_hover + _generate_site_header_merge + _generate_site_header_height + _generate_site_header_height_mobile + _generate_site_header_background_color + _generate_site_header_title_color + _generate_site_header_tagline_color + _generate_site_logo + _generate_retina_logo + _generate_navigation_logo + _generate_mobile_logo + _generate_navigation_location + _generate_navigation_colors + _generate_navigation_background_color + _generate_navigation_text_color + _generate_navigation_background_color_hover + _generate_navigation_text_color_hover + _generate_navigation_background_color_current + _generate_navigation_text_color_current + _generate_sidebar_layout + _generate_footer_widgets + _generate_disable_site_header + _generate_disable_top_bar + _generate_disable_primary_navigation + _generate_disable_secondary_navigation + _generate_disable_featured_image + _generate_disable_content_title + _generate_disable_footer + _generate_content_area + _generate_content_width + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md new file mode 100644 index 00000000..e3af57e1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/CHANGELOG.md @@ -0,0 +1,193 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 1.4.0 - 2023-05-05 +### Added +- Add brute force protection. [#28401] + +### Changed +- General: indicate full compatibility with the latest version of WordPress, 6.2. [#29341] +- Improve the firewall status heading to provide more information based on the current configuration. [#28401] +- Updated package dependencies. [#29480] + +## 1.3.0 - 2023-03-13 +### Added +- Add ability to toggle automatic and manual firewall rules independently. [#27726] +- Add improved messaging for currently enabled firewall features. [#27845] +- Disable Jetpack Firewall on unsupported environments. [#27939] +- Add link to pricing page for getting started with an existing plan or license key. [#27745] + +### Changed +- Updated package dependencies. [#29297] +- Update to React 18. [#28710] +- Use `flex-start`/`flex-end` instead of `start`/`end` for better browser compatibility. [#28530] + +### Fixed +- Fix connection button loading indicators. [#28514] +- Fix Protect status report caching. [#28766] +- Remove unnecessary full path from example in UI. [#29037] +- Other assorted fixes for minor bugs and grammar. [#27846] [#28091] [#28397] [#28273] + +## 1.2.0 - 2023-01-16 +### Added +- Add web application firewall (WAF) features [#27528] +- Add progress bar to site scannnig screen [#27171] + +### Fixed +- Poll for scan status while scanner is provisioning [#28275] +- Bug fixes + +## 1.1.2 - 2022-11-30 +### Changed +- changed description and author [#27618] +- Updated package dependencies. [#27043] + +## 1.1.1 - 2022-11-18 +### Fixed +- Fix issue with plugin activation. + +## 1.1.0 - 2022-11-17 +### Added +- Add features for paid Jetpack Scan users, including file and database threats, on-demand scanning, and threat auto-fixers. + +### Changed +- Compatibility: WordPress 6.1 compatibility + +### Fixed +- Adjust alignment of spinner icon and loading text on the in-progress scan screen. + +## 1.0.4 - 2022-08-29 +### Fixed +- Fixed NaN error that prevented the pricing interstitial from rendering. + +## 1.0.3 - 2022-08-26 +### Added +- Added a default 'See all results' label to the mobile navigation button. +- Added a spinner to the in progress scan page in admin +- Added JITM functionality +- Added threat descriptions. +- My Jetpack includes JITMs + +### Changed +- Add condition to check plugin activation context before redirecting + +### Fixed +- Fixed alignment of long navigation item labels on mobile screen sizes. + +## 1.0.2 - 2022-07-27 +### Changed +- Updated package dependencies. + +### Fixed +- Fix protect admin toolbar icon display when Jetpack enabled and connected +- Minor bug fix - added isset() checks for report data properties + +## 1.0.1 - 2022-07-07 +### Added +- Added two new FAQ entries +- Protect: record even just after the site is registered + +### Changed +- Moved normalization of the Protect status report data to the server side. +- Renamed `master` references to `trunk` +- Reorder JS imports for `import/order` eslint rule. + +### Fixed +- Fixed bug that would not display Core vulnerabilities. +- Removed legacy code and documentation and adds new docs for the debug helper plugin. +- Fixed recommendation for plugins that don't have a fix yet +- Protect: Fix visual issue of the Interstitial page + +## 1.0.0 - 2022-05-31 +### Added +- Add additional tracking events +- Add Alert icon to the error admin page +- Add checks to the Site Health page +- Add custom hook to handle viewport sizes via CSS +- Add error message when adding plugin fails +- Add first approach of Interstitial page +- Add Jetpack Scan to promotion section when site doesn't have Security bundle +- Add missing prop-types module dependency +- Add Navigation dropdown mode and use it for small/medium screens +- Add ProductOffer component +- Add product offer component +- Add title and redirect for vul at wpscan +- Add 'get themes' to synced callables in Protect +- Add installedThemes to the initial state +- Add notifications to the menu item and the admin bar +- Add status polling to the Protect admin page. +- Added details to the FAQ question on how Jetpack Protect is different from other Jetpack products. +- Added Jetpack Protect readme file for the plugin listing. +- Added option to display terms of service below product activation button. +- Added Social card to My Jetpack. +- Added the list of installed plugins to the initial state +- Change ConnectScreen by the Interstitial component +- Creates Status Class +- Empty state screen +- Expose and use IconsCard component +- Flush cache on plugin deactivation +- Footer component +- Handle error in the UI +- Hooks on plugin activation and deactivation +- Hook to read data from the initial state +- Implement Footer +- Implement Add Security bundle workflow +- Introduce Accordion component +- Introduce Navigation component +- Introduce Summary component +- Introduce VulnerabilitiesList component +- JS Components: Introduce Alert component. Add error to ProductOffer components +- More options to the testing api responses +- Record admin page-view and get security from footer events +- Render Security component with data provided by wpcom +- Request and expose to the client the Security bundle data +- Update logo + +### Changed +- Add empty state for no vuls +- Add popover at Badge +- Cache empty statuses for a short period of time +- Changed connection screen to the one that does not require a product +- Changed the method used to disconnect +- Changed the wording for the initial screen. +- Change expiration time of plugin cache +- Clean connection data. Update to latest connection API +- Configure Sync to only what we need to sync +- Janitorial: require a more recent version of WordPress now that WP 6.0 is coming out. +- JS Components: Add subTitle prop to ProductOffer component +- JS Components: iterate over Dialog component +- Improve Dialog layout in medium viewport size +- Move VulnerabilitiesList to section hero +- New VulsList +- Redesign Summary component +- Re-implement "Your results will be ready soon" layout +- Re-implement Admin page by using Dialog component +- Remove use of `pnpx` in preparation for pnpm 7.0. +- Replace deprecated external-link variation by using isExternalLink prop +- Require only site level connection +- Truncate items at NavigationGroup +- Tweak footer +- Update Footer and VulsList for small/medium viewport +- Update Navigation to be external controlled +- Update Protect icon +- Update VulnerabilitiesList to remove severity and add fixed in +- Updated package dependencies. +- Update package.json metadata. +- Updates CTA wording to reduce confusion when user already has Jetpack Security Bundle which includes Jetpack Scan +- Update the Status when connection is established +- Use data provided by My Jetpack to render Product offer +- Use weight Button prop to style the "learn more" footer link +- Use a different copy when there are no found vulnerabilities but there are still some unchecked items + +### Removed +- Removed Full Sync from loaded modules as Full Sync Immediately is present by default now + +### Fixed +- Adjust spacing and overflow properties of the navigation labels to improve display of long names. +- Fix Connectino initialization +- Fix fatal when checking whether site site has vuls +- Fix right margin in primary layout diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot new file mode 100644 index 00000000..51f012dd Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.eot differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg new file mode 100644 index 00000000..51e14560 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.svg @@ -0,0 +1,11 @@ + + + +Generated by IcoMoon + + + + + + + \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf new file mode 100644 index 00000000..c44c262f Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff new file mode 100644 index 00000000..dc898ac5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/fonts/jetpack-protect.woff differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css new file mode 100644 index 00000000..d194c5b1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/assets/jetpack-protect.css @@ -0,0 +1,30 @@ +@font-face { + font-family: 'jetpack-protect'; + src: url('fonts/jetpack-protect.eot?31wpn'); + src: url('fonts/jetpack-protect.eot?31wpn#iefix') format('embedded-opentype'), + url('fonts/jetpack-protect.ttf?31wpn') format('truetype'), + url('fonts/jetpack-protect.woff?31wpn') format('woff'), + url('fonts/jetpack-protect.svg?31wpn#jetpack-protect') format('svg'); + font-weight: normal; + font-style: normal; + font-display: block; + } + +[class^="jp-protect-icon"], [class*=" jp-protect-icon"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'jetpack-protect' !important; + speak: never; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.jp-protect-icon:before { + content: "\e900"; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-db145d62b5ef09c05ad7.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-db145d62b5ef09c05ad7.png new file mode 100644 index 00000000..21176718 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/images/in-progress-db145d62b5ef09c05ad7.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php new file mode 100644 index 00000000..e9339e55 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.asset.php @@ -0,0 +1 @@ + array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f5a19d5afbdcef2dfd58'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css new file mode 100644 index 00000000..f397a746 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.css @@ -0,0 +1 @@ +.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px rgba(0,0,0,.05);content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:0;right:unset;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{fill:var(--jp-gray);flex-shrink:0;margin:0 var(--spacing-base)}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-left:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-right:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-left:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-right:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-left:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-right:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-left:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-right:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-left:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-right:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-left:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-right:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-left:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-right:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-left:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-right:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-left:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-right:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-left:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-right:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-left:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-right:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-left:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-right:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-left:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-right:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-left:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-right:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-left:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-right:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-left:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-right:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-left:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-right:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-left:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-right:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-left:calc(var( --spacing-base )*8)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-10:#f2cf75;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;left:-53px;pointer-events:none;position:absolute;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.5px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-right:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-left:calc(var(--spacing-base)/2)}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(1px,1px)}.gridicon.needs-offset-x g{transform:translate(1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{flex-basis:0;flex-grow:2}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-right:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-left:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.UL3B1tQ854mN7r6taB61{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.IG56Hw7ZR_7rKVsM78qw:focus:not(:disabled){box-shadow:none}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.jp-dashboard-footer{align-items:center;color:#000;display:flex;flex-flow:row wrap;justify-content:space-between;max-width:1128px;width:100%}.jp-dashboard-footer a,.jp-dashboard-footer a:hover,.jp-dashboard-footer a:visited{color:#000;text-decoration:none}.jp-dashboard-footer__jetpack-symbol,.jp-dashboard-footer__module-name{display:inline-block;vertical-align:middle}.jp-dashboard-footer__module-name{font-size:12px;font-weight:600;margin-left:5px}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off)}.lyrXe0pA852TUmyekDb5{display:flex}.KgEeDTKgTC5ZjzYlbTqN{color:var(--jp-black);font-size:var(--font-body);line-height:1.5;margin-right:calc(var(--spacing-base)*4);padding:var(--spacing-base) 0;text-decoration:none}.KgEeDTKgTC5ZjzYlbTqN:last-child{margin-right:0}.KgEeDTKgTC5ZjzYlbTqN:focus,.KgEeDTKgTC5ZjzYlbTqN:hover{border-bottom-color:var(--jp-green);box-shadow:none;color:var(--jp-green)}.Lv4WoNVkeJntqvUyG4dX{border-bottom:1px solid var(--jp-black)}.vvXnRXxrU1kP1KsdSr4J{margin-top:calc(var(--spacing-base)*3*-1)}.aDCTkUFaJEeZzYYE6qv5{background-color:var(--jp-green);border-radius:32px;color:var(--jp-white);font-size:12px;letter-spacing:-2%;line-height:1;margin-left:var(--spacing-base);padding:calc(var(--spacing-base)/2) var(--spacing-base);position:relative;top:-1px}.uQlXhcfYn9tbnK27_Gct{align-items:center;display:flex}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:checked{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:indeterminate{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--jp-green-40)}.PO9zDOaSkcv_RqpfZF_v,.e5YHJiYcvfgdEEJsS_YM{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}@media(max-width:599px){.PO9zDOaSkcv_RqpfZF_v{margin-top:0}}.gTWkHo5lqwE_OCesAhBx{color:var(--jp-gray-50)}.gTWkHo5lqwE_OCesAhBx:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-right:var(--spacing-base);width:8px}.gTWkHo5lqwE_OCesAhBx.JeLxNe31ii68Utrr2xr6{color:var(--jp-green-40)}.gTWkHo5lqwE_OCesAhBx.JeLxNe31ii68Utrr2xr6:before{background:var(--jp-green-40)}svg.V6B8ltQ7TH3UKzUC_qy1{color:var(--jp-black);height:32px;margin:0;width:32px}.C9hcvYAbgHPhN2Tl22xg{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.C9hcvYAbgHPhN2Tl22xg .XkbIpr2gzB4XEhHgzkY4{margin-right:calc(var(--spacing-base)/2)}.BfcZn0_X33Ajdd1Gl18G{display:flex}.BfcZn0_X33Ajdd1Gl18G>.rBmVJIeTNpd0RJWaRGuJ{fill:var(--jp-gray-20);display:flex;margin-left:calc(var(--spacing-base)/2)}.jVq5444f1Xh6nNkz0Qe_{margin-top:calc(var(--spacing-base)*4)}.amF9cOnMiv2nHbkMXQiQ{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FodE_7RbLD8zeBSd6eVR{display:flex;flex-wrap:wrap;margin-left:auto}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-right:calc(var(--spacing-base)*3)}.twyPhW_K164HITnDrwEg{padding:calc(var(--spacing-base)*2);width:250px}.tbcd9xc_TjcFdokOt3F_{font-size:18px}@media(max-width:599px){.pnoqLV3l30xuvj2hLlJc{width:90%}.FodE_7RbLD8zeBSd6eVR{margin-top:calc(var(--spacing-base)*3)}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-bottom:var(--spacing-base);margin-right:0}}.IunwKwdvL271DxBIniPb[type=checkbox]{display:none}.svA9WxEcOByd5S2fZonA{border:2px solid var(--jp-black);border-radius:100px;box-sizing:border-box;cursor:pointer;display:inline-block;height:24px;outline:0;padding:2px;position:relative;transition:all .4s ease,box-shadow 0s;vertical-align:middle;width:48px}.svA9WxEcOByd5S2fZonA:after{background:var(--jp-black);border-radius:50%;content:"";display:block;height:16px;left:0;position:relative;transition:all .2s ease;width:16px}.IunwKwdvL271DxBIniPb:checked+.svA9WxEcOByd5S2fZonA:after{left:22px}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-black);border-color:var(--jp-black)}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-green);border-color:var(--jp-green)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:disabled+span.svA9WxEcOByd5S2fZonA{cursor:default;opacity:.25}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA{border-radius:8px;height:16px;width:24px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA:after{height:12px;width:12px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n:checked+.svA9WxEcOByd5S2fZonA:after{left:8px}._aiMxmJRAw5jRPbZFX57{background-color:var(--jp-gray-90);border-radius:var(--jp-border-radius);color:var(--jp-white);display:flex;overflow:hidden}._aiMxmJRAw5jRPbZFX57.eWgNBUaexiR66ZI1Px4U{border-left:4px solid var(--jp-yellow-20);margin-bottom:calc(var(--spacing-base)*3)}._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{margin-left:calc(var(--spacing-base)*3);position:fixed;right:calc(var(--spacing-base)*3);top:calc(var(--spacing-base)*6)}@media(max-width:782px){._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{top:calc(var(--spacing-base)*8)}}._aiMxmJRAw5jRPbZFX57 a,._aiMxmJRAw5jRPbZFX57 a:active,._aiMxmJRAw5jRPbZFX57 a:hover,._aiMxmJRAw5jRPbZFX57 a:link,._aiMxmJRAw5jRPbZFX57 a:visited{color:var(--jp-white)}.BnI88X_e8ItF1c9Uozmj{fill:var(--jp-white);align-items:center;background-color:var(--jp-yellow-30);display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.hRRUwTCPRpurhMwRNZkg .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-green-50)}.Z6q3IxY_uR1y2lAPTkVF .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-red)}.eWgNBUaexiR66ZI1Px4U .BnI88X_e8ItF1c9Uozmj{fill:var(--jp-yellow-50);background-color:var(--jp-yellow-5)}.ST8sowTbBVLRPrk4ZQrn{font-size:14px;padding:calc(var(--spacing-base)*1.75)}.eWgNBUaexiR66ZI1Px4U .ST8sowTbBVLRPrk4ZQrn{background-color:var(--jp-yellow-5);color:var(--jp-gray-90)}.lMkO08Vd8YQMfwrwaI8u{fill:var(--jp-gray);align-items:center;background:transparent;border:none;cursor:pointer;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.rigH8UdiDrmmSLQMUurD{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);color:var(--jp-black);display:block;font-size:var(--font-body);letter-spacing:-.02em;line-height:1.5;padding:var(--spacing-base) calc(var(--spacing-base)*1.5);transition:box-shadow .1s ease-out;width:100%}.rigH8UdiDrmmSLQMUurD::placeholder{color:var(--jp-gray-20)}.rigH8UdiDrmmSLQMUurD:focus{box-shadow:0 0 0 2px var(--jp-green-5)}.rigH8UdiDrmmSLQMUurD:focus,.rigH8UdiDrmmSLQMUurD:hover:not(:disabled){border:1px solid var(--jp-green)}.rigH8UdiDrmmSLQMUurD:disabled{background-color:var(--jp-gray-0);color:var(--jp-gray-30)}.V8FDM08CpcwQs4UwN2nI{color:var(--jp-black);display:block;font-size:var(--font-title-small);font-weight:600;margin-bottom:calc(var(--spacing-base)*2)}.DM4b8iQ0ewvRYdIPxvZ8{max-width:calc(744px + var(--spacing-base)*6);width:100%}.bW6ZuNzJBYU5PVPktE2S{display:flex}.bW6ZuNzJBYU5PVPktE2S:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.di3wjXHrX1rk_H6rlxKM{margin-right:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.di3wjXHrX1rk_H6rlxKM{margin-right:calc(var(--spacing-base)*5)}}.IrzHnNkRvORtyCL0yiWa{width:100%}.sU82bpLEYPC9n_CFAKoz{align-items:center;display:flex}.ZZc0LldcbJpcftqCe43T .IrzHnNkRvORtyCL0yiWa{opacity:.5}.T17WOOJI7XHN7KRmYaCe>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.T17WOOJI7XHN7KRmYaCe{display:flex;justify-content:space-between}}.typbjN2keZ97hj2TmuMC{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.UUXAN8VTAZY0h8t9rCHG{color:var(--jp-green-50);margin-right:calc(var(--spacing-base)/2)}.eFjcadLMEXY5O61vsTrx{color:var(--jp-gray-50)}.Tr5uYvclUiwlC5kuGk7E{color:var(--jp-red-50)}.zPZcNgYx2X5778nHHtlH{display:flex;flex-wrap:wrap}.lNtkRXnB1z_kYB28MUWq{color:var(--jp-gray-50)}.JgH5ykcLynEgqXYurT78{margin-right:calc(var(--spacing-base)/2)}.JgH5ykcLynEgqXYurT78,.xlWW0IoKZwTZt1Ti0tcQ{color:var(--jp-green-50)}.zhBcgCUGgyC7PvWk8ewB{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.zhBcgCUGgyC7PvWk8ewB{padding-left:calc(var(--spacing-base)*11)}}.mah_f2OWxZ3Vqt_jRFdR{margin-bottom:calc(var(--spacing-base)*4)}.Ax2SmW57c0U5xOTjZuAA{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-2)}.xGZeYQr0_nPJTFmd8pW4{align-items:center;border:1px solid var(--jp-gray-30);border-radius:4px;color:var(--jp-gray-30);display:flex;font-size:12px;height:21px;margin-bottom:calc(var(--spacing-base)*2);margin-left:var(--spacing-base);padding:calc(var(--spacing-base)/2)}.RYTIt8kwLbKcUbWOfG4g{padding:calc(var(--spacing-base)*3);width:304px}.BqXge2rIUP0a_74yvYbr{display:flex;justify-content:space-between}.Lr10UUCcSLF3T_0QqoPr{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.Lr10UUCcSLF3T_0QqoPr:focus,.Lr10UUCcSLF3T_0QqoPr:focus:not(:disabled){box-shadow:none}.th_VukMuODIOVLC7oJo6{display:flex;justify-content:flex-end}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-left-width:6px;border-radius:4px;display:flex;font-size:var(--font-body);padding:24px 31px 27px 18px}.FGpSkMCiIHQjszcV0dbn{margin-right:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:transparent;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{left:24px;position:absolute;top:24px}.KoWZcCwhW13xvkEb0QON{position:absolute;right:24px;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-right:24px}.A5YkDkkXuiYgavrY6Nux{border-left-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-left-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-left-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-left-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.msOlyh2T7D6uhbM6AROg{align-items:center;background:none;border:2px solid var(--jp-green-40);border-radius:var(--jp-border-radius);color:var(--jp-gray-80);display:flex;gap:calc(var(--spacing-base)*3);justify-content:space-between;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);position:relative;text-align:left;width:100%}.msOlyh2T7D6uhbM6AROg a,.msOlyh2T7D6uhbM6AROg button{all:unset;color:var(--jp-gray-80);cursor:pointer}.msOlyh2T7D6uhbM6AROg a:after,.msOlyh2T7D6uhbM6AROg button:after{content:"";height:100%;left:0;position:absolute;top:0;width:100%}.msOlyh2T7D6uhbM6AROg:focus-within{border-color:var(--jp-black)}.msOlyh2T7D6uhbM6AROg:focus-within .cPN7USVqSBpxUswfDtUZ,.msOlyh2T7D6uhbM6AROg:hover .cPN7USVqSBpxUswfDtUZ{transform:translateX(calc(var(--spacing-base)*2))}.msOlyh2T7D6uhbM6AROg:focus-within .EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg:hover .EmnJAyEzzn1QpA8HtypY{text-decoration:underline;text-decoration-thickness:2px}.EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg .EmnJAyEzzn1QpA8HtypY{font-weight:700}.cPN7USVqSBpxUswfDtUZ{fill:var(--jp-green-40);transition:transform .1s ease-out}.vV7YZikAz0oHYsuvtxMq{display:inline;margin:0 0 0 calc(var(--spacing-base)/3);vertical-align:middle}.vV7YZikAz0oHYsuvtxMq svg{position:relative;z-index:10}.T1YaMupeZmBIpXZHY9EZ{display:inline}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.kdsaL7c4bpTwf_A4fIUT{padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6);text-align:center}.b0eN3as5AgxQW7EAkarg{margin-bottom:0}@keyframes rotate-spinner{to{transform:rotate(1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-right-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.JiJhrZaThvWCpM2AfGen{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}._7SGksgOpcPbHfPPpQTV{background:var(--jp-red-5);color:var(--jp-red-60)}.pGNquShR54adQ61sx3lP{background:var(--jp-yellow-5);color:var(--jp-yellow-60)}.IM5kkexAfwGLM6zz0Exd{background:var(--jp-gray-0);color:var(--jp-gray-50)}.NHzH3tt6CypjZ92CvK9x{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;padding:calc(var(--spacing-base)*2)}.NHzH3tt6CypjZ92CvK9x:first-of-type{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x:last-of-type{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x+.NHzH3tt6CypjZ92CvK9x{border-top:0}.D9zvYDUrOP_zwSm0yJMs{margin-right:calc(var(--spacing-base)*2);min-width:24px}._XISfmbjoVlqhB61hHYn{width:100%}.AQDPBnMZFu7BOBuo8mYW{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.cZ9s5eCAZe3R82Y6Ru3z{color:var(--jp-gray-80);font-size:14px;line-height:21px}.AKnbWQiViZ2O_dwCV8Fw,.W6alQ2_S5Rh06djX9m27{align-self:center;margin-left:calc(var(--spacing-base)*2);margin-right:var(--spacing-base)}.uUEJGMrSV3XoBwX5xEwA{display:flex;justify-content:space-between}.sQkG5Cu80gPaeFj3L_wa{margin-bottom:calc(var(--spacing-base)*5)}.oIl6GCMeUnzE0inXbuj9{display:flex;justify-content:space-between}.RP2MVoGqaCFXPKZhhxQ1{margin-bottom:calc(var(--spacing-base)*5)}.YpEs8b7KE7fzVuXUbOEb{display:flex;justify-content:space-between}.EqpwvErHtRi_WQkJKgi1{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.EicvN1QaJu5OJLzdUN5A{margin-right:calc(var(--spacing-base)*2);min-width:24px}.b7ynAmUwGlxK_vxyIN0y{width:100%}.uSV9HYRxjL4S6zIZDlqP{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.XpW8Mvw_XFEbqxUdw155{color:var(--jp-gray-80);font-size:14px;line-height:21px}.Fkj60BmQ5sUo9zHcJwVv{align-self:center;margin-left:calc(var(--spacing-base)*2);margin-right:var(--spacing-base)}.XLzPr74ad3osCq9kxy2q{display:flex;justify-content:space-between}.jNlU3vgp4xEGwmX5aTyK{background-color:var(--jp-gray-5)}.gE8s4nh3f7iGIBrFeyCT{list-style-type:disc;padding-left:calc(var(--spacing-base)*2.5)}.WtVEv641JBaLl929sZq2{align-items:flex-start;background-color:rgba(0,0,0,.25);bottom:0;display:flex;justify-content:center;left:0;padding-top:calc(var(--spacing-base)*12 + 2px);position:fixed;right:0;top:0;z-index:999999}.G0aPt7WmA1rkUE0wcTno{background:var(--jp-white);border:1px solid var(--jp-gray);border-radius:calc(var(--jp-border-radius)*2);box-shadow:0 8px 20px rgba(0,0,0,.25);padding:calc(var(--spacing-base)*4);position:relative;width:616px}.VkrhWjfEIlIwYEumycbP{background:none;border:none;cursor:pointer;padding:0;position:absolute;right:calc(var(--spacing-base)*3);top:calc(var(--spacing-base)*3)}.yFzeV4cmWRbZKk5tIyEw{display:block}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{left:-40px;position:relative;top:-36px}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{width:100%}.hNJWdt5qmZkWYAH_vjIp{background-color:var(--jp-green-40);border-radius:calc(var(--spacing-base)*3);height:9px;transition:width .2s}.DHMUfGyHbl5BgD5vjxVz{color:var(--jp-gray-90);font-weight:600;line-height:24px;margin-left:auto;padding-left:var(--spacing-base)}.Clxt94RgGnDrhORZZyPr,.K2OG1vK5PSOYDWKtqKKG{margin-top:calc(var(--spacing-base)*7)}.ZMBDiTLzs27F012iOsMK>:first-child{flex:1}@media(min-width:960px){.ZMBDiTLzs27F012iOsMK{align-items:center;display:flex}}.zI2DKzqRc1MhF6aq5eHt{align-items:center;color:var(--jp-black);display:flex}.iHgPFku9KaLz8FIQV1Qw{margin-left:-4px;margin-right:var(--spacing-base)}.xuIO_ubyDN6IGJ67NTlx{margin-top:calc(var(--spacing-base)*3)}@media(min-width:960px){.xuIO_ubyDN6IGJ67NTlx{margin-top:0}}.ctq2nQkzIfSoMkldF9t9{margin-top:calc(var(--spacing-base)*2);width:100%}@media(min-width:960px){.ctq2nQkzIfSoMkldF9t9{margin-left:calc(var(--spacing-base)*2);margin-top:0;width:auto}}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook);border-radius:50%!important}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.OtDl6kocO_m2s9sRHaqX{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.BjwJh1S1YVPI7AjmTx6a+.BjwJh1S1YVPI7AjmTx6a{margin-top:calc(var(--spacing-base)*5)}.YWfK8VTp2wnByBauYPKg{background-color:var(--jp-gray-0);overflow-x:scroll;padding:calc(var(--spacing-base)*3)}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:flex-end;margin-top:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.ap6lG79CncSqdigJS_WA{margin-top:calc(var(--spacing-base)*4)}.uym7dGHhp6ifjF57yOAO{align-items:flex-end;display:flex;margin-bottom:calc(var(--spacing-base)*2.25)}.e_2eFTR8RyHwmfeqJL4F{flex:1;margin-bottom:0}.r4Id5qht2FD68jCAH2Cl{margin-left:calc(var(--spacing-base)*2)}.pkw2LnOTd8VvQ3oT8sXQ{border-top:1px solid var(--jp-gray);display:flex;justify-content:right;padding-top:calc(var(--spacing-base)*4);width:100%}.pkw2LnOTd8VvQ3oT8sXQ>:last-child{margin-left:calc(var(--spacing-base)*2)}.ZSZPabDoB8MVVPttP0tu{background-color:#fff;border:1px solid var(--jp-gray);border-bottom:none;color:var(--jp-gray-50);display:grid;grid-template-columns:repeat(9,1fr);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:100%}.ZSZPabDoB8MVVPttP0tu>span:first-child{grid-column:1/7}.ZSZPabDoB8MVVPttP0tu>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}.iJ_biSBRDribuNKX0Zuw>button span{color:var(--jp-gray-70);font-size:var(--font-body-small);font-weight:400}.iJ_biSBRDribuNKX0Zuw button:hover:not(:disabled){text-decoration-line:none}.iJ_biSBRDribuNKX0Zuw button:focus:not(:disabled){box-shadow:none}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.r4Id5qht2FD68jCAH2Cl{flex:1}.r4Id5qht2FD68jCAH2Cl:first-of-type{margin-left:0}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.x8UuVEhWucPfdq0hEJg6{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius)}.x8UuVEhWucPfdq0hEJg6>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.eb6Ovfvm1yONz4mdOwbH{background-color:var(--jp-white)}.jF9LXpXR3TxZVDw7TVXT{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.jF9LXpXR3TxZVDw7TVXT>:first-of-type{grid-column:1/8}.jF9LXpXR3TxZVDw7TVXT>:last-of-type{grid-column:9}.jF9LXpXR3TxZVDw7TVXT:hover{background:var(--jp-gray-0)}.lNQgAfpwdAUSOLZd8dlD{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.WRQwDYPdffWznX158azR{margin-right:var(--spacing-base)}.dJx9pvlYjDnKn11n5wo8{font-weight:600;margin-bottom:var(--spacing-base);margin-left:calc(var(--spacing-base)*4)}.EKcbLuSblRc7UpzgsFXw{align-items:center}.ILMBWlMLcXc0n97IisrG{overflow:hidden;transform-origin:top center}.T8XIzCNJBQy1UETN5gjU{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.kWoHGiaZSbq9XJVyUOMC{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.HQgjxePFDRJHamBAGcVU{background-color:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px rgba(0,0,0,.08);margin:0;padding:var(--spacing-base) 0}.KtdsNIMumOoHNWMLmuAJ{align-items:center;display:flex;justify-content:space-between;margin:0;padding:calc(var(--spacing-base)*2);text-align:left}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2{cursor:pointer;outline-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:focus:not(.owofT85W_XvVdb5vr1GN),.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:hover:not(.owofT85W_XvVdb5vr1GN){background-color:var(--jp-gray-0)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN{background-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .NESnw2xCLrBpP6WlYZL4{color:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .aohnd_y_1lrMuww8NH63{fill:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .Rnas_2_2_eLZSYfZ347E{background-color:var(--jp-red);border:1px solid var(--jp-red);color:var(--jp-white)}.NESnw2xCLrBpP6WlYZL4{align-items:center;display:flex;overflow-x:hidden;padding-right:var(--spacing-base)}.m4_14yNRByDyO9yf9pGg{display:block;overflow-x:hidden;text-overflow:ellipsis}.aohnd_y_1lrMuww8NH63{margin-right:calc(var(--spacing-base)*2)}.Rnas_2_2_eLZSYfZ347E{align-items:center;border:1px solid var(--jp-red-60);border-radius:50%;box-sizing:border-box;color:var(--jp-red-60);display:flex;justify-content:center;min-width:30px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.X8NRHUTBa_4wDvoHN9TT{fill:var(--jp-green-50)}.CsuOteurQlJm4IjXqyZ0{fill:var(--jp-gray-20)}.fvbewglUxEvV1o04yzzp{--icon-size:28px;--item-spacing:calc(var( --spacing-base )*2);--left-spacing:calc(var( --icon-size ) + var( --item-spacing ));list-style:none}.DINy59MKjwiQanaoDTiV{padding:calc(var(--spacing-base)*2)}.XoacHJljw8zRW_fkBSyg{padding:0}.mXM4WZRePVTa07dhQ6MD{margin-left:var(--left-spacing)}.sI3V8khLdCqxkhJQ_XnI{display:flex;justify-content:flex-start;padding:calc(var(--spacing-base)*2)}.hgdxMuIvZwTZ0sfXaols{padding:calc(var(--spacing-base)*2);width:250px}.UErHS2HAh1gszGfYuVIf{align-items:center;background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);display:flex;justify-content:space-between;padding:calc(var(--spacing-base)*2);width:100%}.lEhH1hvCcxLVFMHI8Gwv{display:flex;justify-content:flex-start}.c57Vj4QhAHwcK_HZMxtN{margin-right:var(--spacing-base)}.t5TwI3d3FnCJvFBlkmm5{display:block}.kSa6ERuVPsCMPXugb030{display:none}.LumryWNddoF092fZgN2O{font-size:var(--font-body);line-height:1.5}.NFMwU3H5k2qArZe2TTp9{background-color:var(--jp-gray-10);font-weight:600;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.G5W9M8qfo3sGl2OIbwg9{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:Courier\ 10 Pitch,Courier,monospace;overflow-x:scroll;white-space:pre}.Bx4RDCUR316fm_jgGS8N{background-color:var(--jp-gray-10);color:var(--jp-gray-50);display:flex;flex-direction:column;padding:0 var(--spacing-base);text-align:right}.GhN0JvAyRQI3SnVWp2Ot{display:flex;flex-direction:column;flex-grow:1;overflow-x:visible}.GhN0JvAyRQI3SnVWp2Ot del,.GhN0JvAyRQI3SnVWp2Ot div,.GhN0JvAyRQI3SnVWp2Ot ins{padding:0 var(--spacing-base);text-decoration:none}.GhN0JvAyRQI3SnVWp2Ot del{background-color:var(--jp-red-0);color:var(--jp-red-60)}.GhN0JvAyRQI3SnVWp2Ot ins{background-color:var(--jp-green-5);color:var(--jp-green-60)}.xpPHTch5ul0xuZaUoTNa{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:monospace;overflow-x:scroll;padding:0}.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-0)}.i0_0xMrNWoak1brIaDQq{display:flex;flex-direction:column;text-align:right}.C9fLawPLkMNSZthfwxj6{background-color:var(--jp-gray-10);color:var(--font-body);padding:0 calc(var(--spacing-base)/2)}.C9fLawPLkMNSZthfwxj6.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-50);color:var(--jp-white)}.ogixgg8fRGekmYGtevh1{display:flex;flex:1;flex-direction:column;overflow-x:visible;white-space:pre}.jYPCgKMDRKfT3vnx0mdG{padding-left:var(--spacing-base)}.UEQ1NqkrwNmaQR7qdEK3{background-color:var(--jp-red);border-radius:calc(var(--jp-border-radius)/2);color:var(--jp-white);padding:calc(var(--spacing-base)/4) calc(var(--spacing-base)/2)}.sfXsfklfkeSRtE9ivQwF{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:inline-block;width:100%}.sfXsfklfkeSRtE9ivQwF>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.ozRrKPlj1QFGUyd3oVke{background-color:var(--jp-white)}.PyvnSHQuuUkZvVsArigy{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.PyvnSHQuuUkZvVsArigy>:first-of-type{grid-column:1/7}.PyvnSHQuuUkZvVsArigy>:last-of-type{grid-column:9}.PyvnSHQuuUkZvVsArigy>:not(:first-child){margin:auto}.PyvnSHQuuUkZvVsArigy:hover{background:var(--jp-gray-0)}.u9Xod5s8bCRNj9MR1Drl{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.IbeyulkpO9kjYJ4OkYUD{margin-right:var(--spacing-base)}.KiCgmjHm2f0JDU3cMsgf{font-weight:600;margin-bottom:var(--spacing-base);margin-left:calc(var(--spacing-base)*4)}.kJ8t3FAtd5VAYjk31SfA{align-items:center}.JP0IJZcYRohfgntEozjm{overflow:hidden;transform-origin:top center}.y7c6zi2wjEnbW3F29fmP{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.wQWiN_J0SqgduvadyGnm{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.v1fUFCBPmd6miSCf_ehK{fill:var(--jp-green-40)}@media(max-width:599px){.PyvnSHQuuUkZvVsArigy{display:grid;grid-auto-rows:minmax(auto,auto)}.PyvnSHQuuUkZvVsArigy>:first-child{grid-column:1/8;grid-row:1}.PyvnSHQuuUkZvVsArigy>:nth-child(2){grid-row:2;padding-left:calc(var(--spacing-base)*4)}.PyvnSHQuuUkZvVsArigy>:nth-child(3){grid-row:2}.PyvnSHQuuUkZvVsArigy>:nth-child(3) span{margin-top:var(--spacing-base);position:absolute}.PyvnSHQuuUkZvVsArigy>:last-child{grid-column:10;grid-row:1/3}}.A6a9HOtaZnLUleNgxQrX{padding:calc(var(--spacing-base)*7) 0}.CGT5fOs6LDTFHWCAgIiT,.RFKxbzQ8N58qEyVO0yzW{align-items:center;display:flex}.RFKxbzQ8N58qEyVO0yzW{height:100%}.RFKxbzQ8N58qEyVO0yzW img{object-fit:cover;width:100%}.SvMuuouOkDt2sE0PAn_D{margin-top:calc(var(--spacing-base)*3 + 1px)}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-left:6px solid var(--jp-red-50);border-radius:var(--jp-border-radius);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-left:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-left:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-right:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-right:calc(var(--spacing-base)*2)}*,._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js new file mode 100644 index 00000000..213fe8eb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js @@ -0,0 +1,43 @@ +/*! For license information please see index.js.LICENSE.txt */ +!function(){var e={9487:function(e,t,n){"use strict";n.d(t,{X:function(){return c}});const a={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function c(e){return a[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}},8899:function(e,t,n){"use strict";n.d(t,{LR:function(){return r}});var a=n(9487),c=n(2003);function r(e,t,n={}){const r=(0,a.X)(t);if(!r||isNaN(e))return null;const{decimal:i,grouping:o,precision:l,symbol:s}={...r,...n},u=e<0?"-":"",p=Math.abs(e),m=Math.floor(p);return{sign:u,symbol:s,integer:(0,c.Z)(p,l,i,o).split(i)[0],fraction:l>0?(0,c.Z)(p-m,l,i,o).slice(1):""}}},2003:function(e,t,n){"use strict";function a(e,t=0,n=".",a=","){const c=(e+"").replace(/[^0-9+\-Ee.]/g,""),r=isFinite(+c)?+c:0,i=isFinite(+t)?Math.abs(t):0,o=(i?function(e,t){const n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(r,i):""+Math.round(r)).split(".");return o[0].length>3&&(o[0]=o[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(o[1]||"").length{"%%"!==e&&(a++,"%c"===e&&(c=a))})),t.splice(c,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(1741)(t);const{formatters:a}=e.exports;a.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1741:function(e,t,n){e.exports=function(e){function t(e){let n,c,r,i=null;function o(...e){if(!o.enabled)return;const a=o,c=Number(new Date),r=c-(n||c);a.diff=r,a.prev=n,a.curr=c,n=c,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,c)=>{if("%%"===n)return"%";i++;const r=t.formatters[c];if("function"==typeof r){const t=e[i];n=r.call(a,t),e.splice(i,1),i--}return n})),t.formatArgs.call(a,e);(a.log||t.log).apply(a,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=a,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(c!==t.namespaces&&(c=t.namespaces,r=t.enabled(e)),r),set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function a(e,n){const a=t(this.namespace+(void 0===n?":":n)+e);return a.log=this.log,a}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(c),...t.skips.map(c).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const a=("string"==typeof e?e:"").split(/[\s,]+/),c=a.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),a=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],c=[],r=0;function i(){var e={};for(c.push(e);r=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}},1494:function(e,t){"use strict";t.Z={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},281:function(e,t){"use strict";t.Z={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},3466:function(e,t){"use strict";t.Z={button:"zI5tJ_qhWE6Oe6Lk75GY","is-icon-button":"tuBt2DLqimiImoqVzPqo",small:"Na39I683LAaSA99REg14",normal:"ipS7tKy9GntCS4R3vekF",icon:"paGLQwtPEaJmtArCcmyK",regular:"lZAo6_oGfclXOO9CC6Rd","full-width":"xJDOiJxTt0R_wSl8Ipz_",loading:"q_tVWqMjl39RcY6WtQA6","external-icon":"CDuBjJp_8jxzx5j6Nept"}},1489:function(e,t){"use strict";t.Z={cut:"msOlyh2T7D6uhbM6AROg",icon:"cPN7USVqSBpxUswfDtUZ",cta:"EmnJAyEzzn1QpA8HtypY",iconContainer:"vV7YZikAz0oHYsuvtxMq",description:"T1YaMupeZmBIpXZHY9EZ"}},5785:function(){},1275:function(){},5612:function(e,t){"use strict";t.Z={"star-icon":"cuoSlhSNrqf1dozY22Xb",jetpack:"lAIiifeLMmZAPlQ9n9ZR","checkmark-icon":"JLquNpQVlysAamuh5lJO",socialIcon:"cbOwD8Y4tFjwimmtchQI",facebook:"aHOlEBGD5EA8NKRw3xTw",twitter:"af4Y_zItXvLAOEoSDPSv",linkedin:"f68aqF3XSD1OBvXR1get",tumblr:"xFI0dt3UiXRlRQdqPWkx",google:"q7JEoyymveP6kF747M43",mastodon:"DKOBOTVmTLbh26gUH_73"}},9054:function(){},3247:function(e,t){"use strict";t.Z={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},3080:function(e,t){"use strict";t.Z={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",smCols:"4",mdCols:"8",lgCols:"12","col-sm-1":"RuVLl3q4lxTQa3wbhBJB","col-sm-1-start":"f9LZTRG4MMK42rS89afW","col-sm-1-end":"bHe_zKxjjpUwHw_MdYE1","col-sm-2":"QZbNrOqE2aNSn50xVhpU","col-sm-2-start":"ev7W3z7zVYPeHAlYqZjf","col-sm-2-end":"NJWd1m_e7lOiPYru2ZMP","col-sm-3":"Xc6nt1Qc1DI0Z2A3gt1r","col-sm-3-start":"UIcN_GXiPRoIsin8Kohg","col-sm-3-end":"GRKCyqb5LufCSCgykKFc","col-sm-4":"i_qTq8gqhhC3vIUepVRB","col-sm-4-start":"G3qaZ3Jpbvam_1XvGxgc","col-sm-4-end":"VRCNYKZtO9zukEwmgP1y","col-md-1":"tRm008K_WJL79WoNZTNL","col-md-1-start":"l5T2P_bgKts4tdaRkS1d","col-md-1-end":"zOCxfLZpF6BlgC7a_Yq1","col-md-2":"F80DdgVn0m5OpvtSQWka","col-md-2-start":"oI1c7JYfiJtMQHbhngtU","col-md-2-end":"pMQtA_4jh1_1lVknqEP5","col-md-3":"VenqMpdgyKQVUNNQcfqd","col-md-3-start":"seNYL99uoczf9V4MxBxT","col-md-3-end":"YKfF1HFhI9KygA5l3b2J","col-md-4":"yAi0Cv1xDWkoqsaUhvhR","col-md-4-start":"ubhnyZOnkgxNhh6XtVWv","col-md-4-end":"RGOPGQbWMJ9Ei5oFxS7X","col-md-5":"Sz1E2aWbX483ijdi6yge","col-md-5-start":"tku6_bRYrX9tMbgYGmIl","col-md-5-end":"b5JHttOhSEcI1WBlqAjk","col-md-6":"FboSx5MoKTAWbxXyYlCw","col-md-6-start":"Jhs8yEEmodG30edbJvag","col-md-6-end":"IpzbbKVqEqPcfIGkXkwt","col-md-7":"mhCPwfAZ4Kmm_empzJAq","col-md-7-start":"x034ilrJF7rO9UJB2rI1","col-md-7-end":"Wt8t2e16viRrOJ1lLA5v","col-md-8":"S6pIrEy9AMLKx9bgh_Ae","col-md-8-start":"kEfI4tGyuWfHTlRnvIab","col-md-8-end":"PUzX4RRsKq1dnsz3gebS","col-lg-1":"X_pdcLJikd8LS_YAdJlB","col-lg-1-start":"tl936d14Huby4khYp05X","col-lg-1-end":"hnge0LnR69d3NXEtEE1t","col-lg-2":"fj0NUMuyZQcPNgKcjp5Z","col-lg-2-start":"R2ncBX7a2NigdYCcV1OX","col-lg-2-end":"t8vMSDVYno9k9itRwnXb","col-lg-3":"wsDuEN2GqHx6qzo8dUdk","col-lg-3-start":"cIEVPUweWtLBy3xaXnMx","col-lg-3-end":"fajUWBwu1m2B479j3jmz","col-lg-4":"YR0c7fQTgMkDdWzwSyLp","col-lg-4-start":"xlwp8BmplxkKNMI7gamo","col-lg-4-end":"_C4O1w9DUqx1m3gPf8aA","col-lg-5":"Z54F1hAErckAIrKlxnXW","col-lg-5-start":"ezSDWkRHmKSxDJXxuiOH","col-lg-5-end":"T0ChoeAjGJjkkNrYhD4g","col-lg-6":"qtMoMPF6yHvGJnWHSsde","col-lg-6-start":"gdoywN5VPiWERfIBqkph","col-lg-6-end":"wUev_VH5uf_pwFFlbnAU","col-lg-7":"egIPDFJsOpownTClq9XP","col-lg-7-start":"yGhp9yoAW7k0kQik9AB7","col-lg-7-end":"SJ43U9mR5wUg5V2qBeQA","col-lg-8":"cTuyHfMwSUJxN_HdIEgd","col-lg-8-start":"smCr8DaIagcumdvdldiK","col-lg-8-end":"T03NHzQJvzwL6wAfIiTL","col-lg-9":"pMvxM3RJGjqyNdf9qg1Y","col-lg-9-start":"iIVpNRwEnQ_JI5gpp9EN","col-lg-9-end":"ZbQ4u4vGSX5rJOje4uGL","col-lg-10":"gKb5wuIDAlKGbrjK2vxy","col-lg-10-start":"Z7pINdImE2WJiYnZBTqm","col-lg-10-end":"ZTxp6qpvwurMdOnLLSz1","col-lg-11":"NnQTlbfnxPDR6cQ7rygg","col-lg-11-start":"O137wZd6Yl0olSA9PsXR","col-lg-11-end":"zf2OJtQ2MPz6SDoh6CB0","col-lg-12":"U3H6UHW6HqRt9hdzVg3O","col-lg-12-start":"zynnNeS_ZBTxABcVpUQH","col-lg-12-end":"vI8tltFZtFUNAy9Iag9s"}},8730:function(e,t){"use strict";t.Z={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},7703:function(e,t){"use strict";t.Z={container:"VHYulMcpzbr10HWR0iSE","icon-wrapper":"FGpSkMCiIHQjszcV0dbn","close-button":"KoWZcCwhW13xvkEb0QON","main-content":"smrfczkC53EaFM8OJUXs",title:"IKYRWoPwt9xOVEx1wzNS","action-bar":"qM0qY6mPYp1MPN54A3Kg","is-error":"A5YkDkkXuiYgavrY6Nux",icon:"y_IPyP1wIAOhyNaqvXJq","is-warning":"cT5rwuPMZzWvi5o6shMl","is-info":"yo0O3uvNomPsYUXFCpAS","is-success":"oZdDFf1jBLkzn5ICCC6x"}},9929:function(e,t){"use strict";t.Z={container:"p4qz2tkq0p9hxucJ6Qk2",table:"lbNDyXioOwvyvbALtCBm","is-viewport-large":"s2Lsn4kbm6BrS3DSndRB",card:"cLaNK_XcbTGlRQ4Tp43Q","is-primary":"CYt1X0eH1icRjhtJ28jx",header:"DAkZc1P9A3K12fjEliMg",item:"WUBuYABl8nymjs9NnCEL","last-feature":"ANtCFeb41NhA8PA3H7ZN",value:"Ql2gy_148yW8Vw5vhaKD",icon:"EAQrAnQEW1z1BfdY5gbC","icon-check":"JDSTlLoOC_4aUoH2oNM2","icon-cross":"zNdQRJ1w7BvaQOYyqzHK",popover:"lr7vbX95SKtoe7DarJcZ","popover-icon":"KRrGp2xdkeBOxLZeuQ6X",tos:"H_ZJiRVJg0LiMXPGOcmt","tos-container":"x21z_DixObRDsDaWotP1"}},9184:function(e,t){"use strict";t.Z={container:"dovianZYLKhnbnh9I06o","price-container":"lljtQMhW7lq5tE5SDJEf",price:"dhFQXpZfMwVI8vuYHnwC","is-not-off-price":"eD7hzxFmdtG_MgmBtl_k",footer:"C64ZjjUAqJC1T2Sa7apS",legend:"UpZDGew6Ay1hPoP6eI7b","promo-label":"NubApIV1vQCRUNprfm6b",symbol:"TDiiPbuW1Z0_05u_pvcK"}},1683:function(){},7920:function(){},3280:function(e,t){"use strict";t.Z={reset:"WQVtrU6q0L1Igcj7wCrQ","headline-medium":"UujoBFTnQNY2cWU2SIsH","headline-small":"TeGO5V_thHw5lDAm1_2M","headline-small-regular":"WolQzb2MsSgiNmLtc7_j","title-medium":"hUB0JT8p1T2Hw28N6qC8","title-medium-semi-bold":"gKZWDv5chz3_O3Syp74H","title-small":"zY2No8Ga4b8shbOQGhnv",body:"tIj0D1t8Cc892ikmgFPZ","body-small":"KdcN0BnOaVeVhyLRKqhS","body-extra-small":"dso3Rh3tl3Xv1GumBktz","body-extra-small-bold":"mQ1UlbN9u4Mg9byO8m7v",label:"PItlW5vRExLnTj4a8eLE","m-0":"TwRpPlktzxhmFVeua7P5","mx-0":"zVfqx7gyb3o9mxfGynn1","my-0":"iSHVzNiB9iVleGljaQxy","mt-0":"xqDIp6cNVr_E6RXaiPyD","mr-0":"S8EwaXk1kyPizt6x4WH2","mb-0":"ODX5Vr1TARoLFkDDFooD","ml-0":"cphJ8dCpfimnky7P2FHg","m-1":"PFgIhNxIyiSuNvQjAIYj","mx-1":"M2jKmUzDxvJjjVEPU3zn","my-1":"io15gAh8tMTNbSEfwJKk","mt-1":"rcTN5uw9xIEeMEGL3Xi_","mr-1":"CQSkybjq2TcRM1Xo9COV","mb-1":"hfqOWgq6_MEGdFE82eOY","ml-1":"I8MxZQYTbuu595yfesWA","m-2":"kQkc6rmdpvLKPkyoJtVQ","mx-2":"j6vFPxWuu4Jan2ldoxpp","my-2":"hqr39dC4H_AbactPAkCG","mt-2":"c3dQnMi16C6J6Ecy4283","mr-2":"YNZmHOuRo6hU7zzKfPdP","mb-2":"Db8lbak1_wunpPk8NwKU","ml-2":"ftsYE5J9hLzquQ0tA5dY","m-3":"Det4MHzLUW7EeDnafPzq","mx-3":"h_8EEAztC29Vve1datb5","my-3":"YXIXJ0h1k47u6hzK8KcM","mt-3":"soADBBkcIKCBXzCTuV9_","mr-3":"zSX59ziEaEWGjnpZa4uV","mb-3":"yrVTnq_WBMbejg89c2ZQ","ml-3":"UKtHPJnI2cXBWtPDm5hM","m-4":"guexok_Tqd5Tf52hRlbT","mx-4":"oS1E2KfTBZkJ3F0tN7T6","my-4":"DN1OhhXi6AoBgEdDSbGd","mt-4":"ot2kkMcYHv53hLZ4LSn0","mr-4":"A1krOZZhlQ6Sp8Cy4bly","mb-4":"pkDbXXXL32237M0hokEh","ml-4":"XXv4kDTGvEnQeuGKOPU3","m-5":"yGqHk1a57gaISwkXwXe6","mx-5":"X8cghM358X3DkXLc9aNK","my-5":"GdfSmGwHlFnN2S6xBn1f","mt-5":"yqeuzwyGQ7zG0avrGqi_","mr-5":"g9emeCkuHvYhveiJbfXO","mb-5":"Lvk3dqcyHbZ07QCRlrUQ","ml-5":"r3yQECDQ9qX0XZzXlVAg","m-6":"aQhlPwht2Cz1X_63Miw0","mx-6":"JyHb0vK3wJgpblL9s5j8","my-6":"cY2gULL1lAv6WPNIRuf3","mt-6":"NBWQ9Lwhh_fnry3lg_p7","mr-6":"yIOniNe5E40C8fWvBm5V","mb-6":"t30usboNSyqfQWIwHvT3","ml-6":"Nm_TyFkYCMhOoghoToKJ","m-7":"C4qJKoBXpgKtpmrqtEKB","mx-7":"S93Srbu6NQ_PBr7DmTiD","my-7":"fJj8k6gGJDks3crUZxOS","mt-7":"cW6D6djs7Ppm7fD7TeoV","mr-7":"DuCnqNfcxcP3Z__Yo5Ro","mb-7":"im8407m2fw5vOg7O2zsw","ml-7":"G0fbeBgvz2sh3uTP9gNl","m-8":"kvW3sBCxRxUqz1jrVMJl","mx-8":"tOjEqjLONQdkiYx_XRnw","my-8":"op5hFSx318zgxsoZZNLN","mt-8":"c9WfNHP6TFKWIfLxv52J","mr-8":"sBA75QqcqRwwYSHJh2wc","mb-8":"GpL6idrXmSOM6jB8Ohsf","ml-8":"HbtWJoQwpgGycz8dGzeT","p-0":"uxX3khU88VQ_Ah49Ejsa","px-0":"KX0FhpBKwKzs9fOUdbNz","py-0":"PfK8vKDyN32dnimlzYjz","pt-0":"emxLHRjQuJsImnPbQIzE","pr-0":"kJ8WzlpTVgdViXt8ukP9","pb-0":"tg_UIUI11VBzrTAn2AzJ","pl-0":"uczvl8kaz84oPQJ2DB2R","p-1":"o7UHPcdVK3lt7q3lqV4o","px-1":"IDqEOxvDoYrFYxELPmtX","py-1":"DdywPW2qSYlu2pt8tpO2","pt-1":"npy3hw4A5QSkDicb2CJJ","pr-1":"LgbptTApNY5NwLQvEFAt","pb-1":"WZQy2SZuZso59bUsXXyl","pl-1":"o331apInxNunbYB3SfPE","p-2":"fMPIyD9Vqki1Lrc_yJnG","px-2":"i2pMcTcdrr10IQoiSm_L","py-2":"eA702gn32kwptiI1obXH","pt-2":"o9bGieUKcYc8o0Ij9oZX","pr-2":"SwZcFez1RDqWsOFjB5iG","pb-2":"eHpLc_idmuEqeqCTvqkN","pl-2":"vU39i2B4P1fUTMB2l6Vo","p-3":"JHWNzBnE29awhdu5BEh1","px-3":"X72lGbb56L3KFzC2xQ9N","py-3":"BzfNhRG8wXdCEB5ocQ6e","pt-3":"srV0KSDC83a2fiimSMMQ","pr-3":"lUWfkmbQjCskhcNwkyCm","pb-3":"Ts0dIlc3aTSL7V4cIHis","pl-3":"CzlqQXXhX6MvorArFZ8B","p-4":"TqMPkQtR_DdZuKb5vBoV","px-4":"a7UrjhI69Vetlcj9ZVzz","py-4":"StEhBzGs2Gi5dDEkjhAv","pt-4":"FGneZfZyvYrt1dG0zcnm","pr-4":"APEH216rpdlJWgD2fHc8","pb-4":"oGwXC3ohCic9XnAj6x69","pl-4":"U6gnT9y42ViPNOcNzBwb","p-5":"IpdRLBwnHqbqFrixgbYC","px-5":"HgNeXvkBa9o3bQ5fvFZm","py-5":"tJtFZM3XfPG9v9TSDfN1","pt-5":"PdifHW45QeXYfK568uD8","pr-5":"mbLkWTTZ0Za_BBbFZ5b2","pb-5":"vVWpZpLlWrkTt0hMk8XU","pl-5":"RxfaJj5a1Nt6IavEo5Zl","p-6":"SppJULDGdnOGcjZNCYBy","px-6":"palY2nLwdoyooPUm9Hhk","py-6":"WYw1JvZC0ppLdvSAPhr_","pt-6":"YEEJ9b90ueQaPfiU8aeN","pr-6":"QE0ssnsKvWJMqlhPbY5u","pb-6":"n8yA3jHlMRyLd5UIfoND","pl-6":"tXHmxYnHzbwtfxEaG51n","p-7":"kBTsPKkO_3g_tLkj77Um","px-7":"RyhrFx6Y1FGDrGAAyaxm","py-7":"CBwRpB0bDN3iEdQPPMJO","pt-7":"vQVSq6SvWKbOMu6r4H6b","pr-7":"oBy5__aEADMsH46mrgFX","pb-7":"KVEXoJqf1s92j0JMdNmN","pl-7":"ZMXGNrNaKW3k_3TLz0Fq","p-8":"tuiR9PhkHXhGyEgzRZRI","px-8":"U7454qyWkQNa2iaSJziu","py-8":"VLYIv2GVocjuN93e8HC8","pt-8":"X1rm9DQ1zLGLfogja5Gn","pr-8":"JS7G6kAuqJo5GIuF8S5t","pb-8":"Y8F9ga1TDCMbM1lj4gUz","pl-8":"AJuyNGrI63BOWql719H8"}},3591:function(e,t){"use strict";t.Z={global:"_fUXxnSp5pagKBp9gSN7"}},9836:function(e,t){"use strict";t.Z={heading:"urouayitSUT8zW0V3p_0",notice:"iXXJlk08gFDeCvsTTlNQ",button:"MWqRqr7q6fgvLxitcWYk","bigger-than-medium":"YLcXAoc82nypTPaKSAcd",error:"e6hHy8BZ7ZKPSXbIC0UG",message:"jXz8LnXNzMDdtHqkG0sZ"}},3900:function(e,t){"use strict";t.Z={navigation:"vvXnRXxrU1kP1KsdSr4J",badge:"aDCTkUFaJEeZzYYE6qv5"}},9993:function(e,t){"use strict";t.Z={container:"EU0Rvu4PDqVtnCAmbgHg"}},4424:function(e,t){"use strict";t.Z={loading:"kdsaL7c4bpTwf_A4fIUT",loading__message:"b0eN3as5AgxQW7EAkarg"}},3064:function(e,t){"use strict";t.Z={footer:"_Wc3apZobag_9Ag_THTb"}},9137:function(e,t){"use strict";t.Z={"diff-viewer":"LumryWNddoF092fZgN2O","diff-viewer__filename":"NFMwU3H5k2qArZe2TTp9","diff-viewer__file":"G5W9M8qfo3sGl2OIbwg9","diff-viewer__line-numbers":"Bx4RDCUR316fm_jgGS8N","diff-viewer__lines":"GhN0JvAyRQI3SnVWp2Ot"}},3932:function(e,t){"use strict";t.Z={"footer-checkbox":"uQlXhcfYn9tbnK27_Gct","standalone-mode-section":"e5YHJiYcvfgdEEJsS_YM","share-data-section":"PO9zDOaSkcv_RqpfZF_v"}},8452:function(e,t){"use strict";t.Z={status:"gTWkHo5lqwE_OCesAhBx",active:"JeLxNe31ii68Utrr2xr6",spinner:"V6B8ltQ7TH3UKzUC_qy1","firewall-subheading":"C9hcvYAbgHPhN2Tl22xg","brute-force-protection-subheading":"XkbIpr2gzB4XEhHgzkY4","firewall-subheading__content":"BfcZn0_X33Ajdd1Gl18G","icon-popover":"rBmVJIeTNpd0RJWaRGuJ","upgrade-button":"jVq5444f1Xh6nNkz0Qe_","firewall-header":"amF9cOnMiv2nHbkMXQiQ","stat-card-wrapper":"FodE_7RbLD8zeBSd6eVR","popover-text":"twyPhW_K164HITnDrwEg","loading-text":"tbcd9xc_TjcFdokOt3F_","firewall-heading":"pnoqLV3l30xuvj2hLlJc"}},4854:function(e,t){"use strict";t.Z={container:"DM4b8iQ0ewvRYdIPxvZ8","toggle-section":"bW6ZuNzJBYU5PVPktE2S","toggle-section__control":"di3wjXHrX1rk_H6rlxKM","toggle-section__content":"IrzHnNkRvORtyCL0yiWa","toggle-section__title":"sU82bpLEYPC9n_CFAKoz","toggle-section--disabled":"ZZc0LldcbJpcftqCe43T","toggle-section__details":"T17WOOJI7XHN7KRmYaCe","automatic-rules-stats":"typbjN2keZ97hj2TmuMC","automatic-rules-stats__version":"UUXAN8VTAZY0h8t9rCHG","automatic-rules-stats__last-updated":"eFjcadLMEXY5O61vsTrx","automatic-rules-stats__failed-install":"Tr5uYvclUiwlC5kuGk7E","manual-rules-stats":"zPZcNgYx2X5778nHHtlH","manual-rules-stats__no-rules":"lNtkRXnB1z_kYB28MUWq","manual-rules-stats__block-list-count":"JgH5ykcLynEgqXYurT78","manual-rules-stats__allow-list-count":"xlWW0IoKZwTZt1Ti0tcQ","upgrade-trigger-section":"zhBcgCUGgyC7PvWk8ewB","manual-rules-section":"mah_f2OWxZ3Vqt_jRFdR","go-back-button":"Ax2SmW57c0U5xOTjZuAA",badge:"xGZeYQr0_nPJTFmd8pW4",popover:"RYTIt8kwLbKcUbWOfG4g",popover__header:"BqXge2rIUP0a_74yvYbr",popover__button:"Lr10UUCcSLF3T_0QqoPr",popover__footer:"th_VukMuODIOVLC7oJo6"}},5823:function(e,t){"use strict";t.Z={list:"sQkG5Cu80gPaeFj3L_wa",footer:"oIl6GCMeUnzE0inXbuj9"}},7279:function(e,t){"use strict";t.Z={list:"RP2MVoGqaCFXPKZhhxQ1",footer:"YpEs8b7KE7fzVuXUbOEb"}},1234:function(e,t){"use strict";t.Z={"form-toggle":"IunwKwdvL271DxBIniPb","form-toggle__switch":"svA9WxEcOByd5S2fZonA","is-compact":"wOd7DeP76v1fczKfah5n"}},9122:function(e,t){"use strict";t.Z={accordion:"x8UuVEhWucPfdq0hEJg6","accordion-item":"eb6Ovfvm1yONz4mdOwbH","accordion-header":"jF9LXpXR3TxZVDw7TVXT","accordion-header-label":"lNQgAfpwdAUSOLZd8dlD","accordion-header-label-icon":"WRQwDYPdffWznX158azR","accordion-header-description":"dJx9pvlYjDnKn11n5wo8","accordion-header-button":"EKcbLuSblRc7UpzgsFXw","accordion-body":"ILMBWlMLcXc0n97IisrG","accordion-body-close":"T8XIzCNJBQy1UETN5gjU","accordion-body-open":"kWoHGiaZSbq9XJVyUOMC"}},6983:function(e,t){"use strict";t.Z={threat:"EqpwvErHtRi_WQkJKgi1",threat__icon:"EicvN1QaJu5OJLzdUN5A",threat__summary:"b7ynAmUwGlxK_vxyIN0y",threat__summary__label:"uSV9HYRxjL4S6zIZDlqP",threat__summary__title:"XpW8Mvw_XFEbqxUdw155",threat__severity:"Fkj60BmQ5sUo9zHcJwVv",footer:"XLzPr74ad3osCq9kxy2q"}},2951:function(e,t){"use strict";t.Z={"protect-header":"UL3B1tQ854mN7r6taB61","get-started-button":"IG56Hw7ZR_7rKVsM78qw"}},8735:function(e,t){"use strict";t.Z={"marked-lines":"xpPHTch5ul0xuZaUoTNa","marked-lines__marked-line":"AMOpkL9LURkyTK8316cw","marked-lines__line-numbers":"i0_0xMrNWoak1brIaDQq","marked-lines__line-number":"C9fLawPLkMNSZthfwxj6","marked-lines__lines":"ogixgg8fRGekmYGtevh1","marked-lines__line":"jYPCgKMDRKfT3vnx0mdG","marked-lines__mark":"UEQ1NqkrwNmaQR7qdEK3"}},9980:function(e,t){"use strict";t.Z={modal:"WtVEv641JBaLl929sZq2",modal__window:"G0aPt7WmA1rkUE0wcTno",modal__close:"VkrhWjfEIlIwYEumycbP",modal__close__icon:"yFzeV4cmWRbZKk5tIyEw"}},513:function(e,t){"use strict";t.Z={navigation:"HQgjxePFDRJHamBAGcVU","navigation-item":"KtdsNIMumOoHNWMLmuAJ",clickable:"ewyV4ZGn34WDNXmK3ej2",selected:"owofT85W_XvVdb5vr1GN","navigation-item-label":"NESnw2xCLrBpP6WlYZL4","navigation-item-icon":"aohnd_y_1lrMuww8NH63","navigation-item-badge":"Rnas_2_2_eLZSYfZ347E","navigation-item-label-text":"m4_14yNRByDyO9yf9pGg","navigation-item-check-badge":"X8NRHUTBa_4wDvoHN9TT","navigation-item-info-badge":"CsuOteurQlJm4IjXqyZ0","navigation-group":"fvbewglUxEvV1o04yzzp","navigation-group-label":"DINy59MKjwiQanaoDTiV","navigation-group-content":"XoacHJljw8zRW_fkBSyg","navigation-group-list":"mXM4WZRePVTa07dhQ6MD","navigation-group-truncate":"sI3V8khLdCqxkhJQ_XnI","popover-text":"hgdxMuIvZwTZ0sfXaols","navigation-dropdown-button":"UErHS2HAh1gszGfYuVIf","navigation-dropdown-label":"lEhH1hvCcxLVFMHI8Gwv","navigation-dropdown-icon":"c57Vj4QhAHwcK_HZMxtN","navigation-dropdown-open":"t5TwI3d3FnCJvFBlkmm5","navigation-dropdown-closed":"kSa6ERuVPsCMPXugb030"}},8212:function(e,t){"use strict";t.Z={notice:"_aiMxmJRAw5jRPbZFX57","notice--info":"eWgNBUaexiR66ZI1Px4U","notice--floating":"ZGELG1CO333FilJXOaeI",notice__icon:"BnI88X_e8ItF1c9Uozmj","notice--success":"hRRUwTCPRpurhMwRNZkg","notice--error":"Z6q3IxY_uR1y2lAPTkVF",notice__message:"ST8sowTbBVLRPrk4ZQrn",notice__close:"lMkO08Vd8YQMfwrwaI8u"}},7324:function(e,t){"use strict";t.Z={accordion:"sfXsfklfkeSRtE9ivQwF","accordion-item":"ozRrKPlj1QFGUyd3oVke","accordion-header":"PyvnSHQuuUkZvVsArigy","accordion-header-label":"u9Xod5s8bCRNj9MR1Drl","accordion-header-label-icon":"IbeyulkpO9kjYJ4OkYUD","accordion-header-description":"KiCgmjHm2f0JDU3cMsgf","accordion-header-button":"kJ8t3FAtd5VAYjk31SfA","accordion-body":"JP0IJZcYRohfgntEozjm","accordion-body-close":"y7c6zi2wjEnbW3F29fmP","accordion-body-open":"wQWiN_J0SqgduvadyGnm","icon-check":"v1fUFCBPmd6miSCf_ehK"}},6067:function(e,t){"use strict";t.Z={"progress-bar":"vzMlFr1AXWqefpRrb976","progress-bar__wrapper":"gYSOMa4xxLXmsNzvFPkW","progress-bar__bar":"hNJWdt5qmZkWYAH_vjIp","progress-bar__percent":"DHMUfGyHbl5BgD5vjxVz"}},8383:function(e,t){"use strict";t.Z={"product-section":"Clxt94RgGnDrhORZZyPr","info-section":"K2OG1vK5PSOYDWKtqKKG"}},61:function(e,t){"use strict";t.Z={"main-content":"A6a9HOtaZnLUleNgxQrX","loading-content":"CGT5fOs6LDTFHWCAgIiT",illustration:"RFKxbzQ8N58qEyVO0yzW","connection-error-col":"SvMuuouOkDt2sE0PAn_D"}},8131:function(e,t){"use strict";t.Z={"threat-severity-badge":"JiJhrZaThvWCpM2AfGen","is-critical":"_7SGksgOpcPbHfPPpQTV","is-high":"pGNquShR54adQ61sx3lP","is-low":"IM5kkexAfwGLM6zz0Exd"}},8911:function(e,t){"use strict";t.Z={mark:"jNlU3vgp4xEGwmX5aTyK",list:"gE8s4nh3f7iGIBrFeyCT"}},6561:function(e,t){"use strict";t.Z={summary:"ZMBDiTLzs27F012iOsMK",summary__title:"zI2DKzqRc1MhF6aq5eHt",summary__icon:"iHgPFku9KaLz8FIQV1Qw",summary__notice:"xuIO_ubyDN6IGJ67NTlx","summary__scan-button":"ctq2nQkzIfSoMkldF9t9"}},5714:function(e,t){"use strict";t.Z={tabs:"lyrXe0pA852TUmyekDb5",tab:"KgEeDTKgTC5ZjzYlbTqN","tab--active":"Lv4WoNVkeJntqvUyG4dX"}},8063:function(e,t){"use strict";t.Z={textarea:"rigH8UdiDrmmSLQMUurD",label:"V8FDM08CpcwQs4UwN2nI"}},9971:function(e,t){"use strict";t.Z={threat:"NHzH3tt6CypjZ92CvK9x",threat__icon:"D9zvYDUrOP_zwSm0yJMs",threat__summary:"_XISfmbjoVlqhB61hHYn",threat__summary__label:"AQDPBnMZFu7BOBuo8mYW",threat__summary__title:"cZ9s5eCAZe3R82Y6Ru3z",threat__severity:"AKnbWQiViZ2O_dwCV8Fw",threat__checkbox:"W6alQ2_S5Rh06djX9m27"}},9709:function(e,t){"use strict";t.Z={empty:"OtDl6kocO_m2s9sRHaqX","threat-section":"BjwJh1S1YVPI7AjmTx6a","threat-filename":"YWfK8VTp2wnByBauYPKg","threat-footer":"pkw2LnOTd8VvQ3oT8sXQ","threat-item-cta":"ap6lG79CncSqdigJS_WA","list-header":"uym7dGHhp6ifjF57yOAO","list-title":"e_2eFTR8RyHwmfeqJL4F","list-header-button":"r4Id5qht2FD68jCAH2Cl","accordion-heading":"ZSZPabDoB8MVVPttP0tu","manual-scan":"iJ_biSBRDribuNKX0Zuw"}},541:function(e,t){"use strict";t.Z={footer:"uUEJGMrSV3XoBwX5xEwA"}},1155:function(){},3171:function(e){var t=1e3,n=60*t,a=60*n,c=24*a,r=7*c,i=365.25*c;function o(e,t,n,a){var c=t>=1.5*n;return Math.round(e/n)+" "+a+(c?"s":"")}e.exports=function(e,l){l=l||{};var s=typeof e;if("string"===s&&e.length>0)return function(e){if((e=String(e)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!o)return;var l=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*r;case"days":case"day":case"d":return l*c;case"hours":case"hour":case"hrs":case"hr":case"h":return l*a;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===s&&isFinite(e))return l.long?function(e){var r=Math.abs(e);if(r>=c)return o(e,r,c,"day");if(r>=a)return o(e,r,a,"hour");if(r>=n)return o(e,r,n,"minute");if(r>=t)return o(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=c)return Math.round(e/c)+"d";if(r>=a)return Math.round(e/a)+"h";if(r>=n)return Math.round(e/n)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},469:function(e,t,n){"use strict";var a=n(758);function c(){}function r(){}r.resetWarningCache=c,e.exports=function(){function e(e,t,n,c,r,i){if(i!==a){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:c};return n.PropTypes=n,n}},5162:function(e,t,n){e.exports=n(469)()},758:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},554:function(e,t,n){"use strict";n.d(t,{OL:function(){return m},UT:function(){return u}});var a=n(9196),c=n(5250),r=n(5439);function i(){return i=Object.assign||function(e){for(var t=1;t=0||(c[n]=e[n]);return c}const l=["onClick","reloadDocument","replace","state","target","to"],s=["aria-current","caseSensitive","className","end","style","to","children"];function u(e){let{basename:t,children:n,window:i}=e,o=(0,a.useRef)();null==o.current&&(o.current=(0,c.q_)({window:i}));let l=o.current,[s,u]=(0,a.useState)({action:l.action,location:l.location});return(0,a.useLayoutEffect)((()=>l.listen(u)),[l]),(0,a.createElement)(r.F0,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l})}const p=(0,a.forwardRef)((function(e,t){let{onClick:n,reloadDocument:s,replace:u=!1,state:p,target:m,to:d}=e,h=o(e,l),g=(0,r.oQ)(d),f=function(e,t){let{target:n,replace:i,state:o}=void 0===t?{}:t,l=(0,r.s0)(),s=(0,r.TH)(),u=(0,r.WU)(e);return(0,a.useCallback)((t=>{if(!(0!==t.button||n&&"_self"!==n||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(t))){t.preventDefault();let n=!!i||(0,c.Ep)(s)===(0,c.Ep)(u);l(e,{replace:n,state:o})}}),[s,l,u,i,o,n,e])}(d,{replace:u,state:p,target:m});return(0,a.createElement)("a",i({},h,{href:g,onClick:function(e){n&&n(e),e.defaultPrevented||s||f(e)},ref:t,target:m}))}));const m=(0,a.forwardRef)((function(e,t){let{"aria-current":n="page",caseSensitive:c=!1,className:l="",end:u=!1,style:m,to:d,children:h}=e,g=o(e,s),f=(0,r.TH)(),v=(0,r.WU)(d),E=f.pathname,b=v.pathname;c||(E=E.toLowerCase(),b=b.toLowerCase());let k,y=E===b||!u&&E.startsWith(b)&&"/"===E.charAt(b.length),Z=y?n:void 0;k="function"==typeof l?l({isActive:y}):[l,y?"active":null].filter(Boolean).join(" ");let C="function"==typeof m?m({isActive:y}):m;return(0,a.createElement)(p,i({},g,{"aria-current":Z,className:k,ref:t,style:C,to:d}),"function"==typeof h?h({isActive:y}):h)}))},5439:function(e,t,n){"use strict";n.d(t,{AW:function(){return u},F0:function(){return p},Fg:function(){return s},TH:function(){return g},WU:function(){return v},Z5:function(){return m},oQ:function(){return d},s0:function(){return f}});var a=n(9196),c=n(5250);function r(e,t){if(!e)throw new Error(t)}const i=(0,a.createContext)(null);const o=(0,a.createContext)(null);const l=(0,a.createContext)({outlet:null,matches:[]});function s(e){let{to:t,replace:n,state:c}=e;h()||r(!1);let i=f();return(0,a.useEffect)((()=>{i(t,{replace:n,state:c})})),null}function u(e){r(!1)}function p(e){let{basename:t="/",children:n=null,location:l,navigationType:s=c.aU.Pop,navigator:u,static:p=!1}=e;h()&&r(!1);let m=T(t),d=(0,a.useMemo)((()=>({basename:m,navigator:u,static:p})),[m,u,p]);"string"==typeof l&&(l=(0,c.cP)(l));let{pathname:g="/",search:f="",hash:v="",state:E=null,key:b="default"}=l,k=(0,a.useMemo)((()=>{let e=I(g,m);return null==e?null:{pathname:e,search:f,hash:v,state:E,key:b}}),[m,g,f,v,E,b]);return null==k?null:(0,a.createElement)(i.Provider,{value:d},(0,a.createElement)(o.Provider,{children:n,value:{location:k,navigationType:s}}))}function m(e){let{children:t,location:n}=e;return function(e,t){h()||r(!1);let{matches:n}=(0,a.useContext)(l),i=n[n.length-1],o=i?i.params:{},s=(i&&i.pathname,i?i.pathnameBase:"/");i&&i.route;0;let u,p=g();if(t){var m;let e="string"==typeof t?(0,c.cP)(t):t;"/"===s||(null==(m=e.pathname)?void 0:m.startsWith(s))||r(!1),u=e}else u=p;let d=u.pathname||"/",f="/"===s?d:d.slice(s.length)||"/",v=function(e,t,n){void 0===n&&(n="/");let a="string"==typeof t?(0,c.cP)(t):t,r=I(a.pathname||"/",n);if(null==r)return null;let i=b(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let e=0;null==o&&eObject.assign({},e,{params:Object.assign({},o,e.params),pathname:M([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:M([s,e.pathnameBase])}))),n)}(E(t),n)}function d(e){h()||r(!1);let{basename:t,navigator:n}=(0,a.useContext)(i),{hash:o,pathname:l,search:s}=v(e),u=l;if("/"!==t){let n=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?(0,c.cP)(e).pathname:e.pathname}(e),a=null!=n&&n.endsWith("/");u="/"===l?t+(a?"/":""):M([t,l])}return n.createHref({pathname:u,search:s,hash:o})}function h(){return null!=(0,a.useContext)(o)}function g(){return h()||r(!1),(0,a.useContext)(o).location}function f(){h()||r(!1);let{basename:e,navigator:t}=(0,a.useContext)(i),{matches:n}=(0,a.useContext)(l),{pathname:c}=g(),o=JSON.stringify(n.map((e=>e.pathnameBase))),s=(0,a.useRef)(!1);return(0,a.useEffect)((()=>{s.current=!0})),(0,a.useCallback)((function(n,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof n)return void t.go(n);let r=x(n,JSON.parse(o),c);"/"!==e&&(r.pathname=M([e,r.pathname])),(a.replace?t.replace:t.push)(r,a.state)}),[e,t,o,c])}function v(e){let{matches:t}=(0,a.useContext)(l),{pathname:n}=g(),c=JSON.stringify(t.map((e=>e.pathnameBase)));return(0,a.useMemo)((()=>x(e,JSON.parse(c),n)),[e,c,n])}function E(e){let t=[];return a.Children.forEach(e,(e=>{if(!(0,a.isValidElement)(e))return;if(e.type===a.Fragment)return void t.push.apply(t,E(e.props.children));e.type!==u&&r(!1);let n={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(n.children=E(e.props.children)),t.push(n)})),t}function b(e,t,n,a){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===a&&(a=""),e.forEach(((e,c)=>{let i={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:c,route:e};i.relativePath.startsWith("/")&&(i.relativePath.startsWith(a)||r(!1),i.relativePath=i.relativePath.slice(a.length));let o=M([a,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(!0===e.index&&r(!1),b(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:j(o,e.index),routesMeta:l})})),t}const k=/^:\w+$/,y=3,Z=2,C=1,_=10,w=-2,R=e=>"*"===e;function j(e,t){let n=e.split("/"),a=n.length;return n.some(R)&&(a+=w),t&&(a+=Z),n.filter((e=>!R(e))).reduce(((e,t)=>e+(k.test(t)?y:""===t?C:_)),a)}function N(e,t){let{routesMeta:n}=e,a={},c="/",r=[];for(let e=0;e(0,a.createElement)(l.Provider,{children:void 0!==c.route.element?c.route.element:n,value:{outlet:n,matches:t.concat(e.slice(0,r+1))}})),null)}function P(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);let a=[],c="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),c+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):c+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";let r=new RegExp(c,t?void 0:"i");return[r,a]}(e.path,e.caseSensitive,e.end),c=t.match(n);if(!c)return null;let r=c[0],i=r.replace(/(.)\/+$/,"$1"),o=c.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=o[n]||"";i=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(t){return e}}(o[n]||""),e}),{}),pathname:r,pathnameBase:i,pattern:e}}function x(e,t,n){let a,r="string"==typeof e?(0,c.cP)(e):e,i=""===e||""===r.pathname?"/":r.pathname;if(null==i)a=n;else{let e=t.length-1;if(i.startsWith("..")){let t=i.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let o=function(e,t){void 0===t&&(t="/");let{pathname:n,search:a="",hash:r=""}="string"==typeof e?(0,c.cP)(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:L(a),hash:z(r)}}(r,a);return i&&"/"!==i&&i.endsWith("/")&&!o.pathname.endsWith("/")&&(o.pathname+="/"),o}function I(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const M=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),L=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",z=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},6975:function(e,t,n){"use strict";var a=n(951);const c=n.n(a)()("dops:analytics");let r,i;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const o={initialize:function(e,t,n){o.setUser(e,t),o.setSuperProps(n),o.identifyUser()},setGoogleAnalyticsEnabled:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){i={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);c("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),c('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);o.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);c("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),c('Built stat "%s" in group "%s"',t,e);return n}(e,t);o.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){o.tracks.recordPageView(e),o.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,a,c,r,i){o.ga.recordPurchase(e,t,n,a,c,r,i)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(c("- Super Props: %o",r),t=Object.assign(t,r)),c('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):c('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};o.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){o.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){c("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};o.ga.initialized||(i&&(e={userId:"u-"+i.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),o.ga.initialized=!0)},recordPageView:function(e,t){o.ga.initialize(),c("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,a){o.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(r+=" [Option Label: "+n+"]"),void 0!==a&&(r+=" [Option Value: "+a+"]"),c(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,a)},recordPurchase:function(e,t,n,a,c,r,i){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:a,currency:i}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:c,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){i&&window._tkq.push(["identifyUser",i.ID,i.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}};t.Z=o},4743:function(e,t,n){"use strict";var a=n(1132),c=n(6483);function r(e){class t extends Error{constructor(){super(...arguments),this.name=e}}return t}const i=r("JsonParseError"),o=r("JsonParseAfterRedirectError"),l=r("Api404Error"),s=r("Api404AfterRedirectError"),u=r("FetchNetworkError");const p=new function(e,t){let n=e,r=e,i={"X-WP-Nonce":t},o={credentials:"same-origin",headers:i},l={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})},s=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",a=n.length?n.split("&"):[];return a.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+a.join("&")};const u={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){r=e},setApiNonce(e){i={"X-WP-Nonce":e},o={credentials:"same-origin",headers:i},l={method:"post",credentials:"same-origin",headers:Object.assign({},i,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{s=e},registerSite:(e,t)=>{const c={registration_nonce:e,no_iframe:!0};return(0,a.jetpackConfigHas)("consumer_slug")&&(c.plugin_slug=(0,a.jetpackConfigGet)("consumer_slug")),null!==t&&(c.redirect_uri=t),h(`${n}jetpack/v4/connection/register`,l,{body:JSON.stringify(c)}).then(m).then(d)},fetchAuthorizationUrl:e=>p((0,c.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),o).then(m).then(d),fetchSiteConnectionData:()=>p(`${n}jetpack/v4/connection/data`,o).then(d),fetchSiteConnectionStatus:()=>p(`${n}jetpack/v4/connection`,o).then(d),fetchSiteConnectionTest:()=>p(`${n}jetpack/v4/connection/test`,o).then(m).then(d),fetchUserConnectionData:()=>p(`${n}jetpack/v4/connection/data`,o).then(d),fetchUserTrackingSettings:()=>p(`${n}jetpack/v4/tracking/settings`,o).then(m).then(d),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,l,{body:JSON.stringify(e)}).then(m).then(d),disconnectSite:()=>h(`${n}jetpack/v4/connection`,l,{body:JSON.stringify({isActive:!1})}).then(m).then(d),fetchConnectUrl:()=>p(`${n}jetpack/v4/connection/url`,o).then(m).then(d),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,l,{body:JSON.stringify({linked:!1})}).then(m).then(d),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,l).then(m).then(d),fetchConnectedPlugins:()=>p(`${n}jetpack/v4/connection/plugins`,o).then(m).then(d),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,l).then(m).then(d),fetchModules:()=>p(`${n}jetpack/v4/module/all`,o).then(m).then(d),fetchModule:e=>p(`${n}jetpack/v4/module/${e}`,o).then(m).then(d),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,l,{body:JSON.stringify({active:!0})}).then(m).then(d),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,l,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,l,{body:JSON.stringify(t)}).then(m).then(d),updateSettings:e=>h(`${n}jetpack/v4/settings`,l,{body:JSON.stringify(e)}).then(m).then(d),getProtectCount:()=>p(`${n}jetpack/v4/module/protect/data`,o).then(m).then(d),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,l,{body:JSON.stringify({reset:!0})}).then(m).then(d),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,l,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(m).then(d),getVaultPressData:()=>p(`${n}jetpack/v4/module/vaultpress/data`,o).then(m).then(d),installPlugin:(e,t)=>{const a={slug:e,status:"active"};return t&&(a.source=t),h(`${n}jetpack/v4/plugins`,l,{body:JSON.stringify(a)}).then(m).then(d)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,l,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(m).then(d),getAkismetData:()=>p(`${n}jetpack/v4/module/akismet/data`,o).then(m).then(d),checkAkismetKey:()=>p(`${n}jetpack/v4/module/akismet/key/check`,o).then(m).then(d),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,l,{body:JSON.stringify({api_key:e})}).then(m).then(d),fetchStatsData:e=>p(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),o).then(m).then(d).then(f),getPluginUpdates:()=>p(`${n}jetpack/v4/updates/plugins`,o).then(m).then(d),getPlans:()=>p(`${n}jetpack/v4/plans`,o).then(m).then(d),fetchSettings:()=>p(`${n}jetpack/v4/settings`,o).then(m).then(d),updateSetting:e=>h(`${n}jetpack/v4/settings`,l,{body:JSON.stringify(e)}).then(m).then(d),fetchSiteData:()=>p(`${n}jetpack/v4/site`,o).then(m).then(d).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>p(`${n}jetpack/v4/site/features`,o).then(m).then(d).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>p(`${n}jetpack/v4/site/products`,o).then(m).then(d),fetchSitePurchases:()=>p(`${n}jetpack/v4/site/purchases`,o).then(m).then(d).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>p(`${n}jetpack/v4/site/benefits`,o).then(m).then(d).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>p(`${n}jetpack/v4/site/discount`,o).then(m).then(d).then((e=>e.data)),fetchSetupQuestionnaire:()=>p(`${n}jetpack/v4/setup/questionnaire`,o).then(m).then(d),fetchRecommendationsData:()=>p(`${n}jetpack/v4/recommendations/data`,o).then(m).then(d),fetchRecommendationsProductSuggestions:()=>p(`${n}jetpack/v4/recommendations/product-suggestions`,o).then(m).then(d),fetchRecommendationsUpsell:()=>p(`${n}jetpack/v4/recommendations/upsell`,o).then(m).then(d),fetchRecommendationsConditional:()=>p(`${n}jetpack/v4/recommendations/conditional`,o).then(m).then(d),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,l,{body:JSON.stringify({data:e})}).then(m),fetchProducts:()=>p(`${n}jetpack/v4/products`,o).then(m).then(d),fetchRewindStatus:()=>p(`${n}jetpack/v4/rewind`,o).then(m).then(d).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>p(`${n}jetpack/v4/scan`,o).then(m).then(d).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,l,{body:JSON.stringify({dismissed:!0})}).then(m).then(d),fetchPluginsData:()=>p(`${n}jetpack/v4/plugins`,o).then(m).then(d),fetchIntroOffers:()=>p(`${n}jetpack/v4/intro-offers`,o).then(m).then(d),fetchVerifySiteGoogleStatus:e=>p(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,o).then(m).then(d),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,l,{body:JSON.stringify({keyring_id:e})}).then(m).then(d),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,l,{body:JSON.stringify(e)}).then(m).then(d),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,l,{body:JSON.stringify(e)}).then(m).then(d),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,l,{body:JSON.stringify(e)}).then(m).then(d),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,l,{body:JSON.stringify({license:e})}).then(m).then(d),getUserLicensesCounts:()=>p(`${n}jetpack/v4/licensing/user/counts`,o).then(m).then(d),getUserLicenses:()=>p(`${n}jetpack/v4/licensing/user/licenses`,o).then(m).then(d),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,l,{body:JSON.stringify({last_detached_count:e})}).then(m).then(d),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,l,{body:JSON.stringify({step:e})}).then(m),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,l).then(m),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,l,{body:JSON.stringify({redirect_uri:e})}).then(m).then(d),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,l).then(m),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,l,{body:JSON.stringify({licenses:e})}).then(m).then(d),fetchSearchPlanInfo:()=>p(`${r}jetpack/v4/search/plan`,o).then(m).then(d),fetchSearchSettings:()=>p(`${r}jetpack/v4/search/settings`,o).then(m).then(d),updateSearchSettings:e=>h(`${r}jetpack/v4/search/settings`,l,{body:JSON.stringify(e)}).then(m).then(d),fetchSearchStats:()=>p(`${r}jetpack/v4/search/stats`,o).then(m).then(d),fetchWafSettings:()=>p(`${n}jetpack/v4/waf`,o).then(m).then(d),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,l,{body:JSON.stringify(e)}).then(m).then(d),fetchWordAdsSettings:()=>p(`${n}jetpack/v4/wordads/settings`,o).then(m).then(d),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,l,{body:JSON.stringify(e)}),fetchSearchPricing:()=>p(`${r}jetpack/v4/search/pricing`,o).then(m).then(d),fetchMigrationStatus:()=>p(`${n}jetpack/v4/migration/status`,o).then(m).then(d)};function p(e,t){return fetch(s(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(g)}function f(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,u)};function m(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new s(e.redirected):new l})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function d(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new o(n):new i}function g(){throw new u}t.ZP=p},9105:function(e,t,n){"use strict";var a=n(5736),c=n(5235),r=n.n(c),i=n(8237),o=n(8868),l=n(3846),s=n(3363),u=n(1494);const __=a.__;t.Z=e=>{let{children:t,moduleName:n=__("Jetpack","jetpack-protect"),moduleNameHref:a,a8cLogoHref:c,showHeader:p=!0,showFooter:m=!0,showBackground:d=!0,header:h}=e;const g=r()(u.Z["admin-page"],{[u.Z.background]:d});return React.createElement("div",{className:g},p&&React.createElement(s.Z,{horizontalSpacing:5},React.createElement(l.Z,null,h||React.createElement(o.Z,null))),React.createElement(s.Z,{fluid:!0,horizontalSpacing:0},React.createElement(l.Z,null,t)),m&&React.createElement(s.Z,{horizontalSpacing:5},React.createElement(l.Z,null,React.createElement(i.Z,{moduleName:n,a8cLogoHref:c,moduleNameHref:a}))))}},216:function(e,t,n){"use strict";var a=n(9196),c=n.n(a),r=n(281);t.Z=e=>{let{children:t}=e;return c().createElement("div",{className:r.Z["section-hero"]},t)}},7525:function(e,t,n){"use strict";var a=n(2674),c=n.n(a),r=n(5736),i=n(5235),o=n.n(i),l=n(9196),s=n.n(l);const __=r.__;t.Z=e=>{let{title:t=__("An Automattic Airline","jetpack-protect"),height:n=7,className:a,...r}=e;return s().createElement("svg",c()({role:"img",x:"0",y:"0",viewBox:"0 0 935 38.2",enableBackground:"new 0 0 935 38.2","aria-labelledby":"jp-automattic-byline-logo-title",height:n,className:o()("jp-automattic-byline-logo",a)},r),s().createElement("desc",{id:"jp-automattic-byline-logo-title"},t),s().createElement("path",{d:"M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"}),s().createElement("path",{d:"M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z"}),s().createElement("path",{d:"M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z"}))}},526:function(e,t,n){"use strict";var a=n(2674),c=n.n(a),r=n(5609),i=n(1074),o=n(5381),l=n(5235),s=n.n(l),u=n(9196),p=n.n(u),m=n(3466);const d=(0,u.forwardRef)(((e,t)=>{const{children:n,variant:a="primary",size:l="normal",weight:u="bold",icon:d,iconSize:h,disabled:g,isDestructive:f,isLoading:v,isExternalLink:E,className:b,text:k,fullWidth:y,...Z}=e,C=s()(m.Z.button,b,{[m.Z.normal]:"normal"===l,[m.Z.small]:"small"===l,[m.Z.icon]:Boolean(d),[m.Z.loading]:v,[m.Z.regular]:"regular"===u,[m.Z["full-width"]]:y,[m.Z["is-icon-button"]]:Boolean(d)&&!n});Z.ref=t;const _="normal"===l?20:16,w=E&&p().createElement(i.Z,{size:_,icon:o.Z,className:m.Z["external-icon"]}),R=E?"_blank":void 0,j=n?.[0]&&null!==n[0]&&"components-tooltip"!==n?.[0]?.props?.className;return p().createElement(r.Button,c()({target:R,variant:a,className:s()(C,{"has-text":!!d&&j}),icon:E?void 0:d,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:f,text:k},Z),v&&p().createElement(r.Spinner,null),p().createElement("span",null,n),w)}));t.Z=d},857:function(e,t,n){"use strict";var a=n(1074),c=n(495),r=n(5235),i=n.n(r),o=n(9665),l=n(5106),s=n(1489);t.Z=e=>{let{description:t,cta:n,onClick:r,href:u,openInNewTab:p=!1,className:m,tooltipText:d=""}=e;const h=void 0!==u?"a":"button",g="a"===h?{href:u,...p&&{target:"_blank"}}:{onClick:r};return React.createElement("div",{className:i()(s.Z.cut,m)},React.createElement("div",null,React.createElement(l.ZP,{className:s.Z.description},t),d&&React.createElement(o.Z,{className:s.Z.iconContainer,iconSize:16,offset:4},React.createElement(l.ZP,{variant:"body-small"},d)),React.createElement(h,g,React.createElement(l.ZP,{className:s.Z.cta},n))),React.createElement(a.Z,{icon:c.Z,className:s.Z.icon,size:30}))}},7172:function(e,t,n){"use strict";var a=n(17),c=n.n(a),r=n(5736),i=n(5235),o=n.n(i),l=n(9196);n(5785);const __=r.__;class s extends l.Component{needsOffset(e,t){return["gridicons-arrow-left","gridicons-arrow-right","gridicons-calendar","gridicons-cart","gridicons-folder","gridicons-info","gridicons-info-outline","gridicons-posts","gridicons-star-outline","gridicons-star"].indexOf(e)>=0&&t%18==0}getSVGDescription(e){if("description"in this.props)return this.props.description;switch(e){default:return"";case"gridicons-audio":return __("Has audio.","jetpack-protect");case"gridicons-arrow-left":return __("Arrow left","jetpack-protect");case"gridicons-arrow-right":return __("Arrow right","jetpack-protect");case"gridicons-calendar":return __("Is an event.","jetpack-protect");case"gridicons-cart":return __("Is a product.","jetpack-protect");case"chevron-down":return __("Show filters","jetpack-protect");case"gridicons-comment":return __("Matching comment.","jetpack-protect");case"gridicons-cross":return __("Close.","jetpack-protect");case"gridicons-filter":return __("Toggle search filters.","jetpack-protect");case"gridicons-folder":return __("Category","jetpack-protect");case"gridicons-info":case"gridicons-info-outline":return __("Information.","jetpack-protect");case"gridicons-image-multiple":return __("Has multiple images.","jetpack-protect");case"gridicons-image":return __("Has an image.","jetpack-protect");case"gridicons-page":return __("Page","jetpack-protect");case"gridicons-post":return __("Post","jetpack-protect");case"gridicons-jetpack-search":case"gridicons-search":return __("Magnifying Glass","jetpack-protect");case"gridicons-tag":return __("Tag","jetpack-protect");case"gridicons-video":return __("Has a video.","jetpack-protect")}}renderIcon(e){switch(e){default:return null;case"gridicons-audio":return React.createElement("g",null,React.createElement("path",{d:"M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z"}));case"gridicons-arrow-left":return React.createElement("g",null,React.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}));case"gridicons-arrow-right":return React.createElement("g",null,React.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"}));case"gridicons-block":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12c0-4.418 3.582-8 8-8 1.848 0 3.545.633 4.9 1.686L5.686 16.9C4.633 15.545 4 13.848 4 12zm8 8c-1.848 0-3.546-.633-4.9-1.686L18.314 7.1C19.367 8.455 20 10.152 20 12c0 4.418-3.582 8-8 8z"}));case"gridicons-calendar":return React.createElement("g",null,React.createElement("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.105 0-2 .896-2 2v13c0 1.104.895 2 2 2h14c1.104 0 2-.896 2-2V6c0-1.104-.896-2-2-2zm0 15H5V8h14v11z"}));case"gridicons-cart":return React.createElement("g",null,React.createElement("path",{d:"M9 20c0 1.1-.9 2-2 2s-1.99-.9-1.99-2S5.9 18 7 18s2 .9 2 2zm8-2c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm.396-5c.937 0 1.75-.65 1.952-1.566L21 5H7V4c0-1.105-.895-2-2-2H3v2h2v11c0 1.105.895 2 2 2h12c0-1.105-.895-2-2-2H7v-2h10.396z"}));case"gridicons-checkmark":return React.createElement("g",null,React.createElement("path",{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"}));case"gridicons-chevron-down":return React.createElement("g",null,React.createElement("path",{d:"M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"}));case"gridicons-comment":return React.createElement("g",null,React.createElement("path",{d:"M3 6v9c0 1.105.895 2 2 2h9v5l5.325-3.804c1.05-.75 1.675-1.963 1.675-3.254V6c0-1.105-.895-2-2-2H5c-1.105 0-2 .895-2 2z"}));case"gridicons-cross":return React.createElement("g",null,React.createElement("path",{d:"M18.36 19.78L12 13.41l-6.36 6.37-1.42-1.42L10.59 12 4.22 5.64l1.42-1.42L12 10.59l6.36-6.36 1.41 1.41L13.41 12l6.36 6.36z"}));case"gridicons-filter":return React.createElement("g",null,React.createElement("path",{d:"M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z"}));case"gridicons-folder":return React.createElement("g",null,React.createElement("path",{d:"M18 19H6c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2h7c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2z"}));case"gridicons-image":return React.createElement("g",null,React.createElement("path",{d:"M13 9.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5zM22 6v12c0 1.105-.895 2-2 2H4c-1.105 0-2-.895-2-2V6c0-1.105.895-2 2-2h16c1.105 0 2 .895 2 2zm-2 0H4v7.444L8 9l5.895 6.55 1.587-1.85c.798-.932 2.24-.932 3.037 0L20 15.426V6z"}));case"gridicons-image-multiple":return React.createElement("g",null,React.createElement("path",{d:"M15 7.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5S17.328 9 16.5 9 15 8.328 15 7.5zM4 20h14c0 1.105-.895 2-2 2H4c-1.1 0-2-.9-2-2V8c0-1.105.895-2 2-2v14zM22 4v12c0 1.105-.895 2-2 2H8c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zM8 4v6.333L11 7l4.855 5.395.656-.73c.796-.886 2.183-.886 2.977 0l.513.57V4H8z"}));case"gridicons-info":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}));case"gridicons-info-outline":return React.createElement("g",null,React.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"}));case"gridicons-jetpack-search":return React.createElement("g",null,React.createElement("path",{d:"M0 9.257C0 4.15 4.151 0 9.257 0c5.105 0 9.256 4.151 9.256 9.257a9.218 9.218 0 01-2.251 6.045l.034.033h1.053L24 22.01l-1.986 1.989-6.664-6.662v-1.055l-.033-.033a9.218 9.218 0 01-6.06 2.264C4.15 18.513 0 14.362 0 9.257zm4.169 1.537h4.61V1.82l-4.61 8.973zm5.547-3.092v8.974l4.61-8.974h-4.61z"}));case"gridicons-pages":return React.createElement("g",null,React.createElement("path",{d:"M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z"}));case"gridicons-posts":return React.createElement("g",null,React.createElement("path",{d:"M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z"}));case"gridicons-search":return React.createElement("g",null,React.createElement("path",{d:"M21 19l-5.154-5.154C16.574 12.742 17 11.42 17 10c0-3.866-3.134-7-7-7s-7 3.134-7 7 3.134 7 7 7c1.42 0 2.742-.426 3.846-1.154L19 21l2-2zM5 10c0-2.757 2.243-5 5-5s5 2.243 5 5-2.243 5-5 5-5-2.243-5-5z"}));case"gridicons-star-outline":return React.createElement("g",null,React.createElement("path",{d:"M12 6.308l1.176 3.167.347.936.997.042 3.374.14-2.647 2.09-.784.62.27.963.91 3.25-2.813-1.872-.83-.553-.83.552-2.814 1.87.91-3.248.27-.962-.783-.62-2.648-2.092 3.374-.14.996-.04.347-.936L12 6.308M12 2L9.418 8.953 2 9.257l5.822 4.602L5.82 21 12 16.89 18.18 21l-2.002-7.14L22 9.256l-7.418-.305L12 2z"}));case"gridicons-star":return React.createElement("g",null,React.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}));case"gridicons-tag":return React.createElement("g",null,React.createElement("path",{d:"M20 2.007h-7.087c-.53 0-1.04.21-1.414.586L2.592 11.5c-.78.78-.78 2.046 0 2.827l7.086 7.086c.78.78 2.046.78 2.827 0l8.906-8.906c.376-.374.587-.883.587-1.413V4.007c0-1.105-.895-2-2-2zM17.007 9c-1.105 0-2-.895-2-2s.895-2 2-2 2 .895 2 2-.895 2-2 2z"}));case"gridicons-video":return React.createElement("g",null,React.createElement("path",{d:"M20 4v2h-2V4H6v2H4V4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2v-2h2v2h12v-2h2v2c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zM6 16H4v-3h2v3zm0-5H4V8h2v3zm4 4V9l4.5 3-4.5 3zm10 1h-2v-3h2v3zm0-5h-2V8h2v3z"}))}}render(){const{size:e=24,className:t=""}=this.props,n=this.props.height||e,a=this.props.width||e,c=this.props.style||{height:n,width:a},r="gridicons-"+this.props.icon,i=o()("gridicon",r,t,{"needs-offset":this.needsOffset(r,e)}),l=this.getSVGDescription(r);return React.createElement("svg",{className:i,focusable:this.props.focusable,height:n,onClick:this.props.onClick,style:c,viewBox:"0 0 24 24",width:a,xmlns:"http://www.w3.org/2000/svg","aria-hidden":this.props["aria-hidden"]},l?React.createElement("desc",null,l):null,this.renderIcon(r))}}c()(s,"defaultProps",{"aria-hidden":"false",focusable:"true"}),t.Z=s},9665:function(e,t,n){"use strict";var a=n(5609),c=n(5235),r=n.n(c),i=n(9196),o=n.n(i),l=n(526),s=n(7172);n(1275);const u=e=>({"top-end":"top left",top:"top center","top-start":"top right","bottom-end":"bottom left",bottom:"bottom center","bottom-start":"bottom right"}[e]);t.Z=e=>{let{className:t="",iconClassName:n="",placement:c="bottom-end",animate:p=!0,iconCode:m="info-outline",iconSize:d=18,offset:h=10,title:g,children:f,popoverAnchorStyle:v="icon",forceShow:E=!1}=e;const[b,k]=(0,i.useState)(!1),y=(0,i.useCallback)((()=>k(!0)),[k]),Z=(0,i.useCallback)((()=>k(!1)),[k]),C={position:u(c),placement:c,animate:p,noArrow:!1,resize:!1,flip:!1,offset:h,focusOnMount:"container",onClose:Z,className:"icon-tooltip-container"},_="wrapper"===v,w=r()("icon-tooltip-wrapper",t),R={left:_?0:-(62-d/2)+"px"},j=_&&E;return o().createElement("div",{className:w,"data-testid":"icon-tooltip_wrapper"},!_&&o().createElement(l.Z,{variant:"link",onClick:y},o().createElement(s.Z,{className:n,icon:m,size:d})),o().createElement("div",{className:"icon-tooltip-helper",style:R},(j||b)&&o().createElement(a.Popover,C,o().createElement("div",null,g&&o().createElement("div",{className:"icon-tooltip-title"},g),o().createElement("div",{className:"icon-tooltip-content"},f)))))}},3396:function(e,t,n){"use strict";n.d(t,{VS:function(){return m}});var a=n(2674),c=n.n(a),r=n(5609),i=n(5235),o=n.n(i),l=n(5612);const s=e=>{let{className:t,size:n=24,viewBox:a="0 0 24 24",opacity:i=1,color:s="#2C3338",children:u}=e;const p={className:o()(l.Z.iconWrapper,t),width:n,height:n,viewBox:a,opacity:i,fill:void 0};return s&&(p.fill=s),React.createElement(r.SVG,c()({},p,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:i},u))},u=e=>{let{className:t,fill:n="none",size:a,children:c}=e;return React.createElement(s,{className:o()(l.Z.socialIcon,t),size:a,color:n},c)},p={...{"anti-spam":e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M21.6,12.5c0,0.6-0.3,1-0.9,1c-0.6,0-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1C21.3,11.7,21.6,12.1,21.6,12.5z"}),React.createElement(r.Path,{d:"M4.1,12.5c0,0.6-0.3,1-0.9,1s-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1S4.1,12.1,4.1,12.5z"}))},backup:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1 l8.3,2.9c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.2,0.2,0.4,0.2,0.7c0,0.1,0,0.1,0,0.2v0.1c-0.1,0.5-0.2,0.9-0.3,1.4 c-0.2,0.4-0.3,1.2-0.7,2.2c-0.3,1-0.7,2.1-1.1,3.1c-0.5,1-1,2.1-1.6,3.3s-1.4,2.3-2.2,3.5c-0.9,1.1-1.8,2.2-2.8,3.1 c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4c-1.2-1.1-2.4-2.4-3.5-4c-1-1.6-1.9-3-2.5-4.3c-0.6-1.3-1.1-2.7-1.6-4 C2.8,8.7,2.5,7.6,2.3,7C2.3,6.5,2.1,6.1,2.1,5.8z M2.9,5.9c0,0.2,0.1,0.4,0.1,0.8C3.1,7,3.2,7.5,3.5,8.2C3.7,9,3.9,9.7,4.2,10.6 c0.3,0.7,0.7,1.7,1.1,2.7c0.4,1,1,2,1.5,2.9c0.5,1,1.2,1.9,1.9,2.9c0.8,1,1.6,1.9,2.4,2.6c0.2,0.2,0.4,0.2,0.5,0.2 c0.2,0,0.4-0.1,0.5-0.2c1.2-1,2.2-2.3,3.2-3.8c1-1.5,1.8-2.8,2.3-4c0.6-1.3,1.1-2.5,1.5-3.9c0.4-1.3,0.7-2.2,0.9-2.8 c0.1-0.5,0.2-1,0.3-1.3c0-0.1,0-0.1,0-0.1c0-0.2,0-0.3-0.1-0.4C20.3,5.2,20.2,5.1,20,5L12,2.1c0,0-0.1,0-0.2,0s-0.1,0-0.1,0h-0.2 l-8,2.8C3.2,5,3.1,5.2,3,5.3C2.9,5.5,2.9,5.6,2.9,5.8C2.9,5.8,2.9,5.8,2.9,5.9z M5.9,6.7h3l2.8,7l2.8-7h3c-0.1,0.1-0.2,0.5-0.3,0.8 C17,7.8,17,8.2,16.8,8.4c-0.1,0.3-0.2,0.5-0.4,0.8c0,0.1-0.1,0.1-0.1,0.1s-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.2,0.1-0.2,0.2c0,0-0.1,0.1-0.1,0.1s-0.1,0.1-0.1,0.1c0,0,0,0.1-0.1,0.2c0,0.1-0.1,0.1-0.1,0.1l-0.4,1.1 c-1.3,3.3-2.1,5.2-2.3,5.8h-2.2l-1-2.4c-0.1-0.3-0.3-0.8-0.5-1.3c-0.1-0.3-0.3-0.8-0.5-1.3L8,10.8c-0.1-0.1-0.1-0.2-0.1-0.4 C7.8,10.2,7.7,10,7.7,9.8C7.6,9.7,7.5,9.5,7.4,9.4C7.3,9.3,7.3,9.3,7.3,9.3c-0.1,0-0.2,0-0.2,0s-0.1,0-0.1,0 C6.6,8.5,6.3,7.6,5.9,6.7z"}))},boost:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19505 16.2545C4.47368 16.561 4.94802 16.5836 5.25451 16.3049L10.2595 11.7549L14.2842 15.2765L19 10.5607V13.75H20.5V9.5V8.75239V8.7476V8H19.7529H19.7471H19H14.75V9.5H17.9393L14.2158 13.2235L10.2405 9.74507L4.2455 15.195C3.93901 15.4737 3.91642 15.948 4.19505 16.2545Z"}))},crm:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"}))},extras:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z"}))},protect:e=>{let{opacity:t=1,size:n,className:a,color:c}=e;return React.createElement(s,{className:a,size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z"}),React.createElement(r.Path,{d:"M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z"}))},scan:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z"}))},search:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z"}))},social:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z"}))},star:e=>{let{size:t,className:n=l.Z["star-icon"],color:a}=e;return React.createElement(s,{className:n,size:t,color:a},React.createElement(r.Path,{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}))},videopress:e=>{let{opacity:t=1,size:n,color:a}=e;return React.createElement(s,{size:n,opacity:t,color:a},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3,6.2c0.8,0,1.6,0.6,1.8,1.4l2.3,7.9c0,0,0,0,0,0l2.7-9.3h1.5h4.2c2.9,0,4.9,1.9,4.9,4.7c0,2.9-2,4.7-5,4.7 h-2h-2.5l-0.5,1.5c-0.4,1.4-1.7,2.3-3.2,2.3c-1.4,0-2.7-0.9-3.2-2.3L2.5,8.7C2.1,7.4,3,6.2,4.3,6.2z M13,12.8h2.9c1.3,0,2-0.7,2-1.9 c0-1.2-0.8-1.8-2-1.8h-1.7L13,12.8z"}))},jetpack:e=>{let{size:t,className:n=l.Z.jetpack,color:a}=e;return React.createElement(s,{className:n,size:t,color:a,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"jetpack-logo__icon-circle",d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),React.createElement(r.Polygon,{fill:"#fff",points:"15,19 7,19 15,3"}),React.createElement(r.Polygon,{fill:"#fff",points:"17,29 17,13 25,13"}))}},...{facebook:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.facebook,a)},React.createElement(r.Path,{d:"M12,2C6.5,2,2,6.5,2,12c0,5,3.7,9.1,8.4,9.9v-7H7.9V12h2.5V9.8c0-2.5,1.5-3.9,3.8-3.9c1.1,0,2.2,0.2,2.2,0.2v2.5h-1.3 c-1.2,0-1.6,0.8-1.6,1.6V12h2.8l-0.4,2.9h-2.3v7C18.3,21.1,22,17,22,12C22,6.5,17.5,2,12,2z"}))},twitter:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.twitter,a)},React.createElement(r.Path,{d:"M19,3H5C3.895,3,3,3.895,3,5v14c0,1.105,0.895,2,2,2h14c1.105,0,2-0.895,2-2V5C21,3.895,20.105,3,19,3z M16.466,9.71 c0.004,0.099,0.007,0.198,0.007,0.298c0,3.045-2.318,6.556-6.556,6.556c-1.301,0-2.512-0.381-3.532-1.035 c0.18,0.021,0.364,0.032,0.55,0.032c1.079,0,2.073-0.368,2.862-0.986c-1.008-0.019-1.859-0.685-2.152-1.6 c0.141,0.027,0.285,0.041,0.433,0.041c0.21,0,0.414-0.028,0.607-0.081c-1.054-0.212-1.848-1.143-1.848-2.259 c0-0.01,0-0.019,0-0.029c0.311,0.173,0.666,0.276,1.044,0.288c-0.618-0.413-1.025-1.118-1.025-1.918 c0-0.422,0.114-0.818,0.312-1.158c1.136,1.394,2.834,2.311,4.749,2.407c-0.039-0.169-0.06-0.344-0.06-0.525 c0-1.272,1.032-2.304,2.304-2.304c0.663,0,1.261,0.28,1.682,0.728c0.525-0.103,1.018-0.295,1.463-0.559 c-0.172,0.538-0.537,0.99-1.013,1.275c0.466-0.056,0.91-0.18,1.323-0.363C17.306,8.979,16.916,9.385,16.466,9.71z"}))},linkedin:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.linkedin,a)},React.createElement(r.Path,{d:"M19.7 3H4.3C3.582 3 3 3.582 3 4.3v15.4c0 .718.582 1.3 1.3 1.3h15.4c.718 0 1.3-.582 1.3-1.3V4.3c0-.718-.582-1.3-1.3-1.3zM8.34 18.338H5.666v-8.59H8.34v8.59zM7.003 8.574c-.857 0-1.55-.694-1.55-1.548 0-.855.692-1.548 1.55-1.548.854 0 1.547.694 1.547 1.548 0 .855-.692 1.548-1.546 1.548zm11.335 9.764h-2.67V14.16c0-.995-.017-2.277-1.387-2.277-1.39 0-1.6 1.086-1.6 2.206v4.248h-2.668v-8.59h2.56v1.174h.036c.357-.675 1.228-1.387 2.527-1.387 2.703 0 3.203 1.78 3.203 4.092v4.71z"}))},tumblr:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.tumblr,a)},React.createElement(r.Path,{d:"M19 3H5c-1.105 0-2 .895-2 2v14c0 1.105.895 2 2 2h14c1.105 0 2-.895 2-2V5c0-1.105-.895-2-2-2zm-5.57 14.265c-2.445.042-3.37-1.742-3.37-2.998V10.6H8.922V9.15c1.703-.615 2.113-2.15 2.21-3.026.006-.06.053-.084.08-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.13 1.08 1.107.3-.008.698-.094.907-.194l.54 1.6c-.205.297-1.12.642-1.946.657z"}))},google:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.google,a)},React.createElement(r.Path,{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05h-9.36z"}))},mastodon:e=>{let{fill:t,size:n,className:a}=e;return React.createElement(u,{fill:t,size:n,className:o()(l.Z.mastodon,a)},React.createElement(r.Path,{d:"M 19.997205,6.2868955 C 19.729197,4.3162778 17.992912,2.7633017 15.93468,2.4623753 15.587434,2.4115195 14.271759,2.2264681 11.224008,2.2264681 h -0.02277 c -3.0485688,0 -3.7026204,0.1850577 -4.0498676,0.2359072 C 5.1504449,2.7549655 3.3231548,4.1503966 2.879815,6.1443318 2.6665754,7.1263038 2.6438193,8.2149794 2.6834329,9.2136207 c 0.056471,1.4321143 0.067433,2.8617113 0.1989115,4.2879943 0.090908,0.947406 0.2494696,1.887266 0.4745239,2.812521 0.4214237,1.708868 2.1273496,3.130966 3.7987144,3.71116 1.7894479,0.605052 3.7138403,0.705478 5.5577463,0.290088 0.202828,-0.04667 0.403445,-0.100873 0.601781,-0.162549 0.447558,-0.140863 0.972662,-0.298434 1.358683,-0.575188 0.0052,-0.004 0.0097,-0.0089 0.01266,-0.01471 0.0031,-0.0056 0.0047,-0.01218 0.005,-0.01866 v -1.382076 c -9.4e-5,-0.006 -0.0016,-0.01202 -0.0043,-0.01754 -0.0027,-0.0054 -0.0067,-0.01028 -0.01155,-0.01392 -0.0049,-0.0038 -0.01044,-0.0063 -0.01648,-0.0078 -0.006,-0.0013 -0.01218,-0.0013 -0.01825,7.1e-5 -1.181368,0.279106 -2.391962,0.419012 -3.606552,0.416801 -2.0902554,0 -2.6524392,-0.981126 -2.8134375,-1.3896 -0.1293933,-0.353009 -0.2115739,-0.721231 -0.2444221,-1.095331 -3.29e-4,-0.0063 8.463e-4,-0.0125 0.00348,-0.01832 0.00253,-0.0056 0.00649,-0.01077 0.011389,-0.01471 0.0049,-0.004 0.010755,-0.0068 0.016957,-0.0081 0.00617,-0.0014 0.012655,-0.0012 0.018808,3.52e-4 1.1616831,0.277201 2.3525266,0.417106 3.5475526,0.416801 0.287408,0 0.573966,0 0.861395,-0.0074 1.201893,-0.03335 2.468685,-0.0942 3.6512,-0.322606 0.02952,-0.0058 0.059,-0.01091 0.0843,-0.01833 1.865209,-0.354279 3.640245,-1.466278 3.820617,-4.282163 0.0068,-0.110869 0.0236,-1.161191 0.0236,-1.276219 8.46e-4,-0.390958 0.127273,-2.7733487 -0.01856,-4.2371335 z m -2.87074,7.0263315 H 15.165179 V 8.5617567 c 0,-1.0003116 -0.421434,-1.5104614 -1.278618,-1.5104614 -0.942305,0 -1.414292,0.6035217 -1.414292,1.7955379 V 11.44764 H 10.522764 V 8.8468332 c 0,-1.1920162 -0.472832,-1.7955379 -1.4151372,-1.7955379 -0.8521293,0 -1.2777701,0.5101498 -1.2786179,1.5104614 V 13.313227 H 5.8693944 V 8.4175496 c 0,-1.0003133 0.2582014,-1.7949986 0.7745804,-2.3840846 0.5326766,-0.587672 1.2314038,-0.8894211 2.0986981,-0.8894211 1.003817,0 1.7623841,0.3817657 2.2680911,1.1445204 l 0.488023,0.8102521 0.488846,-0.8102521 c 0.505705,-0.7627547 1.264275,-1.1445204 2.26642,-1.1445204 0.866449,0 1.565152,0.3017491 2.099521,0.8894211 0.516404,0.5885211 0.774583,1.3832066 0.774583,2.3840846 z"}))}}};function m(e){return p[e]?p[e]:null}},8237:function(e,t,n){"use strict";var a=n(2674),c=n.n(a),r=n(5736),i=n(5235),o=n.n(i),l=n(9196),s=n.n(l),u=n(7525),p=(n(9054),n(8868));const __=r.__;t.Z=e=>{let{a8cLogoHref:t="https://automattic.com",moduleName:n=__("Jetpack","jetpack-protect"),className:a,moduleNameHref:r="https://jetpack.com",...i}=e;return s().createElement("div",c()({className:o()("jp-dashboard-footer",a)},i),s().createElement("div",{className:"jp-dashboard-footer__footer-left"},s().createElement(p.Z,{logoColor:"#000",showText:!1,height:16,className:"jp-dashboard-footer__jetpack-symbol","aria-label":__("Jetpack logo","jetpack-protect")}),s().createElement("span",{className:"jp-dashboard-footer__module-name"},r?s().createElement("a",{href:r,"aria-label":n},n):n)),s().createElement("div",{className:"jp-dashboard-footer__footer-right"},s().createElement("a",{href:t,"aria-label":__("An Automattic Airline","jetpack-protect")},s().createElement(u.Z,null))))}},8868:function(e,t,n){"use strict";var a=n(2674),c=n.n(a),r=n(5736),i=n(5235),o=n.n(i),l=n(9196),s=n.n(l);const __=r.__;t.Z=e=>{let{logoColor:t="#069e08",showText:n=!0,className:a,height:r=32,...i}=e;const l=n?"0 0 118 32":"0 0 32 32";return s().createElement("svg",c()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:l,className:o()("jetpack-logo",a),"aria-labelledby":"jetpack-logo-title",height:r},i),s().createElement("desc",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-protect")),s().createElement("path",{fill:t,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),n&&s().createElement(s().Fragment,null,s().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),s().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),s().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),s().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),s().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),s().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),s().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},3846:function(e,t,n){"use strict";var a=n(5235),c=n.n(a),r=n(3080);const i=Number(r.Z.smCols),o=Number(r.Z.mdCols),l=Number(r.Z.lgCols);t.Z=e=>{const{children:t,className:n}=e,a=Math.min(i,"number"==typeof e.sm?e.sm:i),s=Math.min(i,"object"==typeof e.sm?e.sm.start:0),u=Math.min(i,"object"==typeof e.sm?e.sm.end:0),p=Math.min(o,"number"==typeof e.md?e.md:o),m=Math.min(o,"object"==typeof e.md?e.md.start:0),d=Math.min(o,"object"==typeof e.md?e.md.end:0),h=Math.min(l,"number"==typeof e.lg?e.lg:l),g=Math.min(l,"object"==typeof e.lg?e.lg.start:0),f=Math.min(l,"object"==typeof e.lg?e.lg.end:0),v=c()(n,{[r.Z[`col-sm-${a}`]]:!(s&&u),[r.Z[`col-sm-${s}-start`]]:s>0,[r.Z[`col-sm-${u}-end`]]:u>0,[r.Z[`col-md-${p}`]]:!(m&&d),[r.Z[`col-md-${m}-start`]]:m>0,[r.Z[`col-md-${d}-end`]]:d>0,[r.Z[`col-lg-${h}`]]:!(g&&f),[r.Z[`col-lg-${g}-start`]]:g>0,[r.Z[`col-lg-${f}-end`]]:f>0});return React.createElement("div",{className:v},t)}},3363:function(e,t,n){"use strict";var a=n(5235),c=n.n(a),r=n(9196),i=n(8730);t.Z=e=>{let{children:t,fluid:n=!1,className:a,horizontalGap:o=1,horizontalSpacing:l=1}=e;const s=(0,r.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${l} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${o} )`}}),[o,l]),u=c()(a,i.Z.container,{[i.Z.fluid]:n});return React.createElement("div",{className:u,style:s},t)}},2054:function(e,t,n){"use strict";var a=n(4333),c=n(3247);const r=["sm","md","lg"];t.Z=(e,t)=>{const n=Array.isArray(e)?e:[e],i=Array.isArray(t)?t:[t],[o,l,s]=r,u={sm:(0,a.useMediaQuery)(c.Z[o]),md:(0,a.useMediaQuery)(c.Z[l]),lg:(0,a.useMediaQuery)(c.Z[s])};return n.map(((e,t)=>{const n=i[t];return n?((e,t,n)=>{const a=r.indexOf(e),c=a+1,i=t.includes("=");let o=[];return t.startsWith("<")&&(o=r.slice(0,i?c:a)),t.startsWith(">")&&(o=r.slice(i?a:c)),o?.length?o.some((e=>n[e])):n[e]})(e,n,u):u[e]}))}},1342:function(e,t,n){"use strict";var a=n(797),c=n(496),r=n(9201),i=n(1074),o=n(9517),l=n(5235),s=n.n(l),u=n(9196),p=n.n(u),m=n(7703);const d=e=>{switch(e){case"error":case"warning":default:return a.Z;case"info":return c.Z;case"success":return r.Z}},h=e=>{let{level:t,title:n,children:a,actions:c,hideCloseButton:r,onClose:l}=e;const u=s()(m.Z.container,m.Z[`is-${t}`]);return p().createElement("div",{className:u},p().createElement("div",{className:m.Z["icon-wrapper"]},p().createElement(i.Z,{icon:d(t),className:m.Z.icon})),p().createElement("div",{className:m.Z["main-content"]},p().createElement("div",{className:m.Z.title},n),a,c&&c.length>0&&p().createElement("div",{className:m.Z["action-bar"]},c.map(((e,t)=>p().createElement("div",{key:t,className:m.Z.action},e))))),!r&&p().createElement("button",{"aria-label":"close",className:m.Z["close-button"],onClick:l},p().createElement(i.Z,{icon:o.Z})))};h.defaultProps={level:"info",hideCloseButton:!1},t.Z=h},9608:function(e,t,n){"use strict";n.d(t,{NE:function(){return y},kF:function(){return k},oK:function(){return Z}});var a=n(5736),c=n(1074),r=n(9201),i=n(6163),o=n(5235),l=n.n(o),s=n(9196),u=n.n(s),p=n(9665),m=n(2054),d=n(7325),h=n(5106),g=n(9929);const __=a.__,f=__("Included","jetpack-protect"),v=__("Not included","jetpack-protect"),E=__("Coming soon","jetpack-protect"),b=(0,s.createContext)(void 0),k=e=>{let{isIncluded:t=!1,isComingSoon:n=!1,index:o=0,label:d=null,tooltipInfo:k,tooltipTitle:y,tooltipClassName:Z=""}=e;const[C]=(0,m.Z)("lg"),_=(0,s.useContext)(b)[o],w=n||t,R=_.name,j=_.tooltipInfo,N=_.tooltipTitle,S=k||!C&&j,P=((e,t,n)=>e?{lg:E, +// translators: Name of the current feature +default:(0,a.sprintf)(__("%s coming soon","jetpack-protect"),n)}:{lg:t?f:v,default:t?n:(0,a.sprintf)(/* translators: Name of the current feature */ +__("%s not included","jetpack-protect"),n)})(n,t,R),x=C?P.lg:P.default;return u().createElement("div",{className:l()(g.Z.item,g.Z.value)},u().createElement(c.Z,{className:l()(g.Z.icon,w?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:w?r.Z:i.Z}),u().createElement(h.ZP,{variant:"body-small"},d||x),S&&u().createElement(p.Z,{title:y||N,iconClassName:g.Z["popover-icon"],className:l()(g.Z.popover,Z),placement:"bottom-end",iconSize:14,offset:4},u().createElement(h.ZP,{variant:"body-small"},k||j)))},y=e=>{let{children:t}=e;return u().createElement("div",{className:g.Z.header},t)},Z=e=>{let{primary:t=!1,children:n}=e,a=0;return u().createElement("div",{className:l()(g.Z.card,{[g.Z["is-primary"]]:t})},s.Children.map(n,(e=>{const t=e;return t.type===k?(a++,(0,s.cloneElement)(t,{index:a-1})):t})))};t.ZP=e=>{let{title:t,items:n,children:a,showIntroOfferDisclaimer:c=!1}=e;const[r]=(0,m.Z)("lg");return u().createElement(b.Provider,{value:n},u().createElement("div",{className:l()(g.Z.container,{[g.Z["is-viewport-large"]]:r}),style:{"--rows":n.length+1,"--columns":s.Children.toArray(a).length+1}},u().createElement("div",{className:g.Z.table},u().createElement(h.ZP,{variant:"headline-small"},t),r&&n.map(((e,t)=>u().createElement("div",{className:l()(g.Z.item,{[g.Z["last-feature"]]:t===n.length-1}),key:t},u().createElement(h.ZP,{variant:"body-small"},u().createElement("strong",null,e.name)),e.tooltipInfo&&u().createElement(p.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:"bottom-end",iconSize:14,offset:4},u().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),a)),u().createElement("div",{className:g.Z["tos-container"]},u().createElement("div",{className:g.Z.tos},c&&u().createElement(h.ZP,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-protect")),u().createElement(d.Z,{multipleButtons:!0}))))}},5347:function(e,t,n){"use strict";var a=n(5736),c=n(5235),r=n.n(c),i=n(5106),o=n(3789),l=n(9184);const __=a.__;t.Z=e=>{let{price:t,offPrice:n,currency:a="",showNotOffPrice:c=!0,hideDiscountLabel:s=!0,promoLabel:u="",legend:p=__("/month, paid yearly","jetpack-protect"),isNotConvenientPrice:m=!1,hidePriceFraction:d=!1,children:h}=e;if(null==t&&null==n||!a)return null;c=c&&null!=n;const g="number"==typeof t&&"number"==typeof n?Math.floor((t-n)/t*100):0,f=!s&&g&&g>0?g+__("% off","jetpack-protect"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:l.Z.container},React.createElement("div",{className:r()(l.Z["price-container"],"product-price_container")},React.createElement(o.t,{value:n??t,currency:a,isOff:!m,hidePriceFraction:d}),c&&React.createElement(o.t,{value:t,currency:a,isOff:!1,hidePriceFraction:d}))),React.createElement("div",{className:l.Z.footer},h||React.createElement(i.ZP,{className:r()(l.Z.legend,"product-price_legend")},p),u&&React.createElement(i.ZP,{className:r()(l.Z["promo-label"],"product-price_promo_label")},u),f&&React.createElement(i.ZP,{className:r()(l.Z["promo-label"],"product-price_promo_label")},f)))}},3789:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var a=n(8899),c=n(5235),r=n.n(c),i=n(5106),o=n(9184);const l=e=>{let{value:t,currency:n,isOff:c,hidePriceFraction:l}=e;const s=r()(o.Z.price,"product-price_price",{[o.Z["is-not-off-price"]]:!c}),{symbol:u,integer:p,fraction:m}=(0,a.LR)(t,n),d=!l||!m.endsWith("00");return React.createElement(i.ZP,{className:s,variant:"headline-medium",component:"p"},React.createElement(i.ZP,{className:o.Z.symbol,component:"sup",variant:"title-medium"},u),p,d&&React.createElement(i.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,m)))}},5033:function(e,t,n){"use strict";var a=n(5162),c=n.n(a),r=n(9196),i=n.n(r);n(1683);const o=e=>{const t=e.className+" jp-components-spinner",n={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},a={borderTopColor:e.color,borderRightColor:e.color};return i().createElement("div",{className:t},i().createElement("div",{className:"jp-components-spinner__outer",style:n},i().createElement("div",{className:"jp-components-spinner__inner",style:a})))};o.propTypes={color:c().string,className:c().string,size:c().number},o.defaultProps={color:"#FFFFFF",className:"",size:20},t.Z=o},7325:function(e,t,n){"use strict";var a=n(9307),c=n(5736),r=n(5235),i=n.n(r),o=n(6895),l=n(5106);n(7920);const __=c.__,s=()=>(0,a.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to share details with WordPress.com.","jetpack-protect"),{tosLink:React.createElement(p,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(p,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),u=e=>{let{agreeButtonLabel:t}=e;return(0,a.createInterpolateElement)((0,c.sprintf)(/* translators: %s is a button label */ +__("By clicking the %s button, you agree to our Terms of Service and to share details with WordPress.com.","jetpack-protect"),t),{strong:React.createElement("strong",null),tosLink:React.createElement(p,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(p,{slug:"jetpack-support-what-data-does-jetpack-sync"})})},p=e=>{let{slug:t,children:n}=e;return React.createElement("a",{className:"terms-of-service__link",href:(0,o.Z)(t),rel:"noopener noreferrer",target:"_blank"},n)};t.Z=e=>{let{className:t,multipleButtons:n,agreeButtonLabel:a}=e;return React.createElement(l.ZP,{className:i()(t,"terms-of-service")},n?React.createElement(s,null):React.createElement(u,{agreeButtonLabel:a}))}},6017:function(e,t,n){"use strict";n.d(t,{h:function(){return a},s:function(){return c}});const a={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},c=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},5106:function(e,t,n){"use strict";n.d(t,{Dx:function(){return d},H3:function(){return m}});var a=n(2674),c=n.n(a),r=n(5235),i=n.n(r),o=n(9196),l=n.n(o),s=n(6017),u=n(3280);const p=(0,o.forwardRef)(((e,t)=>{let{variant:n="body",children:a,component:r,className:p,...m}=e;const d=r||s.h[n]||"span",h=(0,o.useMemo)((()=>s.s.reduce(((e,t)=>(void 0!==m[t]&&(e+=u.Z[`${t}-${m[t]}`]+" ",delete m[t]),e)),"")),[m]);return m.ref=t,l().createElement(d,c()({className:i()(u.Z.reset,u.Z[n],p,h)},m),a)}));t.ZP=p;const m=e=>{let{children:t,weight:n="bold",...a}=e;const r="headline-small"+("bold"===n?"":`-${n}`);return l().createElement(p,c()({variant:r,mb:3},a),t)},d=e=>{let{children:t,size:n="medium",...a}=e;return l().createElement(p,c()({variant:`title-${n}`,mb:1},a),t)}},8275:function(e,t,n){"use strict";var a=n(9196),c=n.n(a),r=n(3591);const i={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},o={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},l={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},s={"--spacing-base":"8px"},u={},p=(e,t,n)=>{const a={...i,...o,...l,...s};for(const t in a)e.style.setProperty(t,a[t]);n&&e.classList.add(r.Z.global),t&&(u[t]={provided:!0,root:e})};t.ZP=e=>{let{children:t=null,targetDom:n,id:r,withGlobalStyles:i=!0}=e;const o=(0,a.useRef)(),l=u?.[r]?.provided;return(0,a.useLayoutEffect)((()=>{if(!l)return n?p(n,r,i):void(o?.current&&p(o.current,r,i))}),[n,o,l,r,i]),n?t:c().createElement("div",{ref:o},t)}},4153:function(e,t,n){"use strict";function a(e,t,n,a){const c=new URL("https://wordpress.com/checkout/"),r=new URL(`${c}${t}/${e}`);return r.searchParams.set("redirect_to",n),a||r.searchParams.set("unlinked","1"),r.searchParams.set("site",t),r.toString()}n.d(t,{Z:function(){return a}})},6895:function(e,t,n){"use strict";function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};let a;if("undefined"!=typeof window&&(a=window.Initial_State?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,n.url=encodeURIComponent(e)}else n.source=encodeURIComponent(e);Object.keys(t).map((e=>{n[e]=encodeURIComponent(t[e])})),!Object.keys(n).includes("site")&&"undefined"!=typeof jetpack_redirects&&jetpack_redirects.hasOwnProperty("currentSiteRawUrl")&&(n.site=jetpack_redirects.currentSiteRawUrl),a&&(n.calypso_env=a);return"https://jetpack.com/redirect/?"+Object.keys(n).map((e=>e+"="+n[e])).join("&")}n.d(t,{Z:function(){return a}})},1132:function(e,t,n){let a={};try{a=n(6436)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),a={missingConfig:!0}}const c=e=>a.hasOwnProperty(e);e.exports={jetpackConfigHas:c,jetpackConfigGet:e=>{if(!c(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return a[e]}}},6186:function(e,t,n){"use strict";var a=n(2054),c=n(5033),r=n(5609),i=n(5736),o=n(5162),l=n.n(o),s=n(9196),u=n.n(s),p=n(9836);const __=i.__,m=e=>{const{message:t,isRestoringConnection:n,restoreConnectionCallback:o,restoreConnectionError:l}=e,[s]=(0,a.Z)(["md"],[">"]),m=p.Z.notice+(s?" "+p.Z["bigger-than-medium"]:""),d=u().createElement(r.Icon,{icon:u().createElement(r.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u().createElement(r.Path,{d:"M11.7815 4.93772C11.8767 4.76626 12.1233 4.76626 12.2185 4.93772L20.519 19.8786C20.6116 20.0452 20.4911 20.25 20.3005 20.25H3.69951C3.50889 20.25 3.3884 20.0452 3.48098 19.8786L11.7815 4.93772Z",stroke:"#D63638",strokeWidth:"1.5"}),u().createElement(r.Path,{d:"M13 10H11V15H13V10Z",fill:"#D63638"}),u().createElement(r.Path,{d:"M13 16H11V18H13V16Z",fill:"#D63638"}))});if(!t)return null;if(n)return u().createElement(r.Notice,{status:"error",isDismissible:!1,className:m},u().createElement("div",{className:p.Z.message},u().createElement(c.Z,{color:"#B32D2E",size:24}),__("Reconnecting Jetpack","jetpack-protect")));const h=l?u().createElement(r.Notice,{status:"error",isDismissible:!1,className:m+" "+p.Z.error},u().createElement("div",{className:p.Z.message},d,(0,i.sprintf)(/* translators: placeholder is the error. */ +__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),l))):null;return u().createElement(u().Fragment,null,h,u().createElement(r.Notice,{status:"error",isDismissible:!1,className:m},u().createElement("div",{className:p.Z.message},d,t),o&&u().createElement("a",{onClick:o,onKeyDown:o,className:p.Z.button,href:"#"},__("Restore Connection","jetpack-protect"))))};m.propTypes={message:l().string.isRequired,restoreConnectionCallback:l().func,isRestoringConnection:l().bool,restoreConnectionError:l().string},t.Z=m},1294:function(e,t,n){"use strict";var a=n(4743),c=n(9818),r=n(9196),i=n(428);const o=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};t.Z=function(){let{registrationNonce:e=o.registrationNonce,apiRoot:t=o.apiRoot,apiNonce:n=o.apiNonce,redirectUri:l,autoTrigger:s,from:u,skipUserConnection:p}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:m,connectUser:d,refreshConnectedPlugins:h}=(0,c.useDispatch)(i.t),g=(0,c.useSelect)((e=>e(i.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:b,connectionErrors:k,isRegistered:y,isUserConnected:Z,hasConnectedOwner:C}=(0,c.useSelect)((e=>({siteIsRegistering:e(i.t).getSiteIsRegistering(),userIsConnecting:e(i.t).getUserIsConnecting(),userConnectionData:e(i.t).getUserConnectionData(),connectedPlugins:e(i.t).getConnectedPlugins(),connectionErrors:e(i.t).getConnectionErrors(),...e(i.t).getConnectionStatus()}))),_=()=>p?l?(window.location=l,Promise.resolve(l)):Promise.resolve():d({from:u,redirectUri:l}),w=t=>(t&&t.preventDefault(),y?_():m({registrationNonce:e,redirectUri:l}).then((()=>_())));return(0,r.useEffect)((()=>{a.ZP.setApiRoot(t),a.ZP.setApiNonce(n)}),[t,n]),(0,r.useEffect)((()=>{!s||f||v||w()}),[]),{handleRegisterSite:w,handleConnectUser:_,refreshConnectedPlugins:h,isRegistered:y,isUserConnected:Z,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:C,connectedPlugins:b,connectionErrors:k}}},3329:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},h:function(){return o}});var a=n(6186),c=n(1294),r=n(1045);function i(){const{connectionErrors:e}=(0,c.Z)({}),t=Object.values(e).shift(),n=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(n),connectionErrorMessage:n}}const o=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=i(),{restoreConnection:n,isRestoringConnection:c,restoreConnectionError:o}=(0,r.Z)();return e?React.createElement(a.Z,{isRestoringConnection:c,restoreConnectionError:o,restoreConnectionCallback:n,message:t}):null}},8258:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var a=n(4743),c=n(4153),r=n(9818),i=n(951),o=n.n(i),l=n(9196),s=n(1294),u=n(428);const p=o()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:m,apiRoot:d,apiNonce:h,siteSuffix:g}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function f(){let{productSlug:e,redirectUrl:t,siteSuffix:n=g,siteProductAvailabilityHandler:i=null,from:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p("productSlug is %s",e),p("redirectUrl is %s",t),p("siteSuffix is %s",n),p("from is %s",o);const[f,v]=(0,l.useState)(!1),{registerSite:E}=(0,r.useDispatch)(u.t),{isUserConnected:b,isRegistered:k,handleConnectUser:y}=(0,s.Z)({redirectUri:t,from:o}),Z=(0,c.Z)(e,n,t,b);p("checkoutProductUrl is %s",Z),p("isUserConnected is %s",b);const C=()=>Promise.resolve(i&&i()).then((e=>{if(e)return p("handleAfterRegistration: Site has a product associated"),y();p("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",Z),window.location.href=Z}));return(0,l.useEffect)((()=>{a.ZP.setApiRoot(d),a.ZP.setApiNonce(h)}),[]),{run:e=>{if(e&&e.preventDefault(),v(!0),k)return C();E({registrationNonce:m,redirectUri:t}).then(C)},isRegistered:k,hasCheckoutStarted:f}}},1045:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(4743),c=n(9818),r=n(9196),i=n(428);const{apiRoot:o,apiNonce:l}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function s(){const[e,t]=(0,r.useState)(!1),[n,s]=(0,r.useState)(null),{disconnectUserSuccess:u}=(0,c.useDispatch)(i.t),p="/wp-admin/admin.php?page=my-jetpack#/connection";return(0,r.useEffect)((()=>{a.ZP.setApiRoot(o),a.ZP.setApiNonce(l)}),[]),{restoreConnection:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t(!0),s(null),a.ZP.reconnect().then((t=>("in_progress"===t.status?(u(),e&&(window.location.href=p)):window.location.reload(),t))).catch((e=>{throw s(e),t(!1),e}))},isRestoringConnection:e,restoreConnectionError:n}}},7523:function(e,t,n){"use strict";n.d(t,{LI:function(){return r},N4:function(){return o},Qo:function(){return d},T1:function(){return s},TS:function(){return p},ZP:function(){return C},b5:function(){return g},i6:function(){return c},qV:function(){return l},r7:function(){return i},wQ:function(){return h}});var a=n(4743);const c="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",i="SET_SITE_IS_REGISTERING",o="SET_USER_IS_CONNECTING",l="SET_REGISTRATION_ERROR",s="CLEAR_REGISTRATION_ERROR",u="REGISTER_SITE",p="SET_AUTHORIZATION_URL",m="CONNECT_USER",d="DISCONNECT_USER_SUCCESS",h="SET_CONNECTED_PLUGINS",g="SET_CONNECTION_ERRORS",f=e=>({type:c,connectionStatus:e}),v=e=>({type:i,isRegistering:e}),E=e=>({type:o,isConnecting:e}),b=e=>({type:l,registrationError:e}),k=()=>({type:s}),y=e=>({type:p,authorizationUrl:e}),Z=e=>({type:h,connectedPlugins:e});const C={setConnectionStatus:f,setConnectionStatusIsFetching:e=>({type:r,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:v,setUserIsConnecting:E,setRegistrationError:b,clearRegistrationError:k,setAuthorizationUrl:y,registerSite:function(e){let{registrationNonce:t,redirectUri:n}=e;return function*(){yield k(),yield v(!0);try{const e=yield{type:u,registrationNonce:t,redirectUri:n};return yield f({isRegistered:!0}),yield y(e.authorizeUrl),yield v(!1),Promise.resolve(e)}catch(e){return yield b(e),yield v(!1),Promise.reject(e)}}()},connectUser:function(){let{from:e,redirectFunc:t,redirectUri:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){yield E(!0),yield{type:m,from:e,redirectFunc:t,redirectUri:n}}()},disconnectUserSuccess:()=>({type:d}),setConnectedPlugins:Z,refreshConnectedPlugins:()=>async e=>{let{dispatch:t}=e;return await new Promise((e=>a.ZP.fetchConnectedPlugins().then((n=>{t(Z(n)),e(n)}))))},setConnectionErrors:e=>({type:g,connectionErrors:e})}},1432:function(e,t,n){"use strict";var a=n(4743),c=n(9818),r=n(7057);const i=(0,c.createRegistryControl)((e=>{let{resolveSelect:t}=e;return function(){let{from:e,redirectFunc:n,redirectUri:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((c,i)=>{t(r.Z).getAuthorizationUrl(a).then((t=>{const a=n||(e=>window.location.assign(e)),r=new URL(t);e&&r.searchParams.set("from",encodeURIComponent(e));const i=r.toString();a(i),c(i)})).catch((e=>{i(e)}))}))}}));t.Z={FETCH_AUTHORIZATION_URL:e=>{let{redirectUri:t}=e;return a.ZP.fetchAuthorizationUrl(t)},REGISTER_SITE:e=>{let{registrationNonce:t,redirectUri:n}=e;return a.ZP.registerSite(t,n)},CONNECT_USER:i}},1479:function(e,t,n){"use strict";var a=n(9818),c=n(7523);const r=(0,a.combineReducers)({connectionStatus:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case c.i6:return{...e,...t.connectionStatus};case c.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.LI?t.isFetching:e},siteIsRegistering:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.r7?t.isRegistering:e},userIsConnecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.N4?t.isConnecting:e},registrationError:(e,t)=>{switch(t.type){case c.T1:return!1;case c.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===c.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.wQ?t.connectedPlugins:e},connectionErrors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.b5?t.connectionErrors:e}});t.Z=r},7728:function(e,t,n){"use strict";var a=n(9818),c=n(7523),r=n(7057);const i={getAuthorizationUrl:{isFulfilled:function(e){const t=Boolean(e.authorizationUrl);for(var n=arguments.length,c=new Array(n>1?n-1:0),i=1;ie.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}};t.Z=n},3535:function(e,t,n){"use strict";var a=n(17),c=n.n(a),r=n(9818);class i{static mayBeInit(e,t){null===i.store&&(i.store=(0,r.createReduxStore)(e,t),(0,r.register)(i.store))}}c()(i,"store",null),t.Z=i},7057:function(e,t){"use strict";t.Z="jetpack-connection"},428:function(e,t,n){"use strict";n.d(t,{t:function(){return s.Z}});var a=n(7523),c=n(1432),r=n(1479),i=n(7728),o=n(2725),l=n(3535),s=n(7057);const u=window.JP_CONNECTION_INITIAL_STATE;u||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),l.Z.mayBeInit(s.Z,{__experimentalUseThunks:!0,reducer:r.Z,actions:a.ZP,selectors:o.Z,resolvers:i.Z,controls:c.Z,initialState:u||{}})},1827:function(e,t,n){"use strict";var a=n(6989),c=n.n(a),r=n(4769),i=n.n(r);const o={fetchWaf:()=>c()({path:"jetpack-protect/v1/waf",method:"GET"}).then(i()),toggleWaf:()=>c()({method:"POST",path:"jetpack-protect/v1/toggle-waf"}),updateWaf:e=>c()({method:"POST",path:"jetpack/v4/waf",data:e}),wafSeen:()=>c()({path:"jetpack-protect/v1/waf-seen",method:"POST"}),wafUpgradeSeen:()=>c()({path:"jetpack-protect/v1/waf-upgrade-seen",method:"POST"})};t.Z=o},7267:function(e,t,n){"use strict";var a=n(9105),c=n(3363),r=n(8258),i=n(6989),o=n.n(i),l=n(9818),s=n(5736),u=n(6483),p=n(9196),m=n.n(p),d=n(3898),h=n(8963),g=n(4633),f=n(6402),v=n(8266),E=n(3324),b=n(3900),k=n(2770);const __=s.__;t.Z=e=>{let{children:t}=e;(0,k.Z)();const{isSupported:n,isSeen:i}=(0,h.Z)(),{refreshPlan:s,startScanOptimistically:y,refreshStatus:Z}=(0,l.useDispatch)(g.t),{adminUrl:C}=window.jetpackProtectInitialState||{},{run:_,isRegistered:w,hasCheckoutStarted:R}=(0,r.Z)({productSlug:d.o,redirectUrl:(0,u.addQueryArgs)(C,{checkPlan:!0}),siteProductAvailabilityHandler:async()=>o()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>e))});return(0,p.useEffect)((()=>{(0,u.getQueryArg)(window.location.search,"checkPlan")&&(y(),setTimeout((()=>{s(),Z(!0)}),5e3))}),[s,Z,y]),!w||R?m().createElement(f.Z,{onScanAdd:_}):m().createElement(a.Z,{moduleName:__("Jetpack Protect","jetpack-protect"),header:m().createElement(v.Z,null)},m().createElement(c.Z,{horizontalSpacing:0},m().createElement(E.Z,{className:b.Z.navigation},m().createElement(E.O,{link:"/",label:__("Scan","jetpack-protect")}),n&&m().createElement(E.O,{link:"/firewall",label:m().createElement(m().Fragment,null,__("Firewall","jetpack-protect"),!1===i&&m().createElement("span",{className:b.Z.badge},__("New","jetpack-protect")))}))),t)}},2770:function(e,t,n){"use strict";var a=n(1294),c=n(9818),r=n(9196),i=n(4633);t.Z=()=>{const{isRegistered:e}=(0,a.Z)(),{refreshStatus:t}=(0,c.useDispatch)(i.t),n=(0,c.useSelect)((e=>e(i.t).getStatus()));(0,r.useEffect)((()=>{e&&!n.status&&t()}),[e])}},4948:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var a=n(5609),c=n(9196),r=n.n(c),i=n(9993);function o(e){let{className:t,color:n="#D63638"}=e;return r().createElement("div",{className:i.Z.container},r().createElement(a.SVG,{className:t,width:"127",height:"136",viewBox:"0 0 127 136",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r().createElement(a.G,{filter:"url(#filter0_d_2716_19567)"},r().createElement(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M63.4061 36L86.8123 46.4057V61.9177C86.8123 75.141 78.1289 87.6611 65.8844 91.6107C64.2754 92.1298 62.5369 92.1297 60.9279 91.6107C48.6834 87.6611 40 75.141 40 61.9177V46.4057L63.4061 36Z",fill:n}),r().createElement(a.Rect,{x:"59.8953",y:"72.1666",width:"7.02184",height:"7",rx:"3.5",fill:"white"}),r().createElement(a.Path,{d:"M59.9619 51.0626C59.9258 50.4868 60.383 50 60.9599 50H65.8524C66.4293 50 66.8866 50.4868 66.8505 51.0626L65.8056 67.7292C65.7725 68.2562 65.3355 68.6667 64.8075 68.6667H62.0048C61.4769 68.6667 61.0398 68.2562 61.0068 67.7292L59.9619 51.0626Z",fill:"white"})),r().createElement("defs",null,r().createElement("filter",{id:"filter0_d_2716_19567",x:"0",y:"0",width:"126.812",height:"136",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},r().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),r().createElement("feOffset",{dy:"4"}),r().createElement("feGaussianBlur",{stdDeviation:"20"}),r().createElement("feComposite",{in2:"hardAlpha",operator:"out"}),r().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),r().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2716_19567"}),r().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2716_19567",result:"shape"})))))}},9974:function(e,t,n){"use strict";var a=n(5033),c=n(9818),r=n(5736),i=n(4633),o=n(9886),l=n(4424);const __=r.__;t.Z=e=>{let{children:t}=e;const{checkCredentials:n}=(0,c.useDispatch)(i.t),{credentials:r,credentialsIsFetching:s}=(0,c.useSelect)((e=>({credentials:e(i.t).getCredentials(),credentialsIsFetching:e(i.t).getCredentialsIsFetching()})));return r||s||n(),r?0===r.length?React.createElement(o.Z,null):t:React.createElement("div",{className:l.Z.loading},React.createElement(a.Z,{color:"black",style:{color:"black",marginTop:0,marginLeft:0}}),React.createElement("p",{className:l.Z.loading__message},__("Checking credentials…","jetpack-protect")))}},9886:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(6895),i=n(9818),o=n(5736),l=n(9196),s=n(4633),u=n(291),p=n(3064);const __=o.__;t.Z=()=>{const{setModal:e}=(0,i.useDispatch)(s.t),{siteSuffix:t}=window.jetpackProtectInitialState,{checkCredentials:n}=(0,i.useDispatch)(s.t),o=(0,i.useSelect)((e=>e(s.t).getCredentials()));return(0,l.useEffect)((()=>{const e=setInterval((()=>{o&&0!==o.length||n()}),3e3);return()=>clearInterval(e)}),[n,o]),React.createElement(React.Fragment,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("Site credentials needed","jetpack-protect")),React.createElement(u.Z,{type:"info",message:__("Before Jetpack Protect can auto-fix threats on your site, it needs your server credentials.","jetpack-protect")}),React.createElement(a.ZP,{mb:3},__("Your server credentials allow Jetpack Protect to access the server that’s powering your website. This information is securely saved and only used to perform fix threats detected on your site.","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Once you’ve entered server credentials, Jetpack Protect will be fixing the selected threats.","jetpack-protect")),React.createElement("div",{className:p.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(c.Z,{isExternalLink:!0,weight:"regular",href:(0,r.Z)("jetpack-settings-security-credentials",{site:t})},__("Enter server credentials","jetpack-protect"))))}},7127:function(e,t,n){"use strict";var a=n(7470),c=n(9196),r=n(9137);const i=e=>{const t=e.lastIndexOf("/");return t>-1?[e.slice(0,t),e.slice(t)]:["",e]};t.C=e=>{let{diff:t}=e;return React.createElement("div",{className:r.Z["diff-viewer"]},(0,a.G)(t).map(((e,t)=>React.createElement(c.Fragment,{key:t},React.createElement("div",{key:`file-${t}`,className:r.Z["diff-viewer__filename"]},(e=>{let{oldFileName:t,newFileName:n}=e;const a="a"===t[0]&&"/"===t[1]&&"b"===n[0]&&"/"===n[1],[o,l]=a?[t.slice(2),n.slice(2)]:[t,n];if(o===l){const[e,t]=i(o);return React.createElement(c.Fragment,null,e&&React.createElement("span",{className:r.Z["diff-viewer__path-prefix"]},e),React.createElement("span",{className:r.Z["diff-viewer__path"]},t))}const s=Math.max(o.length,l.length);for(let e=0,t=0;e{let n=0;return e.lines.map(((a,c)=>React.createElement("div",{key:`${t}-${c}`},"+"===a[0]?" ":e.oldStart+n++)))}))),React.createElement("div",{key:"right-numbers",className:r.Z["diff-viewer__line-numbers"]},e.hunks.map(((e,t)=>{let n=0;return e.lines.map(((a,c)=>React.createElement("div",{key:`${t}-${c}`},"-"===a[0]?" ":e.newStart+n++)))}))),React.createElement("div",{className:r.Z["diff-viewer__lines"]},e.hunks.map(((e,t)=>e.lines.map(((e,n)=>{const a=e.slice(1).replace(/^\s*$/," "),c=`${t}-${n}`;switch(e[0]){case" ":return React.createElement("div",{key:c},a);case"-":return React.createElement("del",{key:c},a);case"+":return React.createElement("ins",{key:c},a)}}))))))))))}},8431:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(216),i=n(5609),o=n(9818),l=n(9307),s=n(5736),u=n(9196),p=n(3898),m=n(8963),d=n(4633),h=n(9909),g=n(3932);const __=s.__,f=()=>{const{setModal:e}=(0,o.useDispatch)(d.t);return React.createElement("div",{className:g.Z["standalone-mode-section"]},React.createElement(a.Dx,null,__("Standalone mode","jetpack-protect")),React.createElement(a.ZP,{mb:2},__("Learn how you can execute the firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement(c.Z,{variant:"link",isExternalLink:!0,weight:"regular",onClick:t=>{t.preventDefault(),e({type:"STANDALONE_MODE"})}},__("Learn more","jetpack-protect")))},v=()=>{const{config:e,isUpdating:t,toggleShareData:n}=(0,m.Z)(),{jetpackWafShareData:c}=e||{},{setNotice:r}=(0,o.useDispatch)(d.t),[s,h]=(0,u.useState)({jetpack_waf_share_data:c}),f=(0,u.useCallback)((()=>{h({...s,jetpack_waf_share_data:!s.jetpack_waf_share_data}),n().then((()=>r({type:"success",duration:5e3,dismissable:!0,message:__("Changes saved.","jetpack-protect")}))).catch((()=>{r({type:"error",dismissable:!0,message:(0,l.createInterpolateElement)(__("An error ocurred. Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(i.ExternalLink,{href:p.K})})})}))}),[s,n,r]);return(0,u.useEffect)((()=>{h({jetpack_waf_share_data:c})}),[c]),React.createElement("div",{className:g.Z["share-data-section"]},React.createElement(a.Dx,{mb:2},__(" Share data with Jetpack","jetpack-protect")),React.createElement("div",{className:g.Z["footer-checkbox"]},React.createElement(i.CheckboxControl,{checked:Boolean(s.jetpack_waf_share_data),onChange:f,disabled:t}),React.createElement(a.ZP,null,__("Allow Jetpack to collect data to improve firewall protection and rules. Collected data is also used to display advanced usage metrics.","jetpack-protect"))))};t.Z=()=>{const{isEnabled:e}=(0,m.Z)();return React.createElement(r.Z,null,React.createElement(h.Z,{main:React.createElement(f,null),secondary:e&&React.createElement(v,null),preserveSecondaryOnMobile:!0}))}},2651:function(e,t,n){"use strict";var a=n(526),c=n(5106),r=n(216),i=n(3363),o=n(3846),l=n(8258),s=n(5609),u=n(5736),p=n(1074),m=n(1646),d=n(5235),h=n.n(d),g=n(9196),f=n.n(g),v=n(3898),E=n(6477),b=n(5773),k=n(8963),y=n(8452);const __=u.__,Z=()=>{const{adminUrl:e}=window.jetpackProtectInitialState||{},t=e+"#/firewall",{config:{automaticRulesAvailable:n}}=(0,k.Z)(),{run:c}=(0,l.Z)({productSlug:v.o,redirectUrl:t}),{recordEventHandler:r}=(0,E.Z)(),i=r("jetpack_protect_waf_header_get_scan_link_click",c);return f().createElement(a.Z,{className:y.Z["upgrade-button"],onClick:i},n?__("Upgrade to update automatic rules","jetpack-protect",0):__("Upgrade to enable automatic rules","jetpack-protect"))},C=e=>{let{children:t=__("The free version of the firewall does not receive updates to automatic firewall rules.","jetpack-protect")}=e;const[n,a]=(0,g.useState)(!1),r=(0,g.useCallback)((()=>{a(!0)}),[]),i=(0,g.useCallback)((()=>{a(!1)}),[]);return f().createElement("div",{className:y.Z["icon-popover"],onMouseLeave:i,onMouseEnter:r,onClick:r,onFocus:r,onBlur:i,role:"presentation"},f().createElement(p.Z,{icon:m.Z}),n&&f().createElement(s.Popover,{noArrow:!1,offset:5},f().createElement(c.ZP,{className:y.Z["popover-text"],variant:"body-small"},t)))},_=e=>{let{className:t,text:n="",popover:a=!1,children:r}=e;return f().createElement("div",{className:y.Z["firewall-subheading__content"]},f().createElement(c.ZP,{className:y.Z[t],weight:600},n),a&&f().createElement(C,{children:r}))},w=e=>{let{hasRequiredPlan:t,automaticRulesAvailable:n,jetpackWafIpList:a,jetpackWafAutomaticRules:c,bruteForceProtectionIsEnabled:r}=e;const i=c&&a,o=c&&!a,l=!c&&a,s=!c&&!a;return f().createElement(f().Fragment,null,f().createElement("div",{className:y.Z["firewall-subheading"]},r&&f().createElement(_,{className:"brute-force-protection-subheading",text:__("Brute force protection is active.","jetpack-protect")}),s&&f().createElement(_,{text:__("There are no firewall rules applied.","jetpack-protect")}),o&&f().createElement(_,{text:__("Only automatic rules apply.","jetpack-protect"),popover:!t}),l&&f().createElement(_,{text:__("Only manual rules apply.","jetpack-protect"),popover:!t&&!n,children:__("The free version of the firewall only allows for use of manual rules.","jetpack-protect")}),i&&f().createElement(_,{text:__("All firewall rules apply.","jetpack-protect"),popover:!t})),!t&&f().createElement(Z,null))},R=e=>{let{status:t,hasRequiredPlan:n,automaticRulesEnabled:a,automaticRulesAvailable:l,jetpackWafIpList:u,jetpackWafAutomaticRules:p,bruteForceProtectionIsEnabled:m}=e;return f().createElement(r.Z,null,f().createElement(i.Z,{className:y.Z["firewall-header"],horizontalSpacing:7,horizontalGap:0},f().createElement(o.Z,null,"on"===t&&f().createElement(f().Fragment,null,f().createElement(c.ZP,{className:h()(y.Z.status,y.Z.active),variant:"label"},__("Active","jetpack-protect")),f().createElement(c.H3,{className:y.Z["firewall-heading"],mb:1,mt:2},a?__("Automatic firewall is on","jetpack-protect"):__("Firewall is on","jetpack-protect",0)),f().createElement(w,{jetpackWafIpList:u,jetpackWafAutomaticRules:p,bruteForceProtectionIsEnabled:m,hasRequiredPlan:n,automaticRulesAvailable:l})),"off"===t&&f().createElement(f().Fragment,null,f().createElement(c.ZP,{className:y.Z.status,variant:"label"},__("Inactive","jetpack-protect")),f().createElement(c.H3,{className:y.Z["firewall-heading"],mb:2,mt:2},l?__("Automatic firewall is off","jetpack-protect"):__("Firewall is off","jetpack-protect",0)),f().createElement(w,{jetpackWafIpList:u,jetpackWafAutomaticRules:p,bruteForceProtectionIsEnabled:m,hasRequiredPlan:n,automaticRulesAvailable:l})),"loading"===t&&f().createElement(f().Fragment,null,f().createElement(s.Spinner,{className:y.Z.spinner}),f().createElement(c.H3,{className:y.Z["firewall-heading"],mb:2,mt:2},__("Automatic firewall is being set up","jetpack-protect")),f().createElement(c.ZP,{className:y.Z["loading-text"],weight:600},__("Please wait…","jetpack-protect")))),f().createElement(o.Z,null,f().createElement("div",{className:y.Z["stat-card-wrapper"]}))))};t.Z=()=>{const{config:{jetpackWafAutomaticRules:e,jetpackWafIpList:t,automaticRulesAvailable:n,bruteForceProtection:a},isToggling:c}=(0,k.Z)(),{hasRequiredPlan:r}=(0,b.Z)(),i=e||t||a?"on":"off";return f().createElement(R,{status:c?"loading":i,hasRequiredPlan:r,automaticRulesEnabled:e,automaticRulesAvailable:n,jetpackWafIpList:t,jetpackWafAutomaticRules:e,bruteForceProtectionIsEnabled:a})}},5975:function(e,t,n){"use strict";var a=n(2674),c=n.n(a),r=n(2054),i=n(1342),o=n(5106),l=n(526),s=n(857),u=n(3363),p=n(3846),m=n(8258),d=n(5609),h=n(9818),g=n(9307),f=n(5736),v=n(1074),E=n(6163),b=n(3259),k=n(6292),y=n.n(k),Z=n(9196),C=n(5439),_=n(1827),w=n(3898),R=n(6477),j=n(5773),N=n(8963),S=n(4633),P=n(7267),x=n(8431),I=n(2651),M=n(5678),T=n(291),L=n(9265),z=n(4854);const __=f.__,_n=f._n,A=window?.jetpackProtectInitialState?.adminUrl,F=5e3;t.Z=()=>{const[e]=(0,r.Z)(["sm","lg"],[null,"<"]),t=(0,h.useSelect)((e=>e(S.t).getNotice())),{setWafIsSeen:n,setWafUpgradeIsSeen:a,setNotice:k}=(0,h.useDispatch)(S.t),{config:{jetpackWafAutomaticRules:V,jetpackWafIpList:O,jetpackWafIpBlockList:D,jetpackWafIpAllowList:H,automaticRulesAvailable:U,bruteForceProtection:B},isEnabled:W,isSeen:J,upgradeIsSeen:G,displayUpgradeBadge:$,isSupported:q,isUpdating:K,stats:X,toggleAutomaticRules:Q,toggleManualRules:Y,toggleBruteForceProtection:ee,toggleWaf:te,updateConfig:ne}=(0,N.Z)(),{ipAllowListCount:ae,ipBlockListCount:ce,rulesVersion:re,automaticRulesLastUpdated:ie}=X,{hasRequiredPlan:oe}=(0,j.Z)(),{run:le}=(0,m.Z)({productSlug:w.o,redirectUrl:`${A}#/firewall`}),{recordEventHandler:se,recordEvent:ue}=(0,R.Z)(),pe=W&&(oe||U),[me,de]=(0,Z.useState)(!1),[he,ge]=(0,Z.useState)({jetpack_waf_automatic_rules:V,jetpack_waf_ip_list:O,jetpack_waf_ip_block_list:D,jetpack_waf_ip_allow_list:H,brute_force_protection:B}),[fe,ve]=(0,Z.useState)(!1),[Ee,be]=(0,Z.useState)(!1),ke=(0,Z.useCallback)((e=>{switch(e.code){case"file_system_error":return __("A filesystem error occurred.","jetpack-protect");case"rules_api_error":return __("An error occurred retrieving the latest firewall rules from Jetpack.","jetpack-protect");default:return!1}}),[]),ye=(0,Z.useCallback)((e=>{const t=ke(e)||__("An error occurred.","jetpack-protect"),n=(0,g.createInterpolateElement)(__("Please try again or contact support.","jetpack-protect"),{supportLink:React.createElement(d.ExternalLink,{href:w.K})});k({type:"error",message:React.createElement(React.Fragment,null,t," ",n)})}),[ke,k]),Ze=se("jetpack_protect_waf_page_get_scan_link_click",le),Ce=(0,Z.useCallback)((()=>{ve(!0),ne(he).then((()=>k({type:"success",duration:F,message:__("Changes saved.","jetpack-protect")}))).catch(ye).finally((()=>ve(!1)))}),[ne,he,ye,k]),_e=(0,Z.useCallback)((e=>{const{value:t,id:n}=e.target;ge({...he,[n]:t})}),[he]),we=(0,Z.useCallback)((()=>{ve(!0);const e=!he.jetpack_waf_automatic_rules;ge({...he,jetpack_waf_automatic_rules:e}),Q().then((()=>{de(!1),k({type:"success",duration:F,message:e?__("Automatic rules are enabled.","jetpack-protect"):__("Automatic rules are disabled.","jetpack-protect",0)}),ue(e?"jetpack_protect_automatic_rules_enabled":"jetpack_protect_automatic_rules_disabled")})).then((()=>{G||(a(!0),_.Z.wafUpgradeSeen())})).catch((e=>{de(!0),ye(e)})).finally((()=>ve(!1)))}),[he,Q,k,ue,G,a,ye]),Re=(0,Z.useCallback)((()=>{ve(!0);const e=!he.brute_force_protection;ge({...he,brute_force_protection:e}),ee().then((()=>{k({type:"success",duration:F,message:e?__("Brute force protection is enabled.","jetpack-protect"):__("Brute force protection is disabled.","jetpack-protect",0)}),ue(e?"jetpack_protect_brute_force_protection_enabled":"jetpack_protect_brute_force_protection_disabled")})).catch(ye).finally((()=>ve(!1)))}),[he,ee,ye,k,ue]),je=(0,Z.useCallback)((()=>{const e=!he.jetpack_waf_ip_list;ve(!0),ge({...he,jetpack_waf_ip_list:e}),Y().then((()=>{k({type:"success",duration:F,message:e?__("Manual rules are active.","jetpack-protect"):__("Manual rules are disabled.","jetpack-protect",0)}),ue(e?"jetpack_protect_manual_rules_enabled":"jetpack_protect_manual_rules_disabled")})).catch(ye).finally((()=>ve(!1)))}),[he,Y,ye,k,ue]),Ne=(0,Z.useCallback)((()=>{be(!Ee)}),[Ee,be]),Se=(0,Z.useCallback)((()=>{a(!0),_.Z.wafUpgradeSeen()}),[a]);(0,Z.useEffect)((()=>{K||ge({jetpack_waf_automatic_rules:V,jetpack_waf_ip_list:O,jetpack_waf_ip_block_list:D,jetpack_waf_ip_allow_list:H,brute_force_protection:B})}),[O,D,H,V,B,K]),(0,Z.useEffect)((()=>{J||(n(!0),_.Z.wafSeen())}),[J,n]),(0,R.Z)({pageViewEventName:"protect_waf",pageViewEventProperties:{has_plan:oe}});const Pe=React.createElement(i.Z,{level:"error",title:"Jetpack Firewall is currently disabled.",children:React.createElement(o.ZP,null,__("Re-enable the Firewall to continue.","jetpack-protect")),actions:[React.createElement(l.Z,{variant:"link",onClick:te,isLoading:K,disabled:K},__("Enable Firewall","jetpack-protect"))],hideCloseButton:!0}),xe=React.createElement("div",{className:z.Z["toggle-wrapper"]},React.createElement("div",{className:`${z.Z["toggle-section"]} ${pe?"":z.Z["toggle-section--disabled"]}`},React.createElement("div",{className:z.Z["toggle-section__control"]},React.createElement(M.Z,{checked:!!pe&&he.jetpack_waf_automatic_rules,onChange:we,disabled:!W||fe||!pe}),oe&&!1===G&&React.createElement(d.Popover,{noArrow:!1,offset:8,position:"top right"},React.createElement("div",{className:z.Z.popover},React.createElement("div",{className:z.Z.popover__header},React.createElement(o.ZP,{className:z.Z.popover__title,variant:"title-small"},__("Thanks for upgrading!","jetpack-protect")),React.createElement(l.Z,{className:z.Z.popover__button,variant:"icon"},React.createElement(v.Z,{onClick:Se,icon:E.Z,size:24,"aria-label":__("Close Window","jetpack-protect")}))),React.createElement(o.ZP,{className:z.Z.popover__description,variant:"body",mt:2,mb:3},__("Turn on Jetpack Firewall to automatically protect your site with the latest security rules.","jetpack-protect")),React.createElement("div",{className:z.Z.popover__footer},React.createElement(l.Z,{onClick:Se},__("Got it","jetpack-protect")))))),React.createElement("div",{className:z.Z["toggle-section__content"]},React.createElement("div",{className:z.Z["toggle-section__title"]},React.createElement(o.ZP,{variant:"title-medium",mb:2},__("Enable automatic rules","jetpack-protect")),!e&&oe&&$&&React.createElement("span",{className:z.Z.badge},__("NOW AVAILABLE","jetpack-protect"))),React.createElement(o.ZP,null,__("Protect your site against untrusted traffic sources with automatic security rules.","jetpack-protect")),React.createElement("div",{className:z.Z["toggle-section__details"]},V&&!me&&React.createElement("div",{className:z.Z["automatic-rules-stats"]},re&&React.createElement(o.ZP,{className:z.Z["automatic-rules-stats__version"],variant:"body-small"},(0,f.sprintf)( +// translators: placeholder is the latest rules version i.e. "v2.0". +__("Automatic security rules v%s installed.","jetpack-protect"),re)),ie&&React.createElement(o.ZP,{className:z.Z["automatic-rules-stats__last-updated"],variant:"body-small"},(0,f.sprintf)( +// translators: placeholder is the date latest rules were updated i.e. "September 23, 2022". +__("Last updated on %s.","jetpack-protect"),y().unix(ie).format("MMMM D, YYYY")))),me&&React.createElement(React.Fragment,null,React.createElement(o.ZP,{className:z.Z["automatic-rules-stats__failed-install"],variant:"body-small",mt:2},__("Failed to update automatic rules.","jetpack-protect")," ",ke(me)),React.createElement(l.Z,{variant:"link",href:w.K},React.createElement(o.ZP,{variant:"body-small"},__("Contact support","jetpack-protect"))))))),!oe&&React.createElement("div",{className:z.Z["upgrade-trigger-section"]},React.createElement(s.Z,{className:z.Z["upgrade-trigger"],description:pe?__("Your site is not receiving the latest updates to automatic rules","jetpack-protect",0):__("Setup automatic rules with one click","jetpack-protect"),cta:pe?__("Upgrade to keep your site secure with up-to-date firewall rules","jetpack-protect",0):__("Upgrade to enable automatic rules","jetpack-protect"),onClick:Ze})),React.createElement("div",{className:z.Z["toggle-section"]},React.createElement("div",{className:z.Z["toggle-section__control"]},React.createElement(M.Z,{id:"brute_force_protection",checked:he.brute_force_protection,onChange:Re,disabled:fe})),React.createElement("div",{className:z.Z["toggle-section__content"]},React.createElement(o.ZP,{variant:"title-medium",mb:2},__("Enable brute force protection","jetpack-protect")),React.createElement(o.ZP,null,__("Prevent bots and hackers from attempting to log in to your website with common username and password combinations.","jetpack-protect")))),React.createElement("div",{className:`${z.Z["toggle-section"]} ${W?"":z.Z["toggle-section--disabled"]}`},React.createElement("div",{className:z.Z["toggle-section__control"]},React.createElement(M.Z,{id:"jetpack_waf_ip_list",checked:W&&he.jetpack_waf_ip_list,onChange:je,disabled:fe||!W})),React.createElement("div",{className:z.Z["toggle-section__content"]},React.createElement(o.ZP,{variant:"title-medium",mb:2},__("Enable manual rules","jetpack-protect")),React.createElement(o.ZP,null,__("Allows you to add manual rules to block or allow traffic from specific IPs.","jetpack-protect")),O&&React.createElement("div",{className:z.Z["toggle-section__details"]},React.createElement("div",{className:z.Z["manual-rules-stats"]},0===ae&&0===ce&&React.createElement(o.ZP,{className:z.Z["manual-rules-stats__no-rules"],variant:"body-small",mt:2},__("No manual rules are being applied.","jetpack-protect")),ce>0&&React.createElement(o.ZP,{className:z.Z["manual-rules-stats__block-list-count"],variant:"body-small",mt:2},(0,f.sprintf)( +// translators: placeholder is a number of blocked IP addresses i.e. "5 IPs are being blocked". +_n("%s IP is being blocked. ","%s IPs are being blocked. ",ce,"jetpack-protect"),1===ce?"One":ce)),ae>0&&React.createElement(o.ZP,{className:z.Z["manual-rules-stats__allow-list-count"],variant:"body-small",mt:2},(0,f.sprintf)( +// translators: placeholder is a number of allowed IP addresses i.e. "5 IPs are being allowed". +_n("%s IP is being allowed.","%s IPs are being allowed.",ae,"jetpack-protect"),1===ae?"One":ae))),React.createElement(l.Z,{variant:"link",disabled:!W},React.createElement(o.ZP,{variant:"body-small",onClick:Ne},__("Edit manual rules","jetpack-protect"))))))),Ie=React.createElement("div",null,React.createElement(l.Z,{className:z.Z["go-back-button"],variant:"icon",icon:b.Z,onClick:Ne},React.createElement(o.ZP,null,__("Go back","jetpack-protect"))),React.createElement(o.ZP,{variant:"title-medium",mt:4,mb:2},__("Manual rules","jetpack-protect")),React.createElement(o.ZP,{mb:4},__("Add manual rules for what IP traffic the Jetpack Firewall and brute force protection should block or allow.","jetpack-protect")),React.createElement("div",{className:z.Z["manual-rules-section"]},React.createElement(L.Z,{id:"jetpack_waf_ip_block_list",label:__("Blocked IP addresses","jetpack-protect"),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_block_list,onChange:_e,disabled:fe})),React.createElement("div",{className:z.Z["manual-rules-section"]},React.createElement(L.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_allow_list,onChange:_e,disabled:fe})),React.createElement(l.Z,{onClick:Ce,isLoading:fe,disabled:fe},__("Save changes","jetpack-protect")));return q?React.createElement(P.Z,null,t.message&&React.createElement(T.Z,c()({floating:!0,dismissable:!0},t)),React.createElement(I.Z,null),React.createElement(u.Z,{className:z.Z.container,horizontalSpacing:8,horizontalGap:4},!W&&React.createElement(p.Z,null,Pe," "),React.createElement(p.Z,null,Ee?Ie:xe)),React.createElement(x.Z,null)):React.createElement(C.Fg,{replace:!0,to:"/"})}},8840:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(9818),i=n(5736),o=n(9196),l=n(4633),s=n(9974),u=n(8891),p=n(2854),m=n(5823);const __=i.__;t.Z=e=>{let{threatList:t=[]}=e;const{setModal:n,fixThreats:i}=(0,r.useDispatch)(l.t),{threatsUpdating:d}=(0,r.useSelect)((e=>e(l.t).getThreatsUpdating())),[h,g]=(0,o.useState)(t.map((e=>{let{id:t}=e;return t}))),f=(0,o.useCallback)(((e,t)=>{g(e?h.push(t.id):h.filter((e=>e!==t.id)))}),[h]);return React.createElement(p.Z,null,React.createElement(s.Z,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("Fix all threats","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Jetpack will be fixing the selected threats:","jetpack-protect")),React.createElement("div",{className:m.Z.list},t.map((e=>React.createElement(u.Z,{key:e.id,threat:e,fixAllDialog:!0,onCheckFix:f})))),React.createElement("div",{className:m.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),n({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(d)&&d[h[0]],onClick:async e=>{e.preventDefault(),i(h,(()=>{n({type:null})}))}},__("Fix all threats","jetpack-protect")))))}},1593:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(9818),i=n(5736),o=n(4633),l=n(9974),s=n(8891),u=n(2854),p=n(7279);const __=i.__;t.Z=e=>{let{id:t,fixable:n,label:i,icon:m,severity:d}=e;const{setModal:h,fixThreats:g}=(0,r.useDispatch)(o.t),f=(0,r.useSelect)((e=>e(o.t).getThreatsUpdating()));return React.createElement(u.Z,null,React.createElement(l.Z,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("Fix Threat","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Jetpack will be fixing the selected threat:","jetpack-protect")),React.createElement("div",{className:p.Z.list},React.createElement(s.Z,{threat:{id:t,fixable:n,label:i,icon:m,severity:d},fixAllDialog:!1})),React.createElement("div",{className:p.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),h({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(f&&f[t]),onClick:async e=>{e.preventDefault(),g([t],(()=>{h({type:null})}))}},__("Fix threat","jetpack-protect")))))}},5678:function(e,t,n){"use strict";var a=n(9196),c=n(1234);t.Z=e=>{let{ariaLabel:t,checked:n=!1,className:r="",disabled:i=!1,id:o,onChange:l=(()=>{}),onKeyDown:s=(()=>{}),switchClassNames:u="",toggling:p}=e;const m=(0,a.useCallback)((e=>{i||l(e)}),[i,l]),d=(0,a.useCallback)((e=>{i||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l(e)),s(e))}),[i,l,s]);return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("input",{className:`${c.Z["form-toggle"]} ${r} ${p?c.Z["is-toggling"]:""}`,type:"checkbox",checked:n,readOnly:!0,disabled:i}),React.createElement("span",{className:`${c.Z["form-toggle__switch"]} ${u}`,disabled:i,id:o,onClick:m,onKeyDown:d,role:"checkbox","aria-checked":n,"aria-label":t,tabIndex:i?-1:0})))}},3584:function(e,t,n){"use strict";n.d(t,{U:function(){return d}});var a=n(5106),c=n(1074),r=n(7489),i=n(2229),o=n(5235),l=n.n(o),s=n(9196),u=n.n(s),p=n(9122);const m=u().createContext(),d=e=>{let{id:t,title:n,label:o,icon:d,children:h,onOpen:g}=e;const f=(0,s.useContext)(m),v=f?.open===t,E=f?.setOpen,b=l()(p.Z["accordion-body"],{[p.Z["accordion-body-open"]]:v,[p.Z["accordion-body-close"]]:!v}),k=(0,s.useCallback)((()=>{v||g?.(),E((e=>e===t?null:t))}),[v,g,E,t]);return u().createElement("div",{className:p.Z["accordion-item"]},u().createElement("button",{className:p.Z["accordion-header"],onClick:k},u().createElement("div",null,u().createElement(a.ZP,{className:p.Z["accordion-header-label"],mb:1},u().createElement(c.Z,{icon:d,className:p.Z["accordion-header-label-icon"]}),o),u().createElement(a.ZP,{className:p.Z["accordion-header-description"],variant:v?"title-small":"body"},n)),u().createElement("div",{className:p.Z["accordion-header-button"]},u().createElement(c.Z,{icon:v?r.Z:i.Z,size:38}))),u().createElement("div",{className:b,"aria-hidden":v?"false":"true"},h))};t.Z=e=>{let{children:t}=e;const[n,a]=(0,s.useState)();return u().createElement(m.Provider,{value:{open:n,setOpen:a}},u().createElement("div",{className:p.Z.accordion},t))}},3116:function(e,t,n){"use strict";var a=n(6895),c=n(5106),r=n(526),i=n(9818),o=n(9307),l=n(5736),s=n(1074),u=n(4633),p=n(2251),m=n(2854),d=n(6983);const __=l.__;t.Z=e=>{let{id:t,title:n,label:l,icon:h,severity:g}=e;const{setModal:f,ignoreThreat:v}=(0,i.useDispatch)(u.t),E=(0,i.useSelect)((e=>e(u.t).getThreatsUpdating())),b=(0,a.Z)("jetpack-protect-codeable-referral");return React.createElement(m.Z,null,React.createElement(c.ZP,{variant:"title-medium",mb:2},__("Do you really want to ignore this threat?","jetpack-protect")),React.createElement(c.ZP,{mb:3},__("Jetpack will ignore the threat:","jetpack-protect")),React.createElement("div",{className:d.Z.threat},React.createElement(s.Z,{icon:h,className:d.Z.threat__icon}),React.createElement("div",{className:d.Z.threat__summary},React.createElement(c.ZP,{className:d.Z.threat__summary__label,mb:1},l),React.createElement(c.ZP,{className:d.Z.threat__summary__title},n)),React.createElement("div",{className:d.Z.threat__severity},React.createElement(p.Z,{severity:g}))),React.createElement(c.ZP,{mb:4},(0,o.createInterpolateElement)(__("By ignoring this threat you confirm that you have reviewed the detected code and assume the risks of keeping a potentially malicious or vulnerable file on your site. If you are unsure please request an estimate with Codeable.","jetpack-protect"),{codeableLink:React.createElement(r.Z,{variant:"link",isExternalLink:!0,href:b})})),React.createElement("div",{className:d.Z.footer},React.createElement(r.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),f({type:null})}},__("Cancel","jetpack-protect")),React.createElement(r.Z,{isDestructive:!0,isLoading:Boolean(E&&E[t]),onClick:async e=>{e.preventDefault(),v(t,(()=>{f({type:null})}))}},__("Ignore threat","jetpack-protect"))))}},6402:function(e,t,n){"use strict";var a=n(9105),c=n(5106),r=n(216),i=n(3363),o=n(3846),l=n(9307),s=n(5736),u=n(9196),p=n.n(u),m=n(6477),d=n(8266),h=n(9401),g=n(2951);const __=s.__;t.Z=e=>{let{onScanAdd:t}=e;return(0,m.Z)({pageViewEventName:"protect_interstitial"}),p().createElement(a.Z,{moduleName:__("Jetpack Protect","jetpack-protect"),header:p().createElement("div",{className:g.Z["protect-header"]},p().createElement(d.Z,null),p().createElement(c.ZP,{variant:"body-small"},(0,l.createInterpolateElement)(__("Already have an existing plan or license key? Click here to get started","jetpack-protect"),{a:p().createElement("a",{href:"admin.php?page=my-jetpack#/add-license"})})))},p().createElement(r.Z,null,p().createElement(i.Z,{horizontalSpacing:3,horizontalGap:3},p().createElement(o.Z,{sm:4,md:8,lg:12},p().createElement(h.Z,{onScanAdd:t})))))}},8266:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(5609),c=n(9196),r=n.n(c);function i(e){let{iconColor:t="#069E08",color:n="#000"}=e;return r().createElement(a.SVG,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 41",width:245},r().createElement(a.Path,{d:"M159.347 27.3605H156.978V7.9082H162.371C163.176 7.9082 163.917 7.95666 164.596 8.05359C165.284 8.15051 165.914 8.30074 166.486 8.50428C167.649 8.92104 168.531 9.54619 169.132 10.3797C169.733 11.2036 170.033 12.2213 170.033 13.4328C170.033 14.4214 169.834 15.2937 169.437 16.0497C169.049 16.796 168.482 17.4211 167.736 17.9251C166.99 18.4291 166.079 18.812 165.003 19.0737C163.937 19.3257 162.725 19.4517 161.368 19.4517C160.719 19.4517 160.045 19.4226 159.347 19.3644V27.3605ZM159.347 17.1982C159.667 17.237 160.002 17.2661 160.35 17.2854C160.699 17.3048 161.029 17.3145 161.339 17.3145C162.454 17.3145 163.403 17.2273 164.189 17.0528C164.974 16.8784 165.613 16.6264 166.108 16.2968C166.602 15.9576 166.961 15.5505 167.183 15.0756C167.406 14.591 167.518 14.0434 167.518 13.4328C167.518 12.6768 167.334 12.0565 166.965 11.5719C166.607 11.0873 166.093 10.719 165.424 10.467C165.008 10.3119 164.528 10.2053 163.985 10.1471C163.442 10.0793 162.812 10.0453 162.095 10.0453H159.347V17.1982Z",fill:n}),r().createElement(a.Path,{d:"M181.093 15.3809H180.919C180.386 15.3809 179.862 15.4294 179.349 15.5263C178.835 15.6232 178.35 15.7735 177.895 15.977C177.449 16.1708 177.042 16.4131 176.674 16.7039C176.315 16.9947 176.014 17.3388 175.772 17.7361V27.3605H173.519V13.5491H175.263L175.699 15.7444H175.743C175.966 15.3858 176.237 15.0514 176.557 14.7412C176.887 14.4311 177.255 14.1597 177.662 13.9271C178.069 13.6945 178.515 13.5152 179 13.3892C179.484 13.2535 179.993 13.1856 180.526 13.1856C180.623 13.1856 180.72 13.1905 180.817 13.2002C180.924 13.2002 181.016 13.205 181.093 13.2147V15.3809Z",fill:n}),r().createElement(a.Path,{d:"M193.302 20.4694C193.302 19.6164 193.195 18.8604 192.982 18.2014C192.779 17.5326 192.488 16.9705 192.11 16.5149C191.741 16.0497 191.3 15.7008 190.787 15.4682C190.273 15.2258 189.711 15.1047 189.1 15.1047C188.49 15.1047 187.928 15.2258 187.414 15.4682C186.9 15.7008 186.454 16.0497 186.076 16.5149C185.708 16.9705 185.417 17.5326 185.204 18.2014C185.001 18.8604 184.899 19.6164 184.899 20.4694C184.899 21.3126 185.001 22.0686 185.204 22.7373C185.417 23.3964 185.713 23.9537 186.091 24.4092C186.469 24.8648 186.915 25.2137 187.428 25.456C187.942 25.6886 188.504 25.8049 189.115 25.8049C189.725 25.8049 190.283 25.6886 190.787 25.456C191.3 25.2137 191.741 24.8648 192.11 24.4092C192.488 23.9537 192.779 23.3964 192.982 22.7373C193.195 22.0686 193.302 21.3126 193.302 20.4694ZM195.657 20.4694C195.657 21.5549 195.502 22.5435 195.192 23.4352C194.882 24.3269 194.441 25.0926 193.869 25.7322C193.307 26.3622 192.623 26.8517 191.819 27.2006C191.015 27.5495 190.113 27.724 189.115 27.724C188.088 27.724 187.167 27.5495 186.353 27.2006C185.548 26.8517 184.86 26.3622 184.288 25.7322C183.726 25.0926 183.295 24.3269 182.994 23.4352C182.694 22.5435 182.544 21.5549 182.544 20.4694C182.544 19.3741 182.699 18.3807 183.009 17.489C183.319 16.5973 183.755 15.8316 184.317 15.1919C184.889 14.5522 185.577 14.0579 186.382 13.709C187.196 13.3601 188.102 13.1856 189.1 13.1856C190.118 13.1856 191.034 13.3601 191.848 13.709C192.662 14.0579 193.35 14.5522 193.913 15.1919C194.475 15.8316 194.906 16.5973 195.206 17.489C195.507 18.3807 195.657 19.3741 195.657 20.4694Z",fill:n}),r().createElement(a.Path,{d:"M206.354 27.3896C206.16 27.4672 205.864 27.5398 205.467 27.6077C205.07 27.6755 204.595 27.7143 204.042 27.724C203.315 27.724 202.685 27.6319 202.152 27.4478C201.619 27.2733 201.173 27.0213 200.815 26.6918C200.466 26.3525 200.204 25.9455 200.03 25.4705C199.855 24.9956 199.768 24.4674 199.768 23.8859V15.4827H197.107V13.5491H199.768V9.76911H202.021V13.5491H206.15V15.4827H202.021V23.5369C202.021 23.8568 202.065 24.1524 202.152 24.4238C202.249 24.6952 202.395 24.9326 202.588 25.1362C202.792 25.33 203.049 25.4851 203.359 25.6014C203.669 25.708 204.042 25.7613 204.478 25.7613C204.779 25.7613 205.094 25.7371 205.423 25.6886C205.763 25.6402 206.073 25.5772 206.354 25.4996V27.3896Z",fill:n}),r().createElement(a.Path,{d:"M214.681 15.1192C214.167 15.1192 213.687 15.221 213.242 15.4245C212.805 15.6281 212.423 15.9043 212.093 16.2532C211.764 16.6021 211.497 17.0141 211.293 17.489C211.09 17.9542 210.964 18.4534 210.915 18.9864H217.894C217.894 18.4437 217.821 17.9397 217.676 17.4744C217.54 16.9995 217.337 16.5876 217.065 16.2387C216.794 15.8898 216.459 15.6184 216.062 15.4245C215.665 15.221 215.204 15.1192 214.681 15.1192ZM215.917 25.7613C216.663 25.7613 217.341 25.7032 217.952 25.5869C218.572 25.4609 219.188 25.2864 219.798 25.0635V26.9389C219.304 27.1812 218.693 27.3702 217.967 27.5059C217.24 27.6513 216.459 27.724 215.626 27.724C214.637 27.724 213.707 27.598 212.835 27.346C211.972 27.094 211.216 26.6869 210.567 26.1248C209.917 25.5626 209.403 24.8309 209.025 23.9295C208.657 23.0184 208.473 21.9232 208.473 20.6438C208.473 19.3838 208.647 18.2934 208.996 17.3727C209.345 16.4422 209.811 15.6668 210.392 15.0465C210.974 14.4262 211.642 13.961 212.398 13.6509C213.154 13.3407 213.944 13.1856 214.768 13.1856C215.544 13.1856 216.266 13.3165 216.934 13.5782C217.613 13.8302 218.199 14.2324 218.693 14.7849C219.188 15.3373 219.575 16.0497 219.857 16.922C220.147 17.7943 220.293 18.8411 220.293 20.0623C220.293 20.1786 220.293 20.2804 220.293 20.3676C220.293 20.4451 220.288 20.6293 220.278 20.92H210.799C210.799 21.802 210.93 22.5532 211.192 23.1735C211.463 23.7841 211.827 24.2832 212.282 24.6709C212.747 25.0489 213.29 25.3252 213.91 25.4996C214.531 25.6741 215.199 25.7613 215.917 25.7613Z",fill:n}),r().createElement(a.Path,{d:"M229.885 13.1856C230.553 13.1856 231.193 13.2583 231.804 13.4037C232.414 13.5394 232.938 13.7332 233.374 13.9852V15.8607C232.763 15.6281 232.201 15.4536 231.687 15.3373C231.174 15.221 230.65 15.1628 230.117 15.1628C229.555 15.1628 228.998 15.2549 228.445 15.4391C227.893 15.6232 227.398 15.9285 226.962 16.355C226.526 16.7718 226.172 17.3291 225.901 18.0269C225.639 18.7151 225.508 19.5728 225.508 20.6002C225.508 21.3465 225.605 22.0346 225.799 22.6646C226.003 23.2946 226.298 23.8423 226.686 24.3075C227.083 24.763 227.578 25.1216 228.169 25.3833C228.76 25.6353 229.444 25.7613 230.219 25.7613C230.781 25.7613 231.348 25.7032 231.92 25.5869C232.492 25.4609 233.049 25.2864 233.592 25.0635V26.9389C233.427 27.0358 233.209 27.1328 232.938 27.2297C232.676 27.3266 232.385 27.409 232.065 27.4768C231.745 27.5544 231.406 27.6125 231.048 27.6513C230.689 27.6998 230.33 27.724 229.972 27.724C229.041 27.724 228.159 27.5835 227.326 27.3024C226.502 27.0213 225.78 26.59 225.16 26.0085C224.539 25.4269 224.05 24.6903 223.691 23.7986C223.333 22.907 223.153 21.8505 223.153 20.6293C223.153 19.7182 223.245 18.8992 223.429 18.1723C223.623 17.4454 223.885 16.8057 224.215 16.2532C224.544 15.7008 224.927 15.2307 225.363 14.843C225.809 14.4553 226.279 14.1403 226.773 13.898C227.277 13.646 227.796 13.4667 228.329 13.3601C228.862 13.2438 229.381 13.1856 229.885 13.1856Z",fill:n}),r().createElement(a.Path,{d:"M244.143 27.3896C243.949 27.4672 243.654 27.5398 243.256 27.6077C242.859 27.6755 242.384 27.7143 241.832 27.724C241.105 27.724 240.475 27.6319 239.942 27.4478C239.409 27.2733 238.963 27.0213 238.604 26.6918C238.255 26.3525 237.993 25.9455 237.819 25.4705C237.645 24.9956 237.557 24.4674 237.557 23.8859V15.4827H234.897V13.5491H237.557V9.76911H239.811V13.5491H243.94V15.4827H239.811V23.5369C239.811 23.8568 239.854 24.1524 239.942 24.4238C240.039 24.6952 240.184 24.9326 240.378 25.1362C240.581 25.33 240.838 25.4851 241.148 25.6014C241.458 25.708 241.832 25.7613 242.268 25.7613C242.568 25.7613 242.883 25.7371 243.213 25.6886C243.552 25.6402 243.862 25.5772 244.143 25.4996V27.3896Z",fill:n}),r().createElement(a.Path,{d:"M20.1063 40.2111C31.2106 40.2111 40.2126 31.2091 40.2126 20.1048C40.2126 9.00048 31.2106 0 20.1063 0C9.00197 0 0 9.00197 0 20.1063C0 31.2106 9.00197 40.2111 20.1063 40.2111Z",fill:t}),r().createElement(a.Path,{d:"M21.104 16.7295V36.2209L31.1571 16.7295H21.104Z",fill:"white"}),r().createElement(a.Path,{d:"M19.0701 23.4444V3.99023L9.05566 23.4444H19.0701Z",fill:"white"}),r().createElement(a.Path,{d:"M51.9141 33.3819C51.3379 32.499 50.8019 31.6176 50.2644 30.7733C53.1038 29.0462 54.0626 27.666 54.0626 25.0559V9.97619H50.7245V7.09961H57.8236V24.2891C57.8236 28.6635 56.558 31.1188 51.9141 33.3819Z",fill:n}),r().createElement(a.Path,{d:"M81.6522 23.0994C81.6522 24.557 82.6885 24.7104 83.3793 24.7104C84.0702 24.7104 85.0677 24.4796 85.8345 24.2503V26.9363C84.7595 27.2817 83.6473 27.5497 82.1122 27.5497C80.2705 27.5497 78.122 26.8589 78.122 23.6354V15.7307H76.1655V13.006H78.122V8.97852H81.6522V13.0075H86.1025V15.7322H81.6522V23.0994Z",fill:n}),r().createElement(a.Path,{d:"M89.0193 34.7251V12.9691H92.3961V14.2734C93.7391 13.2371 95.2355 12.585 97.0773 12.585C100.262 12.585 102.795 14.8109 102.795 19.6067C102.795 24.3652 100.033 27.5113 95.4663 27.5113C94.3541 27.5113 93.4711 27.358 92.5495 27.1659V34.6864H89.0193V34.7251ZM96.1557 15.5017C95.1194 15.5017 93.8151 16.0005 92.5867 17.0755V24.4814C93.3535 24.6347 94.1605 24.7494 95.234 24.7494C97.7279 24.7494 99.1484 23.1756 99.1484 19.8762C99.1484 16.8447 98.1121 15.5017 96.1557 15.5017Z",fill:n}),r().createElement(a.Path,{d:"M116.683 27.2051H113.384V25.6313H113.306C112.155 26.5142 110.735 27.4731 108.625 27.4731C106.783 27.4731 104.788 26.1301 104.788 23.4054C104.788 19.7605 107.896 19.0696 110.083 18.7629L113.19 18.3416V17.9202C113.19 16.001 112.423 15.3876 110.619 15.3876C109.736 15.3876 107.665 15.6556 105.976 16.3464L105.67 13.5071C107.205 12.9696 109.315 12.5869 111.08 12.5869C114.533 12.5869 116.759 13.9686 116.759 18.0736V27.2051H116.683ZM113.153 20.5675L110.236 21.0276C109.353 21.1422 108.433 21.6797 108.433 22.984C108.433 24.1349 109.085 24.7871 110.044 24.7871C111.08 24.7871 112.193 24.1736 113.152 23.4828V20.5675H113.153Z",fill:n}),r().createElement(a.Path,{d:"M131.264 26.745C129.806 27.2438 128.502 27.5505 126.851 27.5505C121.556 27.5505 119.445 24.5191 119.445 20.1074C119.445 15.465 122.362 12.5869 127.08 12.5869C128.845 12.5869 129.92 12.8936 131.109 13.2778V16.2705C130.073 15.8863 128.577 15.465 127.119 15.465C124.97 15.465 123.129 16.6159 123.129 19.9153C123.129 23.5602 124.97 24.6739 127.311 24.6739C128.423 24.6739 129.652 24.4431 131.301 23.791V26.745H131.264Z",fill:n}),r().createElement(a.Path,{d:"M137.941 19.1093C138.247 18.7639 138.478 18.4185 142.928 13.0077H147.532L141.776 19.7615L148.068 27.2432H143.464L137.978 20.4895V27.2432H134.449V7.09973H137.979V19.1093H137.941Z",fill:n}),r().createElement(a.Path,{d:"M73.5167 26.7445C71.6749 27.3207 70.1011 27.55 68.2593 27.55C63.7316 27.55 60.9309 25.2869 60.9309 19.9908C60.9309 16.1152 63.3102 12.585 67.8752 12.585C72.403 12.585 73.9768 15.731 73.9768 18.7238C73.9768 19.7213 73.8993 20.2588 73.8621 20.8335H64.7306C64.808 23.9409 66.5724 24.6705 69.2197 24.6705C70.6773 24.6705 71.9816 24.325 73.4795 23.7875V26.7416H73.5167V26.7445ZM70.2947 18.4945C70.2947 16.7673 69.7185 15.271 67.8395 15.271C66.0751 15.271 65.0001 16.5365 64.7693 18.4945H70.2947Z",fill:n}))}},4257:function(e,t,n){"use strict";var a=n(8735);const c=e=>React.createElement("mark",{key:e,className:a.Z["marked-lines__mark"]},e);t.Z=e=>{let{context:t}=e;const{marks:n,...r}=t;return React.createElement("div",{className:a.Z["marked-lines"]},React.createElement("div",{className:a.Z["marked-lines__line-numbers"]},Object.keys(r).map((e=>{const t=n.hasOwnProperty(e);return React.createElement("div",{key:e,className:`${a.Z["marked-lines__line-number"]} ${t?a.Z["marked-lines__marked-line"]:""}`},e)}))),React.createElement("div",{className:a.Z["marked-lines__lines"]},Object.keys(r).map((e=>{const t=r[e]||" ",i=n.hasOwnProperty(e);return React.createElement("div",{key:e,className:`${a.Z["marked-lines__line"]} ${i?a.Z["marked-lines__marked-line"]:""} `},React.createElement(React.Fragment,null,i?((e,t)=>{const[n,a]=e.reduce(((e,n)=>{let[a,r]=e,[i,o]=n;const l=t.slice(i,o);return[[...a,...i>r?[t.slice(r,i),c(l)]:[c(l)]],o]}),[[],0]);return a{const e=(0,a.useSelect)((e=>e(o.t).getModalType())),t=(0,a.useSelect)((e=>e(o.t).getModalProps())),{setModal:n}=(0,a.useDispatch)(o.t);if(!e)return null;const c=h[e];return React.createElement("div",{className:d.Z.modal},React.createElement("div",{className:d.Z.modal__window},React.createElement("button",{onClick:e=>{e.preventDefault(),n({type:null})},className:d.Z.modal__close,title:__("Close Modal Window","jetpack-protect")},React.createElement(r.Z,{icon:i.Z,size:24,className:d.Z.modal__close__icon,"aria-label":__("Close Modal Window","jetpack-protect")})),React.createElement(c,t)))}},5167:function(e,t,n){"use strict";var a=n(5106),c=n(5609),r=n(5736),i=n(1074),o=n(496),l=n(9201),s=n(5162),u=n.n(s),p=n(9196),m=n.n(p),d=n(513);const __=r.__,h=e=>{let{count:t,checked:n}=e;const{popoverText:r,badgeElement:s}=((e,t)=>t?0===e?{popoverText:__("No known threats found to affect this version","jetpack-protect"),badgeElement:m().createElement(i.Z,{icon:l.Z,size:28,className:d.Z["navigation-item-check-badge"]})}:{popoverText:null,badgeElement:m().createElement(a.ZP,{variant:"body-extra-small",className:d.Z["navigation-item-badge"],component:"div"},e)}:{popoverText:__("This item was added to your site after the most recent scan. We will check for threats during the next scheduled one.","jetpack-protect"),badgeElement:m().createElement(i.Z,{icon:o.Z,size:28,className:d.Z["navigation-item-info-badge"]})})(t,n),[u,h]=(0,p.useState)(!1),g=(0,p.useCallback)((()=>{h(!0)}),[]),f=(0,p.useCallback)((()=>{h(!1)}),[]);return m().createElement("div",{onMouseLeave:r?f:null,onMouseEnter:r?g:null,onClick:r?g:null,onFocus:r?g:null,onBlur:r?f:null,role:"presentation"},s,u&&m().createElement(c.Popover,{noArrow:!1},m().createElement(a.ZP,{variant:"body-small",className:d.Z["popover-text"]},r)))};h.propTypes={count:u().number,checked:u().bool},t.Z=h},2328:function(e,t,n){"use strict";var a=n(526),c=n(5736),r=n(9196),i=n.n(r),o=n(2389),l=n(513),s=n(246);const __=c.__;t.Z=e=>{let{icon:t,label:n,children:u}=e;const[p,m]=(0,r.useState)(!0),{mode:d}=(0,r.useContext)(s.k),h=Array.isArray(u)&&u?.length>=8&&"list"===d,g=h&&p?u.slice(0,8):u,f=h?u?.length-8:0,v=(0,r.useCallback)((()=>{m((e=>!e))}),[]);return i().createElement("li",{tabIndex:-1,role:"menuitem",className:l.Z["navigation-group"]},i().createElement(o.Z,{icon:t,className:l.Z["navigation-group-label"]},n),i().createElement("div",{className:l.Z["navigation-group-list"]},i().createElement("ul",{className:l.Z["navigation-group-content"]},g),h&&i().createElement("div",{className:l.Z["navigation-group-truncate"]},i().createElement(a.Z,{variant:"link",onClick:v},p?(0,c.sprintf)(/* translators: %s: Number of hide items */ +__("Show %s more","jetpack-protect"),f):(0,c.sprintf)(/* translators: %s: Number of hide items */ +__("Hide %s items","jetpack-protect"),f)))))}},5338:function(e,t,n){"use strict";n.d(t,{Dx:function(){return h.Z},KB:function(){return d.Z}});var a=n(5106),c=n(5609),r=n(5736),i=n(1074),o=n(7489),l=n(2229),s=n(5235),u=n.n(s),p=n(9196),m=n.n(p),d=n(2328),h=n(6119),g=n(513),f=n(246);const __=r.__,v=e=>{let{children:t}=e;return m().createElement("ul",{className:g.Z.navigation,role:"menu"},t)},E=e=>{let{children:t,data:n}=e;const r=(0,p.useRef)(),[s,d]=(0,p.useState)(!1),h=n?.items?.find((e=>e?.id===n?.selectedItem))??{label:__("See all results","jetpack-protect")},{label:f,icon:v}=h,E=(0,p.useCallback)((()=>{d((e=>!e))}),[]);return m().createElement("button",{className:g.Z["navigation-dropdown-button"],onClick:E,ref:r},m().createElement("div",{className:g.Z["navigation-dropdown-label"]},v&&m().createElement(i.Z,{icon:v,className:g.Z["navigation-dropdown-icon"]}),m().createElement(a.ZP,null,f)),m().createElement(i.Z,{icon:s?o.Z:l.Z,size:32}),m().createElement(c.Popover,{position:"bottom center",anchorRef:r?.current,className:u()({[g.Z["navigation-dropdown-open"]]:s,[g.Z["navigation-dropdown-closed"]]:!s})},m().createElement("div",{style:{width:r?.current?.getBoundingClientRect?.()?.width}},t)))};t.ZP=e=>{let{children:t,selected:n,onSelect:a,mode:c="list"}=e;const r=(0,f.Z)({selected:n,onSelect:a}),i=(e=>{switch(e){case"list":default:return v;case"dropdown":return E}})(c);return m().createElement(f.k.Provider,{value:{...r,mode:c}},m().createElement(i,{data:r},t))}},6119:function(e,t,n){"use strict";var a=n(5235),c=n.n(a),r=n(9196),i=n.n(r),o=n(5167),l=n(2389),s=n(513),u=n(246);t.Z=e=>{let{id:t,label:n,icon:a,badge:p,disabled:m,onClick:d,onKeyDown:h,onFocus:g,checked:f}=e;const v=(0,r.useContext)(u.k),E=v?.selectedItem===t,b=v?.registerItem,k=v?.registerRef,y=v?.handleClickItem,Z=v?.handleKeyDownItem,C=v?.handleFocusItem,_=c()(s.Z["navigation-item"],{[s.Z.clickable]:!m,[s.Z.selected]:E}),w=(0,r.useCallback)((e=>{d?.(e),y?.(t)}),[y,t,d]),R=(0,r.useCallback)((e=>{h?.(e),Z?.(e)}),[Z,h]),j=(0,r.useCallback)((e=>{k(e,t)}),[k,t]),N=(0,r.useCallback)((e=>{g?.(e),C?.(t)}),[C,t,g]);return(0,r.useEffect)((()=>{b({id:t,disabled:m,label:n,icon:a})}),[]),i().createElement("li",{className:_,onClick:m?null:w,onKeyDown:R,onFocus:m?null:N,role:"menuitem",tabIndex:m?-1:0,ref:j},i().createElement(l.Z,{icon:a},n),i().createElement(o.Z,{count:p,checked:f}))}},2389:function(e,t,n){"use strict";var a=n(5106),c=n(1074),r=n(5235),i=n.n(r),o=n(5162),l=n.n(o),s=n(9196),u=n.n(s),p=n(513);const m=e=>{let{icon:t,children:n,className:r}=e;return u().createElement(a.ZP,{className:i()(p.Z["navigation-item-label"],r)},t&&u().createElement(c.Z,{icon:t,className:p.Z["navigation-item-icon"],size:28}),u().createElement("span",{className:p.Z["navigation-item-label-content"]},n))};m.propTypes={icon:l().node,children:l().node.isRequired},t.Z=m},246:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var a=n(9196);const c=n.n(a)().createContext();t.Z=e=>{let{selected:t,onSelect:n}=e;const[c,r]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[l,s]=(0,a.useState)(),u=(e,t)=>{const n=e-1,a=n<0?t:n,r=c[a];return r?.disabled?u(a,t):r},p=(e,t)=>{const n=e+1,a=n>t?0:n,r=c[a];return r?.disabled?p(a,t):r};return{selectedItem:t,handleClickItem:e=>{n(e)},handleKeyDownItem:e=>{const a=e?.code,r=c.findIndex((e=>e?.id===t)),o=c.length-1;let s;if("ArrowUp"===a){s=u(r,o)?.id}else if("ArrowDown"===a){s=p(r,o)?.id}else"Enter"!==a&&"Space"!==a||!l||(s=l);if(s){i[s]?.focus(),n(s)}},handleFocusItem:e=>{s(e)},registerRef:(e,t)=>{o((n=>!n[t]&&e?{...n,[t]:e}:n))},registerItem:e=>{r((t=>{const n=[...t],a=e?.id,c=n.findIndex((e=>e?.id===a));return c>=0?n[c]=e:n.push(e),n}))},items:c}}},291:function(e,t,n){"use strict";var a=n(9818),c=n(5736),r=n(9201),i=n(797),o=n(496),l=n(1074),s=n(9517),u=n(9196),p=n(4633),m=n(8212);const __=c.__;t.Z=e=>{let{dismissable:t=!1,duration:n=null,floating:c=!1,message:d,type:h="success"}=e;const{clearNotice:g}=(0,a.useDispatch)(p.t);let f;switch(h){case"success":f=r.Z;break;case"error":f=i.Z;break;default:f=o.Z}const v=(0,u.useCallback)((()=>{g()}),[g]);return(0,u.useEffect)((()=>{let e;return n&&(e=setTimeout(g,n)),()=>clearTimeout(e)}),[g,n,d]),React.createElement("div",{className:`${m.Z.notice} ${m.Z[`notice--${h}`]} ${c?m.Z["notice--floating"]:""}`},React.createElement("div",{className:m.Z.notice__icon},React.createElement(l.Z,{icon:f})),React.createElement("div",{className:m.Z.notice__message},d),t&&React.createElement("button",{className:m.Z.notice__close,"aria-label":__("Dismiss notice.","jetpack-protect"),onClick:v},React.createElement(l.Z,{icon:s.Z})))}},289:function(e,t,n){"use strict";n.d(t,{c:function(){return k}});var a=n(2054),c=n(5106),r=n(5033),i=n(9818),o=n(5736),l=n(1074),s=n(9201),u=n(7489),p=n(2229),m=n(5235),d=n.n(m),h=n(9196),g=n.n(h),f=n(4633),v=n(2251),E=n(7324);const __=o.__,b=g().createContext(),k=e=>{let{id:t,title:n,label:o,icon:m,fixable:k,severity:y,children:Z,onOpen:C}=e;const _=(0,h.useContext)(b),w=_?.open===t,R=_?.setOpen,j=(0,i.useSelect)((e=>e(f.t).getThreatsAreFixing())),N=d()(E.Z["accordion-body"],{[E.Z["accordion-body-open"]]:w,[E.Z["accordion-body-close"]]:!w}),S=(0,h.useCallback)((()=>{w||C?.(),R((e=>e===t?null:t))}),[w,C,R,t]),[P]=(0,a.Z)(["sm","lg"],[null,"<"]);return g().createElement("div",{className:E.Z["accordion-item"]},g().createElement("button",{className:E.Z["accordion-header"],onClick:S},g().createElement("div",null,g().createElement(c.ZP,{className:E.Z["accordion-header-label"],mb:1},g().createElement(l.Z,{icon:m,className:E.Z["accordion-header-label-icon"]}),o),g().createElement(c.ZP,{className:E.Z["accordion-header-description"],variant:w?"title-small":"body"},n)),g().createElement("div",null,g().createElement(v.Z,{severity:y})),g().createElement("div",null,k&&g().createElement(g().Fragment,null,j.indexOf(t)>=0?g().createElement(r.Z,{color:"black"}):g().createElement(l.Z,{icon:s.Z,className:E.Z["icon-check"],size:28}),P&&g().createElement("span",null,__("Auto-fix","jetpack-protect")))),g().createElement("div",{className:E.Z["accordion-header-button"]},g().createElement(l.Z,{icon:w?u.Z:p.Z,size:38}))),g().createElement("div",{className:N,"aria-hidden":w?"false":"true"},Z))};t.Z=e=>{let{children:t}=e;const[n,a]=(0,h.useState)();return g().createElement(b.Provider,{value:{open:n,setOpen:a}},g().createElement("div",{className:E.Z.accordion},t))}},9401:function(e,t,n){"use strict";var a=n(9608),c=n(5347),r=n(526),i=n(1294),o=n(9818),l=n(5736),s=n(9196),u=n.n(s),p=n(6477),m=n(5773),d=n(8963),h=n(4633);const __=l.__;t.Z=e=>{let{onScanAdd:t}=e;const{handleRegisterSite:n,registrationError:l}=(0,i.Z)({skipUserConnection:!0}),{refreshPlan:g,refreshStatus:f}=(0,o.useDispatch)(h.t),[v,E]=(0,s.useState)(!1),[b,k]=(0,s.useState)(!1),{jetpackScan:y}=(0,m.Z)(),{refreshWaf:Z}=(0,d.Z)(),{pricingForUi:C}=y,{introductoryOffer:_,currencyCode:w="USD"}=C,R=C.cost?Math.ceil(C.cost/12*100)/100:null,j=_?.costPerInterval?Math.ceil(_.costPerInterval/12*100)/100:null,{recordEvent:N,recordEventHandler:S}=(0,p.Z)(),P=S("jetpack_protect_pricing_table_get_scan_link_click",(()=>{k(!0),t()})),x=(0,s.useCallback)((()=>{N("jetpack_protect_connected_product_activated"),E(!0),n().then((()=>E(!1))).then((()=>{g(),Z(),f(!0)}))}),[n,N,Z,g,f]),I={title:__("Stay one step ahead of threats","jetpack-protect"),items:[{name:__("Scan for threats and vulnerabilities","jetpack-protect")},{name:__("Daily automated scans","jetpack-protect")},{name:__("Web Application Firewall","jetpack-protect")},{name:__("Brute force protection","jetpack-protect")},{name:__("Access to scan on Cloud","jetpack-protect")},{name:__("One-click auto fixes","jetpack-protect")},{name:__("Notifications","jetpack-protect")},{name:__("Severity labels","jetpack-protect")}]};return u().createElement(u().Fragment,null,u().createElement(a.ZP,I,u().createElement(a.oK,{primary:!0},u().createElement(a.NE,null,u().createElement(c.Z,{price:R,offPrice:j,leyend:__("/month, billed yearly","jetpack-protect"),currency:w,hideDiscountLabel:!1}),u().createElement(r.Z,{fullWidth:!0,onClick:P,isLoading:b,disabled:v||b},__("Get Jetpack Protect","jetpack-protect"))),u().createElement(a.kF,{isIncluded:!0,label:u().createElement("strong",null,__("Line by line malware scanning","jetpack-protect"))}),u().createElement(a.kF,{isIncluded:!0,label:u().createElement("strong",null,__("Plus on-demand manual scans","jetpack-protect"))}),u().createElement(a.kF,{isIncluded:!0,label:u().createElement("strong",null,__("Automatic protection and rule updates","jetpack-protect"))}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!0})),u().createElement(a.oK,null,u().createElement(a.NE,null,u().createElement(c.Z,{price:0,leyend:__("Free forever","jetpack-protect"),currency:w,hidePriceFraction:!0}),u().createElement(r.Z,{fullWidth:!0,variant:"secondary",onClick:x,isLoading:v,disabled:v||b,error:l?__("An error occurred. Please try again.","jetpack-protect"):null},__("Start for free","jetpack-protect"))),u().createElement(a.kF,{isIncluded:!0,label:__("Check items against database","jetpack-protect")}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!0,label:__("Manual rules only","jetpack-protect")}),u().createElement(a.kF,{isIncluded:!0}),u().createElement(a.kF,{isIncluded:!1}),u().createElement(a.kF,{isIncluded:!1}),u().createElement(a.kF,{isIncluded:!1}),u().createElement(a.kF,{isIncluded:!1}))))}},1233:function(e,t,n){"use strict";var a=n(5235),c=n.n(a),r=n(6067);t.Z=e=>{let{className:t,total:n=100,value:a}=e;if(null==a)return null;const i=Math.min(Math.round(a/n*100),100),o={width:`${i}%`};return React.createElement("div",{className:c()(t,r.Z["progress-bar"])},React.createElement("div",{className:r.Z["progress-bar__wrapper"]},React.createElement("div",{"aria-valuemax":n,"aria-valuemin":0,"aria-valuenow":Math.min(a,n),className:r.Z["progress-bar__bar"],role:"progressbar",style:o})),React.createElement("p",{className:r.Z["progress-bar__percent"]},`${i}%`))}},5800:function(e,t,n){"use strict";var a=n(6895),c=n(5106),r=n(526),i=n(857),o=n(8258),l=n(5736),s=n(9196),u=n.n(s),p=n(3898),m=n(6477),d=n(5773),h=n(9909),g=n(8383);const __=l.__,f=()=>{const{adminUrl:e,siteSuffix:t}=window.jetpackProtectInitialState||{},{run:n}=(0,o.Z)({productSlug:p.o,redirectUrl:e}),{recordEventHandler:l}=(0,m.Z)(),s=l("jetpack_protect_footer_get_scan_link_click",n),{hasRequiredPlan:h}=(0,d.Z)();if(h){const e=(0,a.Z)("jetpack-scan-dash",{site:t});return u().createElement("div",{className:g.Z["product-section"]},u().createElement(c.Dx,null,__("Get access to our Cloud","jetpack-protect")),u().createElement(c.ZP,{mb:3},__("With your Protect upgrade, you have free access to scan your site on our Cloud, so you can be aware and fix your threats even if your site goes down. ","jetpack-protect")),u().createElement(r.Z,{variant:"secondary",weight:"regular",href:e},__("Go to Cloud","jetpack-protect")))}return u().createElement("div",{className:g.Z["product-section"]},u().createElement(c.Dx,null,__("Advanced scan results","jetpack-protect")),u().createElement(c.ZP,{mb:3},__("Upgrade Jetpack Protect to get advanced scan tools, including one-click fixes for most threats and malware scanning.","jetpack-protect")),u().createElement(i.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:s}))},v=()=>{const{hasRequiredPlan:e}=(0,d.Z)();if(e){const e=(0,a.Z)("protect-footer-learn-more-scan");return u().createElement("div",{className:g.Z["info-section"]},u().createElement(c.Dx,null,__("Line-by-line scanning","jetpack-protect")),u().createElement(c.ZP,{mb:2},__("We actively review line-by-line of your site files to identify threats and vulnerabilities. Jetpack monitors millions of websites to keep your site secure all the time. ","jetpack-protect"),u().createElement(r.Z,{variant:"link",target:"_blank",weight:"regular",href:e},__("Learn more","jetpack-protect"))))}const t=(0,a.Z)("jetpack-protect-footer-learn-more");return u().createElement("div",{className:g.Z["info-section"]},u().createElement(c.Dx,null,__("Over 22,000 listed vulnerabilities","jetpack-protect")),u().createElement(c.ZP,{mb:3},__("Every day we check your plugin, theme, and WordPress versions against our 22,000 listed vulnerabilities powered by WPScan, an Automattic brand.","jetpack-protect")),u().createElement(r.Z,{variant:"link",isExternalLink:!0,href:t,weight:"regular"},__("Learn more","jetpack-protect")))};t.Z=()=>u().createElement(h.Z,{main:u().createElement(f,null),secondary:u().createElement(v,null),preserveSecondaryOnMobile:!0})},8686:function(e,t,n){"use strict";var a=n(216),c=n(3363),r=n(3846),i=n(5106),o=n(3329),l=n(5609),s=n(9818),u=n(5736),p=n(9196),m=n.n(p),d=n(6477),h=n(5773),g=n(4633),f=n(7267),v=n(4948),E=n(1233),b=n(5800),k=n(9909),y=n(4910),Z=n(5207),C=n(5983),_=n(61),w=n(8264),R=n(6165);const __=u.__;t.Z=()=>{const{lastChecked:e,currentStatus:t,errorCode:n,errorMessage:u,hasRequiredPlan:j}=(0,h.Z)(),{hasConnectionError:N}=(0,o.Z)(),{refreshStatus:S}=(0,s.useDispatch)(g.t),{statusIsFetching:P,scanIsUnavailable:x,status:I}=(0,s.useSelect)((e=>({statusIsFetching:e(g.t).getStatusIsFetching(),scanIsUnavailable:e(g.t).getScanIsUnavailable(),status:e(g.t).getStatus()}))),{currentProgress:M}=I;let T;if(T="error"===t||x?"error":e?"active":"in_progress",(0,R.Z)(),(0,w.Z)(),(0,p.useEffect)((()=>{P||"unavailable"!==I.status||x||S(!0)}),[P,I.status,S,x]),(0,d.Z)({pageViewEventName:"protect_admin",pageViewEventProperties:{check_status:T,has_plan:j}}),"error"===t||x){let e=u?`${u} (${n}).`:__("We are having problems scanning your site.","jetpack-protect");return e+=" "+__("Try again in a few minutes.","jetpack-protect"),m().createElement(f.Z,null,m().createElement(a.Z,null,m().createElement(c.Z,{horizontalSpacing:0},N&&m().createElement(r.Z,{className:_.Z["connection-error-col"]},m().createElement(o.h,null)),m().createElement(r.Z,null,m().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),m().createElement(k.Z,{main:m().createElement("div",{className:_.Z["main-content"]},m().createElement(v.Z,{className:_.Z["alert-icon-wrapper"]}),m().createElement(i.H3,null,__("We’re having problems scanning your site","jetpack-protect")),m().createElement(i.ZP,null,e)),secondary:m().createElement("div",{className:_.Z.illustration},m().createElement("img",{src:C,alt:""})),preserveSecondaryOnMobile:!1})),m().createElement(b.Z,null))}return["scheduled","scanning","optimistically_scanning"].indexOf(I.status)>=0||!e?m().createElement(f.Z,null,m().createElement(a.Z,null,m().createElement(c.Z,{horizontalSpacing:0},N&&m().createElement(r.Z,{className:_.Z["connection-error-col"]},m().createElement(o.h,null)),m().createElement(r.Z,null,m().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),m().createElement(k.Z,{main:m().createElement("div",{className:_.Z["main-content"]},m().createElement(c.Z,{horizontalSpacing:3,horizontalGap:7},m().createElement(r.Z,{className:_.Z["loading-content"]},m().createElement(l.Spinner,{style:{color:"black",marginTop:0,marginLeft:0}}),m().createElement("span",null,__("Scanning your site…","jetpack-protect"))),m().createElement(r.Z,null,m().createElement(i.H3,null,__("Your results will be ready soon","jetpack-protect")),null!==M&&M>=0&&m().createElement(E.Z,{value:M}),m().createElement(i.ZP,null,__("We are scanning for security threats from our more than 22,000 listed vulnerabilities, powered by WPScan. This could take a minute or two.","jetpack-protect"))))),secondary:m().createElement("div",{className:_.Z.illustration},m().createElement("img",{src:C,alt:""})),preserveSecondaryOnMobile:!1})),m().createElement(b.Z,null)):m().createElement(f.Z,null,m().createElement(a.Z,null,m().createElement(c.Z,{horizontalSpacing:0},N&&m().createElement(r.Z,{className:_.Z["connection-error-col"]},m().createElement(o.h,null)),m().createElement(r.Z,null,m().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),m().createElement(c.Z,{horizontalSpacing:3,horizontalGap:7},m().createElement(r.Z,null,m().createElement(y.Z,null)),m().createElement(r.Z,null,m().createElement(Z.Z,null)))),m().createElement(b.Z,null))}},8264:function(e,t,n){"use strict";var a=n(9818),c=n(9196),r=n(4633);t.Z=()=>{const{checkCredentials:e}=(0,a.useDispatch)(r.t),t=(0,a.useSelect)((e=>e(r.t).getCredentials()));(0,c.useEffect)((()=>{t||e()}),[e,t])}},6165:function(e,t,n){"use strict";var a=n(6989),c=n.n(a),r=n(9818),i=n(4769),o=n.n(i),l=n(9196),s=n(6477),u=n(4633);t.Z=()=>{const{recordEvent:e}=(0,s.Z)(),t=(0,r.useSelect)((e=>e(u.t).getStatus())),{setStatus:n,setStatusProgress:a,setStatusIsFetching:i,setScanIsUnavailable:p}=(0,r.useDispatch)(u.t);(0,l.useEffect)((()=>{let r;const l=e=>["scheduled","scanning"].indexOf(e)>=0,s=(e,t)=>!t&&"idle"===e,u=()=>new Promise(((e,t)=>{c()({path:"jetpack-protect/v1/status?hard_refresh=true",method:"GET"}).then((n=>{if(n?.error)throw n?.error_message;if(l(n?.status)||s(n?.status,n?.last_checked))return a(n?.current_progress),void(r=setTimeout((()=>{u().then((t=>e(t))).catch((e=>t(e)))}),1e4));e(n)})).catch((()=>{setTimeout((()=>{u().then((t=>e(t))).catch((e=>t(e)))}),5e3)}))}));if(l(t?.status)||s(t?.status,t?.lastChecked))return r=setTimeout((()=>{i(!0),u().then((t=>{p("unavailable"===t.status),n(o()(t)),e("jetpack_protect_scan_completed",{scan_status:t.status})})).finally((()=>{i(!1)}))}),1e4),()=>clearTimeout(r)}),[t?.status,t?.lastChecked,p,n,a,i,e])}},9909:function(e,t,n){"use strict";var a=n(2054),c=n(3363),r=n(3846),i=n(9196),o=n.n(i);t.Z=e=>{let{main:t,secondary:n,preserveSecondaryOnMobile:i=!1}=e;const[l,s]=(0,a.Z)(["sm","lg"]),u=!i&&l;return o().createElement(c.Z,{horizontalSpacing:0,horizontalGap:0,fluid:!1},!u&&o().createElement(o().Fragment,null,o().createElement(r.Z,{sm:12,md:4,lg:6},t),s&&o().createElement(r.Z,{lg:1}),o().createElement(r.Z,{sm:12,md:4,lg:5},n)),u&&o().createElement(r.Z,null,t))}},2251:function(e,t,n){"use strict";var a=n(5736),c=n(8131);const __=a.__,r=e=>e>=5?"is-critical":e>=3&&e<5?"is-high":"is-low";t.Z=e=>{let{severity:t}=e;return React.createElement("div",{className:`${c.Z["threat-severity-badge"]} ${c.Z[r(t)]}`},(e=>{const t=__("Critical","jetpack-protect"),n=__("High","jetpack-protect"),a=__("Low","jetpack-protect");return e>=5?t:e>=3&&e<5?n:a})(t))}},8959:function(e,t,n){"use strict";var a=n(5106),c=n(9307),r=n(5736),i=n(8911);const __=r.__;t.Z=()=>React.createElement(React.Fragment,null,React.createElement(a.ZP,{variant:"title-medium-semi-bold",mb:2},__("Enhanced protection","jetpack-protect")),React.createElement(a.ZP,{mb:2},__("Learn how you can execute Jetpack Firewall before WordPress initializes. This mode offers the most protection.","jetpack-protect")),React.createElement("ul",{className:i.Z.list},React.createElement("li",{className:i.Z["list-item"]},React.createElement(a.ZP,{variant:"body-small"},(0,c.createInterpolateElement)(__("To ensure the firewall can best protect your site, please update: auto_prepend_file PHP directive to point to wp-content/jetpack-waf/bootstrap.php Typically this is set either in an .htaccess file or in the global PHP configuration; contact your host for further assistance.","jetpack-protect"),{mark:React.createElement("mark",{className:i.Z.mark})}))),React.createElement("li",{className:i.Z["list-item"]},React.createElement(a.ZP,{variant:"body-small"},__("Don't forget to undo this action when Firewall is turned off, or when you uninstall Jetpack.","jetpack-protect")))))},4910:function(e,t,n){"use strict";var a=n(3396),c=n(3363),r=n(3846),i=n(5106),o=n(526),l=n(9818),s=n(9771),u=n(5736),p=n(9196),m=n.n(p),d=n(5773),h=n(4633),g=n(291),f=n(6561);const __=u.__;t.Z=()=>{const{numThreats:e,lastChecked:t,hasRequiredPlan:n}=(0,d.Z)(),p=(0,l.useSelect)((e=>e(h.t).getNotice())),v=(0,l.useSelect)((e=>e(h.t).getScanIsEnqueuing())),{scan:E}=(0,l.useDispatch)(h.t),b=(0,a.VS)("protect");return m().createElement(c.Z,{fluid:!0},m().createElement(r.Z,null,m().createElement("div",{className:f.Z.summary},m().createElement("div",null,m().createElement(i.Dx,{size:"small",className:f.Z.summary__title},m().createElement(b,{size:32,className:f.Z.summary__icon}),(0,u.sprintf)(/* translators: %s: Latest check date */ +__("Latest results as of %s","jetpack-protect"),(0,s.dateI18n)("F jS",t))),e>0&&m().createElement(i.ZP,{variant:"headline-small",component:"h1"},(0,u.sprintf)(/* translators: %s: Total number of threats */ +__("%1$s %2$s found","jetpack-protect"),e,1===e?"threat":"threats"))),m().createElement("div",{className:f.Z.summary__notice},p&&p.message&&m().createElement(g.Z,p)),n&&0===e&&m().createElement(o.Z,{variant:"secondary",className:f.Z["summary__scan-button"],isLoading:v,onClick:e=>{e.preventDefault(),E()}},__("Scan now","jetpack-protect")))))}},3324:function(e,t,n){"use strict";n.d(t,{O:function(){return r}});var a=n(554),c=n(5714);const r=e=>{let{label:t,link:n}=e;return React.createElement(a.OL,{to:n,className:e=>{let{isActive:t}=e;return t?`${c.Z.tab} ${c.Z["tab--active"]}`:c.Z.tab}},t)};t.Z=e=>{let{children:t,className:n=""}=e;return React.createElement("nav",{className:`${c.Z.tabs} ${n}`},t)}},9265:function(e,t,n){"use strict";var a=n(8063);t.Z=e=>{let{disabled:t=!1,id:n,label:c="",placeholder:r="",rows:i=3,value:o="",onChange:l=(()=>{})}=e;return React.createElement("div",null,Boolean(c)&&React.createElement("label",{className:a.Z.label,htmlFor:n},c),React.createElement("textarea",{className:a.Z.textarea,disabled:t,placeholder:r,rows:i,id:n,name:n,onChange:l,value:o||""}))}},8891:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(5106),c=n(5736),r=n(1074),i=n(9196),o=n.n(i),l=n(2251),s=n(9971);const __=c.__,u=e=>{switch(e.fixer){case"replace":return __("Jetpack Scan will replace the affected file or directory.","jetpack-protect");case"delete":return __("Jetpack Scan will delete the affected file or directory.","jetpack-protect");case"update":return e.target?(0,c.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */ +__("Jetpack Scan will update to a newer version %s.","jetpack-protect"),e.target):__("Jetpack Scan will update to a newer version.","jetpack-protect");case"edit":return __("Jetpack Scan will edit the affected file or directory.","jetpack-protect");case"rollback":return e.target?(0,c.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */ +__("Jetpack Scan will rollback the affected file to the version from %s.","jetpack-protect"),e.target):__("Jetpack Scan will rollback the affected file to an older (clean) version.","jetpack-protect");default:return __("Jetpack Scan will resolve the threat.","jetpack-protect")}};function p(e){let{threat:t,fixAllDialog:n,onCheckFix:c}=e;const[p,m]=(0,i.useState)(!0),d=(0,i.useCallback)((e=>{m(e.target.checked),c(e.target.checked,t)}),[c,t]);return o().createElement(o().Fragment,null,o().createElement("div",{className:s.Z.threat},o().createElement(r.Z,{icon:t.icon,className:s.Z.threat__icon}),o().createElement("div",{className:s.Z.threat__summary},o().createElement(a.ZP,{className:s.Z.threat__summary__label,mb:1},t.label),o().createElement(a.ZP,{className:s.Z.threat__summary__title},u(t.fixable))),o().createElement("div",{className:s.Z.threat__severity},o().createElement(l.Z,{severity:t.severity})),n&&o().createElement("div",{className:s.Z.threat__checkbox},o().createElement("input",{type:"checkbox",checked:p,onChange:d,value:t.id}))))}},5658:function(e,t,n){"use strict";var a=n(5106),c=n(9307),r=n(5736),i=n(9196),o=n(5773),l=n(9709);const __=r.__,_n=r._n,s=()=>React.createElement("svg",{width:"80",height:"96",viewBox:"0 0 80 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z",fill:"#069E08"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z",fill:"white"}));t.Z=()=>{const{lastChecked:e}=(0,o.Z)(),t=(0,i.useMemo)((()=>e?(e=>{const t=new Date,n=6e4*t.getTimezoneOffset(),a=Math.floor((new Date(t.getTime()+n).getTime()-e)/1e3);let c=a/31536e3;return c>1?(0,r.sprintf)( +// translators: placeholder is a number amount of years i.e. "5 years ago". +_n("%s year ago","%s years ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=a/2592e3,c>1?(0,r.sprintf)( +// translators: placeholder is a number amount of months i.e. "5 months ago". +_n("%s month ago","%s months ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=a/86400,c>1?(0,r.sprintf)( +// translators: placeholder is a number amount of days i.e. "5 days ago". +_n("%s day ago","%s days ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=a/3600,c>1?(0,r.sprintf)( +// translators: placeholder is a number amount of hours i.e. "5 hours ago". +_n("%s hour ago","%s hours ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=a/60,c>1?(0,r.sprintf)( +// translators: placeholder is a number amount of minutes i.e. "5 minutes ago". +_n("%s minute ago","%s minutes ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:l.Z.empty},React.createElement(s,null),React.createElement(a.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(a.ZP,null,(0,c.createInterpolateElement)((0,r.sprintf)( +// translators: placeholder is the amount of time since the last scan, i.e. "5 minutes ago". +__("The last Protect scan ran %s and everything looked great.","jetpack-protect"),t),{strong:React.createElement("strong",null)})))}},2831:function(e,t,n){"use strict";var a=n(526),c=n(5106),r=n(857),i=n(8258),o=n(5736),l=n(9196),s=n.n(l),u=n(3898),p=n(6477),m=n(3584),d=n(9709);const __=o.__,h=e=>{let{description:t,filename:n,fixedIn:h,icon:g,id:f,name:v,source:E,table:b,title:k,type:y,version:Z}=e;const{adminUrl:C}=window.jetpackProtectInitialState||{},{run:_}=(0,i.Z)({productSlug:u.o,redirectUrl:C}),{recordEventHandler:w}=(0,p.Z)(),R=w("jetpack_protect_threat_list_get_scan_link_click",_),j=E?s().createElement(a.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:E},__("See more technical details of this threat","jetpack-protect")):null,N=(0,l.useCallback)((()=>v&&Z?`${v} (${Z})`:n?n.split("/").pop():b||void 0),[n,v,b,Z]);return s().createElement(m.U,{id:f,label:N(),title:k,icon:g,onOpen:(0,l.useCallback)((()=>{["core","plugin","theme"].includes(y)&&w(`jetpack_protect_${y}_threat_open`)}),[w,y])},t&&s().createElement("div",{className:d.Z["threat-section"]},s().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),s().createElement(c.ZP,{mb:2},t),j),h&&s().createElement("div",{className:d.Z["threat-section"]},s().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),s().createElement(c.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +(0,o.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),v,h)),s().createElement(r.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:R,className:d.Z["threat-item-cta"]})),!t&&s().createElement("div",{className:d.Z["threat-section"]},j))};t.Z=e=>{let{list:t}=e;return s().createElement(m.Z,null,t.map((e=>{let{description:t,fixedIn:n,icon:a,id:c,name:r,source:i,table:o,title:l,type:u,version:p}=e;return s().createElement(h,{description:t,fixedIn:n,icon:a,id:c,key:c,name:r,source:i,table:o,title:l,type:u,version:p})})))}},5207:function(e,t,n){"use strict";var a=n(3363),c=n(3846),r=n(5106),i=n(526),o=n(9818),l=n(5736),s=n(9196),u=n.n(s),p=n(5773),m=n(4633),d=n(5658),h=n(2831),g=n(4289),f=n(1400),v=n(9709),E=n(7930);const __=l.__;t.Z=()=>{const{hasRequiredPlan:e}=(0,p.Z)(),{item:t,list:n,selected:b,setSelected:k}=(0,E.Z)(),y=n.filter((e=>e.fixable)),{setModal:Z}=(0,o.useDispatch)(m.t),{scan:C}=(0,o.useDispatch)(m.t),_=(0,o.useSelect)((e=>e(m.t).getScanIsEnqueuing())),w=(0,s.useCallback)((()=>{switch(b){case"all":return 1===n.length?__("All threats","jetpack-protect"):(0,l.sprintf)(/* translators: placeholder is the amount of threats found on the site. */ +__("All %s threats","jetpack-protect"),n.length);case"files":return(0,l.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */ +__("%1$s file %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");case"database":return(0,l.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */ +__("%1$s database %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");default:return(0,l.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +__("%1$s %2$s in your %3$s %4$s","jetpack-protect"),n.length,1===n.length?"threat":"threats",t?.name,t?.version)}}),[b,n,t]);return u().createElement(a.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},u().createElement(c.Z,{lg:4},u().createElement(g.Z,{selected:b,onSelect:k})),u().createElement(c.Z,{lg:8},n?.length>0?u().createElement(u().Fragment,null,u().createElement("div",{className:v.Z["list-header"]},u().createElement(r.Dx,{className:v.Z["list-title"]},w()),e&&u().createElement(u().Fragment,null,y.length>0&&u().createElement(i.Z,{variant:"primary",className:v.Z["list-header-button"],onClick:(R=y,e=>{e.preventDefault(),Z({type:"FIX_ALL_THREATS",props:{threatList:R}})})},/* translators: Translates to Auto fix all. $s: Number of fixable threats. */ +(0,l.sprintf)(__("Auto fix all (%s)","jetpack-protect"),y.length)),u().createElement(i.Z,{variant:"secondary",className:v.Z["list-header-button"],isLoading:_,onClick:e=>{e.preventDefault(),C()}},__("Scan now","jetpack-protect")))),e?u().createElement(f.Z,{list:n}):u().createElement(h.Z,{list:n})):u().createElement(d.Z,null)));var R}},4289:function(e,t,n){"use strict";var a=n(2054),c=n(5736),r=n(797),i=n(2817),o=n(7663),l=n(8960),s=n(4160),u=n(6376),p=n(9196),m=n(6477),d=n(5773),h=n(5338);const __=c.__;t.Z=e=>{let{selected:t,onSelect:n}=e;const{plugins:c,themes:g,numThreats:f,numCoreThreats:v,numFilesThreats:E,numDatabaseThreats:b,hasRequiredPlan:k}=(0,d.Z)(),{recordEvent:y}=(0,m.Z)(),[Z]=(0,a.Z)("lg","<"),C=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_all_click")}),[y]),_=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_core_click")}),[y]),w=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_plugin_click")}),[y]),R=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_theme_click")}),[y]),j=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_file_click")}),[y]),N=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_database_click")}),[y]);return React.createElement(h.ZP,{selected:t,onSelect:n,mode:Z?"dropdown":"list"},React.createElement(h.Dx,{initial:!0,id:"all",label:__("All threats","jetpack-protect"),icon:r.Z,badge:f,disabled:f<=0,onClick:C,checked:!0}),React.createElement(h.Dx,{id:"wordpress",label:__("WordPress","jetpack-protect"),icon:i.Z,badge:v,disabled:v<=0,onClick:_,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:o.Z},c.map((e=>{let{name:t,threats:n,checked:a}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:a,badge:n?.length,disabled:n?.length<=0,onClick:w})}))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:l.Z},g.map((e=>{let{name:t,threats:n,checked:a}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:a,badge:n?.length,disabled:n?.length<=0,onClick:R})}))),k&&React.createElement(React.Fragment,null,React.createElement(h.Dx,{id:"files",label:__("Files","jetpack-protect"),icon:s.Z,badge:E,disabled:E<=0,onClick:j,checked:!0}),React.createElement(h.Dx,{id:"database",label:__("Database","jetpack-protect"),icon:u.Z,badge:b,disabled:b<=0,onClick:N,checked:!0})))}},1400:function(e,t,n){"use strict";var a=n(526),c=n(5106),r=n(2054),i=n(9818),o=n(9307),l=n(5736),s=n(9196),u=n.n(s),p=n(6477),m=n(4633),d=n(7127),h=n(4257),g=n(289),f=n(9709);const __=l.__,v=e=>{let{context:t,description:n,diff:r,filename:o,fixedIn:v,icon:E,fixable:b,id:k,label:y,name:Z,source:C,title:_,type:w,severity:R}=e;const{setModal:j}=(0,i.useDispatch)(m.t),{recordEvent:N}=(0,p.Z)(),S=C?u().createElement(a.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:C},__("See more technical details of this threat","jetpack-protect")):null;return u().createElement(g.c,{id:k,label:y,title:_,icon:E,fixable:b,severity:R,onOpen:(0,s.useCallback)((()=>{["core","plugin","theme","file","database"].includes(w)&&N(`jetpack_protect_${w}_threat_open`)}),[N,w])},n&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),u().createElement(c.ZP,{mb:2},n),S),(o||t||r)&&u().createElement(c.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),o&&u().createElement(u().Fragment,null,u().createElement(c.ZP,{mb:2},/* translators: filename follows in separate line; e.g. "PHP.Injection.5 in: `post.php`" */ +__("Threat found in file:","jetpack-protect")),u().createElement("pre",{className:f.Z["threat-filename"]},o)),t&&u().createElement(h.Z,{context:t}),r&&u().createElement(d.C,{diff:r}),v&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),u().createElement(c.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */ +(0,l.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),Z,v))),!n&&u().createElement("div",{className:f.Z["threat-section"]},S),u().createElement("div",{className:f.Z["threat-footer"]},u().createElement(a.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),j({type:"IGNORE_THREAT",props:{id:k,label:y,title:_,icon:E,severity:R}})}},__("Ignore threat","jetpack-protect")),b&&u().createElement(a.Z,{onClick:e=>{e.preventDefault(),j({type:"FIX_THREAT",props:{id:k,label:y,title:_,icon:E,severity:R,fixable:b}})}},__("Fix threat","jetpack-protect"))))};t.Z=e=>{let{list:t}=e;const{scan:n}=(0,i.useDispatch)(m.t),l=(0,o.createInterpolateElement)(__("If you have manually fixed any of the threats listed above, you can run a manual scan now or wait for Jetpack to scan your site later today.","jetpack-protect"),{manualScanLink:u().createElement(a.Z,{variant:"link",onClick:e=>{e.preventDefault(),n()}})}),[s]=(0,r.Z)(["sm","lg"],[null,"<"]),p=e=>e.name&&e.version?`${e.name} (${e.version})`:e.filename?e.filename.split("/").pop():e.table?e.table:void 0;return t=t.map((e=>({label:p(e),...e}))),u().createElement(u().Fragment,null,!s&&u().createElement("div",{className:f.Z["accordion-heading"]},u().createElement("span",null,__("Details","jetpack-protect")),u().createElement("span",null,__("Severity","jetpack-protect")),u().createElement("span",null,__("Auto-fix","jetpack-protect")),u().createElement("span",null)),u().createElement(g.Z,null,t.map((e=>{let{context:t,description:n,diff:a,filename:c,fixedIn:r,icon:i,fixable:o,id:l,label:s,name:p,severity:m,source:d,table:h,title:g,type:f,version:E}=e;return u().createElement(v,{context:t,description:n,diff:a,filename:c,fixedIn:r,icon:i,fixable:o,id:l,key:l,label:s,name:p,severity:m,source:d,table:h,title:g,type:f,version:E})}))),u().createElement(c.ZP,{className:f.Z["manual-scan"],variant:"body-small"},l))}},7930:function(e,t,n){"use strict";var a=n(2817),c=n(7663),r=n(8960),i=n(4160),o=n(6376),l=n(9196),s=n(5773);const u=(e,t)=>Array.isArray(e)?e.map((e=>u(e,t))).flat():e?.threats?.map((n=>({...n,...e,icon:t}))),p=e=>{let{core:t,plugins:n,themes:l,files:s,database:p}=e;return[...u(t,a.Z),...u(n,c.Z),...u(l,r.Z),...u(s,i.Z),...u(p,o.Z)]};t.Z=()=>{const{plugins:e,themes:t,core:n,files:m,database:d}=(0,s.Z)();let h=p({core:n,plugins:e,themes:t,files:m,database:d}),g={};const[f,v]=(0,l.useState)(h.length?"all":null);switch(f){case"all":h=p({core:n,plugins:e,themes:t,files:m,database:d});break;case"wordpress":h=u(n,a.Z),g=n;break;case"files":h=u(m,i.Z),g=m;break;case"database":h=u(d,o.Z),g=d}const E=e.find((e=>e?.name===f));E&&(h=u(E,c.Z),g=E);const b=t.find((e=>e?.name===f));return b&&(h=u(b,r.Z),g=b),{item:g,list:h,selected:f,setSelected:v}}},2854:function(e,t,n){"use strict";var a=n(1294),c=n(8227);t.Z=e=>{let{children:t}=e;const{isUserConnected:n,hasConnectedOwner:r}=(0,a.Z)();return n&&r?t:React.createElement(c.Z,null)}},8227:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(1294),i=n(9818),o=n(5736),l=n(4633),s=n(291),u=n(541);const __=o.__;t.Z=()=>{const{setModal:e}=(0,i.useDispatch)(l.t),{userIsConnecting:t,handleConnectUser:n}=(0,r.Z)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(s.Z,{type:"info",message:__("Before Jetpack Protect can ignore and auto-fix threats on your site, a user connection is needed.","jetpack-protect")}),React.createElement(a.ZP,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Once you’ve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:u.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(c.Z,{isExternalLink:!0,weight:"regular",isLoading:t,onClick:n},__("Connect your user account","jetpack-protect"))))}},3898:function(e,t,n){"use strict";n.d(t,{K:function(){return a},o:function(){return c}});const a="https://wordpress.org/support/plugin/jetpack-protect/",c="jetpack_scan"},6477:function(e,t,n){"use strict";var a=n(6975),c=n(1294),r=n(9196);t.Z=function(){let{pageViewEventName:e,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{isUserConnected:o,isRegistered:l,userConnectionData:s}=(0,c.Z)(),{login:u,ID:p}=s.currentUser?.wpcomUser||{},{tracks:m}=a.Z,{recordEvent:d}=m,h=(0,r.useCallback)((async(e,t)=>{d(e,t)}),[d]),g=(0,r.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};return n="function"==typeof t?t:n,t="function"==typeof t?{}:t,()=>h(e,t).then(n)}),[h]);(0,r.useEffect)((()=>{o&&p&&u&&a.Z.initialize(p,u)}),[o,p,u]);const f=e?`${t}_${e}_${n}`:null;return(0,r.useEffect)((()=>{l&&f&&d(f,i)}),[]),{recordEvent:h,recordEventHandler:g}}},5773:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(9818),c=n(9196),r=n(4633);function i(){const{statusIsFetching:e,status:t,jetpackScan:n,hasRequiredPlan:i}=(0,a.useSelect)((e=>({statusIsFetching:e(r.t).getStatusIsFetching(),status:e(r.t).getStatus(),jetpackScan:e(r.t).getJetpackScan(),hasRequiredPlan:e(r.t).hasRequiredPlan()})));let o="error";!0===e?o="loading":t.status&&(o=t.status);const l=(0,c.useMemo)((()=>t.core?.threats?.length||0),[t.core]),s=(0,c.useMemo)((()=>(t.plugins||[]).reduce(((e,t)=>e+t.threats.length),0)),[t.plugins]),u=(0,c.useMemo)((()=>(t.themes||[]).reduce(((e,t)=>e+t.threats.length),0)),[t.themes]),p=(0,c.useMemo)((()=>t.files?.length||0),[t.files]),m=(0,c.useMemo)((()=>t.database?.length||0),[t.database]);return{numThreats:l+s+u+p+m,numCoreThreats:l,numPluginsThreats:s,numThemesThreats:u,numFilesThreats:p,numDatabaseThreats:m,lastChecked:t.lastChecked||null,errorCode:t.errorCode||null,errorMessage:t.errorMessage||null,core:t.core||{},plugins:t.plugins||[],themes:t.themes||[],files:{threats:t.files||[]},database:{threats:t.database||[]},currentStatus:o,hasUncheckedItems:t.hasUncheckedItems,jetpackScan:n,hasRequiredPlan:i}}},8963:function(e,t,n){"use strict";var a=n(9818),c=n(9196),r=n(1827),i=n(4633);t.Z=()=>{const{setWafConfig:e,setWafStats:t,setWafIsEnabled:n,setWafIsUpdating:o,setWafIsToggling:l}=(0,a.useDispatch)(i.t),s=(0,a.useSelect)((e=>e(i.t).getWaf())),u=(0,c.useCallback)((()=>(o(!0),r.Z.fetchWaf().then((a=>{n(a?.isEnabled),e(a?.config),t(a?.stats)})).finally((()=>o(!1))))),[e,t,n,o]),p=(0,c.useCallback)((()=>(s.isEnabled||l(!0),o(!0),r.Z.toggleWaf().then(u).finally((()=>{l(!1),o(!1)})))),[u,s.isEnabled,l,o]),m=(0,c.useCallback)((()=>s.isEnabled?Promise.resolve():p()),[p,s.isEnabled]),d=(0,c.useCallback)((()=>(o(!0),m().then((()=>r.Z.updateWaf({jetpack_waf_automatic_rules:!s.config.jetpackWafAutomaticRules}))).then(u).finally((()=>o(!1))))),[m,u,o,s.config.jetpackWafAutomaticRules]),h=(0,c.useCallback)((()=>(o(!0),m().then((()=>r.Z.updateWaf({jetpack_waf_ip_list:!s.config.jetpackWafIpList}))).then(u).finally((()=>o(!1))))),[m,u,o,s.config.jetpackWafIpList]),g=(0,c.useCallback)((()=>(o(!0),m().then((()=>r.Z.updateWaf({brute_force_protection:!s.config.bruteForceProtection}))).then(u).finally((()=>o(!1))))),[m,u,o,s.config.bruteForceProtection]),f=(0,c.useCallback)((()=>(o(!0),m().then((()=>r.Z.updateWaf({jetpack_waf_share_data:!s.config.jetpackWafShareData}))).then(u).finally((()=>o(!1))))),[m,u,o,s.config.jetpackWafShareData]),v=(0,c.useCallback)((e=>(o(!0),m().then((()=>r.Z.updateWaf(e))).then(u).finally((()=>o(!1))))),[m,u,o]);return(0,c.useEffect)((()=>{void 0!==s.config||s.isFetching||u()}),[s.config,s.isFetching,o,u]),{...s,refreshWaf:u,toggleWaf:p,toggleAutomaticRules:d,toggleManualRules:h,toggleBruteForceProtection:g,toggleShareData:f,updateConfig:v}}},5230:function(e,t,n){"use strict";n.d(t,{BZ:function(){return y},Gk:function(){return d},Oc:function(){return S},Ot:function(){return N},PF:function(){return P},P_:function(){return E},RR:function(){return f},Rj:function(){return R},U2:function(){return v},VF:function(){return C},Xm:function(){return k},Y2:function(){return m},ZP:function(){return $},_N:function(){return l},d0:function(){return u},dG:function(){return _},eG:function(){return h},hI:function(){return g},i0:function(){return Z},jA:function(){return s},kd:function(){return j},l:function(){return I},o9:function(){return p},r0:function(){return w},tu:function(){return b},y:function(){return x}});var a=n(6989),c=n.n(a),r=n(5736),i=n(4769),o=n.n(i);const _n=r._n,__=r.__,l="SET_CREDENTIALS_STATE_IS_FETCHING",s="SET_CREDENTIALS_STATE",u="SET_STATUS",p="SET_STATUS_PROGRESS",m="START_SCAN_OPTIMISTICALLY",d="SET_STATUS_IS_FETCHING",h="SET_SCAN_IS_UNAVAILABLE",g="SET_SCAN_IS_ENQUEUING",f="SET_INSTALLED_PLUGINS",v="SET_INSTALLED_THEMES",E="SET_WP_VERSION",b="SET_JETPACK_SCAN",k="SET_THREAT_IS_UPDATING",y="SET_THREATS_ARE_FIXING",Z="SET_MODAL",C="SET_NOTICE",_="CLEAR_NOTICE",w="SET_HAS_REQUIRED_PLAN",R="SET_WAF_IS_SEEN",j="SET_WAF_UPGRADE_IS_SEEN",N="SET_WAF_IS_ENABLED",S="SET_WAF_IS_UPDATING",P="SET_WAF_IS_TOGGLING",x="SET_WAF_CONFIG",I="SET_WAF_STATS",M=e=>({type:u,status:e}),T=()=>({type:m}),L=e=>c()({path:"jetpack-protect/v1/status"+(e?"?hard_refresh=true":""),method:"GET"}),z=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return async t=>{let{dispatch:n}=t;return n(O(!0)),await new Promise(((t,a)=>L(e).then(A).then((e=>{n(D("unavailable"===e.status)),n(M(o()(e))),t(e)})).catch((e=>{a(e)})).finally((()=>{n(O(!1))}))))}},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise(((n,a)=>{"unavailable"===e.status&&t<3?L(!0).then((e=>{setTimeout((()=>{A(e,t+1).then((e=>n(e))).catch((e=>a(e)))}),5e3)})).catch(a):n(e)}))},F=e=>({type:l,isFetching:e}),V=e=>({type:s,credentials:e}),O=e=>({type:d,status:e}),D=e=>({type:h,status:e}),H=e=>({type:g,isEnqueuing:e}),U=(e,t)=>({type:k,payload:{threatId:e,isUpdating:t}}),B=e=>({type:y,threatIds:e}),W=e=>async t=>{let{dispatch:n}=t;const a=e.reduce(((e,t)=>`${e}threat_ids[]=${t}&`),"jetpack-protect/v1/fix-threats-status?");return n(B(e)),await c()({path:a,method:"GET"}).then((async t=>{const a=Object.values(t.threats);if(a.filter((e=>"in_progress"===e.status)).length>0)return await new Promise((()=>{setTimeout((()=>{n(W(e))}),1e3)}));if(!a.filter((e=>"fixed"===e.status)).length===e.length)throw"Not all threats could be fixed."})).then((()=>{n(z()),n(J({type:"success",message:(0,r.sprintf)( +// translators: placeholder is the number amount of fixed threats. +_n("%s threat was fixed successfully","%s threats were fixed successfully",e.length,"jetpack-protect"),e.length)}))})).catch((()=>{n(J({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{n(B([]))}))},J=e=>({type:C,payload:e}),G=e=>({type:w,hasRequiredPlan:e}),$={checkCredentials:()=>async e=>{let{dispatch:t}=e;return await new Promise(((e,n)=>(t(F(!0)),c()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((n=>{t(V(n)),e(n)})).catch((e=>{n(e)})).finally((()=>{t(F(!1))})))))},setCredentials:V,setCredentialsIsFetching:F,setStatus:M,setStatusProgress:e=>({type:p,currentProgress:e}),startScanOptimistically:T,refreshStatus:z,setStatusIsFetching:O,setScanIsEnqueuing:H,setInstalledPlugins:e=>({type:f,plugins:e}),setInstalledThemes:e=>({type:v,themes:e}),setwpVersion:e=>({type:E,version:e}),setJetpackScan:e=>({type:b,scan:e}),ignoreThreat:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:a}=n;return a(U(e,!0)),await new Promise((()=>c()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(z()))).then((()=>a(J({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>a(J({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{a(U(e,!1)),t()}))))}},setModal:e=>({type:Z,payload:e}),setNotice:J,clearNotice:()=>({type:_}),fixThreats:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:a}=n;return e.forEach((e=>{a(U(e,!0))})),await new Promise((()=>c()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>a(J({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>a(W(e))),1e3)})).catch((()=>a(J({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{a(U(e,!1))})),t()}))))}},scan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return async t=>{let{dispatch:n}=t;return n(H(!0)),await new Promise((()=>c()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{n(T()),setTimeout((()=>n(z(!0))),5e3)})).catch((()=>n(J({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{n(H(!1)),e()}))))}},setThreatsAreFixing:B,refreshPlan:()=>e=>{let{dispatch:t}=e;c()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>t(G(e))))},setHasRequiredPlan:G,setScanIsUnavailable:D,setWafIsEnabled:e=>({type:N,isEnabled:e}),setWafIsSeen:e=>({type:R,isSeen:e}),setWafUpgradeIsSeen:e=>({type:j,upgradeIsSeen:e}),setWafIsUpdating:e=>({type:S,isUpdating:e}),setWafIsToggling:e=>({type:P,isToggling:e}),setWafConfig:e=>({type:x,config:e}),setWafStats:e=>({type:I,stats:e})}},3638:function(e,t,n){"use strict";var a=n(9818),c=n(5230);const r={isSupported:null,isSeen:!1,upgradeIsSeen:!1,isEnabled:!1,isUpdating:!1,isToggling:!1,config:void 0,stats:void 0},i=(0,a.combineReducers)({credentials:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===c.jA?t.credentials:e},credentialsIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c._N?t.isFetching:e},status:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case c.d0:return t.status;case c.o9:return{...e,currentProgress:t.currentProgress};case c.Y2:return{...e,currentProgress:0,status:"optimistically_scanning"}}return e},statusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.Gk?t.status:e},scanIsUnavailable:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.eG?t.status:e},scanIsEnqueuing:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.hI?t.isEnqueuing:e},installedPlugins:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.RR?t.plugins:e},installedThemes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.U2?t.themes:e},wpVersion:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.P_?t.version:e},jetpackScan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.tu?t.scan:e},threatsUpdating:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.Xm?{...e,[t.payload.threatId]:t.payload.isUpdating}:e},modal:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===c.i0?{...e,...t.payload}:e},notice:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case c.VF:return{...e,...t.payload};case c.dG:return{}}return e},setThreatsFixing:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t.type===c.BZ?t.threatIds:e},hasRequiredPlan:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===c.r0?t.hasRequiredPlan:e},waf:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case c.Rj:return{...e,isSeen:t.isSeen};case c.kd:return{...e,upgradeIsSeen:t.upgradeIsSeen};case c.Ot:return{...e,isEnabled:t.isEnabled};case c.y:return{...e,config:t.config};case c.l:return{...e,stats:t.stats};case c.Oc:return{...e,isUpdating:t.isUpdating};case c.PF:return{...e,isToggling:t.isToggling}}return e}});t.Z=i},1056:function(e,t,n){"use strict";var a=n(6989),c=n.n(a),r=n(5230);const i={getJetpackScan:{isFulfilled:e=>Object.keys(e?.jetpackScan).length>0,fulfill:()=>async e=>{let{dispatch:t}=e;const n=await c()({path:"/my-jetpack/v1/site/products/scan",method:"GET"});t(r.ZP.setJetpackScan(n))}}};t.Z=i},6850:function(e,t){"use strict";t.Z={getCredentials:e=>e.credentials||null,getCredentialsIsFetching:e=>e.credentialsIsFetching||!1,getInstalledPlugins:e=>e.installedPlugins||{},getInstalledThemes:e=>e.installedThemes||{},getStatus:e=>e.status||{},getStatusIsFetching:e=>e.statusIsFetching||!1,getScanIsUnavailable:e=>e.scanIsUnavailable||!1,getScanIsEnqueuing:e=>e.scanIsEnqueuing||!1,getWpVersion:e=>e.wpVersion||"",getJetpackScan:e=>e.jetpackScan||{},getThreatsUpdating:e=>e.threatsUpdating||{},getModalType:e=>e.modal?.type||null,getModalProps:e=>e.modal?.props||{},getNotice:e=>e.notice||null,getThreatsAreFixing:e=>e.threatsAreFixing||[],hasRequiredPlan:e=>e.hasRequiredPlan||!1,getWaf:e=>e.waf}},5217:function(e,t,n){"use strict";var a=n(17),c=n.n(a),r=n(9818);class i{static mayBeInit(e,t){null===i.store&&(i.store=(0,r.createReduxStore)(e,t),(0,r.register)(i.store))}}c()(i,"store",null),t.Z=i},4633:function(e,t,n){"use strict";n.d(t,{N:function(){return p},t:function(){return u}});var a=n(4769),c=n.n(a),r=n(5230),i=n(3638),o=n(1056),l=n(6850),s=n(5217);const u="jetpack-protect";function p(){s.Z.mayBeInit(u,{__experimentalUseThunks:!0,reducer:i.Z,actions:r.ZP,selectors:l.Z,resolvers:o.Z,initialState:c()(window.jetpackProtectInitialState)||{}})}},5983:function(e,t,n){"use strict";e.exports=n.p+"images/in-progress-db145d62b5ef09c05ad7.png"},6436:function(e){"use strict";if(void 0==={consumer_slug:"jetpack-protect"}){var t=new Error('Cannot find module \'{"consumer_slug":"jetpack-protect"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"jetpack-protect"}},9196:function(e){"use strict";e.exports=window.React},6292:function(e){"use strict";e.exports=window.moment},6989:function(e){"use strict";e.exports=window.wp.apiFetch},5609:function(e){"use strict";e.exports=window.wp.components},4333:function(e){"use strict";e.exports=window.wp.compose},9818:function(e){"use strict";e.exports=window.wp.data},9771:function(e){"use strict";e.exports=window.wp.date},9307:function(e){"use strict";e.exports=window.wp.element},5736:function(e){"use strict";e.exports=window.wp.i18n},444:function(e){"use strict";e.exports=window.wp.primitives},6483:function(e){"use strict";e.exports=window.wp.url},17:function(e,t,n){var a=n(6930);e.exports=function(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},2674:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;twindow.scrollTo(0,0)),[e]),null}(0,u.N)(),function(){const n=document.getElementById("jetpack-protect-root");if(null===n)return;const a=c().createElement(e.ZP,null,c().createElement(i.UT,null,c().createElement(p,null),c().createElement(r.Z5,null,c().createElement(r.AW,{path:"/",element:c().createElement(s.Z,null)}),c().createElement(r.AW,{path:"/firewall",element:c().createElement(o.Z,null)}))),c().createElement(l.Z,null));t.createRoot?t.createRoot(n).render(a):t.render(a,n)}()}()}(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt new file mode 100644 index 00000000..77b8fe88 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.js.LICENSE.txt @@ -0,0 +1,35 @@ +/* + * Exposes number format capability + * + * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors). + * @license See CREDITS.md + * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js + */ + +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ + +/** + * React Router DOM v6.2.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router v6.2.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css new file mode 100644 index 00000000..c5721523 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/build/index.rtl.css @@ -0,0 +1 @@ +.p4qz2tkq0p9hxucJ6Qk2{--padding:calc(var(--spacing-base)*4);color:var(--jp-black)}.lbNDyXioOwvyvbALtCBm{--gap:calc(var(--spacing-base)*3);padding:var(--padding) 0;position:relative}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm{column-gap:var(--gap);display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--columns),1fr);grid-template-rows:repeat(var(--rows),minmax(min-content,max-content))}.cLaNK_XcbTGlRQ4Tp43Q{margin-top:var(--padding)}.s2Lsn4kbm6BrS3DSndRB .cLaNK_XcbTGlRQ4Tp43Q{display:contents}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>*{background:var(--jp-white);position:relative}.cLaNK_XcbTGlRQ4Tp43Q.CYt1X0eH1icRjhtJ28jx>:after{bottom:0;box-shadow:0 4px 24px rgba(0,0,0,.05);content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.cLaNK_XcbTGlRQ4Tp43Q>:first-child{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius);border-width:1px 1px 0}.cLaNK_XcbTGlRQ4Tp43Q>:last-child{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius);border-width:0 1px 1px}.DAkZc1P9A3K12fjEliMg{display:flex;flex-direction:column;justify-content:space-between;padding:var(--padding)}.WUBuYABl8nymjs9NnCEL{align-items:center;display:flex;padding-bottom:calc(var(--spacing-base)*2);position:relative}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)){padding-top:calc(var(--spacing-base)*2)}.WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{background-color:var(--jp-gray);content:"";height:1px;left:var(--padding);position:absolute;right:var(--padding);top:0;z-index:5}.s2Lsn4kbm6BrS3DSndRB .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{left:unset;right:0;width:calc(100% + var(--gap))}.s2Lsn4kbm6BrS3DSndRB .lbNDyXioOwvyvbALtCBm>:last-child .WUBuYABl8nymjs9NnCEL:not(:nth-child(2)):before{width:100%}.ANtCFeb41NhA8PA3H7ZN,.WUBuYABl8nymjs9NnCEL:last-of-type{padding-bottom:var(--padding)}.Ql2gy_148yW8Vw5vhaKD{padding-left:var(--padding);padding-right:var(--padding)}.EAQrAnQEW1z1BfdY5gbC{fill:var(--jp-gray);flex-shrink:0;margin:0 var(--spacing-base)}.EAQrAnQEW1z1BfdY5gbC.JDSTlLoOC_4aUoH2oNM2{fill:var(--jp-green-40)}.EAQrAnQEW1z1BfdY5gbC.zNdQRJ1w7BvaQOYyqzHK{fill:var(--jp-red-50)}.lr7vbX95SKtoe7DarJcZ{margin-right:auto}.s2Lsn4kbm6BrS3DSndRB .lr7vbX95SKtoe7DarJcZ{margin:0 var(--spacing-base);top:1px}.WUBuYABl8nymjs9NnCEL .KRrGp2xdkeBOxLZeuQ6X{fill:var(--jp-gray-20);flex-shrink:0}.H_ZJiRVJg0LiMXPGOcmt{text-align:center;width:fit-content}.H_ZJiRVJg0LiMXPGOcmt>a{color:#000}.s2Lsn4kbm6BrS3DSndRB .H_ZJiRVJg0LiMXPGOcmt{grid-column:2;overflow:hidden;padding-left:var(--padding);padding-right:var(--padding);white-space:nowrap}.x21z_DixObRDsDaWotP1{align-items:right;display:flex;justify-content:right;margin:0 calc(var(--spacing-base)*4)}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-left:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-right:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-left:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-right:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-left:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-right:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-left:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-right:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-left:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-right:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-left:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-right:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-left:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-right:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-left:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-right:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-left:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-right:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-left:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-right:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-left:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-right:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-left:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-right:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-left:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-right:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-left:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-right:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-left:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-right:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-left:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-right:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-left:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-right:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-left:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-right:calc(var( --spacing-base )*8)}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-10:#f2cf75;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(-8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-left:-62px}.icon-tooltip-helper .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-right:-62px}.icon-tooltip-helper .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.icon-tooltip-helper .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.icon-tooltip-helper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.icon-tooltip-helper .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.icon-tooltip-wrapper{color:var(--jp-black);display:inline-block;position:relative}.icon-tooltip-wrapper .components-button.is-link:focus:not(:disabled){box-shadow:none}.icon-tooltip-helper{height:18px;pointer-events:none;position:absolute;right:-53px;top:0;width:124px}.icon-tooltip-container{pointer-events:all}.icon-tooltip-title{font-size:16px;font-weight:600;line-height:19px}.icon-tooltip-title:not(:last-child){margin-bottom:8px}.icon-tooltip-content{font-size:14px;font-weight:400;line-height:24px}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.5px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-left:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-right:calc(var(--spacing-base)/2)}.gridicon{fill:currentColor;display:inline-block}.gridicon.needs-offset g{transform:translate(-1px,1px)}.gridicon.needs-offset-x g{transform:translate(-1px)}.gridicon.needs-offset-y g{transform:translateY(1px)}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50)}.dovianZYLKhnbnh9I06o{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-end}.lljtQMhW7lq5tE5SDJEf{flex-basis:0;flex-grow:2}.dhFQXpZfMwVI8vuYHnwC{align-items:flex-start;display:inline-flex;position:relative}.dhFQXpZfMwVI8vuYHnwC:first-child{margin-left:calc(var(--spacing-base)*2)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k{color:var(--jp-gray-20)}.dhFQXpZfMwVI8vuYHnwC.eD7hzxFmdtG_MgmBtl_k:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.C64ZjjUAqJC1T2Sa7apS{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start;margin-bottom:calc(var(--spacing-base)*3)}.UpZDGew6Ay1hPoP6eI7b{color:var(--jp-gray-40);font-size:var(--font-body-small);line-height:20px}.UpZDGew6Ay1hPoP6eI7b:after{content:"​"}.NubApIV1vQCRUNprfm6b{background-color:var(--jp-yellow-10);border-radius:4px;font-size:13px;font-weight:600;margin-right:var(--spacing-base);padding-left:var(--spacing-base);padding-right:var(--spacing-base)}.TDiiPbuW1Z0_05u_pvcK{font-weight:400}.UL3B1tQ854mN7r6taB61{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.IG56Hw7ZR_7rKVsM78qw:focus:not(:disabled){box-shadow:none}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.jp-dashboard-footer{align-items:center;color:#000;display:flex;flex-flow:row wrap;justify-content:space-between;max-width:1128px;width:100%}.jp-dashboard-footer a,.jp-dashboard-footer a:hover,.jp-dashboard-footer a:visited{color:#000;text-decoration:none}.jp-dashboard-footer__jetpack-symbol,.jp-dashboard-footer__module-name{display:inline-block;vertical-align:middle}.jp-dashboard-footer__module-name{font-size:12px;font-weight:600;margin-right:5px}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off)}.lyrXe0pA852TUmyekDb5{display:flex}.KgEeDTKgTC5ZjzYlbTqN{color:var(--jp-black);font-size:var(--font-body);line-height:1.5;margin-left:calc(var(--spacing-base)*4);padding:var(--spacing-base) 0;text-decoration:none}.KgEeDTKgTC5ZjzYlbTqN:last-child{margin-left:0}.KgEeDTKgTC5ZjzYlbTqN:focus,.KgEeDTKgTC5ZjzYlbTqN:hover{border-bottom-color:var(--jp-green);box-shadow:none;color:var(--jp-green)}.Lv4WoNVkeJntqvUyG4dX{border-bottom:1px solid var(--jp-black)}.vvXnRXxrU1kP1KsdSr4J{margin-top:calc(var(--spacing-base)*3*-1)}.aDCTkUFaJEeZzYYE6qv5{background-color:var(--jp-green);border-radius:32px;color:var(--jp-white);font-size:12px;letter-spacing:-2%;line-height:1;margin-right:var(--spacing-base);padding:calc(var(--spacing-base)/2) var(--spacing-base);position:relative;top:-1px}.uQlXhcfYn9tbnK27_Gct{align-items:center;display:flex}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:checked{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:indeterminate{background:var(--jp-green-40);border-color:var(--jp-green-40)}.uQlXhcfYn9tbnK27_Gct input[type=checkbox]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--jp-green-40)}.PO9zDOaSkcv_RqpfZF_v,.e5YHJiYcvfgdEEJsS_YM{margin-bottom:calc(var(--spacing-base)*7);margin-top:calc(var(--spacing-base)*7)}@media(max-width:599px){.PO9zDOaSkcv_RqpfZF_v{margin-top:0}}.gTWkHo5lqwE_OCesAhBx{color:var(--jp-gray-50)}.gTWkHo5lqwE_OCesAhBx:before{background:var(--jp-gray-50);border-radius:50%;content:"";display:inline-block;height:8px;margin-left:var(--spacing-base);width:8px}.gTWkHo5lqwE_OCesAhBx.JeLxNe31ii68Utrr2xr6{color:var(--jp-green-40)}.gTWkHo5lqwE_OCesAhBx.JeLxNe31ii68Utrr2xr6:before{background:var(--jp-green-40)}svg.V6B8ltQ7TH3UKzUC_qy1{color:var(--jp-black);height:32px;margin:0;width:32px}.C9hcvYAbgHPhN2Tl22xg{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.C9hcvYAbgHPhN2Tl22xg .XkbIpr2gzB4XEhHgzkY4{margin-left:calc(var(--spacing-base)/2)}.BfcZn0_X33Ajdd1Gl18G{display:flex}.BfcZn0_X33Ajdd1Gl18G>.rBmVJIeTNpd0RJWaRGuJ{fill:var(--jp-gray-20);display:flex;margin-right:calc(var(--spacing-base)/2)}.jVq5444f1Xh6nNkz0Qe_{margin-top:calc(var(--spacing-base)*4)}.amF9cOnMiv2nHbkMXQiQ{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FodE_7RbLD8zeBSd6eVR{display:flex;flex-wrap:wrap;margin-right:auto}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-left:calc(var(--spacing-base)*3)}.twyPhW_K164HITnDrwEg{padding:calc(var(--spacing-base)*2);width:250px}.tbcd9xc_TjcFdokOt3F_{font-size:18px}@media(max-width:599px){.pnoqLV3l30xuvj2hLlJc{width:90%}.FodE_7RbLD8zeBSd6eVR{margin-top:calc(var(--spacing-base)*3)}.FodE_7RbLD8zeBSd6eVR>:first-child{margin-bottom:var(--spacing-base);margin-left:0}}.IunwKwdvL271DxBIniPb[type=checkbox]{display:none}.svA9WxEcOByd5S2fZonA{border:2px solid var(--jp-black);border-radius:100px;box-sizing:border-box;cursor:pointer;display:inline-block;height:24px;outline:0;padding:2px;position:relative;transition:all .4s ease,box-shadow 0s;vertical-align:middle;width:48px}.svA9WxEcOByd5S2fZonA:after{background:var(--jp-black);border-radius:50%;content:"";display:block;height:16px;position:relative;right:0;transition:all .2s ease;width:16px}.IunwKwdvL271DxBIniPb:checked+.svA9WxEcOByd5S2fZonA:after{right:22px}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-black);border-color:var(--jp-black)}.IunwKwdvL271DxBIniPb:checked:disabled+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA{background-color:var(--jp-green);border-color:var(--jp-green)}.IunwKwdvL271DxBIniPb:checked:not(:disabled)+.svA9WxEcOByd5S2fZonA:after{background-color:var(--jp-white)}.IunwKwdvL271DxBIniPb:disabled+span.svA9WxEcOByd5S2fZonA{cursor:default;opacity:.25}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA{border-radius:8px;height:16px;width:24px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n+.svA9WxEcOByd5S2fZonA:after{height:12px;width:12px}.IunwKwdvL271DxBIniPb.wOd7DeP76v1fczKfah5n:checked+.svA9WxEcOByd5S2fZonA:after{right:8px}._aiMxmJRAw5jRPbZFX57{background-color:var(--jp-gray-90);border-radius:var(--jp-border-radius);color:var(--jp-white);display:flex;overflow:hidden}._aiMxmJRAw5jRPbZFX57.eWgNBUaexiR66ZI1Px4U{border-right:4px solid var(--jp-yellow-20);margin-bottom:calc(var(--spacing-base)*3)}._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{left:calc(var(--spacing-base)*3);margin-right:calc(var(--spacing-base)*3);position:fixed;top:calc(var(--spacing-base)*6)}@media(max-width:782px){._aiMxmJRAw5jRPbZFX57.ZGELG1CO333FilJXOaeI{top:calc(var(--spacing-base)*8)}}._aiMxmJRAw5jRPbZFX57 a,._aiMxmJRAw5jRPbZFX57 a:active,._aiMxmJRAw5jRPbZFX57 a:hover,._aiMxmJRAw5jRPbZFX57 a:link,._aiMxmJRAw5jRPbZFX57 a:visited{color:var(--jp-white)}.BnI88X_e8ItF1c9Uozmj{fill:var(--jp-white);align-items:center;background-color:var(--jp-yellow-30);display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.hRRUwTCPRpurhMwRNZkg .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-green-50)}.Z6q3IxY_uR1y2lAPTkVF .BnI88X_e8ItF1c9Uozmj{background-color:var(--jp-red)}.eWgNBUaexiR66ZI1Px4U .BnI88X_e8ItF1c9Uozmj{fill:var(--jp-yellow-50);background-color:var(--jp-yellow-5)}.ST8sowTbBVLRPrk4ZQrn{font-size:14px;padding:calc(var(--spacing-base)*1.75)}.eWgNBUaexiR66ZI1Px4U .ST8sowTbBVLRPrk4ZQrn{background-color:var(--jp-yellow-5);color:var(--jp-gray-90)}.lMkO08Vd8YQMfwrwaI8u{fill:var(--jp-gray);align-items:center;background:transparent;border:none;cursor:pointer;display:flex;justify-content:center;padding:calc(var(--spacing-base)*1.5)}.rigH8UdiDrmmSLQMUurD{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);color:var(--jp-black);display:block;font-size:var(--font-body);letter-spacing:-.02em;line-height:1.5;padding:var(--spacing-base) calc(var(--spacing-base)*1.5);transition:box-shadow .1s ease-out;width:100%}.rigH8UdiDrmmSLQMUurD::placeholder{color:var(--jp-gray-20)}.rigH8UdiDrmmSLQMUurD:focus{box-shadow:0 0 0 2px var(--jp-green-5)}.rigH8UdiDrmmSLQMUurD:focus,.rigH8UdiDrmmSLQMUurD:hover:not(:disabled){border:1px solid var(--jp-green)}.rigH8UdiDrmmSLQMUurD:disabled{background-color:var(--jp-gray-0);color:var(--jp-gray-30)}.V8FDM08CpcwQs4UwN2nI{color:var(--jp-black);display:block;font-size:var(--font-title-small);font-weight:600;margin-bottom:calc(var(--spacing-base)*2)}.DM4b8iQ0ewvRYdIPxvZ8{max-width:calc(744px + var(--spacing-base)*6);width:100%}.bW6ZuNzJBYU5PVPktE2S{display:flex}.bW6ZuNzJBYU5PVPktE2S:not(:first-child){margin-top:calc(var(--spacing-base)*7)}.di3wjXHrX1rk_H6rlxKM{margin-left:calc(var(--spacing-base)*2);padding-top:calc(var(--spacing-base)/2)}@media(min-width:600px){.di3wjXHrX1rk_H6rlxKM{margin-left:calc(var(--spacing-base)*5)}}.IrzHnNkRvORtyCL0yiWa{width:100%}.sU82bpLEYPC9n_CFAKoz{align-items:center;display:flex}.ZZc0LldcbJpcftqCe43T .IrzHnNkRvORtyCL0yiWa{opacity:.5}.T17WOOJI7XHN7KRmYaCe>:last-child{margin-top:calc(var(--spacing-base)*2)}@media(min-width:600px){.T17WOOJI7XHN7KRmYaCe{display:flex;justify-content:space-between}}.typbjN2keZ97hj2TmuMC{display:flex;flex-wrap:wrap;margin-top:calc(var(--spacing-base)*2)}.UUXAN8VTAZY0h8t9rCHG{color:var(--jp-green-50);margin-left:calc(var(--spacing-base)/2)}.eFjcadLMEXY5O61vsTrx{color:var(--jp-gray-50)}.Tr5uYvclUiwlC5kuGk7E{color:var(--jp-red-50)}.zPZcNgYx2X5778nHHtlH{display:flex;flex-wrap:wrap}.lNtkRXnB1z_kYB28MUWq{color:var(--jp-gray-50)}.JgH5ykcLynEgqXYurT78{margin-left:calc(var(--spacing-base)/2)}.JgH5ykcLynEgqXYurT78,.xlWW0IoKZwTZt1Ti0tcQ{color:var(--jp-green-50)}.zhBcgCUGgyC7PvWk8ewB{margin-top:calc(var(--spacing-base)*3)}@media(min-width:600px){.zhBcgCUGgyC7PvWk8ewB{padding-right:calc(var(--spacing-base)*11)}}.mah_f2OWxZ3Vqt_jRFdR{margin-bottom:calc(var(--spacing-base)*4)}.Ax2SmW57c0U5xOTjZuAA{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-2)}.xGZeYQr0_nPJTFmd8pW4{align-items:center;border:1px solid var(--jp-gray-30);border-radius:4px;color:var(--jp-gray-30);display:flex;font-size:12px;height:21px;margin-bottom:calc(var(--spacing-base)*2);margin-right:var(--spacing-base);padding:calc(var(--spacing-base)/2)}.RYTIt8kwLbKcUbWOfG4g{padding:calc(var(--spacing-base)*3);width:304px}.BqXge2rIUP0a_74yvYbr{display:flex;justify-content:space-between}.Lr10UUCcSLF3T_0QqoPr{margin:calc(var(--spacing-base)*-1) calc(var(--spacing-base)*-3)}.Lr10UUCcSLF3T_0QqoPr:focus,.Lr10UUCcSLF3T_0QqoPr:focus:not(:disabled){box-shadow:none}.th_VukMuODIOVLC7oJo6{display:flex;justify-content:flex-end}.VHYulMcpzbr10HWR0iSE{align-items:flex-start;border:1px solid var(--jp-black);border-color:var(--jp-gray-5);border-radius:4px;border-right-width:6px;display:flex;font-size:var(--font-body);padding:24px 18px 27px 31px}.FGpSkMCiIHQjszcV0dbn{margin-left:20px}.FGpSkMCiIHQjszcV0dbn,.KoWZcCwhW13xvkEb0QON{height:calc(var(--spacing-base)*3);width:calc(var(--spacing-base)*3)}.KoWZcCwhW13xvkEb0QON{background-color:transparent;border:none;cursor:pointer;outline:none}@media screen and (max-width:600px){.VHYulMcpzbr10HWR0iSE{box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);padding-top:68px;position:relative}.FGpSkMCiIHQjszcV0dbn{position:absolute;right:24px;top:24px}.KoWZcCwhW13xvkEb0QON{left:24px;position:absolute;top:24px}}.smrfczkC53EaFM8OJUXs{flex-grow:1}.IKYRWoPwt9xOVEx1wzNS{font-weight:600;margin-bottom:8px}.qM0qY6mPYp1MPN54A3Kg{align-items:center;display:flex;margin-top:20px}.qM0qY6mPYp1MPN54A3Kg a,.qM0qY6mPYp1MPN54A3Kg a:active,.qM0qY6mPYp1MPN54A3Kg a:focus,.qM0qY6mPYp1MPN54A3Kg a:hover{color:var(--jp-black)}.qM0qY6mPYp1MPN54A3Kg>*{margin-left:24px}.A5YkDkkXuiYgavrY6Nux{border-right-color:var(--jp-red)}.A5YkDkkXuiYgavrY6Nux .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-red)}.cT5rwuPMZzWvi5o6shMl{border-right-color:var(--jp-yellow-20)}.cT5rwuPMZzWvi5o6shMl .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-yellow-20)}.yo0O3uvNomPsYUXFCpAS{border-right-color:var(--black)}.yo0O3uvNomPsYUXFCpAS .y_IPyP1wIAOhyNaqvXJq{fill:var(--black)}.oZdDFf1jBLkzn5ICCC6x{border-right-color:var(--jp-green)}.oZdDFf1jBLkzn5ICCC6x .y_IPyP1wIAOhyNaqvXJq{fill:var(--jp-green)}.msOlyh2T7D6uhbM6AROg{align-items:center;background:none;border:2px solid var(--jp-green-40);border-radius:var(--jp-border-radius);color:var(--jp-gray-80);display:flex;gap:calc(var(--spacing-base)*3);justify-content:space-between;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);position:relative;text-align:right;width:100%}.msOlyh2T7D6uhbM6AROg a,.msOlyh2T7D6uhbM6AROg button{all:unset;color:var(--jp-gray-80);cursor:pointer}.msOlyh2T7D6uhbM6AROg a:after,.msOlyh2T7D6uhbM6AROg button:after{content:"";height:100%;position:absolute;right:0;top:0;width:100%}.msOlyh2T7D6uhbM6AROg:focus-within{border-color:var(--jp-black)}.msOlyh2T7D6uhbM6AROg:focus-within .cPN7USVqSBpxUswfDtUZ,.msOlyh2T7D6uhbM6AROg:hover .cPN7USVqSBpxUswfDtUZ{transform:translateX(calc((var(--spacing-base)*2)*-1))}.msOlyh2T7D6uhbM6AROg:focus-within .EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg:hover .EmnJAyEzzn1QpA8HtypY{text-decoration:underline;text-decoration-thickness:2px}.EmnJAyEzzn1QpA8HtypY,.msOlyh2T7D6uhbM6AROg .EmnJAyEzzn1QpA8HtypY{font-weight:700}.cPN7USVqSBpxUswfDtUZ{fill:var(--jp-green-40);transition:transform .1s ease-out}.vV7YZikAz0oHYsuvtxMq{display:inline;margin:0 calc(var(--spacing-base)/3) 0 0;vertical-align:middle}.vV7YZikAz0oHYsuvtxMq svg{position:relative;z-index:10}.T1YaMupeZmBIpXZHY9EZ{display:inline}._Wc3apZobag_9Ag_THTb{display:flex;justify-content:space-between}.kdsaL7c4bpTwf_A4fIUT{padding-bottom:calc(var(--spacing-base)*6);padding-top:calc(var(--spacing-base)*6);text-align:center}.b0eN3as5AgxQW7EAkarg{margin-bottom:0}@keyframes rotate-spinner{to{transform:rotate(-1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-left-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.JiJhrZaThvWCpM2AfGen{border-radius:32px;flex-shrink:0;font-size:12px;font-style:normal;font-weight:600;line-height:16px;padding:calc(var(--spacing-base)/2);position:relative;text-align:center;width:60px}._7SGksgOpcPbHfPPpQTV{background:var(--jp-red-5);color:var(--jp-red-60)}.pGNquShR54adQ61sx3lP{background:var(--jp-yellow-5);color:var(--jp-yellow-60)}.IM5kkexAfwGLM6zz0Exd{background:var(--jp-gray-0);color:var(--jp-gray-50)}.NHzH3tt6CypjZ92CvK9x{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;padding:calc(var(--spacing-base)*2)}.NHzH3tt6CypjZ92CvK9x:first-of-type{border-top-left-radius:var(--jp-border-radius);border-top-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x:last-of-type{border-bottom-left-radius:var(--jp-border-radius);border-bottom-right-radius:var(--jp-border-radius)}.NHzH3tt6CypjZ92CvK9x+.NHzH3tt6CypjZ92CvK9x{border-top:0}.D9zvYDUrOP_zwSm0yJMs{margin-left:calc(var(--spacing-base)*2);min-width:24px}._XISfmbjoVlqhB61hHYn{width:100%}.AQDPBnMZFu7BOBuo8mYW{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.cZ9s5eCAZe3R82Y6Ru3z{color:var(--jp-gray-80);font-size:14px;line-height:21px}.AKnbWQiViZ2O_dwCV8Fw,.W6alQ2_S5Rh06djX9m27{align-self:center;margin-left:var(--spacing-base);margin-right:calc(var(--spacing-base)*2)}.uUEJGMrSV3XoBwX5xEwA{display:flex;justify-content:space-between}.sQkG5Cu80gPaeFj3L_wa{margin-bottom:calc(var(--spacing-base)*5)}.oIl6GCMeUnzE0inXbuj9{display:flex;justify-content:space-between}.RP2MVoGqaCFXPKZhhxQ1{margin-bottom:calc(var(--spacing-base)*5)}.YpEs8b7KE7fzVuXUbOEb{display:flex;justify-content:space-between}.EqpwvErHtRi_WQkJKgi1{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:flex;margin-bottom:calc(var(--spacing-base)*3);padding:calc(var(--spacing-base)*2)}.EicvN1QaJu5OJLzdUN5A{margin-left:calc(var(--spacing-base)*2);min-width:24px}.b7ynAmUwGlxK_vxyIN0y{width:100%}.uSV9HYRxjL4S6zIZDlqP{font-size:18px;font-weight:600;line-height:24px;margin-bottom:0}.XpW8Mvw_XFEbqxUdw155{color:var(--jp-gray-80);font-size:14px;line-height:21px}.Fkj60BmQ5sUo9zHcJwVv{align-self:center;margin-left:var(--spacing-base);margin-right:calc(var(--spacing-base)*2)}.XLzPr74ad3osCq9kxy2q{display:flex;justify-content:space-between}.jNlU3vgp4xEGwmX5aTyK{background-color:var(--jp-gray-5)}.gE8s4nh3f7iGIBrFeyCT{list-style-type:disc;padding-right:calc(var(--spacing-base)*2.5)}.WtVEv641JBaLl929sZq2{align-items:flex-start;background-color:rgba(0,0,0,.25);bottom:0;display:flex;justify-content:center;left:0;padding-top:calc(var(--spacing-base)*12 + 2px);position:fixed;right:0;top:0;z-index:999999}.G0aPt7WmA1rkUE0wcTno{background:var(--jp-white);border:1px solid var(--jp-gray);border-radius:calc(var(--jp-border-radius)*2);box-shadow:0 8px 20px rgba(0,0,0,.25);padding:calc(var(--spacing-base)*4);position:relative;width:616px}.VkrhWjfEIlIwYEumycbP{background:none;border:none;cursor:pointer;left:calc(var(--spacing-base)*3);padding:0;position:absolute;top:calc(var(--spacing-base)*3)}.yFzeV4cmWRbZKk5tIyEw{display:block}.EU0Rvu4PDqVtnCAmbgHg{height:56px;margin-bottom:calc(var(--spacing-base)*8);width:48px}.EU0Rvu4PDqVtnCAmbgHg>svg{position:relative;right:-40px;top:-36px}.vzMlFr1AXWqefpRrb976{align-items:center;display:flex;justify-content:space-between;margin-bottom:calc(var(--spacing-base)*3)}.gYSOMa4xxLXmsNzvFPkW{width:100%}.hNJWdt5qmZkWYAH_vjIp{background-color:var(--jp-green-40);border-radius:calc(var(--spacing-base)*3);height:9px;transition:width .2s}.DHMUfGyHbl5BgD5vjxVz{color:var(--jp-gray-90);font-weight:600;line-height:24px;margin-right:auto;padding-right:var(--spacing-base)}.Clxt94RgGnDrhORZZyPr,.K2OG1vK5PSOYDWKtqKKG{margin-top:calc(var(--spacing-base)*7)}.ZMBDiTLzs27F012iOsMK>:first-child{flex:1}@media(min-width:960px){.ZMBDiTLzs27F012iOsMK{align-items:center;display:flex}}.zI2DKzqRc1MhF6aq5eHt{align-items:center;color:var(--jp-black);display:flex}.iHgPFku9KaLz8FIQV1Qw{margin-left:var(--spacing-base);margin-right:-4px}.xuIO_ubyDN6IGJ67NTlx{margin-top:calc(var(--spacing-base)*3)}@media(min-width:960px){.xuIO_ubyDN6IGJ67NTlx{margin-top:0}}.ctq2nQkzIfSoMkldF9t9{margin-top:calc(var(--spacing-base)*2);width:100%}@media(min-width:960px){.ctq2nQkzIfSoMkldF9t9{margin-right:calc(var(--spacing-base)*2);margin-top:0;width:auto}}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook);border-radius:50%!important}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.OtDl6kocO_m2s9sRHaqX{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;max-height:600px;width:100%}.BjwJh1S1YVPI7AjmTx6a+.BjwJh1S1YVPI7AjmTx6a{margin-top:calc(var(--spacing-base)*5)}.YWfK8VTp2wnByBauYPKg{background-color:var(--jp-gray-0);overflow-x:scroll;padding:calc(var(--spacing-base)*3)}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:flex-end;margin-top:calc(var(--spacing-base)*3);padding-top:calc(var(--spacing-base)*3)}.ap6lG79CncSqdigJS_WA{margin-top:calc(var(--spacing-base)*4)}.uym7dGHhp6ifjF57yOAO{align-items:flex-end;display:flex;margin-bottom:calc(var(--spacing-base)*2.25)}.e_2eFTR8RyHwmfeqJL4F{flex:1;margin-bottom:0}.r4Id5qht2FD68jCAH2Cl{margin-right:calc(var(--spacing-base)*2)}.pkw2LnOTd8VvQ3oT8sXQ{border-top:1px solid var(--jp-gray);display:flex;justify-content:right;padding-top:calc(var(--spacing-base)*4);width:100%}.pkw2LnOTd8VvQ3oT8sXQ>:last-child{margin-right:calc(var(--spacing-base)*2)}.ZSZPabDoB8MVVPttP0tu{background-color:#fff;border:1px solid var(--jp-gray);border-bottom:none;color:var(--jp-gray-50);display:grid;grid-template-columns:repeat(9,1fr);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);width:100%}.ZSZPabDoB8MVVPttP0tu>span:first-child{grid-column:1/7}.ZSZPabDoB8MVVPttP0tu>span:not(:first-child){text-align:center}.iJ_biSBRDribuNKX0Zuw{margin:calc(var(--spacing-base)*4) calc(var(--spacing-base)*8);text-align:center}.iJ_biSBRDribuNKX0Zuw>button span{color:var(--jp-gray-70);font-size:var(--font-body-small);font-weight:400}.iJ_biSBRDribuNKX0Zuw button:hover:not(:disabled){text-decoration-line:none}.iJ_biSBRDribuNKX0Zuw button:focus:not(:disabled){box-shadow:none}@media(max-width:599px){.uym7dGHhp6ifjF57yOAO{margin-bottom:calc(var(--spacing-base)*3)}.e_2eFTR8RyHwmfeqJL4F{display:none}.r4Id5qht2FD68jCAH2Cl{flex:1}.r4Id5qht2FD68jCAH2Cl:first-of-type{margin-right:0}.pkw2LnOTd8VvQ3oT8sXQ{justify-content:center}.pkw2LnOTd8VvQ3oT8sXQ>*{width:50%}}.x8UuVEhWucPfdq0hEJg6{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius)}.x8UuVEhWucPfdq0hEJg6>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.eb6Ovfvm1yONz4mdOwbH{background-color:var(--jp-white)}.jF9LXpXR3TxZVDw7TVXT{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.jF9LXpXR3TxZVDw7TVXT>:first-of-type{grid-column:1/8}.jF9LXpXR3TxZVDw7TVXT>:last-of-type{grid-column:9}.jF9LXpXR3TxZVDw7TVXT:hover{background:var(--jp-gray-0)}.lNQgAfpwdAUSOLZd8dlD{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.WRQwDYPdffWznX158azR{margin-left:var(--spacing-base)}.dJx9pvlYjDnKn11n5wo8{font-weight:600;margin-bottom:var(--spacing-base);margin-right:calc(var(--spacing-base)*4)}.EKcbLuSblRc7UpzgsFXw{align-items:center}.ILMBWlMLcXc0n97IisrG{overflow:hidden;transform-origin:top center}.T8XIzCNJBQy1UETN5gjU{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.kWoHGiaZSbq9XJVyUOMC{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.HQgjxePFDRJHamBAGcVU{background-color:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px rgba(0,0,0,.08);margin:0;padding:var(--spacing-base) 0}.KtdsNIMumOoHNWMLmuAJ{align-items:center;display:flex;justify-content:space-between;margin:0;padding:calc(var(--spacing-base)*2);text-align:right}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2{cursor:pointer;outline-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:focus:not(.owofT85W_XvVdb5vr1GN),.KtdsNIMumOoHNWMLmuAJ.ewyV4ZGn34WDNXmK3ej2:hover:not(.owofT85W_XvVdb5vr1GN){background-color:var(--jp-gray-0)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN{background-color:var(--jp-black)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .NESnw2xCLrBpP6WlYZL4{color:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .aohnd_y_1lrMuww8NH63{fill:var(--jp-white)}.KtdsNIMumOoHNWMLmuAJ.owofT85W_XvVdb5vr1GN .Rnas_2_2_eLZSYfZ347E{background-color:var(--jp-red);border:1px solid var(--jp-red);color:var(--jp-white)}.NESnw2xCLrBpP6WlYZL4{align-items:center;display:flex;overflow-x:hidden;padding-left:var(--spacing-base)}.m4_14yNRByDyO9yf9pGg{display:block;overflow-x:hidden;text-overflow:ellipsis}.aohnd_y_1lrMuww8NH63{margin-left:calc(var(--spacing-base)*2)}.Rnas_2_2_eLZSYfZ347E{align-items:center;border:1px solid var(--jp-red-60);border-radius:50%;box-sizing:border-box;color:var(--jp-red-60);display:flex;justify-content:center;min-width:30px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.X8NRHUTBa_4wDvoHN9TT{fill:var(--jp-green-50)}.CsuOteurQlJm4IjXqyZ0{fill:var(--jp-gray-20)}.fvbewglUxEvV1o04yzzp{--icon-size:28px;--item-spacing:calc(var( --spacing-base )*2);--left-spacing:calc(var( --icon-size ) + var( --item-spacing ));list-style:none}.DINy59MKjwiQanaoDTiV{padding:calc(var(--spacing-base)*2)}.XoacHJljw8zRW_fkBSyg{padding:0}.mXM4WZRePVTa07dhQ6MD{margin-right:var(--left-spacing)}.sI3V8khLdCqxkhJQ_XnI{display:flex;justify-content:flex-start;padding:calc(var(--spacing-base)*2)}.hgdxMuIvZwTZ0sfXaols{padding:calc(var(--spacing-base)*2);width:250px}.UErHS2HAh1gszGfYuVIf{align-items:center;background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-border-radius);display:flex;justify-content:space-between;padding:calc(var(--spacing-base)*2);width:100%}.lEhH1hvCcxLVFMHI8Gwv{display:flex;justify-content:flex-start}.c57Vj4QhAHwcK_HZMxtN{margin-left:var(--spacing-base)}.t5TwI3d3FnCJvFBlkmm5{display:block}.kSa6ERuVPsCMPXugb030{display:none}.LumryWNddoF092fZgN2O{font-size:var(--font-body);line-height:1.5}.NFMwU3H5k2qArZe2TTp9{background-color:var(--jp-gray-10);font-weight:600;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.G5W9M8qfo3sGl2OIbwg9{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:Courier\ 10 Pitch,Courier,monospace;overflow-x:scroll;white-space:pre}.Bx4RDCUR316fm_jgGS8N{background-color:var(--jp-gray-10);color:var(--jp-gray-50);display:flex;flex-direction:column;padding:0 var(--spacing-base);text-align:left}.GhN0JvAyRQI3SnVWp2Ot{display:flex;flex-direction:column;flex-grow:1;overflow-x:visible}.GhN0JvAyRQI3SnVWp2Ot del,.GhN0JvAyRQI3SnVWp2Ot div,.GhN0JvAyRQI3SnVWp2Ot ins{padding:0 var(--spacing-base);text-decoration:none}.GhN0JvAyRQI3SnVWp2Ot del{background-color:var(--jp-red-0);color:var(--jp-red-60)}.GhN0JvAyRQI3SnVWp2Ot ins{background-color:var(--jp-green-5);color:var(--jp-green-60)}.xpPHTch5ul0xuZaUoTNa{background-color:var(--jp-gray-0);display:flex;flex-direction:row;font-family:monospace;overflow-x:scroll;padding:0}.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-0)}.i0_0xMrNWoak1brIaDQq{display:flex;flex-direction:column;text-align:left}.C9fLawPLkMNSZthfwxj6{background-color:var(--jp-gray-10);color:var(--font-body);padding:0 calc(var(--spacing-base)/2)}.C9fLawPLkMNSZthfwxj6.AMOpkL9LURkyTK8316cw{background-color:var(--jp-red-50);color:var(--jp-white)}.ogixgg8fRGekmYGtevh1{display:flex;flex:1;flex-direction:column;overflow-x:visible;white-space:pre}.jYPCgKMDRKfT3vnx0mdG{padding-right:var(--spacing-base)}.UEQ1NqkrwNmaQR7qdEK3{background-color:var(--jp-red);border-radius:calc(var(--jp-border-radius)/2);color:var(--jp-white);padding:calc(var(--spacing-base)/4) calc(var(--spacing-base)/2)}.sfXsfklfkeSRtE9ivQwF{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);display:inline-block;width:100%}.sfXsfklfkeSRtE9ivQwF>:not(:last-child){border-bottom:1px solid var(--jp-gray)}.ozRrKPlj1QFGUyd3oVke{background-color:var(--jp-white)}.PyvnSHQuuUkZvVsArigy{align-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:repeat(9,1fr);margin:0;outline-color:var(--jp-black);padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3);text-align:start;width:100%}.PyvnSHQuuUkZvVsArigy>:first-of-type{grid-column:1/7}.PyvnSHQuuUkZvVsArigy>:last-of-type{grid-column:9}.PyvnSHQuuUkZvVsArigy>:not(:first-child){margin:auto}.PyvnSHQuuUkZvVsArigy:hover{background:var(--jp-gray-0)}.u9Xod5s8bCRNj9MR1Drl{align-items:center;display:flex;font-size:var(--font-body-small);font-weight:400}.IbeyulkpO9kjYJ4OkYUD{margin-left:var(--spacing-base)}.KiCgmjHm2f0JDU3cMsgf{font-weight:600;margin-bottom:var(--spacing-base);margin-right:calc(var(--spacing-base)*4)}.kJ8t3FAtd5VAYjk31SfA{align-items:center}.JP0IJZcYRohfgntEozjm{overflow:hidden;transform-origin:top center}.y7c6zi2wjEnbW3F29fmP{max-height:0;padding:0;transform:scaleY(0);transition:all .1s}.wQWiN_J0SqgduvadyGnm{max-height:1000px;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*7);transform:scaleY(1);transition:max-height .3s,transform .2s}.v1fUFCBPmd6miSCf_ehK{fill:var(--jp-green-40)}@media(max-width:599px){.PyvnSHQuuUkZvVsArigy{display:grid;grid-auto-rows:minmax(auto,auto)}.PyvnSHQuuUkZvVsArigy>:first-child{grid-column:1/8;grid-row:1}.PyvnSHQuuUkZvVsArigy>:nth-child(2){grid-row:2;padding-right:calc(var(--spacing-base)*4)}.PyvnSHQuuUkZvVsArigy>:nth-child(3){grid-row:2}.PyvnSHQuuUkZvVsArigy>:nth-child(3) span{margin-top:var(--spacing-base);position:absolute}.PyvnSHQuuUkZvVsArigy>:last-child{grid-column:10;grid-row:1/3}}.A6a9HOtaZnLUleNgxQrX{padding:calc(var(--spacing-base)*7) 0}.CGT5fOs6LDTFHWCAgIiT,.RFKxbzQ8N58qEyVO0yzW{align-items:center;display:flex}.RFKxbzQ8N58qEyVO0yzW{height:100%}.RFKxbzQ8N58qEyVO0yzW img{object-fit:cover;width:100%}.SvMuuouOkDt2sE0PAn_D{margin-top:calc(var(--spacing-base)*3 + 1px)}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);border-right:6px solid var(--jp-red-50);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-right:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-right:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-left:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-left:calc(var(--spacing-base)*2)}*,._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json new file mode 100644 index 00000000..4186b8af --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/composer.json @@ -0,0 +1,76 @@ +{ + "name": "automattic/jetpack-protect", + "description": "Social plugin", + "type": "wordpress-plugin", + "license": "GPL-2.0-or-later", + "require": { + "ext-json": "*", + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-admin-ui": "^0.2.19", + "automattic/jetpack-autoloader": "^2.11.18", + "automattic/jetpack-composer-plugin": "^1.1.10", + "automattic/jetpack-config": "^1.15.1", + "automattic/jetpack-identity-crisis": "^0.8.40", + "automattic/jetpack-my-jetpack": "^2.9.1", + "automattic/jetpack-plugins-installer": "^0.2.3", + "automattic/jetpack-sync": "^1.47.4", + "automattic/jetpack-transport-helper": "^0.1.4", + "automattic/jetpack-plans": "^0.2.10", + "automattic/jetpack-waf": "^0.11.4", + "automattic/jetpack-status": "^1.17.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "0.4.2" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "pnpm run build-production-concurrently" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "repositories": [], + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "mirror-repo": "Automattic/jetpack-protect-plugin", + "autorelease": true, + "autotagger": { + "v": false + }, + "release-branch-prefix": "protect", + "wp-plugin-slug": "jetpack-protect", + "wp-svn-autopublish": true, + "version-constants": { + "JETPACK_PROTECT_VERSION": "jetpack-protect.php" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true, + "automattic/jetpack-autoloader": true, + "automattic/jetpack-composer-plugin": true + }, + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0" + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php new file mode 100644 index 00000000..9578dffb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack-protect.php @@ -0,0 +1,123 @@ + +
        +

        + this document to set up your development environment. Jetpack Protect must have Composer dependencies installed and built via the build command.', 'jetpack-protect' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project' + ); + ?> +

        +
        + ' . __( 'Dashboard', 'jetpack-protect' ) . ''; + array_unshift( $actions, $settings_link ); + + return $actions; + } +); + +register_activation_hook( __FILE__, array( 'Jetpack_Protect', 'plugin_activation' ) ); +register_deactivation_hook( __FILE__, array( 'Jetpack_Protect', 'plugin_deactivation' ) ); + +// Main plugin class. +new Jetpack_Protect(); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md new file mode 100644 index 00000000..9fa97652 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/CHANGELOG.md @@ -0,0 +1,146 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.20] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.4.19] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.4.18] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.4.17] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.4.16] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.4.15] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.4.14] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.4.13] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.4.12] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.4.11] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.4.10] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.4.9] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.8] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.4.7] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.6] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.5] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- updated annotations versions + +## [1.4.4] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.3] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.4.2] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.4.1] - 2021-02-05 + +- CI: Make tests more generic + +## [1.4.0] - 2021-01-20 + +- Add mirror-repo information to all current composer packages + +## [1.3.0] - 2020-12-17 + +- Coverage Update whitelist for backend tests +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.2.0] - 2020-09-17 + +## [1.1.1] - 2020-09-17 + +- a8c-mc-stats: Do not distribute test files + +## [1.1.0] - 2020-08-13 + +- CI: Try collect js coverage + +## 1.0.0 - 2020-07-27 + +- Creates the MC Stats package + +[1.4.20]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.19...v1.4.20 +[1.4.19]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.18...v1.4.19 +[1.4.18]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.17...v1.4.18 +[1.4.17]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.16...v1.4.17 +[1.4.16]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.15...v1.4.16 +[1.4.15]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.14...v1.4.15 +[1.4.14]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.13...v1.4.14 +[1.4.13]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.12...v1.4.13 +[1.4.12]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.11...v1.4.12 +[1.4.11]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.10...v1.4.11 +[1.4.10]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.9...v1.4.10 +[1.4.9]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json new file mode 100644 index 00000000..b499ae4c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/composer.json @@ -0,0 +1,39 @@ +{ + "name": "automattic/jetpack-a8c-mc-stats", + "description": "Used to record internal usage stats for Automattic. Not visible to site owners.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-a8c-mc-stats", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php new file mode 100644 index 00000000..73a1fcf8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php @@ -0,0 +1,182 @@ +use_transparent_pixel = $use_transparent_pixel; + } + + /** + * Store a stat for later output. + * + * @param string $group The stat group. + * @param string $name The stat name to bump. + * + * @return boolean true if stat successfully added + */ + public function add( $group, $name ) { + + if ( ! \is_string( $group ) || ! \is_string( $name ) ) { + return false; + } + + if ( ! isset( $this->stats[ $group ] ) ) { + $this->stats[ $group ] = array(); + } + + if ( \in_array( $name, $this->stats[ $group ], true ) ) { + return false; + } + + $this->stats[ $group ][] = $name; + + return true; + } + + /** + * Gets current stats stored to be processed + * + * @return array $stats + */ + public function get_current_stats() { + return $this->stats; + } + + /** + * Return the stats from a group in an array ready to be added as parameters in a query string + * + * @param string $group_name The name of the group to retrieve. + * @return array Array with one item, where the key is the prefixed group and the value are all stats concatenated with a comma. If group not found, an empty array will be returned + */ + public function get_group_query_args( $group_name ) { + $stats = $this->get_current_stats(); + if ( isset( $stats[ $group_name ] ) && ! empty( $stats[ $group_name ] ) ) { + return array( "x_jetpack-{$group_name}" => implode( ',', $stats[ $group_name ] ) ); + } + return array(); + } + + /** + * Gets a list of trac URLs for every stored URL + * + * @return array An array of URLs + */ + public function get_stats_urls() { + + $urls = array(); + + foreach ( $this->get_current_stats() as $group => $stat ) { + $group_query_string = $this->get_group_query_args( $group ); + $urls[] = $this->build_stats_url( $group_query_string ); + } + + return $urls; + } + + /** + * Outputs the tracking pixels for the current stats and empty the stored stats from the object + * + * @return void + */ + public function do_stats() { + $urls = $this->get_stats_urls(); + foreach ( $urls as $url ) { + echo ''; + } + $this->stats = array(); + } + + /** + * Pings the stats server for the current stats and empty the stored stats from the object + * + * @return void + */ + public function do_server_side_stats() { + $urls = $this->get_stats_urls(); + foreach ( $urls as $url ) { + $this->do_server_side_stat( $url ); + } + $this->stats = array(); + } + + /** + * Runs stats code for a one-off, server-side. + * + * @param string $url string The URL to be pinged. Should include `x_jetpack-{$group}={$stats}` or whatever we want to store. + * + * @return bool If it worked. + */ + public function do_server_side_stat( $url ) { + $response = wp_remote_get( esc_url_raw( $url ) ); + if ( is_wp_error( $response ) ) { + return false; + } + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + return true; + } + + /** + * Builds the stats url. + * + * @param array $args array|string The arguments to append to the URL. + * + * @return string The URL to be pinged. + */ + public function build_stats_url( $args ) { + $defaults = array( + 'v' => 'wpcom2', + 'rand' => md5( wp_rand( 0, 999 ) . time() ), + ); + $args = wp_parse_args( $args, $defaults ); + $gifname = true === $this->use_transparent_pixel ? 'b.gif' : 'g.gif'; + + /** + * Filter the URL used as the Stats tracking pixel. + * + * @since-jetpack 2.3.2 + * @since 1.0.0 + * + * @param string $url Base URL used as the Stats tracking pixel. + */ + $base_url = apply_filters( + 'jetpack_stats_base_url', + 'https://pixel.wp.com/' . $gifname + ); + $url = add_query_arg( $args, $base_url ); + return $url; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md new file mode 100644 index 00000000..ee74202c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/CHANGELOG.md @@ -0,0 +1,127 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.19] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.18] - 2023-04-04 +### Changed +- Menu icon: update to latest version of the Jetpack logo [#29418] + +## [0.2.17] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.16] - 2023-01-25 +### Changed +- Minor internal updates. + +## [0.2.15] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [0.2.14] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.13] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.12] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [0.2.11] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.2.10] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [0.2.9] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [0.2.8] - 2022-06-14 +### Changed +- Updated package dependencies. + +## [0.2.7] - 2022-04-26 +### Changed +- Update package.json metadata. + +## [0.2.6] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [0.2.5] - 2022-03-08 +### Fixed +- Do not handle Akismet submenu if Jetpack plugin is present + +## [0.2.4] - 2022-02-09 +### Added +- Support for akismet menu with stand-alone plugins + +### Fixed +- Fixes menu order working around a bug in add_submenu_page + +## [0.2.3] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [0.2.2] - 2022-01-18 +### Changed +- General: update required node version to v16.13.2 + +## [0.2.1] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [0.2.0] - 2021-12-14 +### Added +- New method to get the top level menu item + +## [0.1.1] - 2021-11-17 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## 0.1.0 - 2021-10-13 +### Added +- Created the package. + +### Changed +- Updated package dependencies. + +### Fixed +- Fixing menu visibility issues. + +[0.2.19]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.18...0.2.19 +[0.2.18]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.17...0.2.18 +[0.2.17]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.16...0.2.17 +[0.2.16]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.15...0.2.16 +[0.2.15]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.14...0.2.15 +[0.2.14]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.13...0.2.14 +[0.2.13]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.12...0.2.13 +[0.2.12]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.11...0.2.12 +[0.2.11]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.10...0.2.11 +[0.2.10]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.9...0.2.10 +[0.2.9]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.8...0.2.9 +[0.2.8]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.7...0.2.8 +[0.2.7]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.6...0.2.7 +[0.2.6]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.5...0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.4...0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.3...0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.2...0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-admin-ui/compare/0.1.1...0.2.0 +[0.1.1]: https://github.com/Automattic/jetpack-admin-ui/compare/0.1.0...0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json new file mode 100644 index 00000000..423f4d69 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/composer.json @@ -0,0 +1,52 @@ +{ + "name": "automattic/jetpack-admin-ui", + "description": "Generic Jetpack wp-admin UI elements", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-logo": "^1.6.1", + "automattic/wordbless": "dev-master" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-admin-ui", + "textdomain": "jetpack-admin-ui", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-admin-ui/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-admin-menu.php" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php new file mode 100644 index 00000000..319db852 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php @@ -0,0 +1,202 @@ +get_base64_logo() + : 'dashicons-admin-plugins'; + + if ( ! $jetpack_plugin_present ) { + add_menu_page( + 'Jetpack', + 'Jetpack', + 'read', + 'jetpack', + '__return_null', + $icon, + 3 + ); + + // If Jetpack plugin is not present, user will only be able to see this menu if they have enough capability to at least one of the sub menus being added. + $can_see_toplevel_menu = false; + } + + /** + * The add_sub_menu function has a bug and will not keep the right order of menu items. + * + * @see https://core.trac.wordpress.org/ticket/52035 + * Let's order the items before registering them. + * Since this all happens after the Jetpack plugin menu items were added, all items will be added after Jetpack plugin items - unless position is very low number (smaller than the number of menu items present in Jetpack plugin). + */ + usort( + self::$menu_items, + function ( $a, $b ) { + $position_a = empty( $a['position'] ) ? 0 : $a['position']; + $position_b = empty( $b['position'] ) ? 0 : $b['position']; + return $position_a - $position_b; + } + ); + + foreach ( self::$menu_items as $menu_item ) { + if ( ! current_user_can( $menu_item['capability'] ) ) { + continue; + } + + $can_see_toplevel_menu = true; + + add_submenu_page( + 'jetpack', + $menu_item['page_title'], + $menu_item['menu_title'], + $menu_item['capability'], + $menu_item['menu_slug'], + $menu_item['function'], + $menu_item['position'] + ); + } + + if ( ! $jetpack_plugin_present ) { + remove_submenu_page( 'jetpack', 'jetpack' ); + } + + if ( ! $can_see_toplevel_menu ) { + remove_menu_page( 'jetpack' ); + } + } + + /** + * Adds a new submenu to the Jetpack Top level menu + * + * The parameters this method accepts are the same as @see add_submenu_page. This class will + * aggreagate all menu items registered by stand-alone plugins and make sure they all go under the same + * Jetpack top level menu. It will also handle the top level menu registration in case the Jetpack plugin is not present. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu + * is selected. + * @param string $menu_title The text to be used for the menu. + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu + * and only include lowercase alphanumeric, dashes, and underscores characters + * to be compatible with sanitize_key(). + * @param callable $function The function to be called to output the content for this page. + * @param int $position The position in the menu order this item should appear. + * + * @return string The resulting page's hook_suffix + */ + public static function add_menu( $page_title, $menu_title, $capability, $menu_slug, $function, $position = null ) { + self::init(); + self::$menu_items[] = compact( 'page_title', 'menu_title', 'capability', 'menu_slug', 'function', 'position' ); + + /** + * Let's return the page hook so consumers can use. + * We know all pages will be under Jetpack top level menu page, so we can hardcode the first part of the string. + * Using get_plugin_page_hookname here won't work because the top level page is not registered yet. + */ + return 'jetpack_page_' . $menu_slug; + } + + /** + * Gets the slug for the first item under the Jetpack top level menu + * + * @return string|null + */ + public static function get_top_level_menu_item_slug() { + global $submenu; + if ( ! empty( $submenu['jetpack'] ) ) { + $item = reset( $submenu['jetpack'] ); + if ( isset( $item[2] ) ) { + return $item[2]; + } + } + } + + /** + * Gets the URL for the first item under the Jetpack top level menu + * + * @param string $fallback If Jetpack menu is not there or no children is found, return this fallback instead. Default to admin_url(). + * @return string + */ + public static function get_top_level_menu_item_url( $fallback = false ) { + $slug = self::get_top_level_menu_item_slug(); + + if ( $slug ) { + $url = menu_page_url( $slug, false ); + return $url; + } + + $url = $fallback ? $fallback : admin_url(); + return $url; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md new file mode 100644 index 00000000..0072154a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/CHANGELOG.md @@ -0,0 +1,382 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.17.34] - 2023-03-20 +### Changed +- Updated package dependencies. [#29471] + +## [1.17.33] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [1.17.32] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.17.31] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [1.17.30] - 2023-01-25 +### Changed +- Minor internal updates. + +## [1.17.29] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.17.28] - 2022-12-02 +### Changed +- Updated package dependencies. + +## [1.17.27] - 2022-11-28 +### Changed +- Updated package dependencies. [#27576] + +## [1.17.26] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.17.25] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [1.17.24] - 2022-11-01 +### Changed +- Updated package dependencies. + +## [1.17.23] - 2022-10-13 +### Changed +- Updated package dependencies. [#26791] + +## [1.17.22] - 2022-10-05 +### Changed +- Updated package dependencies. [#26568] + +## [1.17.21] - 2022-08-25 +### Changed +- Updated package dependencies. [#25814] + +## [1.17.20] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.17.19] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [1.17.18] - 2022-07-06 +### Changed +- Updated package dependencies + +## [1.17.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.17.16] - 2022-06-14 + +## [1.17.15] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] + +## [1.17.14] - 2022-05-18 +### Changed +- Updated package dependencies [#24372] + +## [1.17.13] - 2022-05-10 +### Changed +- Updated package dependencies. [#24302] + +## [1.17.12] - 2022-05-04 +### Added +- Add missing JavaScript dependencies, and fix a test. [#24096] + +## [1.17.11] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.17.10] - 2022-04-19 +### Fixed +- Assets: Defer the enqueued script instead of its translations + +## [1.17.9] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [1.17.8] - 2022-03-29 +### Changed +- Updated package dependencies. + +## [1.17.7] - 2022-03-23 +### Changed +- Updated package dependencies. + +## [1.17.6] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.17.5] - 2022-02-16 +### Changed +- Updated package dependencies. + +## [1.17.4] - 2022-02-09 +### Changed +- Updated package dependencies. + +## [1.17.3] - 2022-02-02 +### Fixed +- Fixed minor coding standard violation. + +## [1.17.2] - 2022-02-01 +### Changed +- Build: remove unneeded files from production build. + +## [1.17.1] - 2022-01-27 +### Changed +- Updated package dependencies. + +## [1.17.0] - 2022-01-25 +### Added +- Accept package path prefixes from jetpack-composer-plugin and use them when lazy-loading JS translations. +- Generate the `wp-jp-i18n-loader` module needed by the new i18n-loader-webpack-plugin. + +### Deprecated +- Deprecated the `wp-jp-i18n-state` module. + +## [1.16.2] - 2022-01-18 +### Fixed +- Handle the case where `WP_LANG_DIR` is in `WP_CONTENT_DIR`, but `WP_CONTENT_DIR` is not in `ABSPATH`. + +## [1.16.1] - 2022-01-05 +### Fixed +- Don't issue a "doing it wrong" warning for registering aliases during plugin activation. + +## [1.16.0] - 2022-01-04 +### Added +- Document use of jetpack-assets, jetpack-composer-plugin, and i18n-loader-webpack-plugin together. + +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-assets`. + +## [1.15.0] - 2021-12-20 +### Added +- Add `alias_textdomain()`. + +## [1.14.0] - 2021-12-14 +### Added +- Generate `wp-jp-i18n-state` script. + +## [1.13.1] - 2021-11-22 +### Fixed +- Call `_doing_it_wrong` correctly. + +## [1.13.0] - 2021-11-22 +### Added +- Have `Assets::register_script()` accept a textdomain for `wp_set_script_translations` (and complain if no textdomain is passed when `wp-i18n` is depended on). + +### Changed +- Updated package dependencies + +### Fixed +- Added missing option doc for `Assets::register_script()`. + +## [1.12.0] - 2021-11-15 +### Added +- Add `Assets::register_script()` for easier loading of Webpack-built scripts. + +## [1.11.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.11.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.11.8] - 2021-10-06 +### Changed +- Updated package dependencies + +## [1.11.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.11.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.11.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.11.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.11.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.11.2] - 2021-02-23 + +- CI: Make tests more generic + +## [1.11.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.11.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 + +## [1.10.0] - 2020-12-08 + +- Assets: introduce new method to process static resources +- Assets: Use defer for script tags +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.9.1] - 2020-11-24 + +- Update dependency brain/monkey to v2.5.0 +- Updated PHPCS: Packages and Debugger + +## [1.9.0] - 2020-10-27 + +- Instagram oEmbed: Simplify + +## [1.8.0] - 2020-09-29 + +- Consolidate the Lazy Images package to rely on the Assets package + +## [1.7.0] - 2020-08-25 + +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.6.0] - 2020-07-28 + +- Various: Use wp_resource_hints + +## [1.5.0] - 2020-06-30 + +- PHPCS: Clean up the packages +- WooCommerce Analytics: avoid 404 error when enqueuing script + +## [1.4.0] - 2020-05-26 + +- Add Jetpack Scan threat notifications + +## [1.3.0] - 2020-04-28 + +- Update dependencies to latest stable + +## [1.2.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.1.1] - 2020-01-27 + +- Pin dependency brain/monkey to 2.4.0 + +## [1.1.0] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.0.3] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.1] - 2019-10-28 + +- PHPCS: JITM and Assets packages +- Packages: Add gitattributes files to all packages that need th… + +## 1.0.0 - 2019-09-14 + +- Statically access asset tools + +[1.17.34]: https://github.com/Automattic/jetpack-assets/compare/v1.17.33...v1.17.34 +[1.17.33]: https://github.com/Automattic/jetpack-assets/compare/v1.17.32...v1.17.33 +[1.17.32]: https://github.com/Automattic/jetpack-assets/compare/v1.17.31...v1.17.32 +[1.17.31]: https://github.com/Automattic/jetpack-assets/compare/v1.17.30...v1.17.31 +[1.17.30]: https://github.com/Automattic/jetpack-assets/compare/v1.17.29...v1.17.30 +[1.17.29]: https://github.com/Automattic/jetpack-assets/compare/v1.17.28...v1.17.29 +[1.17.28]: https://github.com/Automattic/jetpack-assets/compare/v1.17.27...v1.17.28 +[1.17.27]: https://github.com/Automattic/jetpack-assets/compare/v1.17.26...v1.17.27 +[1.17.26]: https://github.com/Automattic/jetpack-assets/compare/v1.17.25...v1.17.26 +[1.17.25]: https://github.com/Automattic/jetpack-assets/compare/v1.17.24...v1.17.25 +[1.17.24]: https://github.com/Automattic/jetpack-assets/compare/v1.17.23...v1.17.24 +[1.17.23]: https://github.com/Automattic/jetpack-assets/compare/v1.17.22...v1.17.23 +[1.17.22]: https://github.com/Automattic/jetpack-assets/compare/v1.17.21...v1.17.22 +[1.17.21]: https://github.com/Automattic/jetpack-assets/compare/v1.17.20...v1.17.21 +[1.17.20]: https://github.com/Automattic/jetpack-assets/compare/v1.17.19...v1.17.20 +[1.17.19]: https://github.com/Automattic/jetpack-assets/compare/v1.17.18...v1.17.19 +[1.17.18]: https://github.com/Automattic/jetpack-assets/compare/v1.17.17...v1.17.18 +[1.17.17]: https://github.com/Automattic/jetpack-assets/compare/v1.17.16...v1.17.17 +[1.17.16]: https://github.com/Automattic/jetpack-assets/compare/v1.17.15...v1.17.16 +[1.17.15]: https://github.com/Automattic/jetpack-assets/compare/v1.17.14...v1.17.15 +[1.17.14]: https://github.com/Automattic/jetpack-assets/compare/v1.17.13...v1.17.14 +[1.17.13]: https://github.com/Automattic/jetpack-assets/compare/v1.17.12...v1.17.13 +[1.17.12]: https://github.com/Automattic/jetpack-assets/compare/v1.17.11...v1.17.12 +[1.17.11]: https://github.com/Automattic/jetpack-assets/compare/v1.17.10...v1.17.11 +[1.17.10]: https://github.com/Automattic/jetpack-assets/compare/v1.17.9...v1.17.10 +[1.17.9]: https://github.com/Automattic/jetpack-assets/compare/v1.17.8...v1.17.9 +[1.17.8]: https://github.com/Automattic/jetpack-assets/compare/v1.17.7...v1.17.8 +[1.17.7]: https://github.com/Automattic/jetpack-assets/compare/v1.17.6...v1.17.7 +[1.17.6]: https://github.com/Automattic/jetpack-assets/compare/v1.17.5...v1.17.6 +[1.17.5]: https://github.com/Automattic/jetpack-assets/compare/v1.17.4...v1.17.5 +[1.17.4]: https://github.com/Automattic/jetpack-assets/compare/v1.17.3...v1.17.4 +[1.17.3]: https://github.com/Automattic/jetpack-assets/compare/v1.17.2...v1.17.3 +[1.17.2]: https://github.com/Automattic/jetpack-assets/compare/v1.17.1...v1.17.2 +[1.17.1]: https://github.com/Automattic/jetpack-assets/compare/v1.17.0...v1.17.1 +[1.17.0]: https://github.com/Automattic/jetpack-assets/compare/v1.16.2...v1.17.0 +[1.16.2]: https://github.com/Automattic/jetpack-assets/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-assets/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-assets/compare/v1.15.0...v1.16.0 +[1.15.0]: https://github.com/Automattic/jetpack-assets/compare/v1.14.0...v1.15.0 +[1.14.0]: https://github.com/Automattic/jetpack-assets/compare/v1.13.1...v1.14.0 +[1.13.1]: https://github.com/Automattic/jetpack-assets/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-assets/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/Automattic/jetpack-assets/compare/v1.11.10...v1.12.0 +[1.11.10]: https://github.com/Automattic/jetpack-assets/compare/v1.11.9...v1.11.10 +[1.11.9]: https://github.com/Automattic/jetpack-assets/compare/v1.11.8...v1.11.9 +[1.11.8]: https://github.com/Automattic/jetpack-assets/compare/v1.11.7...v1.11.8 +[1.11.7]: https://github.com/Automattic/jetpack-assets/compare/v1.11.6...v1.11.7 +[1.11.6]: https://github.com/Automattic/jetpack-assets/compare/v1.11.5...v1.11.6 +[1.11.5]: https://github.com/Automattic/jetpack-assets/compare/v1.11.4...v1.11.5 +[1.11.4]: https://github.com/Automattic/jetpack-assets/compare/v1.11.3...v1.11.4 +[1.11.3]: https://github.com/Automattic/jetpack-assets/compare/v1.11.2...v1.11.3 +[1.11.2]: https://github.com/Automattic/jetpack-assets/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-assets/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-assets/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-assets/compare/v1.9.1...v1.10.0 +[1.9.1]: https://github.com/Automattic/jetpack-assets/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-assets/compare/v1.8.0...v1.9.0 +[1.8.0]: https://github.com/Automattic/jetpack-assets/compare/v1.7.0...v1.8.0 +[1.7.0]: https://github.com/Automattic/jetpack-assets/compare/v1.6.0...v1.7.0 +[1.6.0]: https://github.com/Automattic/jetpack-assets/compare/v1.5.0...v1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-assets/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-assets/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-assets/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-assets/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-assets/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-assets/compare/v1.0.3...v1.1.0 +[1.0.3]: https://github.com/Automattic/jetpack-assets/compare/v1.0.1...v1.0.3 +[1.0.1]: https://github.com/Automattic/jetpack-assets/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php new file mode 100644 index 00000000..1c8becda --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/actions.php @@ -0,0 +1,19 @@ + 1, + 'function' => array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ), + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php new file mode 100644 index 00000000..5488269e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.asset.php @@ -0,0 +1 @@ + array('wp-i18n'), 'version' => 'e69db286c9c94bd98790'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js new file mode 100644 index 00000000..22d2b90a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/build/i18n-loader.js @@ -0,0 +1 @@ +!function(){var e={356:function(e){e.exports=function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=1)}([function(e,n,r){"use strict";function t(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,n){for(var r=0;r>>32-o)+r&4294967295}},{key:"ff",value:function(n,r,t,o,a,i,f){return e.cmn(r&t|~r&o,n,r,a,i,f)}},{key:"gg",value:function(n,r,t,o,a,i,f){return e.cmn(r&o|t&~o,n,r,a,i,f)}},{key:"hh",value:function(n,r,t,o,a,i,f){return e.cmn(r^t^o,n,r,a,i,f)}},{key:"ii",value:function(n,r,t,o,a,i,f){return e.cmn(t^(r|~o),n,r,a,i,f)}},{key:"md51",value:function(n){for(var r=n.length,t=[1732584193,-271733879,-1732584194,271733878],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0,i=64;i<=r;i+=64)e.md5cycle(t,e.md5blk(n.substring(i-64,i)));for(n=n.substring(i-64),i=0,a=n.length;i>2]|=n.charCodeAt(i)<<(i%4<<3);if(o[i>>2]|=128<<(i%4<<3),i>55)for(e.md5cycle(t,o),i=0;i<16;i++)o[i]=0;return o[14]=8*r,e.md5cycle(t,o),t}},{key:"md5blk",value:function(e){for(var n=[],r=0;r<64;r+=4)n[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return n}},{key:"rhex",value:function(n){var r="";return r+=e.hexArray[n>>4&15]+e.hexArray[n>>0&15],r+=e.hexArray[n>>12&15]+e.hexArray[n>>8&15],(r+=e.hexArray[n>>20&15]+e.hexArray[n>>16&15])+(e.hexArray[n>>28&15]+e.hexArray[n>>24&15])}},{key:"hex",value:function(n){for(var r=n.length,t=0;tObject.prototype.hasOwnProperty.call(e,n);e.exports={state:{baseUrl:null,locale:null,domainMap:{},domainPaths:{}},async downloadI18n(e,n,r){const f=this.state;if(!f||"string"!=typeof f.baseUrl)throw new Error("wp.jpI18nLoader.state is not set");if("en_US"===f.locale)return;if("undefined"==typeof fetch)throw new Error("Fetch API is not available.");const u=i(f.domainPaths,n)?f.domainPaths[n]:"";let c,h;const l=e.indexOf("?");l>=0?(c=o.hash(u+e.substring(0,l)),h=e.substring(l)):(c=o.hash(u+e),h="");const s=i(f.domainMap,n)?f.domainMap[n]:a[r]+n,g=await fetch(`${f.baseUrl}${s}-${f.locale}-${c}.json${h}`);if(!g.ok)throw new Error(`HTTP request failed: ${g.status} ${g.statusText}`);const d=await g.json(),p=i(d.locale_data,n)?d.locale_data[n]:d.locale_data.messages;p[""].domain=n,t.setLocaleData(p,n)}}},736:function(e){"use strict";e.exports=window.wp.i18n}},n={};var r=function r(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={exports:{}};return e[t].call(a.exports,a,a.exports,r),a.exports}(618);(window.wp=window.wp||{}).jpI18nLoader=r}(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json new file mode 100644 index 00000000..19fbb26c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/composer.json @@ -0,0 +1,53 @@ +{ + "name": "automattic/jetpack-assets", + "description": "Asset management utilities for Jetpack ecosystem packages", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-constants": "^1.6.21" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "wikimedia/testing-access-wrapper": "^1.0 || ^2.0" + }, + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "pnpm run build-production" + ], + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-js": [ + "pnpm run test" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-assets", + "textdomain": "jetpack-assets", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.17.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php new file mode 100644 index 00000000..f78f3635 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php @@ -0,0 +1,738 @@ + array( string target_domain, string target_type, string semver, string path_prefix ) )`. + */ + private static $domain_map = array(); + + /** + * Constructor. + * + * Static-only class, so nothing here. + */ + private function __construct() {} + + // //////////////////// + // region Async script loading + + /** + * Get the singleton instance of the class. + * + * @return Assets + */ + public static function instance() { + if ( ! isset( self::$instance ) ) { + self::$instance = new Assets(); + self::$instance->init_hooks(); + } + + return self::$instance; + } + + /** + * Initalize the hooks as needed. + */ + private function init_hooks() { + /* + * Load some scripts asynchronously. + */ + add_filter( 'script_loader_tag', array( $this, 'script_add_async' ), 10, 2 ); + } + + /** + * A public method for adding the async script. + * + * @param string $script_handle Script handle. + */ + public function add_async_script( $script_handle ) { + $this->defer_script_handles[] = $script_handle; + } + + /** + * Add an async attribute to scripts that can be loaded deferred. + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script + * + * @param string $tag The + ' . esc_html__( 'Every Jetpack site needs at least one connected admin for the features to work properly. Please connect to your WordPress.com account via the button below. Once you connect, you may refresh this page to see an option to change the connection owner.', 'jetpack-connection' ) . '

        '; + $connect_url = $connection_manager->get_authorization_url(); + $connect_url = add_query_arg( 'from', 'delete_connection_owner_notice', $connect_url ); + echo "" . esc_html__( 'Connect to WordPress.com', 'jetpack-connection' ) . ''; + } + + echo '

        '; + printf( + wp_kses( + /* translators: URL to Jetpack support doc regarding the primary user. */ + __( "Learn more about the connection owner and what will break if you do not have one.", 'jetpack-connection' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) + ), + esc_url( Redirect::get_url( 'jetpack-support-primary-user' ) ) + ); + echo '

        '; + echo '

        '; + printf( + wp_kses( + /* translators: URL to contact Jetpack support. */ + __( 'As always, feel free to contact our support team if you have any questions.', 'jetpack-connection' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) + ), + esc_url( Redirect::get_url( 'jetpack-contact-support' ) ) + ); + echo '

        '; + echo ''; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php new file mode 100644 index 00000000..76e360c8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php @@ -0,0 +1,730 @@ + [ + * $user_id => [ + * $error_details + * ] + * ] + * ] + * + * For each error code we store a maximum of 5 errors for 5 different user ids. + * + * An user ID can be + * * 0 for blog tokens + * * positive integer for user tokens + * * 'invalid' for malformed tokens + * + * @since 1.14.2 + */ +class Error_Handler { + + /** + * The name of the option that stores the errors + * + * @since 1.14.2 + * + * @var string + */ + const STORED_ERRORS_OPTION = 'jetpack_connection_xmlrpc_errors'; + + /** + * The name of the option that stores the errors + * + * @since 1.14.2 + * + * @var string + */ + const STORED_VERIFIED_ERRORS_OPTION = 'jetpack_connection_xmlrpc_verified_errors'; + + /** + * The prefix of the transient that controls the gate for each error code + * + * @since 1.14.2 + * + * @var string + */ + const ERROR_REPORTING_GATE = 'jetpack_connection_error_reporting_gate_'; + + /** + * Time in seconds a test should live in the database before being discarded + * + * @since 1.14.2 + */ + const ERROR_LIFE_TIME = DAY_IN_SECONDS; + + /** + * The error code for event tracking purposes. + * If there are many, only the first error code will be tracked. + * + * @var string + */ + private $error_code; + + /** + * List of known errors. Only error codes in this list will be handled + * + * @since 1.14.2 + * + * @var array + */ + public $known_errors = array( + 'malformed_token', + 'malformed_user_id', + 'unknown_user', + 'no_user_tokens', + 'empty_master_user_option', + 'no_token_for_user', + 'token_malformed', + 'user_id_mismatch', + 'no_possible_tokens', + 'no_valid_user_token', + 'no_valid_blog_token', + 'unknown_token', + 'could_not_sign', + 'invalid_scheme', + 'invalid_secret', + 'invalid_token', + 'token_mismatch', + 'invalid_body', + 'invalid_signature', + 'invalid_body_hash', + 'invalid_nonce', + 'signature_mismatch', + ); + + /** + * Holds the instance of this singleton class + * + * @since 1.14.2 + * + * @var Error_Handler $instance + */ + public static $instance = null; + + /** + * Initialize instance, hookds and load verified errors handlers + * + * @since 1.14.2 + */ + private function __construct() { + defined( 'JETPACK__ERRORS_PUBLIC_KEY' ) || define( 'JETPACK__ERRORS_PUBLIC_KEY', 'KdZY80axKX+nWzfrOcizf0jqiFHnrWCl9X8yuaClKgM=' ); + + add_action( 'rest_api_init', array( $this, 'register_verify_error_endpoint' ) ); + + $this->handle_verified_errors(); + + // If the site gets reconnected, clear errors. + add_action( 'jetpack_site_registered', array( $this, 'delete_all_errors' ) ); + add_action( 'jetpack_get_site_data_success', array( $this, 'delete_all_errors' ) ); + add_filter( 'jetpack_connection_disconnect_site_wpcom', array( $this, 'delete_all_errors_and_return_unfiltered_value' ) ); + add_filter( 'jetpack_connection_delete_all_tokens', array( $this, 'delete_all_errors_and_return_unfiltered_value' ) ); + add_action( 'jetpack_unlinked_user', array( $this, 'delete_all_errors' ) ); + add_action( 'jetpack_updated_user_token', array( $this, 'delete_all_errors' ) ); + } + + /** + * Gets the list of verified errors and act upon them + * + * @since 1.14.2 + * + * @return void + */ + public function handle_verified_errors() { + $verified_errors = $this->get_verified_errors(); + foreach ( array_keys( $verified_errors ) as $error_code ) { + switch ( $error_code ) { + case 'malformed_token': + case 'token_malformed': + case 'no_possible_tokens': + case 'no_valid_user_token': + case 'no_valid_blog_token': + case 'unknown_token': + case 'could_not_sign': + case 'invalid_token': + case 'token_mismatch': + case 'invalid_signature': + case 'signature_mismatch': + case 'no_user_tokens': + case 'no_token_for_user': + add_action( 'admin_notices', array( $this, 'generic_admin_notice_error' ) ); + add_action( 'react_connection_errors_initial_state', array( $this, 'jetpack_react_dashboard_error' ) ); + $this->error_code = $error_code; + + // Since we are only generically handling errors, we don't need to trigger error messages for each one of them. + break 2; + } + } + } + + /** + * Gets the instance of this singleton class + * + * @since 1.14.2 + * + * @return Error_Handler $instance + */ + public static function get_instance() { + if ( self::$instance === null ) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Keep track of a connection error that was encountered + * + * @param \WP_Error $error The error object. + * @param boolean $force Force the report, even if should_report_error is false. + * @param boolean $skip_wpcom_verification Set to 'true' to verify the error locally and skip the WP.com verification. + * + * @return void + * @since 1.14.2 + */ + public function report_error( \WP_Error $error, $force = false, $skip_wpcom_verification = false ) { + if ( in_array( $error->get_error_code(), $this->known_errors, true ) && $this->should_report_error( $error ) || $force ) { + $stored_error = $this->store_error( $error ); + if ( $stored_error ) { + $skip_wpcom_verification ? $this->verify_error( $stored_error ) : $this->send_error_to_wpcom( $stored_error ); + } + } + } + + /** + * Checks the status of the gate + * + * This protects the site (and WPCOM) against over loads. + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean $should_report True if gate is open and the error should be reported. + */ + public function should_report_error( \WP_Error $error ) { + if ( defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG ) { + return true; + } + + /** + * Whether to bypass the gate for the error handling + * + * By default, we only process errors once an hour for each error code. + * This is done to avoid overflows. If you need to disable this gate, you can set this variable to true. + * + * This filter is useful for unit testing + * + * @since 1.14.2 + * + * @param boolean $bypass_gate whether to bypass the gate. Default is false, do not bypass. + */ + $bypass_gate = apply_filters( 'jetpack_connection_bypass_error_reporting_gate', false ); + if ( true === $bypass_gate ) { + return true; + } + + $transient = self::ERROR_REPORTING_GATE . $error->get_error_code(); + + if ( get_transient( $transient ) ) { + return false; + } + + set_transient( $transient, true, HOUR_IN_SECONDS ); + return true; + } + + /** + * Stores the error in the database so we know there is an issue and can inform the user + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean|array False if stored errors were not updated and the error array if it was successfully stored. + */ + public function store_error( \WP_Error $error ) { + + $stored_errors = $this->get_stored_errors(); + $error_array = $this->wp_error_to_array( $error ); + $error_code = $error->get_error_code(); + $user_id = $error_array['user_id']; + + if ( ! isset( $stored_errors[ $error_code ] ) || ! is_array( $stored_errors[ $error_code ] ) ) { + $stored_errors[ $error_code ] = array(); + } + + $stored_errors[ $error_code ][ $user_id ] = $error_array; + + // Let's store a maximum of 5 different user ids for each error code. + if ( count( $stored_errors[ $error_code ] ) > 5 ) { + // array_shift will destroy keys here because they are numeric, so manually remove first item. + $keys = array_keys( $stored_errors[ $error_code ] ); + unset( $stored_errors[ $error_code ][ $keys[0] ] ); + } + + if ( update_option( self::STORED_ERRORS_OPTION, $stored_errors ) ) { + return $error_array; + } + + return false; + } + + /** + * Converts a WP_Error object in the array representation we store in the database + * + * @since 1.14.2 + * + * @param \WP_Error $error the error object. + * @return boolean|array False if error is invalid or the error array + */ + public function wp_error_to_array( \WP_Error $error ) { + + $data = $error->get_error_data(); + + if ( ! isset( $data['signature_details'] ) || ! is_array( $data['signature_details'] ) ) { + return false; + } + + $signature_details = $data['signature_details']; + + if ( ! isset( $signature_details['token'] ) || empty( $signature_details['token'] ) ) { + return false; + } + + $user_id = $this->get_user_id_from_token( $signature_details['token'] ); + + $error_array = array( + 'error_code' => $error->get_error_code(), + 'user_id' => $user_id, + 'error_message' => $error->get_error_message(), + 'error_data' => $signature_details, + 'timestamp' => time(), + 'nonce' => wp_generate_password( 10, false ), + 'error_type' => empty( $data['error_type'] ) ? '' : $data['error_type'], + ); + + return $error_array; + } + + /** + * Sends the error to WP.com to be verified + * + * @since 1.14.2 + * + * @param array $error_array The array representation of the error as it is stored in the database. + * @return bool + */ + public function send_error_to_wpcom( $error_array ) { + + $blog_id = \Jetpack_Options::get_option( 'id' ); + + $encrypted_data = $this->encrypt_data_to_wpcom( $error_array ); + + if ( false === $encrypted_data ) { + return false; + } + + $args = array( + 'body' => array( + 'error_data' => $encrypted_data, + ), + ); + + // send encrypted data to WP.com Public-API v2. + wp_remote_post( "https://public-api.wordpress.com/wpcom/v2/sites/{$blog_id}/jetpack-report-error/", $args ); + return true; + } + + /** + * Encrypt data to be sent over to WP.com + * + * @since 1.14.2 + * + * @param array|string $data the data to be encoded. + * @return boolean|string The encoded string on success, false on failure + */ + public function encrypt_data_to_wpcom( $data ) { + + try { + // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $encrypted_data = base64_encode( sodium_crypto_box_seal( wp_json_encode( $data ), base64_decode( JETPACK__ERRORS_PUBLIC_KEY ) ) ); + // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + // phpcs:enable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } catch ( \SodiumException $e ) { + // error encrypting data. + return false; + } + + return $encrypted_data; + } + + /** + * Extracts the user ID from a token + * + * @since 1.14.2 + * + * @param string $token the token used to make the request. + * @return string $the user id or `invalid` if user id not present. + */ + public function get_user_id_from_token( $token ) { + $parsed_token = explode( ':', wp_unslash( $token ) ); + + if ( isset( $parsed_token[2] ) && ctype_digit( $parsed_token[2] ) ) { + $user_id = $parsed_token[2]; + } else { + $user_id = 'invalid'; + } + + return $user_id; + } + + /** + * Gets the reported errors stored in the database + * + * @since 1.14.2 + * + * @return array $errors + */ + public function get_stored_errors() { + + $stored_errors = get_option( self::STORED_ERRORS_OPTION ); + + if ( ! is_array( $stored_errors ) ) { + $stored_errors = array(); + } + + $stored_errors = $this->garbage_collector( $stored_errors ); + + return $stored_errors; + } + + /** + * Gets the verified errors stored in the database + * + * @since 1.14.2 + * + * @return array $errors + */ + public function get_verified_errors() { + + $verified_errors = get_option( self::STORED_VERIFIED_ERRORS_OPTION ); + + if ( ! is_array( $verified_errors ) ) { + $verified_errors = array(); + } + + $verified_errors = $this->garbage_collector( $verified_errors ); + + return $verified_errors; + } + + /** + * Removes expired errors from the array + * + * This method is called by get_stored_errors and get_verified errors and filters their result + * Whenever a new error is stored to the database or verified, this will be triggered and the + * expired error will be permantently removed from the database + * + * @since 1.14.2 + * + * @param array $errors array of errors as stored in the database. + * @return array + */ + private function garbage_collector( $errors ) { + foreach ( $errors as $error_code => $users ) { + foreach ( $users as $user_id => $error ) { + if ( self::ERROR_LIFE_TIME < time() - (int) $error['timestamp'] ) { + unset( $errors[ $error_code ][ $user_id ] ); + } + } + } + // Clear empty error codes. + $errors = array_filter( + $errors, + function ( $user_errors ) { + return ! empty( $user_errors ); + } + ); + return $errors; + } + + /** + * Delete all stored and verified errors from the database + * + * @since 1.14.2 + * + * @return void + */ + public function delete_all_errors() { + $this->delete_stored_errors(); + $this->delete_verified_errors(); + } + + /** + * Delete all stored and verified errors from the database and returns unfiltered value + * + * This is used to hook into a couple of filters that expect true to not short circuit the disconnection flow + * + * @since 8.9.0 + * + * @param mixed $check The input sent by the filter. + * @return boolean + */ + public function delete_all_errors_and_return_unfiltered_value( $check ) { + $this->delete_all_errors(); + return $check; + } + + /** + * Delete the reported errors stored in the database + * + * @since 1.14.2 + * + * @return boolean True, if option is successfully deleted. False on failure. + */ + public function delete_stored_errors() { + return delete_option( self::STORED_ERRORS_OPTION ); + } + + /** + * Delete the verified errors stored in the database + * + * @since 1.14.2 + * + * @return boolean True, if option is successfully deleted. False on failure. + */ + public function delete_verified_errors() { + return delete_option( self::STORED_VERIFIED_ERRORS_OPTION ); + } + + /** + * Gets an error based on the nonce + * + * Receives a nonce and finds the related error. + * + * @since 1.14.2 + * + * @param string $nonce The nonce created for the error we want to get. + * @return null|array Returns the error array representation or null if error not found. + */ + public function get_error_by_nonce( $nonce ) { + $errors = $this->get_stored_errors(); + foreach ( $errors as $user_group ) { + foreach ( $user_group as $error ) { + if ( $error['nonce'] === $nonce ) { + return $error; + } + } + } + return null; + } + + /** + * Adds an error to the verified error list + * + * @since 1.14.2 + * + * @param array $error The error array, as it was saved in the unverified errors list. + * @return void + */ + public function verify_error( $error ) { + + $verified_errors = $this->get_verified_errors(); + $error_code = $error['error_code']; + $user_id = $error['user_id']; + + if ( ! isset( $verified_errors[ $error_code ] ) ) { + $verified_errors[ $error_code ] = array(); + } + + $verified_errors[ $error_code ][ $user_id ] = $error; + + update_option( self::STORED_VERIFIED_ERRORS_OPTION, $verified_errors ); + } + + /** + * Register REST API end point for error hanlding. + * + * @since 1.14.2 + * + * @return void + */ + public function register_verify_error_endpoint() { + register_rest_route( + 'jetpack/v4', + '/verify_xmlrpc_error', + array( + 'methods' => \WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'verify_xml_rpc_error' ), + 'permission_callback' => '__return_true', + 'args' => array( + 'nonce' => array( + 'required' => true, + 'type' => 'string', + ), + ), + ) + ); + } + + /** + * Handles verification that a xml rpc error is legit and came from WordPres.com + * + * @since 1.14.2 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return boolean + */ + public function verify_xml_rpc_error( \WP_REST_Request $request ) { + $error = $this->get_error_by_nonce( $request['nonce'] ); + + if ( $error ) { + $this->verify_error( $error ); + return new \WP_REST_Response( true, 200 ); + } + + return new \WP_REST_Response( false, 200 ); + } + + /** + * Prints a generic error notice for all connection errors + * + * @since 8.9.0 + * + * @return void + */ + public function generic_admin_notice_error() { + // do not add admin notice to the jetpack dashboard. + global $pagenow; + if ( 'admin.php' === $pagenow || isset( $_GET['page'] ) && 'jetpack' === $_GET['page'] ) { // phpcs:ignore + return; + } + + if ( ! current_user_can( 'jetpack_connect' ) ) { + return; + } + + /** + * Filters the message to be displayed in the admin notices area when there's a connection error. + * + * By default we don't display any errors. + * + * Return an empty value to disable the message. + * + * @since 8.9.0 + * + * @param string $message The error message. + * @param array $errors The array of errors. See Automattic\Jetpack\Connection\Error_Handler for details on the array structure. + */ + $message = apply_filters( 'jetpack_connection_error_notice_message', '', $this->get_verified_errors() ); + + /** + * Fires inside the admin_notices hook just before displaying the error message for a broken connection. + * + * If you want to disable the default message from being displayed, return an emtpy value in the jetpack_connection_error_notice_message filter. + * + * @since 8.9.0 + * + * @param array $errors The array of errors. See Automattic\Jetpack\Connection\Error_Handler for details on the array structure. + */ + do_action( 'jetpack_connection_error_notice', $this->get_verified_errors() ); + + if ( empty( $message ) ) { + return; + } + + ?> + + 'connection_error', + 'message' => __( 'Your connection with WordPress.com seems to be broken. If you\'re experiencing issues, please try reconnecting.', 'jetpack-connection' ), + 'action' => 'reconnect', + 'data' => array( 'api_error_code' => $this->error_code ), + ); + return $errors; + } + + /** + * Check REST API response for errors, and report them to WP.com if needed. + * + * @see wp_remote_request() For more information on the $http_response array format. + * @param array|\WP_Error $http_response The response or WP_Error on failure. + * @param array $auth_data Auth data, allowed keys: `token`, `timestamp`, `nonce`, `body-hash`. + * @param string $url Request URL. + * @param string $method Request method. + * @param string $error_type The source of an error: 'xmlrpc' or 'rest'. + * + * @return void + */ + public function check_api_response_for_errors( $http_response, $auth_data, $url, $method, $error_type ) { + if ( 200 === wp_remote_retrieve_response_code( $http_response ) || ! is_array( $auth_data ) || ! $url || ! $method ) { + return; + } + + $body_raw = wp_remote_retrieve_body( $http_response ); + if ( ! $body_raw ) { + return; + } + + $body = json_decode( $body_raw, true ); + if ( empty( $body['error'] ) || ( ! is_string( $body['error'] ) && ! is_int( $body['error'] ) ) ) { + return; + } + + $error = new \WP_Error( + $body['error'], + empty( $body['message'] ) ? '' : $body['message'], + array( + 'signature_details' => array( + 'token' => empty( $auth_data['token'] ) ? '' : $auth_data['token'], + 'timestamp' => empty( $auth_data['timestamp'] ) ? '' : $auth_data['timestamp'], + 'nonce' => empty( $auth_data['nonce'] ) ? '' : $auth_data['nonce'], + 'body_hash' => empty( $auth_data['body_hash'] ) ? '' : $auth_data['body_hash'], + 'method' => $method, + 'url' => $url, + ), + 'error_type' => in_array( $error_type, array( 'xmlrpc', 'rest' ), true ) ? $error_type : '', + ) + ); + + $this->report_error( $error, false, true ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php new file mode 100644 index 00000000..83785d37 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php @@ -0,0 +1,253 @@ +cron_name, array( $this, 'cron_exec' ) ); + + if ( ! wp_next_scheduled( $this->cron_name ) ) { + // Deal with the old pre-3.0 weekly one. + $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ); + if ( $timestamp ) { + wp_unschedule_event( $timestamp, 'jetpack_heartbeat' ); + } + + wp_schedule_event( time(), 'daily', $this->cron_name ); + } + + add_filter( 'jetpack_xmlrpc_unauthenticated_methods', array( __CLASS__, 'jetpack_xmlrpc_methods' ) ); + + if ( defined( 'WP_CLI' ) && WP_CLI ) { + WP_CLI::add_command( 'jetpack-heartbeat', array( $this, 'cli_callback' ) ); + } + } + + /** + * Method that gets executed on the wp-cron call + * + * @since 1.0.0 + * @since-jetpack 2.3.3 + * @global string $wp_version + */ + public function cron_exec() { + + $a8c_mc_stats = new A8c_Mc_Stats(); + + /* + * This should run daily. Figuring in for variances in + * WP_CRON, don't let it run more than every 23 hours at most. + * + * i.e. if it ran less than 23 hours ago, fail out. + */ + $last = (int) Jetpack_Options::get_option( 'last_heartbeat' ); + if ( $last && ( $last + DAY_IN_SECONDS - HOUR_IN_SECONDS > time() ) ) { + return; + } + + /* + * Check for an identity crisis + * + * If one exists: + * - Bump stat for ID crisis + * - Email site admin about potential ID crisis + */ + + // Coming Soon! + + foreach ( self::generate_stats_array( 'v2-' ) as $key => $value ) { + if ( is_array( $value ) ) { + foreach ( $value as $v ) { + $a8c_mc_stats->add( $key, (string) $v ); + } + } else { + $a8c_mc_stats->add( $key, (string) $value ); + } + } + + Jetpack_Options::update_option( 'last_heartbeat', time() ); + + $a8c_mc_stats->do_server_side_stats(); + + /** + * Fires when we synchronize all registered options on heartbeat. + * + * @since 3.3.0 + */ + do_action( 'jetpack_heartbeat' ); + } + + /** + * Generates heartbeat stats data. + * + * @param string $prefix Prefix to add before stats identifier. + * + * @return array The stats array. + */ + public static function generate_stats_array( $prefix = '' ) { + + /** + * This filter is used to build the array of stats that are bumped once a day by Jetpack Heartbeat. + * + * Filter the array and add key => value pairs where + * * key is the stat group name + * * value is the stat name. + * + * Example: + * add_filter( 'jetpack_heartbeat_stats_array', function( $stats ) { + * $stats['is-https'] = is_ssl() ? 'https' : 'http'; + * }); + * + * This will bump the stats for the 'is-https/https' or 'is-https/http' stat. + * + * @param array $stats The stats to be filtered. + * @param string $prefix The prefix that will automatically be added at the begining at each stat group name. + */ + $stats = apply_filters( 'jetpack_heartbeat_stats_array', array(), $prefix ); + $return = array(); + + // Apply prefix to stats. + foreach ( $stats as $stat => $value ) { + $return[ "$prefix$stat" ] = $value; + } + + return $return; + } + + /** + * Registers jetpack.getHeartbeatData xmlrpc method + * + * @param array $methods The list of methods to be filtered. + * @return array $methods + */ + public static function jetpack_xmlrpc_methods( $methods ) { + $methods['jetpack.getHeartbeatData'] = array( __CLASS__, 'xmlrpc_data_response' ); + return $methods; + } + + /** + * Handles the response for the jetpack.getHeartbeatData xmlrpc method + * + * @param array $params The parameters received in the request. + * @return array $params all the stats that heartbeat handles. + */ + public static function xmlrpc_data_response( $params = array() ) { + // The WordPress XML-RPC server sets a default param of array() + // if no argument is passed on the request and the method handlers get this array in $params. + // generate_stats_array() needs a string as first argument. + $params = empty( $params ) ? '' : $params; + return self::generate_stats_array( $params ); + } + + /** + * Clear scheduled events + * + * @return void + */ + public function deactivate() { + // Deal with the old pre-3.0 weekly one. + $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ); + if ( $timestamp ) { + wp_unschedule_event( $timestamp, 'jetpack_heartbeat' ); + } + + $timestamp = wp_next_scheduled( $this->cron_name ); + wp_unschedule_event( $timestamp, $this->cron_name ); + } + + /** + * Interact with the Heartbeat + * + * ## OPTIONS + * + * inspect (default): Gets the list of data that is going to be sent in the heartbeat and the date/time of the last heartbeat + * + * @param array $args Arguments passed via CLI. + * + * @return void + */ + public function cli_callback( $args ) { + + $allowed_args = array( + 'inspect', + ); + + if ( isset( $args[0] ) && ! in_array( $args[0], $allowed_args, true ) ) { + /* translators: %s is a command like "prompt" */ + WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack-connection' ), $args[0] ) ); + } + + $stats = self::generate_stats_array(); + $formatted_stats = array(); + + foreach ( $stats as $stat_name => $bin ) { + $formatted_stats[] = array( + 'Stat name' => $stat_name, + 'Bin' => $bin, + ); + } + + WP_CLI\Utils\format_items( 'table', $formatted_stats, array( 'Stat name', 'Bin' ) ); + + $last_heartbeat = Jetpack_Options::get_option( 'last_heartbeat' ); + + if ( $last_heartbeat ) { + $last_date = gmdate( 'Y-m-d H:i:s', $last_heartbeat ); + /* translators: %s is the full datetime of the last heart beat e.g. 2020-01-01 12:21:23 */ + WP_CLI::line( sprintf( __( 'Last heartbeat sent at: %s', 'jetpack-connection' ), $last_date ) ); + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php new file mode 100644 index 00000000..88d03c5b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php @@ -0,0 +1,58 @@ + esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + 'registrationNonce' => wp_create_nonce( 'jetpack-registration-nonce' ), + 'connectionStatus' => REST_Connector::connection_status( false ), + 'userConnectionData' => REST_Connector::get_user_connection_data( false ), + 'connectedPlugins' => REST_Connector::get_connection_plugins( false ), + 'wpVersion' => $wp_version, + 'siteSuffix' => ( new Status() )->get_site_suffix(), + 'connectionErrors' => Error_Handler::get_instance()->get_verified_errors(), + ); + } + + /** + * Render the initial state into a JavaScript variable. + * + * @return string + */ + public static function render() { + if ( self::$rendered ) { + return null; + } + self::$rendered = true; + return 'var JP_CONNECTION_INITIAL_STATE=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( self::get_data() ) ) . '"));'; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php new file mode 100644 index 00000000..9254dc43 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php @@ -0,0 +1,2512 @@ +set_plugin_instance( new Plugin( $plugin_slug ) ); + } + } + + /** + * Initializes required listeners. This is done separately from the constructors + * because some objects sometimes need to instantiate separate objects of this class. + * + * @todo Implement a proper nonce verification. + */ + public static function configure() { + $manager = new self(); + + add_filter( + 'jetpack_constant_default_value', + __NAMESPACE__ . '\Utils::jetpack_api_constant_filter', + 10, + 2 + ); + + $manager->setup_xmlrpc_handlers( + $_GET, // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $manager->has_connected_owner(), + $manager->verify_xml_rpc_signature() + ); + + $manager->error_handler = Error_Handler::get_instance(); + + if ( $manager->is_connected() ) { + add_filter( 'xmlrpc_methods', array( $manager, 'public_xmlrpc_methods' ) ); + add_filter( 'shutdown', array( new Package_Version_Tracker(), 'maybe_update_package_versions' ) ); + } + + add_action( 'rest_api_init', array( $manager, 'initialize_rest_api_registration_connector' ) ); + + ( new Nonce_Handler() )->init_schedule(); + + add_action( 'plugins_loaded', __NAMESPACE__ . '\Plugin_Storage::configure', 100 ); + + add_filter( 'map_meta_cap', array( $manager, 'jetpack_connection_custom_caps' ), 1, 4 ); + + Heartbeat::init(); + add_filter( 'jetpack_heartbeat_stats_array', array( $manager, 'add_stats_to_heartbeat' ) ); + + Webhooks::init( $manager ); + + // Set up package version hook. + add_filter( 'jetpack_package_versions', __NAMESPACE__ . '\Package_Version::send_package_version_to_tracker' ); + + if ( defined( 'JETPACK__SANDBOX_DOMAIN' ) && JETPACK__SANDBOX_DOMAIN ) { + ( new Server_Sandbox() )->init(); + } + + // Initialize connection notices. + new Connection_Notice(); + } + + /** + * Sets up the XMLRPC request handlers. + * + * @since 1.25.0 Deprecate $is_active param. + * + * @param array $request_params incoming request parameters. + * @param bool $has_connected_owner Whether the site has a connected owner. + * @param bool $is_signed whether the signature check has been successful. + * @param \Jetpack_XMLRPC_Server $xmlrpc_server (optional) an instance of the server to use instead of instantiating a new one. + */ + public function setup_xmlrpc_handlers( + $request_params, + $has_connected_owner, + $is_signed, + \Jetpack_XMLRPC_Server $xmlrpc_server = null + ) { + add_filter( 'xmlrpc_blog_options', array( $this, 'xmlrpc_options' ), 1000, 2 ); + + if ( + ! isset( $request_params['for'] ) + || 'jetpack' !== $request_params['for'] + ) { + return false; + } + + // Alternate XML-RPC, via ?for=jetpack&jetpack=comms. + if ( + isset( $request_params['jetpack'] ) + && 'comms' === $request_params['jetpack'] + ) { + if ( ! Constants::is_defined( 'XMLRPC_REQUEST' ) ) { + // Use the real constant here for WordPress' sake. + define( 'XMLRPC_REQUEST', true ); + } + + add_action( 'template_redirect', array( $this, 'alternate_xmlrpc' ) ); + + add_filter( 'xmlrpc_methods', array( $this, 'remove_non_jetpack_xmlrpc_methods' ), 1000 ); + } + + if ( ! Constants::get_constant( 'XMLRPC_REQUEST' ) ) { + return false; + } + // Display errors can cause the XML to be not well formed. + @ini_set( 'display_errors', false ); // phpcs:ignore + + if ( $xmlrpc_server ) { + $this->xmlrpc_server = $xmlrpc_server; + } else { + $this->xmlrpc_server = new \Jetpack_XMLRPC_Server(); + } + + $this->require_jetpack_authentication(); + + if ( $is_signed ) { + // If the site is connected either at a site or user level and the request is signed, expose the methods. + // The callback is responsible to determine whether the request is signed with blog or user token and act accordingly. + // The actual API methods. + $callback = array( $this->xmlrpc_server, 'xmlrpc_methods' ); + + // Hack to preserve $HTTP_RAW_POST_DATA. + add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); + + } elseif ( $has_connected_owner && ! $is_signed ) { + // The jetpack.authorize method should be available for unauthenticated users on a site with an + // active Jetpack connection, so that additional users can link their account. + $callback = array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ); + + } else { + // Any other unsigned request should expose the bootstrap methods. + $callback = array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ); + new XMLRPC_Connector( $this ); + } + + add_filter( 'xmlrpc_methods', $callback ); + + // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. + add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); + return true; + } + + /** + * Initializes the REST API connector on the init hook. + */ + public function initialize_rest_api_registration_connector() { + new REST_Connector( $this ); + } + + /** + * Since a lot of hosts use a hammer approach to "protecting" WordPress sites, + * and just blanket block all requests to /xmlrpc.php, or apply other overly-sensitive + * security/firewall policies, we provide our own alternate XML RPC API endpoint + * which is accessible via a different URI. Most of the below is copied directly + * from /xmlrpc.php so that we're replicating it as closely as possible. + * + * @todo Tighten $wp_xmlrpc_server_class a bit to make sure it doesn't do bad things. + */ + public function alternate_xmlrpc() { + // Some browser-embedded clients send cookies. We don't want them. + $_COOKIE = array(); + + include_once ABSPATH . 'wp-admin/includes/admin.php'; + include_once ABSPATH . WPINC . '/class-IXR.php'; + include_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'; + + /** + * Filters the class used for handling XML-RPC requests. + * + * @since 1.7.0 + * @since-jetpack 3.1.0 + * + * @param string $class The name of the XML-RPC server class. + */ + $wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' ); + $wp_xmlrpc_server = new $wp_xmlrpc_server_class(); + + // Fire off the request. + nocache_headers(); + $wp_xmlrpc_server->serve_request(); + + exit; + } + + /** + * Removes all XML-RPC methods that are not `jetpack.*`. + * Only used in our alternate XML-RPC endpoint, where we want to + * ensure that Core and other plugins' methods are not exposed. + * + * @param array $methods a list of registered WordPress XMLRPC methods. + * @return array filtered $methods + */ + public function remove_non_jetpack_xmlrpc_methods( $methods ) { + $jetpack_methods = array(); + + foreach ( $methods as $method => $callback ) { + if ( 0 === strpos( $method, 'jetpack.' ) ) { + $jetpack_methods[ $method ] = $callback; + } + } + + return $jetpack_methods; + } + + /** + * Removes all other authentication methods not to allow other + * methods to validate unauthenticated requests. + */ + public function require_jetpack_authentication() { + // Don't let anyone authenticate. + $_COOKIE = array(); + remove_all_filters( 'authenticate' ); + remove_all_actions( 'wp_login_failed' ); + + if ( $this->is_connected() ) { + // Allow Jetpack authentication. + add_filter( 'authenticate', array( $this, 'authenticate_jetpack' ), 10, 3 ); + } + } + + /** + * Authenticates XML-RPC and other requests from the Jetpack Server + * + * @param WP_User|Mixed $user user object if authenticated. + * @param String $username username. + * @param String $password password string. + * @return WP_User|Mixed authenticated user or error. + */ + public function authenticate_jetpack( $user, $username, $password ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( is_a( $user, '\\WP_User' ) ) { + return $user; + } + + $token_details = $this->verify_xml_rpc_signature(); + + if ( ! $token_details ) { + return $user; + } + + if ( 'user' !== $token_details['type'] ) { + return $user; + } + + if ( ! $token_details['user_id'] ) { + return $user; + } + + nocache_headers(); + + return new \WP_User( $token_details['user_id'] ); + } + + /** + * Verifies the signature of the current request. + * + * @return false|array + */ + public function verify_xml_rpc_signature() { + if ( $this->xmlrpc_verification === null ) { + $this->xmlrpc_verification = $this->internal_verify_xml_rpc_signature(); + + if ( is_wp_error( $this->xmlrpc_verification ) ) { + /** + * Action for logging XMLRPC signature verification errors. This data is sensitive. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param WP_Error $signature_verification_error The verification error + */ + do_action( 'jetpack_verify_signature_error', $this->xmlrpc_verification ); + + Error_Handler::get_instance()->report_error( $this->xmlrpc_verification ); + + } + } + + return is_wp_error( $this->xmlrpc_verification ) ? false : $this->xmlrpc_verification; + } + + /** + * Verifies the signature of the current request. + * + * This function has side effects and should not be used. Instead, + * use the memoized version `->verify_xml_rpc_signature()`. + * + * @internal + * @todo Refactor to use proper nonce verification. + */ + private function internal_verify_xml_rpc_signature() { + // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + // It's not for us. + if ( ! isset( $_GET['token'] ) || empty( $_GET['signature'] ) ) { + return false; + } + + $signature_details = array( + 'token' => isset( $_GET['token'] ) ? wp_unslash( $_GET['token'] ) : '', + 'timestamp' => isset( $_GET['timestamp'] ) ? wp_unslash( $_GET['timestamp'] ) : '', + 'nonce' => isset( $_GET['nonce'] ) ? wp_unslash( $_GET['nonce'] ) : '', + 'body_hash' => isset( $_GET['body-hash'] ) ? wp_unslash( $_GET['body-hash'] ) : '', + 'method' => isset( $_SERVER['REQUEST_METHOD'] ) ? wp_unslash( $_SERVER['REQUEST_METHOD'] ) : null, + 'url' => wp_unslash( ( isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : null ) . ( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : null ) ), // Temp - will get real signature URL later. + 'signature' => isset( $_GET['signature'] ) ? wp_unslash( $_GET['signature'] ) : '', + ); + + $error_type = 'xmlrpc'; + + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @list( $token_key, $version, $user_id ) = explode( ':', wp_unslash( $_GET['token'] ) ); + // phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + + $jetpack_api_version = Constants::get_constant( 'JETPACK__API_VERSION' ); + + if ( + empty( $token_key ) + || + empty( $version ) || (string) $jetpack_api_version !== $version ) { + return new \WP_Error( 'malformed_token', 'Malformed token in request', compact( 'signature_details', 'error_type' ) ); + } + + if ( '0' === $user_id ) { + $token_type = 'blog'; + $user_id = 0; + } else { + $token_type = 'user'; + if ( empty( $user_id ) || ! ctype_digit( $user_id ) ) { + return new \WP_Error( + 'malformed_user_id', + 'Malformed user_id in request', + compact( 'signature_details', 'error_type' ) + ); + } + $user_id = (int) $user_id; + + $user = new \WP_User( $user_id ); + if ( ! $user || ! $user->exists() ) { + return new \WP_Error( + 'unknown_user', + sprintf( 'User %d does not exist', $user_id ), + compact( 'signature_details', 'error_type' ) + ); + } + } + + $token = $this->get_tokens()->get_access_token( $user_id, $token_key, false ); + if ( is_wp_error( $token ) ) { + $token->add_data( compact( 'signature_details', 'error_type' ) ); + return $token; + } elseif ( ! $token ) { + return new \WP_Error( + 'unknown_token', + sprintf( 'Token %s:%s:%d does not exist', $token_key, $version, $user_id ), + compact( 'signature_details', 'error_type' ) + ); + } + + $jetpack_signature = new \Jetpack_Signature( $token->secret, (int) \Jetpack_Options::get_option( 'time_diff' ) ); + // phpcs:disable WordPress.Security.NonceVerification.Missing + if ( isset( $_POST['_jetpack_is_multipart'] ) ) { + $post_data = $_POST; + $file_hashes = array(); + foreach ( $post_data as $post_data_key => $post_data_value ) { + if ( 0 !== strpos( $post_data_key, '_jetpack_file_hmac_' ) ) { + continue; + } + $post_data_key = substr( $post_data_key, strlen( '_jetpack_file_hmac_' ) ); + $file_hashes[ $post_data_key ] = $post_data_value; + } + + foreach ( $file_hashes as $post_data_key => $post_data_value ) { + unset( $post_data[ "_jetpack_file_hmac_{$post_data_key}" ] ); + $post_data[ $post_data_key ] = $post_data_value; + } + + ksort( $post_data ); + + $body = http_build_query( stripslashes_deep( $post_data ) ); + } elseif ( $this->raw_post_data === null ) { + $body = file_get_contents( 'php://input' ); + } else { + $body = null; + } + // phpcs:enable + + $signature = $jetpack_signature->sign_current_request( + array( 'body' => $body === null ? $this->raw_post_data : $body ) + ); + + $signature_details['url'] = $jetpack_signature->current_request_url; + + if ( ! $signature ) { + return new \WP_Error( + 'could_not_sign', + 'Unknown signature error', + compact( 'signature_details', 'error_type' ) + ); + } elseif ( is_wp_error( $signature ) ) { + return $signature; + } + + // phpcs:disable WordPress.Security.NonceVerification.Recommended + $timestamp = (int) $_GET['timestamp']; + $nonce = wp_unslash( (string) $_GET['nonce'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- WP Core doesn't sanitize nonces either. + // phpcs:enable WordPress.Security.NonceVerification.Recommended + + // Use up the nonce regardless of whether the signature matches. + if ( ! ( new Nonce_Handler() )->add( $timestamp, $nonce ) ) { + return new \WP_Error( + 'invalid_nonce', + 'Could not add nonce', + compact( 'signature_details', 'error_type' ) + ); + } + + // Be careful about what you do with this debugging data. + // If a malicious requester has access to the expected signature, + // bad things might be possible. + $signature_details['expected'] = $signature; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! hash_equals( $signature, wp_unslash( $_GET['signature'] ) ) ) { + return new \WP_Error( + 'signature_mismatch', + 'Signature mismatch', + compact( 'signature_details', 'error_type' ) + ); + } + + /** + * Action for additional token checking. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param array $post_data request data. + * @param array $token_data token data. + */ + return apply_filters( + 'jetpack_signature_check_token', + array( + 'type' => $token_type, + 'token_key' => $token_key, + 'user_id' => $token->external_user_id, + ), + $token, + $this->raw_post_data + ); + } + + /** + * Returns true if the current site is connected to WordPress.com and has the minimum requirements to enable Jetpack UI. + * + * This method is deprecated since version 1.25.0 of this package. Please use has_connected_owner instead. + * + * Since this method has a wide spread use, we decided not to throw any deprecation warnings for now. + * + * @deprecated 1.25.0 + * @see Manager::has_connected_owner + * @return Boolean is the site connected? + */ + public function is_active() { + return (bool) $this->get_tokens()->get_access_token( true ); + } + + /** + * Obtains an instance of the Tokens class. + * + * @return Tokens the Tokens object + */ + public function get_tokens() { + return new Tokens(); + } + + /** + * Returns true if the site has both a token and a blog id, which indicates a site has been registered. + * + * @access public + * @deprecated 1.12.1 Use is_connected instead + * @see Manager::is_connected + * + * @return bool + */ + public function is_registered() { + _deprecated_function( __METHOD__, '1.12.1' ); + return $this->is_connected(); + } + + /** + * Returns true if the site has both a token and a blog id, which indicates a site has been connected. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function is_connected() { + $has_blog_id = (bool) \Jetpack_Options::get_option( 'id' ); + $has_blog_token = (bool) $this->get_tokens()->get_access_token(); + return $has_blog_id && $has_blog_token; + } + + /** + * Returns true if the site has at least one connected administrator. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_admin() { + return (bool) count( $this->get_connected_users( 'manage_options' ) ); + } + + /** + * Returns true if the site has any connected user. + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_user() { + return (bool) count( $this->get_connected_users( 'any', 1 ) ); + } + + /** + * Returns an array of users that have user tokens for communicating with wpcom. + * Able to select by specific capability. + * + * @since 9.9.1 Added $limit parameter. + * + * @param string $capability The capability of the user. + * @param int|null $limit How many connected users to get before returning. + * @return WP_User[] Array of WP_User objects if found. + */ + public function get_connected_users( $capability = 'any', $limit = null ) { + $connected_users = array(); + $user_tokens = $this->get_tokens()->get_user_tokens(); + + if ( ! is_array( $user_tokens ) || empty( $user_tokens ) ) { + return $connected_users; + } + $connected_user_ids = array_keys( $user_tokens ); + + if ( ! empty( $connected_user_ids ) ) { + foreach ( $connected_user_ids as $id ) { + // Check for capability. + if ( 'any' !== $capability && ! user_can( $id, $capability ) ) { + continue; + } + + $user_data = get_userdata( $id ); + if ( $user_data instanceof \WP_User ) { + $connected_users[] = $user_data; + if ( $limit && count( $connected_users ) >= $limit ) { + return $connected_users; + } + } + } + } + + return $connected_users; + } + + /** + * Returns true if the site has a connected Blog owner (master_user). + * + * @access public + * @since 1.21.1 + * + * @return bool + */ + public function has_connected_owner() { + return (bool) $this->get_connection_owner_id(); + } + + /** + * Returns true if the site is connected only at a site level. + * + * Note that we are explicitly checking for the existence of the master_user option in order to account for cases where we don't have any user tokens (user-level connection) but the master_user option is set, which could be the result of a problematic user connection. + * + * @access public + * @since 1.25.0 + * @deprecated 1.27.0 + * + * @return bool + */ + public function is_userless() { + _deprecated_function( __METHOD__, '1.27.0', 'Automattic\\Jetpack\\Connection\\Manager::is_site_connection' ); + return $this->is_site_connection(); + } + + /** + * Returns true if the site is connected only at a site level. + * + * Note that we are explicitly checking for the existence of the master_user option in order to account for cases where we don't have any user tokens (user-level connection) but the master_user option is set, which could be the result of a problematic user connection. + * + * @access public + * @since 1.27.0 + * + * @return bool + */ + public function is_site_connection() { + return $this->is_connected() && ! $this->has_connected_user() && ! \Jetpack_Options::get_option( 'master_user' ); + } + + /** + * Checks to see if the connection owner of the site is missing. + * + * @return bool + */ + public function is_missing_connection_owner() { + $connection_owner = $this->get_connection_owner_id(); + if ( ! get_user_by( 'id', $connection_owner ) ) { + return true; + } + + return false; + } + + /** + * Returns true if the user with the specified identifier is connected to + * WordPress.com. + * + * @param int $user_id the user identifier. Default is the current user. + * @return bool Boolean is the user connected? + */ + public function is_user_connected( $user_id = false ) { + $user_id = false === $user_id ? get_current_user_id() : absint( $user_id ); + if ( ! $user_id ) { + return false; + } + + return (bool) $this->get_tokens()->get_access_token( $user_id ); + } + + /** + * Returns the local user ID of the connection owner. + * + * @return bool|int Returns the ID of the connection owner or False if no connection owner found. + */ + public function get_connection_owner_id() { + $owner = $this->get_connection_owner(); + return $owner instanceof \WP_User ? $owner->ID : false; + } + + /** + * Get the wpcom user data of the current|specified connected user. + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param Integer $user_id the user identifier. + * @return bool|array An array with the WPCOM user data on success, false otherwise. + */ + public function get_connected_user_data( $user_id = null ) { + if ( ! $user_id ) { + $user_id = get_current_user_id(); + } + + // Check if the user is connected and return false otherwise. + if ( ! $this->is_user_connected( $user_id ) ) { + return false; + } + + $transient_key = "jetpack_connected_user_data_$user_id"; + $cached_user_data = get_transient( $transient_key ); + + if ( $cached_user_data ) { + return $cached_user_data; + } + + $xml = new Jetpack_IXR_Client( + array( + 'user_id' => $user_id, + ) + ); + $xml->query( 'wpcom.getUser' ); + + if ( ! $xml->isError() ) { + $user_data = $xml->getResponse(); + set_transient( $transient_key, $xml->getResponse(), DAY_IN_SECONDS ); + return $user_data; + } + + return false; + } + + /** + * Returns a user object of the connection owner. + * + * @return WP_User|false False if no connection owner found. + */ + public function get_connection_owner() { + + $user_id = \Jetpack_Options::get_option( 'master_user' ); + + if ( ! $user_id ) { + return false; + } + + // Make sure user is connected. + $user_token = $this->get_tokens()->get_access_token( $user_id ); + + $connection_owner = false; + + if ( $user_token && is_object( $user_token ) && isset( $user_token->external_user_id ) ) { + $connection_owner = get_userdata( $user_token->external_user_id ); + } + + return $connection_owner; + } + + /** + * Returns true if the provided user is the Jetpack connection owner. + * If user ID is not specified, the current user will be used. + * + * @param Integer|Boolean $user_id the user identifier. False for current user. + * @return Boolean True the user the connection owner, false otherwise. + */ + public function is_connection_owner( $user_id = false ) { + if ( ! $user_id ) { + $user_id = get_current_user_id(); + } + + return ( (int) $user_id ) === $this->get_connection_owner_id(); + } + + /** + * Connects the user with a specified ID to a WordPress.com user using the + * remote login flow. + * + * @access public + * + * @param Integer $user_id (optional) the user identifier, defaults to current user. + * @param String $redirect_url the URL to redirect the user to for processing, defaults to + * admin_url(). + * @return WP_Error only in case of a failed user lookup. + */ + public function connect_user( $user_id = null, $redirect_url = null ) { + $user = null; + if ( null === $user_id ) { + $user = wp_get_current_user(); + } else { + $user = get_user_by( 'ID', $user_id ); + } + + if ( empty( $user ) ) { + return new \WP_Error( 'user_not_found', 'Attempting to connect a non-existent user.' ); + } + + if ( null === $redirect_url ) { + $redirect_url = admin_url(); + } + + // Using wp_redirect intentionally because we're redirecting outside. + wp_redirect( $this->get_authorization_url( $user, $redirect_url ) ); // phpcs:ignore WordPress.Security.SafeRedirect + exit(); + } + + /** + * Unlinks the current user from the linked WordPress.com user. + * + * @access public + * @static + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param Integer $user_id the user identifier. + * @param bool $can_overwrite_primary_user Allow for the primary user to be disconnected. + * @param bool $force_disconnect_locally Disconnect user locally even if we were unable to disconnect them from WP.com. + * @return Boolean Whether the disconnection of the user was successful. + */ + public function disconnect_user( $user_id = null, $can_overwrite_primary_user = false, $force_disconnect_locally = false ) { + $user_id = empty( $user_id ) ? get_current_user_id() : (int) $user_id; + $is_primary_user = Jetpack_Options::get_option( 'master_user' ) === $user_id; + + if ( $is_primary_user && ! $can_overwrite_primary_user ) { + return false; + } + + // Attempt to disconnect the user from WordPress.com. + $is_disconnected_from_wpcom = $this->unlink_user_from_wpcom( $user_id ); + + $is_disconnected_locally = false; + if ( $is_disconnected_from_wpcom || $force_disconnect_locally ) { + // Disconnect the user locally. + $is_disconnected_locally = $this->get_tokens()->disconnect_user( $user_id ); + + if ( $is_disconnected_locally ) { + // Delete cached connected user data. + $transient_key = "jetpack_connected_user_data_$user_id"; + delete_transient( $transient_key ); + + /** + * Fires after the current user has been unlinked from WordPress.com. + * + * @since 1.7.0 + * @since-jetpack 4.1.0 + * + * @param int $user_id The current user's ID. + */ + do_action( 'jetpack_unlinked_user', $user_id ); + + if ( $is_primary_user ) { + Jetpack_Options::delete_option( 'master_user' ); + } + } + } + + return $is_disconnected_from_wpcom && $is_disconnected_locally; + } + + /** + * Request to wpcom for a user to be unlinked from their WordPress.com account + * + * @param int $user_id The user identifier. + * + * @return bool Whether the disconnection of the user was successful. + */ + public function unlink_user_from_wpcom( $user_id ) { + // Attempt to disconnect the user from WordPress.com. + $xml = new Jetpack_IXR_Client(); + + $xml->query( 'jetpack.unlink_user', $user_id ); + if ( $xml->isError() ) { + return false; + } + + return (bool) $xml->getResponse(); + } + + /** + * Update the connection owner. + * + * @since 1.29.0 + * + * @param Integer $new_owner_id The ID of the user to become the connection owner. + * + * @return true|WP_Error True if owner successfully changed, WP_Error otherwise. + */ + public function update_connection_owner( $new_owner_id ) { + $roles = new Roles(); + if ( ! user_can( $new_owner_id, $roles->translate_role_to_cap( 'administrator' ) ) ) { + return new WP_Error( + 'new_owner_not_admin', + __( 'New owner is not admin', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + $old_owner_id = $this->get_connection_owner_id(); + + if ( $old_owner_id === $new_owner_id ) { + return new WP_Error( + 'new_owner_is_existing_owner', + __( 'New owner is same as existing owner', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + if ( ! $this->is_user_connected( $new_owner_id ) ) { + return new WP_Error( + 'new_owner_not_connected', + __( 'New owner is not connected', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + // Notify WPCOM about the connection owner change. + $owner_updated_wpcom = $this->update_connection_owner_wpcom( $new_owner_id ); + + if ( $owner_updated_wpcom ) { + // Update the connection owner in Jetpack only if they were successfully updated on WPCOM. + // This will ensure consistency with WPCOM. + \Jetpack_Options::update_option( 'master_user', $new_owner_id ); + + // Track it. + ( new Tracking() )->record_user_event( 'set_connection_owner_success' ); + + return true; + } + return new WP_Error( + 'error_setting_new_owner', + __( 'Could not confirm new owner.', 'jetpack-connection' ), + array( 'status' => 500 ) + ); + } + + /** + * Request to WPCOM to update the connection owner. + * + * @since 1.29.0 + * + * @param Integer $new_owner_id The ID of the user to become the connection owner. + * + * @return Boolean Whether the ownership transfer was successful. + */ + public function update_connection_owner_wpcom( $new_owner_id ) { + // Notify WPCOM about the connection owner change. + $xml = new Jetpack_IXR_Client( + array( + 'user_id' => get_current_user_id(), + ) + ); + $xml->query( + 'jetpack.switchBlogOwner', + array( + 'new_blog_owner' => $new_owner_id, + ) + ); + if ( $xml->isError() ) { + return false; + } + + return (bool) $xml->getResponse(); + } + + /** + * Returns the requested Jetpack API URL. + * + * @param String $relative_url the relative API path. + * @return String API URL. + */ + public function api_url( $relative_url ) { + $api_base = Constants::get_constant( 'JETPACK__API_BASE' ); + $api_version = '/' . Constants::get_constant( 'JETPACK__API_VERSION' ) . '/'; + + /** + * Filters the API URL that Jetpack uses for server communication. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param String $url the generated URL. + * @param String $relative_url the relative URL that was passed as an argument. + * @param String $api_base the API base string that is being used. + * @param String $api_version the API version string that is being used. + */ + return apply_filters( + 'jetpack_api_url', + rtrim( $api_base . $relative_url, '/\\' ) . $api_version, + $relative_url, + $api_base, + $api_version + ); + } + + /** + * Returns the Jetpack XMLRPC WordPress.com API endpoint URL. + * + * @return String XMLRPC API URL. + */ + public function xmlrpc_api_url() { + $base = preg_replace( + '#(https?://[^?/]+)(/?.*)?$#', + '\\1', + Constants::get_constant( 'JETPACK__API_BASE' ) + ); + return untrailingslashit( $base ) . '/xmlrpc.php'; + } + + /** + * Attempts Jetpack registration which sets up the site for connection. Should + * remain public because the call to action comes from the current site, not from + * WordPress.com. + * + * @param String $api_endpoint (optional) an API endpoint to use, defaults to 'register'. + * @return true|WP_Error The error object. + */ + public function register( $api_endpoint = 'register' ) { + add_action( 'pre_update_jetpack_option_register', array( '\\Jetpack_Options', 'delete_option' ) ); + $secrets = ( new Secrets() )->generate( 'register', get_current_user_id(), 600 ); + + if ( false === $secrets ) { + return new WP_Error( 'cannot_save_secrets', __( 'Jetpack experienced an issue trying to save options (cannot_save_secrets). We suggest that you contact your hosting provider, and ask them for help checking that the options table is writable on your site.', 'jetpack-connection' ) ); + } + + if ( + empty( $secrets['secret_1'] ) || + empty( $secrets['secret_2'] ) || + empty( $secrets['exp'] ) + ) { + return new \WP_Error( 'missing_secrets' ); + } + + // Better to try (and fail) to set a higher timeout than this system + // supports than to have register fail for more users than it should. + $timeout = $this->set_min_time_limit( 60 ) / 2; + + $gmt_offset = get_option( 'gmt_offset' ); + if ( ! $gmt_offset ) { + $gmt_offset = 0; + } + + $stats_options = get_option( 'stats_options' ); + $stats_id = isset( $stats_options['blog_id'] ) + ? $stats_options['blog_id'] + : null; + + /* This action is documented in src/class-package-version-tracker.php */ + $package_versions = apply_filters( 'jetpack_package_versions', array() ); + + $active_plugins_using_connection = Plugin_Storage::get_all(); + + /** + * Filters the request body for additional property addition. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param array $post_data request data. + * @param Array $token_data token data. + */ + $body = apply_filters( + 'jetpack_register_request_body', + array_merge( + array( + 'siteurl' => Urls::site_url(), + 'home' => Urls::home_url(), + 'gmt_offset' => $gmt_offset, + 'timezone_string' => (string) get_option( 'timezone_string' ), + 'site_name' => (string) get_option( 'blogname' ), + 'secret_1' => $secrets['secret_1'], + 'secret_2' => $secrets['secret_2'], + 'site_lang' => get_locale(), + 'timeout' => $timeout, + 'stats_id' => $stats_id, + 'state' => get_current_user_id(), + 'site_created' => $this->get_assumed_site_creation_date(), + 'jetpack_version' => Constants::get_constant( 'JETPACK__VERSION' ), + 'ABSPATH' => Constants::get_constant( 'ABSPATH' ), + 'current_user_email' => wp_get_current_user()->user_email, + 'connect_plugin' => $this->get_plugin() ? $this->get_plugin()->get_slug() : null, + 'package_versions' => $package_versions, + 'active_connected_plugins' => $active_plugins_using_connection, + ), + self::$extra_register_params + ) + ); + + $args = array( + 'method' => 'POST', + 'body' => $body, + 'headers' => array( + 'Accept' => 'application/json', + ), + 'timeout' => $timeout, + ); + + $args['body'] = $this->apply_activation_source_to_args( $args['body'] ); + + // TODO: fix URLs for bad hosts. + $response = Client::_wp_remote_request( + $this->api_url( $api_endpoint ), + $args, + true + ); + + // Make sure the response is valid and does not contain any Jetpack errors. + $registration_details = $this->validate_remote_register_response( $response ); + + if ( is_wp_error( $registration_details ) ) { + return $registration_details; + } elseif ( ! $registration_details ) { + return new \WP_Error( + 'unknown_error', + 'Unknown error registering your Jetpack site.', + wp_remote_retrieve_response_code( $response ) + ); + } + + if ( empty( $registration_details->jetpack_secret ) || ! is_string( $registration_details->jetpack_secret ) ) { + return new \WP_Error( + 'jetpack_secret', + 'Unable to validate registration of your Jetpack site.', + wp_remote_retrieve_response_code( $response ) + ); + } + + if ( isset( $registration_details->jetpack_public ) ) { + $jetpack_public = (int) $registration_details->jetpack_public; + } else { + $jetpack_public = false; + } + + \Jetpack_Options::update_options( + array( + 'id' => (int) $registration_details->jetpack_id, + 'public' => $jetpack_public, + ) + ); + + update_option( Package_Version_Tracker::PACKAGE_VERSION_OPTION, $package_versions ); + + $this->get_tokens()->update_blog_token( (string) $registration_details->jetpack_secret ); + + $alternate_authorization_url = isset( $registration_details->alternate_authorization_url ) ? $registration_details->alternate_authorization_url : ''; + + add_filter( + 'jetpack_register_site_rest_response', + function ( $response ) use ( $alternate_authorization_url ) { + $response['alternateAuthorizeUrl'] = $alternate_authorization_url; + return $response; + } + ); + + /** + * Fires when a site is registered on WordPress.com. + * + * @since 1.7.0 + * @since-jetpack 3.7.0 + * + * @param int $json->jetpack_id Jetpack Blog ID. + * @param string $json->jetpack_secret Jetpack Blog Token. + * @param int|bool $jetpack_public Is the site public. + */ + do_action( + 'jetpack_site_registered', + $registration_details->jetpack_id, + $registration_details->jetpack_secret, + $jetpack_public + ); + + if ( isset( $registration_details->token ) ) { + /** + * Fires when a user token is sent along with the registration data. + * + * @since 1.7.0 + * @since-jetpack 7.6.0 + * + * @param object $token the administrator token for the newly registered site. + */ + do_action( 'jetpack_site_registered_user_token', $registration_details->token ); + } + + return true; + } + + /** + * Attempts Jetpack registration. + * + * @param bool $tos_agree Whether the user agreed to TOS. + * + * @return bool|WP_Error + */ + public function try_registration( $tos_agree = true ) { + if ( $tos_agree ) { + $terms_of_service = new Terms_Of_Service(); + $terms_of_service->agree(); + } + + /** + * Action fired when the user attempts the registration. + * + * @since 1.26.0 + */ + $pre_register = apply_filters( 'jetpack_pre_register', null ); + + if ( is_wp_error( $pre_register ) ) { + return $pre_register; + } + + $tracking_data = array(); + + if ( null !== $this->get_plugin() ) { + $tracking_data['plugin_slug'] = $this->get_plugin()->get_slug(); + } + + $tracking = new Tracking(); + $tracking->record_user_event( 'jpc_register_begin', $tracking_data ); + + add_filter( 'jetpack_register_request_body', array( Utils::class, 'filter_register_request_body' ) ); + + $result = $this->register(); + + remove_filter( 'jetpack_register_request_body', array( Utils::class, 'filter_register_request_body' ) ); + + // If there was an error with registration and the site was not registered, record this so we can show a message. + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Adds a parameter to the register request body + * + * @since 1.26.0 + * + * @param string $name The name of the parameter to be added. + * @param string $value The value of the parameter to be added. + * + * @throws \InvalidArgumentException If supplied arguments are not strings. + * @return void + */ + public function add_register_request_param( $name, $value ) { + if ( ! is_string( $name ) || ! is_string( $value ) ) { + throw new \InvalidArgumentException( 'name and value must be strings' ); + } + self::$extra_register_params[ $name ] = $value; + } + + /** + * Takes the response from the Jetpack register new site endpoint and + * verifies it worked properly. + * + * @since 1.7.0 + * @since-jetpack 2.6.0 + * + * @param Mixed $response the response object, or the error object. + * @return string|WP_Error A JSON object on success or WP_Error on failures + **/ + protected function validate_remote_register_response( $response ) { + if ( is_wp_error( $response ) ) { + return new \WP_Error( + 'register_http_request_failed', + $response->get_error_message() + ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $registration_response = json_decode( $entity ); + } else { + $registration_response = false; + } + + $code_type = (int) ( $code / 100 ); + if ( 5 === $code_type ) { + return new \WP_Error( 'wpcom_5??', $code ); + } elseif ( 408 === $code ) { + return new \WP_Error( 'wpcom_408', $code ); + } elseif ( ! empty( $registration_response->error ) ) { + if ( + 'xml_rpc-32700' === $registration_response->error + && ! function_exists( 'xml_parser_create' ) + ) { + $error_description = __( "PHP's XML extension is not available. Jetpack requires the XML extension to communicate with WordPress.com. Please contact your hosting provider to enable PHP's XML extension.", 'jetpack-connection' ); + } else { + $error_description = isset( $registration_response->error_description ) + ? (string) $registration_response->error_description + : ''; + } + + return new \WP_Error( + (string) $registration_response->error, + $error_description, + $code + ); + } elseif ( 200 !== $code ) { + return new \WP_Error( 'wpcom_bad_response', $code ); + } + + // Jetpack ID error block. + if ( empty( $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID is empty. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } elseif ( ! is_scalar( $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) { + return new \WP_Error( + 'jetpack_id', + /* translators: %s is an error message string */ + sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack-connection' ), $entity ), + $entity + ); + } + + return $registration_response; + } + + /** + * Adds a used nonce to a list of known nonces. + * + * @param int $timestamp the current request timestamp. + * @param string $nonce the nonce value. + * @return bool whether the nonce is unique or not. + * + * @deprecated since 1.24.0 + * @see Nonce_Handler::add() + */ + public function add_nonce( $timestamp, $nonce ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Nonce_Handler::add' ); + return ( new Nonce_Handler() )->add( $timestamp, $nonce ); + } + + /** + * Cleans nonces that were saved when calling ::add_nonce. + * + * @todo Properly prepare the query before executing it. + * + * @param bool $all whether to clean even non-expired nonces. + * + * @deprecated since 1.24.0 + * @see Nonce_Handler::clean_all() + */ + public function clean_nonces( $all = false ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Nonce_Handler::clean_all' ); + ( new Nonce_Handler() )->clean_all( $all ? PHP_INT_MAX : ( time() - Nonce_Handler::LIFETIME ) ); + } + + /** + * Sets the Connection custom capabilities. + * + * @param string[] $caps Array of the user's capabilities. + * @param string $cap Capability name. + * @param int $user_id The user ID. + * @param array $args Adds the context to the cap. Typically the object ID. + */ + public function jetpack_connection_custom_caps( $caps, $cap, $user_id, $args ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + switch ( $cap ) { + case 'jetpack_connect': + case 'jetpack_reconnect': + $is_offline_mode = ( new Status() )->is_offline_mode(); + if ( $is_offline_mode ) { + $caps = array( 'do_not_allow' ); + break; + } + // Pass through. If it's not offline mode, these should match disconnect. + // Let users disconnect if it's offline mode, just in case things glitch. + case 'jetpack_disconnect': + /** + * Filters the jetpack_disconnect capability. + * + * @since 1.14.2 + * + * @param array An array containing the capability name. + */ + $caps = apply_filters( 'jetpack_disconnect_cap', array( 'manage_options' ) ); + break; + case 'jetpack_connect_user': + $is_offline_mode = ( new Status() )->is_offline_mode(); + if ( $is_offline_mode ) { + $caps = array( 'do_not_allow' ); + break; + } + // With site connections in mind, non-admin users can connect their account only if a connection owner exists. + $caps = $this->has_connected_owner() ? array( 'read' ) : array( 'manage_options' ); + break; + } + return $caps; + } + + /** + * Builds the timeout limit for queries talking with the wpcom servers. + * + * Based on local php max_execution_time in php.ini + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * @return int + **/ + public function get_max_execution_time() { + $timeout = (int) ini_get( 'max_execution_time' ); + + // Ensure exec time set in php.ini. + if ( ! $timeout ) { + $timeout = 30; + } + return $timeout; + } + + /** + * Sets a minimum request timeout, and returns the current timeout + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * @param Integer $min_timeout the minimum timeout value. + **/ + public function set_min_time_limit( $min_timeout ) { + $timeout = $this->get_max_execution_time(); + if ( $timeout < $min_timeout ) { + $timeout = $min_timeout; + set_time_limit( $timeout ); + } + return $timeout; + } + + /** + * Get our assumed site creation date. + * Calculated based on the earlier date of either: + * - Earliest admin user registration date. + * - Earliest date of post of any post type. + * + * @since 1.7.0 + * @since-jetpack 7.2.0 + * + * @return string Assumed site creation date and time. + */ + public function get_assumed_site_creation_date() { + $cached_date = get_transient( 'jetpack_assumed_site_creation_date' ); + if ( ! empty( $cached_date ) ) { + return $cached_date; + } + + $earliest_registered_users = get_users( + array( + 'role' => 'administrator', + 'orderby' => 'user_registered', + 'order' => 'ASC', + 'fields' => array( 'user_registered' ), + 'number' => 1, + ) + ); + $earliest_registration_date = $earliest_registered_users[0]->user_registered; + + $earliest_posts = get_posts( + array( + 'posts_per_page' => 1, + 'post_type' => 'any', + 'post_status' => 'any', + 'orderby' => 'date', + 'order' => 'ASC', + ) + ); + + // If there are no posts at all, we'll count only on user registration date. + if ( $earliest_posts ) { + $earliest_post_date = $earliest_posts[0]->post_date; + } else { + $earliest_post_date = PHP_INT_MAX; + } + + $assumed_date = min( $earliest_registration_date, $earliest_post_date ); + set_transient( 'jetpack_assumed_site_creation_date', $assumed_date ); + + return $assumed_date; + } + + /** + * Adds the activation source string as a parameter to passed arguments. + * + * @todo Refactor to use rawurlencode() instead of urlencode(). + * + * @param array $args arguments that need to have the source added. + * @return array $amended arguments. + */ + public static function apply_activation_source_to_args( $args ) { + list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); + + if ( $activation_source_name ) { + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode + $args['_as'] = urlencode( $activation_source_name ); + } + + if ( $activation_source_keyword ) { + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode + $args['_ak'] = urlencode( $activation_source_keyword ); + } + + return $args; + } + + /** + * Generates two secret tokens and the end of life timestamp for them. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @param Integer $exp Expiration time in seconds. + */ + public function generate_secrets( $action, $user_id = false, $exp = 600 ) { + return ( new Secrets() )->generate( $action, $user_id, $exp ); + } + + /** + * Returns two secret tokens and the end of life timestamp for them. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->get() instead. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @return string|array an array of secrets or an error string. + */ + public function get_secrets( $action, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->get' ); + return ( new Secrets() )->get( $action, $user_id ); + } + + /** + * Deletes secret tokens in case they, for example, have expired. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->delete() instead. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + */ + public function delete_secrets( $action, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->delete' ); + ( new Secrets() )->delete( $action, $user_id ); + } + + /** + * Deletes all connection tokens and transients from the local Jetpack site. + * If the plugin object has been provided in the constructor, the function first checks + * whether it's the only active connection. + * If there are any other connections, the function will do nothing and return `false` + * (unless `$ignore_connected_plugins` is set to `true`). + * + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * + * @return bool True if disconnected successfully, false otherwise. + */ + public function delete_all_connection_tokens( $ignore_connected_plugins = false ) { + // refuse to delete if we're not the last Jetpack plugin installed. + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + /** + * Fires upon the disconnect attempt. + * Return `false` to prevent the disconnect. + * + * @since 1.14.2 + */ + if ( ! apply_filters( 'jetpack_connection_delete_all_tokens', true ) ) { + return false; + } + + \Jetpack_Options::delete_option( + array( + 'master_user', + 'time_diff', + 'fallback_no_verify_ssl_certs', + ) + ); + + ( new Secrets() )->delete_all(); + $this->get_tokens()->delete_all(); + + // Delete cached connected user data. + $transient_key = 'jetpack_connected_user_data_' . get_current_user_id(); + delete_transient( $transient_key ); + + // Delete all XML-RPC errors. + Error_Handler::get_instance()->delete_all_errors(); + + return true; + } + + /** + * Tells WordPress.com to disconnect the site and clear all tokens from cached site. + * If the plugin object has been provided in the constructor, the function first check + * whether it's the only active connection. + * If there are any other connections, the function will do nothing and return `false` + * (unless `$ignore_connected_plugins` is set to `true`). + * + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * + * @return bool True if disconnected successfully, false otherwise. + */ + public function disconnect_site_wpcom( $ignore_connected_plugins = false ) { + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + /** + * Fires upon the disconnect attempt. + * Return `false` to prevent the disconnect. + * + * @since 1.14.2 + */ + if ( ! apply_filters( 'jetpack_connection_disconnect_site_wpcom', true, $this ) ) { + return false; + } + + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.deregister', get_current_user_id() ); + + return true; + } + + /** + * Disconnect the plugin and remove the tokens. + * This function will automatically perform "soft" or "hard" disconnect depending on whether other plugins are using the connection. + * This is a proxy method to simplify the Connection package API. + * + * @see Manager::disconnect_site() + * + * @param boolean $disconnect_wpcom Should disconnect_site_wpcom be called. + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + * @return bool + */ + public function remove_connection( $disconnect_wpcom = true, $ignore_connected_plugins = false ) { + + $this->disconnect_site( $disconnect_wpcom, $ignore_connected_plugins ); + + return true; + } + + /** + * Completely clearing up the connection, and initiating reconnect. + * + * @return true|WP_Error True if reconnected successfully, a `WP_Error` object otherwise. + */ + public function reconnect() { + ( new Tracking() )->record_user_event( 'restore_connection_reconnect' ); + + $this->disconnect_site_wpcom( true ); + $this->delete_all_connection_tokens( true ); + + return $this->register(); + } + + /** + * Validate the tokens, and refresh the invalid ones. + * + * @return string|bool|WP_Error True if connection restored or string indicating what's to be done next. A `WP_Error` object or false otherwise. + */ + public function restore() { + // If this is a site connection we need to trigger a full reconnection as our only secure means of + // communication with WPCOM, aka the blog token, is compromised. + if ( $this->is_site_connection() ) { + return $this->reconnect(); + } + + $validate_tokens_response = $this->get_tokens()->validate(); + + // If token validation failed, trigger a full reconnection. + if ( is_array( $validate_tokens_response ) && + isset( $validate_tokens_response['blog_token']['is_healthy'] ) && + isset( $validate_tokens_response['user_token']['is_healthy'] ) ) { + $blog_token_healthy = $validate_tokens_response['blog_token']['is_healthy']; + $user_token_healthy = $validate_tokens_response['user_token']['is_healthy']; + } else { + $blog_token_healthy = false; + $user_token_healthy = false; + } + + // Tokens are both valid, or both invalid. We can't fix the problem we don't see, so the full reconnection is needed. + if ( $blog_token_healthy === $user_token_healthy ) { + $result = $this->reconnect(); + return ( true === $result ) ? 'authorize' : $result; + } + + if ( ! $blog_token_healthy ) { + return $this->refresh_blog_token(); + } + + if ( ! $user_token_healthy ) { + return ( true === $this->refresh_user_token() ) ? 'authorize' : false; + } + + return false; + } + + /** + * Responds to a WordPress.com call to register the current site. + * Should be changed to protected. + * + * @param array $registration_data Array of [ secret_1, user_id ]. + */ + public function handle_registration( array $registration_data ) { + list( $registration_secret_1, $registration_user_id ) = $registration_data; + if ( empty( $registration_user_id ) ) { + return new \WP_Error( 'registration_state_invalid', __( 'Invalid Registration State', 'jetpack-connection' ), 400 ); + } + + return ( new Secrets() )->verify( 'register', $registration_secret_1, (int) $registration_user_id ); + } + + /** + * Perform the API request to validate the blog and user tokens. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->validate_tokens() instead. + * + * @param int|null $user_id ID of the user we need to validate token for. Current user's ID by default. + * + * @return array|false|WP_Error The API response: `array( 'blog_token_is_healthy' => true|false, 'user_token_is_healthy' => true|false )`. + */ + public function validate_tokens( $user_id = null ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->validate' ); + return $this->get_tokens()->validate( $user_id ); + } + + /** + * Verify a Previously Generated Secret. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Secrets->verify() instead. + * + * @param string $action The type of secret to verify. + * @param string $secret_1 The secret string to compare to what is stored. + * @param int $user_id The user ID of the owner of the secret. + * @return \WP_Error|string WP_Error on failure, secret_2 on success. + */ + public function verify_secrets( $action, $secret_1, $user_id ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Secrets->verify' ); + return ( new Secrets() )->verify( $action, $secret_1, $user_id ); + } + + /** + * Responds to a WordPress.com call to authorize the current user. + * Should be changed to protected. + */ + public function handle_authorization() { + } + + /** + * Obtains the auth token. + * + * @param array $data The request data. + * @return object|\WP_Error Returns the auth token on success. + * Returns a \WP_Error on failure. + */ + public function get_token( $data ) { + return $this->get_tokens()->get( $data, $this->api_url( 'token' ) ); + } + + /** + * Builds a URL to the Jetpack connection auth page. + * + * @param WP_User $user (optional) defaults to the current logged in user. + * @param String $redirect (optional) a redirect URL to use instead of the default. + * @return string Connect URL. + */ + public function get_authorization_url( $user = null, $redirect = null ) { + if ( empty( $user ) ) { + $user = wp_get_current_user(); + } + + $roles = new Roles(); + $role = $roles->translate_user_to_role( $user ); + $signed_role = $this->get_tokens()->sign_role( $role ); + + /** + * Filter the URL of the first time the user gets redirected back to your site for connection + * data processing. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site admin URL. + */ + $processing_url = apply_filters( 'jetpack_connect_processing_url', admin_url( 'admin.php' ) ); + + /** + * Filter the URL to redirect the user back to when the authorization process + * is complete. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site URL. + */ + $redirect = apply_filters( 'jetpack_connect_redirect_url', $redirect ); + + $secrets = ( new Secrets() )->generate( 'authorize', $user->ID, 2 * HOUR_IN_SECONDS ); + + /** + * Filter the type of authorization. + * 'calypso' completes authorization on wordpress.com/jetpack/connect + * while 'jetpack' ( or any other value ) completes the authorization at jetpack.wordpress.com. + * + * @since 1.7.0 + * @since-jetpack 4.3.3 + * + * @param string $auth_type Defaults to 'calypso', can also be 'jetpack'. + */ + $auth_type = apply_filters( 'jetpack_auth_type', 'calypso' ); + + /** + * Filters the user connection request data for additional property addition. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $request_data request data. + */ + $body = apply_filters( + 'jetpack_connect_request_body', + array( + 'response_type' => 'code', + 'client_id' => \Jetpack_Options::get_option( 'id' ), + 'redirect_uri' => add_query_arg( + array( + 'handler' => 'jetpack-connection-webhooks', + 'action' => 'authorize', + '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), + 'redirect' => $redirect ? rawurlencode( $redirect ) : false, + ), + esc_url( $processing_url ) + ), + 'state' => $user->ID, + 'scope' => $signed_role, + 'user_email' => $user->user_email, + 'user_login' => $user->user_login, + 'is_active' => $this->has_connected_owner(), // TODO Deprecate this. + 'jp_version' => (string) Constants::get_constant( 'JETPACK__VERSION' ), + 'auth_type' => $auth_type, + 'secret' => $secrets['secret_1'], + 'blogname' => get_option( 'blogname' ), + 'site_url' => Urls::site_url(), + 'home_url' => Urls::home_url(), + 'site_icon' => get_site_icon_url(), + 'site_lang' => get_locale(), + 'site_created' => $this->get_assumed_site_creation_date(), + 'allow_site_connection' => ! $this->has_connected_owner(), + ) + ); + + $body = $this->apply_activation_source_to_args( urlencode_deep( $body ) ); + + $api_url = $this->api_url( 'authorize' ); + + return add_query_arg( $body, $api_url ); + } + + /** + * Authorizes the user by obtaining and storing the user token. + * + * @param array $data The request data. + * @return string|\WP_Error Returns a string on success. + * Returns a \WP_Error on failure. + */ + public function authorize( $data = array() ) { + /** + * Action fired when user authorization starts. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + */ + do_action( 'jetpack_authorize_starting' ); + + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + + if ( ! $role ) { + return new \WP_Error( 'no_role', 'Invalid request.', 400 ); + } + + $cap = $roles->translate_role_to_cap( $role ); + if ( ! $cap ) { + return new \WP_Error( 'no_cap', 'Invalid request.', 400 ); + } + + if ( ! empty( $data['error'] ) ) { + return new \WP_Error( $data['error'], 'Error included in the request.', 400 ); + } + + if ( ! isset( $data['state'] ) ) { + return new \WP_Error( 'no_state', 'Request must include state.', 400 ); + } + + if ( ! ctype_digit( $data['state'] ) ) { + return new \WP_Error( $data['error'], 'State must be an integer.', 400 ); + } + + $current_user_id = get_current_user_id(); + if ( $current_user_id !== (int) $data['state'] ) { + return new \WP_Error( 'wrong_state', 'State does not match current user.', 400 ); + } + + if ( empty( $data['code'] ) ) { + return new \WP_Error( 'no_code', 'Request must include an authorization code.', 400 ); + } + + $token = $this->get_tokens()->get( $data, $this->api_url( 'token' ) ); + + if ( is_wp_error( $token ) ) { + $code = $token->get_error_code(); + if ( empty( $code ) ) { + $code = 'invalid_token'; + } + return new \WP_Error( $code, $token->get_error_message(), 400 ); + } + + if ( ! $token ) { + return new \WP_Error( 'no_token', 'Error generating token.', 400 ); + } + + $is_connection_owner = ! $this->has_connected_owner(); + + $this->get_tokens()->update_user_token( $current_user_id, sprintf( '%s.%d', $token, $current_user_id ), $is_connection_owner ); + + /** + * Fires after user has successfully received an auth token. + * + * @since 1.7.0 + * @since-jetpack 3.9.0 + */ + do_action( 'jetpack_user_authorized' ); + + if ( ! $is_connection_owner ) { + /** + * Action fired when a secondary user has been authorized. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + */ + do_action( 'jetpack_authorize_ending_linked' ); + return 'linked'; + } + + /** + * Action fired when the master user has been authorized. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $data The request data. + */ + do_action( 'jetpack_authorize_ending_authorized', $data ); + + \Jetpack_Options::delete_raw_option( 'jetpack_last_connect_url_check' ); + + ( new Nonce_Handler() )->reschedule(); + + return 'authorized'; + } + + /** + * Disconnects from the Jetpack servers. + * Forgets all connection details and tells the Jetpack servers to do the same. + * + * @param boolean $disconnect_wpcom Should disconnect_site_wpcom be called. + * @param bool $ignore_connected_plugins Delete the tokens even if there are other connected plugins. + */ + public function disconnect_site( $disconnect_wpcom = true, $ignore_connected_plugins = true ) { + if ( ! $ignore_connected_plugins && null !== $this->plugin && ! $this->plugin->is_only() ) { + return false; + } + + wp_clear_scheduled_hook( 'jetpack_clean_nonces' ); + + ( new Nonce_Handler() )->clean_all(); + + /** + * Fires when a site is disconnected. + * + * @since 1.36.3 + */ + do_action( 'jetpack_site_before_disconnected' ); + + // If the site is in an IDC because sync is not allowed, + // let's make sure to not disconnect the production site. + if ( $disconnect_wpcom ) { + $tracking = new Tracking(); + $tracking->record_user_event( 'disconnect_site', array() ); + + $this->disconnect_site_wpcom( $ignore_connected_plugins ); + } + + $this->delete_all_connection_tokens( $ignore_connected_plugins ); + + // Remove tracked package versions, since they depend on the Jetpack Connection. + delete_option( Package_Version_Tracker::PACKAGE_VERSION_OPTION ); + + $jetpack_unique_connection = \Jetpack_Options::get_option( 'unique_connection' ); + if ( $jetpack_unique_connection ) { + // Check then record unique disconnection if site has never been disconnected previously. + if ( - 1 === $jetpack_unique_connection['disconnected'] ) { + $jetpack_unique_connection['disconnected'] = 1; + } else { + if ( 0 === $jetpack_unique_connection['disconnected'] ) { + $a8c_mc_stats_instance = new A8c_Mc_Stats(); + $a8c_mc_stats_instance->add( 'connections', 'unique-disconnect' ); + $a8c_mc_stats_instance->do_server_side_stats(); + } + // increment number of times disconnected. + $jetpack_unique_connection['disconnected'] += 1; + } + + \Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection ); + } + + /** + * Fires when a site is disconnected. + * + * @since 1.30.1 + */ + do_action( 'jetpack_site_disconnected' ); + } + + /** + * The Base64 Encoding of the SHA1 Hash of the Input. + * + * @param string $text The string to hash. + * @return string + */ + public function sha1_base64( $text ) { + return base64_encode( sha1( $text, true ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } + + /** + * This function mirrors Jetpack_Data::is_usable_domain() in the WPCOM codebase. + * + * @param string $domain The domain to check. + * + * @return bool|WP_Error + */ + public function is_usable_domain( $domain ) { + + // If it's empty, just fail out. + if ( ! $domain ) { + return new \WP_Error( + 'fail_domain_empty', + /* translators: %1$s is a domain name. */ + sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is empty.', 'jetpack-connection' ), $domain ) + ); + } + + /** + * Skips the usuable domain check when connecting a site. + * + * Allows site administrators with domains that fail gethostname-based checks to pass the request to WP.com + * + * @since 1.7.0 + * @since-jetpack 4.1.0 + * + * @param bool If the check should be skipped. Default false. + */ + if ( apply_filters( 'jetpack_skip_usuable_domain_check', false ) ) { + return true; + } + + // None of the explicit localhosts. + $forbidden_domains = array( + 'wordpress.com', + 'localhost', + 'localhost.localdomain', + '127.0.0.1', + 'local.wordpress.test', // VVV pattern. + 'local.wordpress-trunk.test', // VVV pattern. + 'src.wordpress-develop.test', // VVV pattern. + 'build.wordpress-develop.test', // VVV pattern. + ); + if ( in_array( $domain, $forbidden_domains, true ) ) { + return new \WP_Error( + 'fail_domain_forbidden', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it is in the forbidden array.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // No .test or .local domains. + if ( preg_match( '#\.(test|local)$#i', $domain ) ) { + return new \WP_Error( + 'fail_domain_tld', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // No WPCOM subdomains. + if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) { + return new \WP_Error( + 'fail_subdomain_wpcom', + sprintf( + /* translators: %1$s is a domain name. */ + __( + 'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.', + 'jetpack-connection' + ), + $domain + ) + ); + } + + // If PHP was compiled without support for the Filter module (very edge case). + if ( ! function_exists( 'filter_var' ) ) { + // Just pass back true for now, and let wpcom sort it out. + return true; + } + + return true; + } + + /** + * Gets the requested token. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->get_access_token() instead. + * + * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. + * @param string|false $token_key If provided, check that the token matches the provided input. + * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. + * + * @return object|false + * + * @see $this->get_tokens()->get_access_token() + */ + public function get_access_token( $user_id = false, $token_key = false, $suppress_errors = true ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->get_access_token' ); + return $this->get_tokens()->get_access_token( $user_id, $token_key, $suppress_errors ); + } + + /** + * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths + * since it is passed by reference to various methods. + * Capture it here so we can verify the signature later. + * + * @param array $methods an array of available XMLRPC methods. + * @return array the same array, since this method doesn't add or remove anything. + */ + public function xmlrpc_methods( $methods ) { + $this->raw_post_data = isset( $GLOBALS['HTTP_RAW_POST_DATA'] ) ? $GLOBALS['HTTP_RAW_POST_DATA'] : null; + return $methods; + } + + /** + * Resets the raw post data parameter for testing purposes. + */ + public function reset_raw_post_data() { + $this->raw_post_data = null; + } + + /** + * Registering an additional method. + * + * @param array $methods an array of available XMLRPC methods. + * @return array the amended array in case the method is added. + */ + public function public_xmlrpc_methods( $methods ) { + if ( array_key_exists( 'wp.getOptions', $methods ) ) { + $methods['wp.getOptions'] = array( $this, 'jetpack_get_options' ); + } + return $methods; + } + + /** + * Handles a getOptions XMLRPC method call. + * + * @param array $args method call arguments. + * @return an amended XMLRPC server options array. + */ + public function jetpack_get_options( $args ) { + global $wp_xmlrpc_server; + + $wp_xmlrpc_server->escape( $args ); + + $username = $args[1]; + $password = $args[2]; + + $user = $wp_xmlrpc_server->login( $username, $password ); + if ( ! $user ) { + return $wp_xmlrpc_server->error; + } + + $options = array(); + $user_data = $this->get_connected_user_data(); + if ( is_array( $user_data ) ) { + $options['jetpack_user_id'] = array( + 'desc' => __( 'The WP.com user ID of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['ID'], + ); + $options['jetpack_user_login'] = array( + 'desc' => __( 'The WP.com username of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['login'], + ); + $options['jetpack_user_email'] = array( + 'desc' => __( 'The WP.com user email of the connected user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['email'], + ); + $options['jetpack_user_site_count'] = array( + 'desc' => __( 'The number of sites of the connected WP.com user', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $user_data['site_count'], + ); + } + $wp_xmlrpc_server->blog_options = array_merge( $wp_xmlrpc_server->blog_options, $options ); + $args = stripslashes_deep( $args ); + return $wp_xmlrpc_server->wp_getOptions( $args ); + } + + /** + * Adds Jetpack-specific options to the output of the XMLRPC options method. + * + * @param array $options standard Core options. + * @return array amended options. + */ + public function xmlrpc_options( $options ) { + $jetpack_client_id = false; + if ( $this->is_connected() ) { + $jetpack_client_id = \Jetpack_Options::get_option( 'id' ); + } + $options['jetpack_version'] = array( + 'desc' => __( 'Jetpack Plugin Version', 'jetpack-connection' ), + 'readonly' => true, + 'value' => Constants::get_constant( 'JETPACK__VERSION' ), + ); + + $options['jetpack_client_id'] = array( + 'desc' => __( 'The Client ID/WP.com Blog ID of this site', 'jetpack-connection' ), + 'readonly' => true, + 'value' => $jetpack_client_id, + ); + return $options; + } + + /** + * Resets the saved authentication state in between testing requests. + */ + public function reset_saved_auth_state() { + $this->xmlrpc_verification = null; + } + + /** + * Sign a user role with the master access token. + * If not specified, will default to the current user. + * + * @access public + * + * @param string $role User role. + * @param int $user_id ID of the user. + * @return string Signed user role. + */ + public function sign_role( $role, $user_id = null ) { + return $this->get_tokens()->sign_role( $role, $user_id ); + } + + /** + * Set the plugin instance. + * + * @param Plugin $plugin_instance The plugin instance. + * + * @return $this + */ + public function set_plugin_instance( Plugin $plugin_instance ) { + $this->plugin = $plugin_instance; + + return $this; + } + + /** + * Retrieve the plugin management object. + * + * @return Plugin|null + */ + public function get_plugin() { + return $this->plugin; + } + + /** + * Get all connected plugins information, excluding those disconnected by user. + * WARNING: the method cannot be called until Plugin_Storage::configure is called, which happens on plugins_loaded + * Even if you don't use Jetpack Config, it may be introduced later by other plugins, + * so please make sure not to run the method too early in the code. + * + * @return array|WP_Error + */ + public function get_connected_plugins() { + $maybe_plugins = Plugin_Storage::get_all(); + + if ( $maybe_plugins instanceof WP_Error ) { + return $maybe_plugins; + } + + return $maybe_plugins; + } + + /** + * Force plugin disconnect. After its called, the plugin will not be allowed to use the connection. + * Note: this method does not remove any access tokens. + * + * @deprecated since 1.39.0 + * @return bool + */ + public function disable_plugin() { + return null; + } + + /** + * Force plugin reconnect after user-initiated disconnect. + * After its called, the plugin will be allowed to use the connection again. + * Note: this method does not initialize access tokens. + * + * @deprecated since 1.39.0. + * @return bool + */ + public function enable_plugin() { + return null; + } + + /** + * Whether the plugin is allowed to use the connection, or it's been disconnected by user. + * If no plugin slug was passed into the constructor, always returns true. + * + * @deprecated 1.42.0 This method no longer has a purpose after the removal of the soft disconnect feature. + * + * @return bool + */ + public function is_plugin_enabled() { + return true; + } + + /** + * Perform the API request to refresh the blog token. + * Note that we are making this request on behalf of the Jetpack master user, + * given they were (most probably) the ones that registered the site at the first place. + * + * @return WP_Error|bool The result of updating the blog_token option. + */ + public function refresh_blog_token() { + ( new Tracking() )->record_user_event( 'restore_connection_refresh_blog_token' ); + + $blog_id = \Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-refresh-blog-token' + ); + $method = 'POST'; + $user_id = get_current_user_id(); + + $response = Client::remote_request( compact( 'url', 'method', 'user_id' ) ); + + if ( is_wp_error( $response ) ) { + return new WP_Error( 'refresh_blog_token_http_request_failed', $response->get_error_message() ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $json = json_decode( $entity ); + } else { + $json = false; + } + + if ( 200 !== $code ) { + if ( empty( $json->code ) ) { + return new WP_Error( 'unknown', '', $code ); + } + + /* translators: Error description string. */ + $error_description = isset( $json->message ) ? sprintf( __( 'Error Details: %s', 'jetpack-connection' ), (string) $json->message ) : ''; + + return new WP_Error( (string) $json->code, $error_description, $code ); + } + + if ( empty( $json->jetpack_secret ) || ! is_scalar( $json->jetpack_secret ) ) { + return new WP_Error( 'jetpack_secret', '', $code ); + } + + Error_Handler::get_instance()->delete_all_errors(); + + return $this->get_tokens()->update_blog_token( (string) $json->jetpack_secret ); + } + + /** + * Disconnect the user from WP.com, and initiate the reconnect process. + * + * @return bool + */ + public function refresh_user_token() { + ( new Tracking() )->record_user_event( 'restore_connection_refresh_user_token' ); + $this->disconnect_user( null, true, true ); + return true; + } + + /** + * Fetches a signed token. + * + * @deprecated 1.24.0 Use Automattic\Jetpack\Connection\Tokens->get_signed_token() instead. + * + * @param object $token the token. + * @return WP_Error|string a signed token + */ + public function get_signed_token( $token ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->get_signed_token' ); + return $this->get_tokens()->get_signed_token( $token ); + } + + /** + * If the site-level connection is active, add the list of plugins using connection to the heartbeat (except Jetpack itself) + * + * @param array $stats The Heartbeat stats array. + * @return array $stats + */ + public function add_stats_to_heartbeat( $stats ) { + + if ( ! $this->is_connected() ) { + return $stats; + } + + $active_plugins_using_connection = Plugin_Storage::get_all(); + foreach ( array_keys( $active_plugins_using_connection ) as $plugin_slug ) { + if ( 'jetpack' !== $plugin_slug ) { + $stats_group = isset( $active_plugins_using_connection['jetpack'] ) ? 'combined-connection' : 'standalone-connection'; + $stats[ $stats_group ][] = $plugin_slug; + } + } + return $stats; + } + + /** + * Get the WPCOM or self-hosted site ID. + * + * @return int|WP_Error + */ + public static function get_site_id() { + $is_wpcom = ( defined( 'IS_WPCOM' ) && IS_WPCOM ); + $site_id = $is_wpcom ? get_current_blog_id() : \Jetpack_Options::get_option( 'id' ); + if ( ! $site_id ) { + return new \WP_Error( + 'unavailable_site_id', + __( 'Sorry, something is wrong with your Jetpack connection.', 'jetpack-connection' ), + 403 + ); + } + return (int) $site_id; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php new file mode 100644 index 00000000..a3bfaed2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php @@ -0,0 +1,213 @@ +db = $wpdb; + } + + /** + * Scheduling the WP-cron cleanup event. + */ + public function init_schedule() { + add_action( 'jetpack_clean_nonces', array( __CLASS__, 'clean_scheduled' ) ); + if ( ! wp_next_scheduled( 'jetpack_clean_nonces' ) ) { + wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' ); + } + } + + /** + * Reschedule the WP-cron cleanup event to make it start sooner. + */ + public function reschedule() { + wp_clear_scheduled_hook( 'jetpack_clean_nonces' ); + wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' ); + } + + /** + * Adds a used nonce to a list of known nonces. + * + * @param int $timestamp the current request timestamp. + * @param string $nonce the nonce value. + * + * @return bool whether the nonce is unique or not. + */ + public function add( $timestamp, $nonce ) { + if ( isset( static::$nonces_used_this_request[ "$timestamp:$nonce" ] ) ) { + return static::$nonces_used_this_request[ "$timestamp:$nonce" ]; + } + + // This should always have gone through Jetpack_Signature::sign_request() first to check $timestamp and $nonce. + $timestamp = (int) $timestamp; + $nonce = esc_sql( $nonce ); + + // Raw query so we can avoid races: add_option will also update. + $show_errors = $this->db->hide_errors(); + + // Running `try...finally` to make sure that we re-enable errors in case of an exception. + try { + $old_nonce = $this->db->get_row( + $this->db->prepare( "SELECT 1 FROM `{$this->db->options}` WHERE option_name = %s", "jetpack_nonce_{$timestamp}_{$nonce}" ) + ); + + if ( $old_nonce === null ) { + $return = (bool) $this->db->query( + $this->db->prepare( + "INSERT INTO `{$this->db->options}` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s)", + "jetpack_nonce_{$timestamp}_{$nonce}", + time(), + 'no' + ) + ); + } else { + $return = false; + } + } finally { + $this->db->show_errors( $show_errors ); + } + + static::$nonces_used_this_request[ "$timestamp:$nonce" ] = $return; + + return $return; + } + + /** + * Removing all existing nonces, or at least as many as possible. + * Capped at 20 seconds to avoid breaking the site. + * + * @param int $cutoff_timestamp All nonces added before this timestamp will be removed. + * @param int $time_limit How long the cleanup can run (in seconds). + * + * @return true + */ + public function clean_all( $cutoff_timestamp = PHP_INT_MAX, $time_limit = 20 ) { + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed + for ( $end_time = time() + $time_limit; time() < $end_time; ) { + $result = $this->delete( static::CLEAN_ALL_LIMIT_PER_BATCH, $cutoff_timestamp ); + + if ( ! $result ) { + break; + } + } + + return true; + } + + /** + * Scheduled clean up of the expired nonces. + */ + public static function clean_scheduled() { + /** + * Adjust the time limit for the scheduled cleanup. + * + * @since 9.5.0 + * + * @param int $time_limit How long the cleanup can run (in seconds). + */ + $time_limit = apply_filters( 'jetpack_connection_nonce_cleanup_runtime_limit', static::SCHEDULED_CLEANUP_TIME_LIMIT ); + + ( new static() )->clean_all( time() - static::LIFETIME, $time_limit ); + } + + /** + * Delete the nonces. + * + * @param int $limit How many nonces to delete. + * @param null|int $cutoff_timestamp All nonces added before this timestamp will be removed. + * + * @return int|false Number of removed nonces, or `false` if nothing to remove (or in case of a database error). + */ + public function delete( $limit = 10, $cutoff_timestamp = null ) { + global $wpdb; + + $ids = $wpdb->get_col( + $wpdb->prepare( + "SELECT option_id FROM `{$wpdb->options}`" + . " WHERE `option_name` >= 'jetpack_nonce_' AND `option_name` < %s" + . ' LIMIT %d', + 'jetpack_nonce_' . $cutoff_timestamp, + $limit + ) + ); + + if ( ! is_array( $ids ) ) { + // There's an error and we can't proceed. + return false; + } + + // Removing zeroes in case AUTO_INCREMENT of the options table is broken, and all ID's are zeroes. + $ids = array_filter( $ids ); + + if ( ! count( $ids ) ) { + // There's nothing to remove. + return false; + } + + $ids_fill = implode( ', ', array_fill( 0, count( $ids ), '%d' ) ); + + $args = $ids; + $args[] = 'jetpack_nonce_%'; + + // The Code Sniffer is unable to understand what's going on... + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber + return $wpdb->query( $wpdb->prepare( "DELETE FROM `{$wpdb->options}` WHERE `option_id` IN ( {$ids_fill} ) AND option_name LIKE %s", $args ) ); + } + + /** + * Clean the cached nonces valid during the current request, therefore making them invalid. + * + * @return bool + */ + public static function invalidate_request_nonces() { + static::$nonces_used_this_request = array(); + + return true; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php new file mode 100644 index 00000000..7d77c808 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php @@ -0,0 +1,112 @@ + $version ) { + if ( ! is_string( $package ) || ! is_string( $version ) ) { + unset( $filter_versions[ $package ] ); + } + } + + if ( ! is_array( $option_versions ) + || count( array_diff_assoc( $filter_versions, $option_versions ) ) + || count( array_diff_assoc( $option_versions, $filter_versions ) ) + ) { + $this->update_package_versions_option( $filter_versions ); + } + } + + /** + * Updates the package versions: + * - Sends the updated package versions to wpcom. + * - Updates the 'jetpack_package_versions' option. + * + * @param array $package_versions The package versions. + */ + protected function update_package_versions_option( $package_versions ) { + $connection = new Manager(); + if ( ! $connection->is_connected() ) { + return; + } + + $site_id = \Jetpack_Options::get_option( 'id' ); + + $last_failed_attempt_within_hour = get_transient( self::CACHED_FAILED_REQUEST_KEY ); + + if ( $last_failed_attempt_within_hour ) { + return; + } + + $body = wp_json_encode( + array( + 'package_versions' => $package_versions, + ) + ); + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/jetpack-package-versions', $site_id ), + '2', + array( + 'headers' => array( 'content-type' => 'application/json' ), + 'method' => 'POST', + ), + $body, + 'wpcom' + ); + + if ( 200 === wp_remote_retrieve_response_code( $response ) ) { + update_option( self::PACKAGE_VERSION_OPTION, $package_versions ); + } else { + set_transient( self::CACHED_FAILED_REQUEST_KEY, time(), self::CACHED_FAILED_REQUEST_EXPIRATION ); + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php new file mode 100644 index 00000000..2b746816 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php @@ -0,0 +1,30 @@ +is_connected() ) { + return; + } + + $site_id = \Jetpack_Options::get_option( 'id' ); + + $body = wp_json_encode( + array( + 'active_connected_plugins' => self::$plugins, + ) + ); + + Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/jetpack-active-connected-plugins', $site_id ), + '2', + array( + 'headers' => array( 'content-type' => 'application/json' ), + 'method' => 'POST', + ), + $body, + 'wpcom' + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php new file mode 100644 index 00000000..10b5c7b9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php @@ -0,0 +1,122 @@ +slug = $slug; + } + + /** + * Get the plugin slug. + * + * @return string + */ + public function get_slug() { + return $this->slug; + } + + /** + * Add the plugin connection info into Jetpack. + * + * @param string $name Plugin name, required. + * @param array $args Plugin arguments, optional. + * + * @return $this + * @see $this->arguments_whitelist + */ + public function add( $name, array $args = array() ) { + $args = compact( 'name' ) + array_intersect_key( $args, array_flip( $this->arguments_whitelist ) ); + + Plugin_Storage::upsert( $this->slug, $args ); + + return $this; + } + + /** + * Remove the plugin connection info from Jetpack. + * + * @return $this + */ + public function remove() { + Plugin_Storage::delete( $this->slug ); + + return $this; + } + + /** + * Determine if this plugin connection is the only one active at the moment, if any. + * + * @return bool + */ + public function is_only() { + $plugins = Plugin_Storage::get_all(); + + return ! $plugins || ( array_key_exists( $this->slug, $plugins ) && 1 === count( $plugins ) ); + } + + /** + * Add the plugin to the set of disconnected ones. + * + * @deprecated since 1.39.0. + * + * @return bool + */ + public function disable() { + return true; + } + + /** + * Remove the plugin from the set of disconnected ones. + * + * @deprecated since 1.39.0. + * + * @return bool + */ + public function enable() { + return true; + } + + /** + * Whether this plugin is allowed to use the connection. + * + * @deprecated since 11.0 + * @return bool + */ + public function is_enabled() { + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php new file mode 100644 index 00000000..c5a89f53 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php @@ -0,0 +1,220 @@ +connection_manager = new Manager(); + } + + /** + * Controls the single instance of this class. + * + * @static + */ + public static function init() { + if ( ! self::$instance ) { + self::$instance = new self(); + + add_filter( 'determine_current_user', array( self::$instance, 'wp_rest_authenticate' ) ); + add_filter( 'rest_authentication_errors', array( self::$instance, 'wp_rest_authentication_errors' ) ); + } + + return self::$instance; + } + + /** + * Authenticates requests from Jetpack server to WP REST API endpoints. + * Uses the existing XMLRPC request signing implementation. + * + * @param int|bool $user User ID if one has been determined, false otherwise. + * + * @return int|null The user id or null if the request was authenticated via blog token, or not authenticated at all. + */ + public function wp_rest_authenticate( $user ) { + if ( $this->doing_determine_current_user_filter ) { + return $user; + } + + $this->doing_determine_current_user_filter = true; + + try { + if ( ! empty( $user ) ) { + // Another authentication method is in effect. + return $user; + } + + add_filter( + 'jetpack_constant_default_value', + __NAMESPACE__ . '\Utils::jetpack_api_constant_filter', + 10, + 2 + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['_for'] ) || 'jetpack' !== $_GET['_for'] ) { + // Nothing to do for this authentication method. + return null; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['token'] ) && ! isset( $_GET['signature'] ) ) { + // Nothing to do for this authentication method. + return null; + } + + if ( ! isset( $_SERVER['REQUEST_METHOD'] ) ) { + $this->rest_authentication_status = new \WP_Error( + 'rest_invalid_request', + __( 'The request method is missing.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + + // Only support specific request parameters that have been tested and + // are known to work with signature verification. A different method + // can be passed to the WP REST API via the '?_method=' parameter if + // needed. + if ( 'GET' !== $_SERVER['REQUEST_METHOD'] && 'POST' !== $_SERVER['REQUEST_METHOD'] ) { + $this->rest_authentication_status = new \WP_Error( + 'rest_invalid_request', + __( 'This request method is not supported.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + if ( 'POST' !== $_SERVER['REQUEST_METHOD'] && ! empty( file_get_contents( 'php://input' ) ) ) { + $this->rest_authentication_status = new \WP_Error( + 'rest_invalid_request', + __( 'This request method does not support body parameters.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } + + $verified = $this->connection_manager->verify_xml_rpc_signature(); + + if ( + $verified && + isset( $verified['type'] ) && + 'blog' === $verified['type'] + ) { + // Site-level authentication successful. + $this->rest_authentication_status = true; + $this->rest_authentication_type = 'blog'; + return null; + } + + if ( + $verified && + isset( $verified['type'] ) && + 'user' === $verified['type'] && + ! empty( $verified['user_id'] ) + ) { + // User-level authentication successful. + $this->rest_authentication_status = true; + $this->rest_authentication_type = 'user'; + return $verified['user_id']; + } + + // Something else went wrong. Probably a signature error. + $this->rest_authentication_status = new \WP_Error( + 'rest_invalid_signature', + __( 'The request is not signed correctly.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + return null; + } finally { + $this->doing_determine_current_user_filter = false; + } + } + + /** + * Report authentication status to the WP REST API. + * + * @param WP_Error|mixed $value Error from another authentication handler, null if we should handle it, or another value if not. + * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} + */ + public function wp_rest_authentication_errors( $value ) { + if ( null !== $value ) { + return $value; + } + return $this->rest_authentication_status; + } + + /** + * Resets the saved authentication state in between testing requests. + */ + public function reset_saved_auth_state() { + $this->rest_authentication_status = null; + $this->connection_manager->reset_saved_auth_state(); + } + + /** + * Whether the request was signed with a blog token. + * + * @since 1.29.0 + * + * @return bool True if the request was signed with a valid blog token, false otherwise. + */ + public static function is_signed_with_blog_token() { + $instance = self::init(); + + return true === $instance->rest_authentication_status && 'blog' === $instance->rest_authentication_type; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php new file mode 100644 index 00000000..9c0a2246 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php @@ -0,0 +1,850 @@ +connection = $connection; + + self::$user_permissions_error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-connection' + ); + + $jp_version = Constants::get_constant( 'JETPACK__VERSION' ); + + if ( ! $this->connection->has_connected_owner() ) { + // Register a site. + register_rest_route( + 'jetpack/v4', + '/verify_registration', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'verify_registration' ), + 'permission_callback' => '__return_true', + ) + ); + } + + // Authorize a remote user. + register_rest_route( + 'jetpack/v4', + '/remote_authorize', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::remote_authorize', + 'permission_callback' => '__return_true', + ) + ); + + // Get current connection status of Jetpack. + register_rest_route( + 'jetpack/v4', + '/connection', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::connection_status', + 'permission_callback' => '__return_true', + ) + ); + + // Disconnect site. + register_rest_route( + 'jetpack/v4', + '/connection', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::disconnect_site', + 'permission_callback' => __CLASS__ . '::disconnect_site_permission_check', + 'args' => array( + 'isActive' => array( + 'description' => __( 'Set to false will trigger the site to disconnect.', 'jetpack-connection' ), + 'validate_callback' => function ( $value ) { + if ( false !== $value ) { + return new WP_Error( + 'rest_invalid_param', + __( 'The isActive argument should be set to false.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + return true; + }, + 'required' => true, + ), + ), + ) + ); + + // We are only registering this route if Jetpack-the-plugin is not active or it's version is ge 10.0-alpha. + // The reason for doing so is to avoid conflicts between the Connection package and + // older versions of Jetpack, registering the same route twice. + if ( empty( $jp_version ) || version_compare( $jp_version, '10.0-alpha', '>=' ) ) { + // Get current user connection data. + register_rest_route( + 'jetpack/v4', + '/connection/data', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_connection_data', + 'permission_callback' => __CLASS__ . '::user_connection_data_permission_check', + ) + ); + } + + // Get list of plugins that use the Jetpack connection. + register_rest_route( + 'jetpack/v4', + '/connection/plugins', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( __CLASS__, 'get_connection_plugins' ), + 'permission_callback' => __CLASS__ . '::connection_plugins_permission_check', + ) + ); + + // Full or partial reconnect in case of connection issues. + register_rest_route( + 'jetpack/v4', + '/connection/reconnect', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'connection_reconnect' ), + 'permission_callback' => __CLASS__ . '::jetpack_reconnect_permission_check', + ) + ); + + // Register the site (get `blog_token`). + register_rest_route( + 'jetpack/v4', + '/connection/register', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'connection_register' ), + 'permission_callback' => __CLASS__ . '::jetpack_register_permission_check', + 'args' => array( + 'from' => array( + 'description' => __( 'Indicates where the registration action was triggered for tracking/segmentation purposes', 'jetpack-connection' ), + 'type' => 'string', + ), + 'registration_nonce' => array( + 'description' => __( 'The registration nonce', 'jetpack-connection' ), + 'type' => 'string', + 'required' => true, + ), + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-connection' ), + 'type' => 'string', + ), + 'plugin_slug' => array( + 'description' => __( 'Indicates from what plugin the request is coming from', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + + // Get authorization URL. + register_rest_route( + 'jetpack/v4', + '/connection/authorize_url', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => array( $this, 'connection_authorize_url' ), + 'permission_callback' => __CLASS__ . '::user_connection_data_permission_check', + 'args' => array( + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-connection' ), + 'type' => 'string', + ), + ), + ) + ); + + register_rest_route( + 'jetpack/v4', + '/user-token', + array( + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( static::class, 'update_user_token' ), + 'permission_callback' => array( static::class, 'update_user_token_permission_check' ), + 'args' => array( + 'user_token' => array( + 'description' => __( 'New user token', 'jetpack-connection' ), + 'type' => 'string', + 'required' => true, + ), + 'is_connection_owner' => array( + 'description' => __( 'Is connection owner', 'jetpack-connection' ), + 'type' => 'boolean', + ), + ), + ), + ) + ); + + // Set the connection owner. + register_rest_route( + 'jetpack/v4', + '/connection/owner', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( static::class, 'set_connection_owner' ), + 'permission_callback' => array( static::class, 'set_connection_owner_permission_check' ), + 'args' => array( + 'owner' => array( + 'description' => __( 'New owner', 'jetpack-connection' ), + 'type' => 'integer', + 'required' => true, + ), + ), + ) + ); + } + + /** + * Handles verification that a site is registered. + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return string|WP_Error + */ + public function verify_registration( WP_REST_Request $request ) { + $registration_data = array( $request['secret_1'], $request['state'] ); + + return $this->connection->handle_registration( $registration_data ); + } + + /** + * Handles verification that a site is registered + * + * @since 1.7.0 + * @since-jetpack 5.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|wp-error + */ + public static function remote_authorize( $request ) { + $xmlrpc_server = new Jetpack_XMLRPC_Server(); + $result = $xmlrpc_server->remote_authorize( $request ); + + if ( is_a( $result, 'IXR_Error' ) ) { + $result = new WP_Error( $result->code, $result->message ); + } + + return $result; + } + + /** + * Get connection status for this Jetpack site. + * + * @since 1.7.0 + * @since-jetpack 4.3.0 + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @return WP_REST_Response|array Connection information. + */ + public static function connection_status( $rest_response = true ) { + $status = new Status(); + $connection = new Manager(); + + $connection_status = array( + 'isActive' => $connection->has_connected_owner(), // TODO deprecate this. + 'isStaging' => $status->is_staging_site(), + 'isRegistered' => $connection->is_connected(), + 'isUserConnected' => $connection->is_user_connected(), + 'hasConnectedOwner' => $connection->has_connected_owner(), + 'offlineMode' => array( + 'isActive' => $status->is_offline_mode(), + 'constant' => defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG, + 'url' => $status->is_local_site(), + /** This filter is documented in packages/status/src/class-status.php */ + 'filter' => ( apply_filters( 'jetpack_development_mode', false ) || apply_filters( 'jetpack_offline_mode', false ) ), // jetpack_development_mode is deprecated. + 'wpLocalConstant' => defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV, + ), + 'isPublic' => '1' == get_option( 'blog_public' ), // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual + ); + + /** + * Filters the connection status data. + * + * @since 1.25.0 + * + * @param array An array containing the connection status data. + */ + $connection_status = apply_filters( 'jetpack_connection_status', $connection_status ); + + if ( $rest_response ) { + return rest_ensure_response( + $connection_status + ); + } else { + return $connection_status; + } + } + + /** + * Get plugins connected to the Jetpack. + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @since 1.13.1 + * @since 1.38.0 Added $rest_response param. + * + * @return WP_REST_Response|WP_Error Response or error object, depending on the request result. + */ + public static function get_connection_plugins( $rest_response = true ) { + $plugins = ( new Manager() )->get_connected_plugins(); + + if ( is_wp_error( $plugins ) ) { + return $plugins; + } + + array_walk( + $plugins, + function ( &$data, $slug ) { + $data['slug'] = $slug; + } + ); + + if ( $rest_response ) { + return rest_ensure_response( array_values( $plugins ) ); + } + + return array_values( $plugins ); + } + + /** + * Verify that user can view Jetpack admin page and can activate plugins. + * + * @since 1.15.0 + * + * @return bool|WP_Error Whether user has the capability 'activate_plugins'. + */ + public static function activate_plugins_permission_check() { + if ( current_user_can( 'activate_plugins' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_activate_plugins', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Permission check for the connection_plugins endpoint + * + * @return bool|WP_Error + */ + public static function connection_plugins_permission_check() { + if ( true === static::activate_plugins_permission_check() ) { + return true; + } + + if ( true === static::is_request_signed_by_jetpack_debugger() ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_activate_plugins', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Permission check for the disconnect site endpoint. + * + * @since 1.30.1 + * + * @return bool|WP_Error True if user is able to disconnect the site. + */ + public static function disconnect_site_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_jetpack_disconnect', + self::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } + + /** + * Get miscellaneous user data related to the connection. Similar data available in old "My Jetpack". + * Information about the master/primary user. + * Information about the current user. + * + * @param bool $rest_response Should we return a rest response or a simple array. Default to rest response. + * + * @since 1.30.1 + * + * @return \WP_REST_Response|array + */ + public static function get_user_connection_data( $rest_response = true ) { + $blog_id = \Jetpack_Options::get_option( 'id' ); + + $connection = new Manager(); + + $current_user = wp_get_current_user(); + $connection_owner = $connection->get_connection_owner(); + + $owner_display_name = false === $connection_owner ? null : $connection_owner->display_name; + + $is_user_connected = $connection->is_user_connected(); + $is_master_user = false === $connection_owner ? false : ( $current_user->ID === $connection_owner->ID ); + $wpcom_user_data = $connection->get_connected_user_data(); + + // Add connected user gravatar to the returned wpcom_user_data. + // Probably we shouldn't do this when $wpcom_user_data is false, but we have been since 2016 so + // clients probably expect that by now. + if ( false === $wpcom_user_data ) { + $wpcom_user_data = array(); + } + $wpcom_user_data['avatar'] = ( ! empty( $wpcom_user_data['email'] ) ? + get_avatar_url( + $wpcom_user_data['email'], + array( + 'size' => 64, + 'default' => 'mysteryman', + ) + ) + : false ); + + $current_user_connection_data = array( + 'isConnected' => $is_user_connected, + 'isMaster' => $is_master_user, + 'username' => $current_user->user_login, + 'id' => $current_user->ID, + 'blogId' => $blog_id, + 'wpcomUser' => $wpcom_user_data, + 'gravatar' => get_avatar_url( $current_user->ID, 64, 'mm', '', array( 'force_display' => true ) ), + 'permissions' => array( + 'connect' => current_user_can( 'jetpack_connect' ), + 'connect_user' => current_user_can( 'jetpack_connect_user' ), + 'disconnect' => current_user_can( 'jetpack_disconnect' ), + ), + ); + + /** + * Filters the current user connection data. + * + * @since 1.30.1 + * + * @param array An array containing the current user connection data. + */ + $current_user_connection_data = apply_filters( 'jetpack_current_user_connection_data', $current_user_connection_data ); + + $response = array( + 'currentUser' => $current_user_connection_data, + 'connectionOwner' => $owner_display_name, + ); + + if ( $rest_response ) { + return rest_ensure_response( $response ); + } + + return $response; + } + + /** + * Permission check for the connection/data endpoint + * + * @return bool|WP_Error + */ + public static function user_connection_data_permission_check() { + if ( current_user_can( 'jetpack_connect_user' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_user_connection_data', + self::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } + + /** + * Verifies if the request was signed with the Jetpack Debugger key + * + * @param string|null $pub_key The public key used to verify the signature. Default is the Jetpack Debugger key. This is used for testing purposes. + * + * @return bool + */ + public static function is_request_signed_by_jetpack_debugger( $pub_key = null ) { + // phpcs:disable WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['signature'], $_GET['timestamp'], $_GET['url'], $_GET['rest_route'] ) ) { + return false; + } + + // signature timestamp must be within 5min of current time. + if ( abs( time() - (int) $_GET['timestamp'] ) > 300 ) { + return false; + } + + $signature = base64_decode( filter_var( wp_unslash( $_GET['signature'] ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + + $signature_data = wp_json_encode( + array( + 'rest_route' => filter_var( wp_unslash( $_GET['rest_route'] ) ), + 'timestamp' => (int) $_GET['timestamp'], + 'url' => filter_var( wp_unslash( $_GET['url'] ) ), + ) + ); + + if ( + ! function_exists( 'openssl_verify' ) + || 1 !== openssl_verify( + $signature_data, + $signature, + $pub_key ? $pub_key : static::JETPACK__DEBUGGER_PUBLIC_KEY + ) + ) { + return false; + } + + // phpcs:enable WordPress.Security.NonceVerification.Recommended + + return true; + } + + /** + * Verify that user is allowed to disconnect Jetpack. + * + * @since 1.15.0 + * + * @return bool|WP_Error Whether user has the capability 'jetpack_disconnect'. + */ + public static function jetpack_reconnect_permission_check() { + if ( current_user_can( 'jetpack_reconnect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_jetpack_disconnect', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Returns generic error message when user is not allowed to perform an action. + * + * @return string The error message. + */ + public static function get_user_permissions_error_msg() { + return self::$user_permissions_error_msg; + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.15.0 + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_reconnect() { + $response = array(); + + $next = null; + + $result = $this->connection->restore(); + + if ( is_wp_error( $result ) ) { + $response = $result; + } elseif ( is_string( $result ) ) { + $next = $result; + } else { + $next = true === $result ? 'completed' : 'failed'; + } + + switch ( $next ) { + case 'authorize': + $response['status'] = 'in_progress'; + $response['authorizeUrl'] = $this->connection->get_authorization_url(); + break; + case 'completed': + $response['status'] = 'completed'; + /** + * Action fired when reconnection has completed successfully. + * + * @since 1.18.1 + */ + do_action( 'jetpack_reconnection_completed' ); + break; + case 'failed': + $response = new WP_Error( 'Reconnect failed' ); + break; + } + + return rest_ensure_response( $response ); + } + + /** + * Verify that user is allowed to connect Jetpack. + * + * @since 1.26.0 + * + * @return bool|WP_Error Whether user has the capability 'jetpack_connect'. + */ + public static function jetpack_register_permission_check() { + if ( current_user_can( 'jetpack_connect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_jetpack_connect', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.7.0 + * @since-jetpack 7.7.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_register( $request ) { + if ( ! wp_verify_nonce( $request->get_param( 'registration_nonce' ), 'jetpack-registration-nonce' ) ) { + return new WP_Error( 'invalid_nonce', __( 'Unable to verify your request.', 'jetpack-connection' ), array( 'status' => 403 ) ); + } + + if ( isset( $request['from'] ) ) { + $this->connection->add_register_request_param( 'from', (string) $request['from'] ); + } + + if ( ! empty( $request['plugin_slug'] ) ) { + // If `plugin_slug` matches a plugin using the connection, let's inform the plugin that is establishing the connection. + $connected_plugin = Plugin_Storage::get_one( (string) $request['plugin_slug'] ); + if ( ! is_wp_error( $connected_plugin ) && ! empty( $connected_plugin ) ) { + $this->connection->set_plugin_instance( new Plugin( (string) $request['plugin_slug'] ) ); + } + } + + $result = $this->connection->try_registration(); + + if ( is_wp_error( $result ) ) { + return $result; + } + + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + + if ( class_exists( 'Jetpack' ) ) { + $authorize_url = \Jetpack::build_authorize_url( $redirect_uri ); + } else { + $authorize_url = $this->connection->get_authorization_url( null, $redirect_uri ); + } + + /** + * Filters the response of jetpack/v4/connection/register endpoint + * + * @param array $response Array response + * @since 1.27.0 + */ + $response_body = apply_filters( + 'jetpack_register_site_rest_response', + array() + ); + + // We manipulate the alternate URLs after the filter is applied, so they can not be overwritten. + $response_body['authorizeUrl'] = $authorize_url; + if ( ! empty( $response_body['alternateAuthorizeUrl'] ) ) { + $response_body['alternateAuthorizeUrl'] = Redirect::get_url( $response_body['alternateAuthorizeUrl'] ); + } + + return rest_ensure_response( $response_body ); + } + + /** + * Get the authorization URL. + * + * @since 1.27.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public function connection_authorize_url( $request ) { + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + $authorize_url = $this->connection->get_authorization_url( null, $redirect_uri ); + + return rest_ensure_response( + array( + 'authorizeUrl' => $authorize_url, + ) + ); + } + + /** + * The endpoint tried to partially or fully reconnect the website to WP.com. + * + * @since 1.29.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function update_user_token( $request ) { + $token_parts = explode( '.', $request['user_token'] ); + + if ( count( $token_parts ) !== 3 || ! (int) $token_parts[2] || ! ctype_digit( $token_parts[2] ) ) { + return new WP_Error( 'invalid_argument_user_token', esc_html__( 'Invalid user token is provided', 'jetpack-connection' ) ); + } + + $user_id = (int) $token_parts[2]; + + if ( false === get_userdata( $user_id ) ) { + return new WP_Error( 'invalid_argument_user_id', esc_html__( 'Invalid user id is provided', 'jetpack-connection' ) ); + } + + $connection = new Manager(); + + if ( ! $connection->is_connected() ) { + return new WP_Error( 'site_not_connected', esc_html__( 'Site is not connected', 'jetpack-connection' ) ); + } + + $is_connection_owner = isset( $request['is_connection_owner'] ) + ? (bool) $request['is_connection_owner'] + : ( new Manager() )->get_connection_owner_id() === $user_id; + + ( new Tokens() )->update_user_token( $user_id, $request['user_token'], $is_connection_owner ); + + /** + * Fires when the user token gets successfully replaced. + * + * @since 1.29.0 + * + * @param int $user_id User ID. + * @param string $token New user token. + */ + do_action( 'jetpack_updated_user_token', $user_id, $request['user_token'] ); + + return rest_ensure_response( + array( + 'success' => true, + ) + ); + } + + /** + * Disconnects Jetpack from the WordPress.com Servers + * + * @since 1.30.1 + * + * @return bool|WP_Error True if Jetpack successfully disconnected. + */ + public static function disconnect_site() { + $connection = new Manager(); + + if ( $connection->is_connected() ) { + $connection->disconnect_site(); + return rest_ensure_response( array( 'code' => 'success' ) ); + } + + return new WP_Error( + 'disconnect_failed', + esc_html__( 'Failed to disconnect the site as it appears already disconnected.', 'jetpack-connection' ), + array( 'status' => 400 ) + ); + } + + /** + * Verify that the API client is allowed to replace user token. + * + * @since 1.29.0 + * + * @return bool|WP_Error. + */ + public static function update_user_token_permission_check() { + return Rest_Authentication::is_signed_with_blog_token() + ? true + : new WP_Error( 'invalid_permission_update_user_token', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Change the connection owner. + * + * @since 1.29.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function set_connection_owner( $request ) { + $new_owner_id = $request['owner']; + + $owner_set = ( new Manager() )->update_connection_owner( $new_owner_id ); + + if ( is_wp_error( $owner_set ) ) { + return $owner_set; + } + + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + + /** + * Check that user has permission to change the master user. + * + * @since 1.7.0 + * @since-jetpack 6.2.0 + * @since-jetpack 7.7.0 Update so that any user with jetpack_disconnect privs can set owner. + * + * @return bool|WP_Error True if user is able to change master user. + */ + public static function set_connection_owner_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_set_connection_owner', self::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php new file mode 100644 index 00000000..1d41c4e4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php @@ -0,0 +1,281 @@ + time() + ) { + return $secrets[ $secret_name ]; + } + + $secret_value = array( + 'secret_1' => call_user_func( $callable ), + 'secret_2' => call_user_func( $callable ), + 'exp' => time() + $exp, + ); + + $secrets[ $secret_name ] = $secret_value; + + $res = Jetpack_Options::update_raw_option( self::LEGACY_SECRETS_OPTION_NAME, $secrets ); + return $res ? $secrets[ $secret_name ] : false; + } + + /** + * Returns two secret tokens and the end of life timestamp for them. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + * @return string|array an array of secrets or an error string. + */ + public function get( $action, $user_id ) { + $secret_name = 'jetpack_' . $action . '_' . $user_id; + $secrets = Jetpack_Options::get_raw_option( + self::LEGACY_SECRETS_OPTION_NAME, + array() + ); + + if ( ! isset( $secrets[ $secret_name ] ) ) { + return self::SECRETS_MISSING; + } + + if ( $secrets[ $secret_name ]['exp'] < time() ) { + $this->delete( $action, $user_id ); + return self::SECRETS_EXPIRED; + } + + return $secrets[ $secret_name ]; + } + + /** + * Deletes secret tokens in case they, for example, have expired. + * + * @param String $action The action name. + * @param Integer $user_id The user identifier. + */ + public function delete( $action, $user_id ) { + $secret_name = 'jetpack_' . $action . '_' . $user_id; + $secrets = Jetpack_Options::get_raw_option( + self::LEGACY_SECRETS_OPTION_NAME, + array() + ); + if ( isset( $secrets[ $secret_name ] ) ) { + unset( $secrets[ $secret_name ] ); + Jetpack_Options::update_raw_option( self::LEGACY_SECRETS_OPTION_NAME, $secrets ); + } + } + + /** + * Verify a Previously Generated Secret. + * + * @param string $action The type of secret to verify. + * @param string $secret_1 The secret string to compare to what is stored. + * @param int $user_id The user ID of the owner of the secret. + * @return WP_Error|string WP_Error on failure, secret_2 on success. + */ + public function verify( $action, $secret_1, $user_id ) { + $allowed_actions = array( 'register', 'authorize', 'publicize' ); + if ( ! in_array( $action, $allowed_actions, true ) ) { + return new WP_Error( 'unknown_verification_action', 'Unknown Verification Action', 400 ); + } + + $user = get_user_by( 'id', $user_id ); + + /** + * We've begun verifying the previously generated secret. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + */ + do_action( 'jetpack_verify_secrets_begin', $action, $user ); + + $return_error = function ( WP_Error $error ) use ( $action, $user ) { + /** + * Verifying of the previously generated secret has failed. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + * @param WP_Error $error The error object. + */ + do_action( 'jetpack_verify_secrets_fail', $action, $user, $error ); + + return $error; + }; + + $stored_secrets = $this->get( $action, $user_id ); + $this->delete( $action, $user_id ); + + $error = null; + if ( empty( $secret_1 ) ) { + $error = $return_error( + new WP_Error( + 'verify_secret_1_missing', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is missing.', 'jetpack-connection' ), 'secret_1' ), + 400 + ) + ); + } elseif ( ! is_string( $secret_1 ) ) { + $error = $return_error( + new WP_Error( + 'verify_secret_1_malformed', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is malformed.', 'jetpack-connection' ), 'secret_1' ), + 400 + ) + ); + } elseif ( empty( $user_id ) ) { + // $user_id is passed around during registration as "state". + $error = $return_error( + new WP_Error( + 'state_missing', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is missing.', 'jetpack-connection' ), 'state' ), + 400 + ) + ); + } elseif ( ! ctype_digit( (string) $user_id ) ) { + $error = $return_error( + new WP_Error( + 'state_malformed', + /* translators: "%s" is the name of a paramter. It can be either "secret_1" or "state". */ + sprintf( __( 'The required "%s" parameter is malformed.', 'jetpack-connection' ), 'state' ), + 400 + ) + ); + } elseif ( self::SECRETS_MISSING === $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_missing', + __( 'Verification secrets not found', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( self::SECRETS_EXPIRED === $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_expired', + __( 'Verification took too long', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( ! $stored_secrets ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_empty', + __( 'Verification secrets are empty', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( is_wp_error( $stored_secrets ) ) { + $stored_secrets->add_data( 400 ); + $error = $return_error( $stored_secrets ); + } elseif ( empty( $stored_secrets['secret_1'] ) || empty( $stored_secrets['secret_2'] ) || empty( $stored_secrets['exp'] ) ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_incomplete', + __( 'Verification secrets are incomplete', 'jetpack-connection' ), + 400 + ) + ); + } elseif ( ! hash_equals( $secret_1, $stored_secrets['secret_1'] ) ) { + $error = $return_error( + new WP_Error( + 'verify_secrets_mismatch', + __( 'Secret mismatch', 'jetpack-connection' ), + 400 + ) + ); + } + + // Something went wrong during the checks, returning the error. + if ( ! empty( $error ) ) { + return $error; + } + + /** + * We've succeeded at verifying the previously generated secret. + * + * @since 1.7.0 + * @since-jetpack 7.5.0 + * + * @param string $action The type of secret to verify. + * @param \WP_User $user The user object. + */ + do_action( 'jetpack_verify_secrets_success', $action, $user ); + + return $stored_secrets['secret_2']; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php new file mode 100644 index 00000000..711480bb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php @@ -0,0 +1,243 @@ + new URL, 'host' => new Host, 'new_signature => New signature if url was changed ] + */ + public function server_sandbox_request_parameters( $sandbox, $url, $headers, $data = null, $method = 'GET' ) { + $host = ''; + $new_signature = ''; + + if ( ! is_string( $sandbox ) || ! is_string( $url ) ) { + return array( + 'url' => $url, + 'host' => $host, + 'new_signature' => $new_signature, + ); + } + + $url_host = wp_parse_url( $url, PHP_URL_HOST ); + + switch ( $url_host ) { + case 'public-api.wordpress.com': + case 'jetpack.wordpress.com': + case 'jetpack.com': + case 'dashboard.wordpress.com': + $host = isset( $headers['Host'] ) ? $headers['Host'] : $url_host; + $original_url = $url; + $url = preg_replace( + '@^(https?://)' . preg_quote( $url_host, '@' ) . '(?=[/?#].*|$)@', + '${1}' . $sandbox, + $url, + 1 + ); + + /** + * Whether to add the X Debug query parameter to the request made to the Sandbox + * + * @since 1.36.0 + * + * @param bool $add_parameter Whether to add the parameter to the request or not. Default is to false. + * @param string $url The URL of the request being made. + * @param string $host The host of the request being made. + */ + if ( apply_filters( 'jetpack_sandbox_add_profile_parameter', false, $url, $host ) ) { + $url = add_query_arg( 'XDEBUG_PROFILE', 1, $url ); + + // URL has been modified since the signature was created. We'll need a new one. + $original_url = add_query_arg( 'XDEBUG_PROFILE', 1, $original_url ); + $new_signature = $this->get_new_signature( $original_url, $headers, $data, $method ); + + } + } + + return compact( 'url', 'host', 'new_signature' ); + } + + /** + * Gets a new signature for the request + * + * @param string $url The new URL to be signed. + * @param array $headers The headers of the request about to be made. + * @param string $data The body of request about to be made. + * @param string $method The method of the request about to be made. + * @return string|null + */ + private function get_new_signature( $url, $headers, $data, $method ) { + + if ( ! empty( $headers['Authorization'] ) ) { + $a_headers = $this->extract_authorization_headers( $headers ); + if ( ! empty( $a_headers ) ) { + $token_details = explode( ':', $a_headers['token'] ); + + if ( count( $token_details ) === 3 ) { + $user_id = $token_details[2]; + $token = ( new Tokens() )->get_access_token( $user_id ); + $time_diff = (int) \Jetpack_Options::get_option( 'time_diff' ); + $jetpack_signature = new \Jetpack_Signature( $token->secret, $time_diff ); + + $signature = $jetpack_signature->sign_request( + $a_headers['token'], + $a_headers['timestamp'], + $a_headers['nonce'], + $a_headers['body-hash'], + $method, + $url, + $data, + false + ); + + if ( $signature && ! is_wp_error( $signature ) ) { + return $signature; + } elseif ( is_wp_error( $signature ) ) { + $this->log_new_signature_error( $signature->get_error_message() ); + } + } else { + $this->log_new_signature_error( 'Malformed token on Authorization Header' ); + } + } else { + $this->log_new_signature_error( 'Error extracting Authorization Header' ); + } + } else { + $this->log_new_signature_error( 'Empty Authorization Header' ); + } + } + + /** + * Logs error if the attempt to create a new signature fails + * + * @param string $message The error message. + * @return void + */ + private function log_new_signature_error( $message ) { + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + error_log( sprintf( "SANDBOXING: Error re-signing the request. '%s'", $message ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + } + } + + /** + * Extract the values in the Authorization header into an array + * + * @param array $headers The headers of the request about to be made. + * @return array|null + */ + public function extract_authorization_headers( $headers ) { + if ( ! empty( $headers['Authorization'] ) && is_string( $headers['Authorization'] ) ) { + $header = str_replace( 'X_JETPACK ', '', $headers['Authorization'] ); + $vars = explode( ' ', $header ); + $result = array(); + foreach ( $vars as $var ) { + $elements = explode( '"', $var ); + if ( count( $elements ) === 3 ) { + $result[ substr( $elements[0], 0, -1 ) ] = $elements[1]; + } + } + return $result; + } + } + + /** + * Modifies parameters of request in order to send the request to the + * server specified by `JETPACK__SANDBOX_DOMAIN`. + * + * Attached to the `requests-requests.before_request` filter. + * + * @param string $url URL of request about to be made. + * @param array $headers Headers of request about to be made. + * @param array|string $data Data of request about to be made. + * @param string $type Type of request about to be made. + * @return void + */ + public function server_sandbox( &$url, &$headers, &$data = null, &$type = null ) { + if ( ! Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ) ) { + return; + } + + $original_url = $url; + + $request_parameters = $this->server_sandbox_request_parameters( Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), $url, $headers, $data, $type ); + + $url = $request_parameters['url']; + + if ( $request_parameters['host'] ) { + $headers['Host'] = $request_parameters['host']; + + if ( $request_parameters['new_signature'] ) { + $headers['Authorization'] = preg_replace( '/signature=\"[^\"]+\"/', 'signature="' . $request_parameters['new_signature'] . '"', $headers['Authorization'] ); + } + + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + error_log( sprintf( "SANDBOXING via '%s': '%s'", Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), $original_url ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + } + } + } + + /** + * Adds a "Jetpack API Sandboxed" item to the admin bar if the JETPACK__SANDBOX_DOMAIN + * constant is set. + * + * Attached to the `admin_bar_menu` action. + * + * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. + */ + public function admin_bar_add_sandbox_item( $wp_admin_bar ) { + if ( ! Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ) ) { + return; + } + + $node = array( + 'id' => 'jetpack-connection-api-sandbox', + 'title' => 'Jetpack API Sandboxed', + 'meta' => array( + 'title' => 'Sandboxing via ' . Constants::get_constant( 'JETPACK__SANDBOX_DOMAIN' ), + ), + ); + + $wp_admin_bar->add_menu( $node ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php new file mode 100644 index 00000000..c94d4fb5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php @@ -0,0 +1,112 @@ +set_agree(); + /** + * Acton fired when the master user has agreed to the terms of service. + * + * @since 1.0.4 + * @since-jetpack 7.9.0 + */ + do_action( 'jetpack_agreed_to_terms_of_service' ); + } + + /** + * Allow the site to reject to the terms of service. + */ + public function reject() { + $this->set_reject(); + /** + * Acton fired when the master user has revoked their agreement to the terms of service. + * + * @since 1.0.4 + * @since-jetpack 7.9.1 + */ + do_action( 'jetpack_reject_terms_of_service' ); + } + + /** + * Returns whether the master user has agreed to the terms of service. + * + * The following conditions have to be met in order to agree to the terms of service. + * 1. The master user has gone though the connect flow. + * 2. The site is not in dev mode. + * 3. The master user of the site is still connected (deprecated @since 1.4.0). + * + * @return bool + */ + public function has_agreed() { + if ( $this->is_offline_mode() ) { + return false; + } + /** + * Before 1.4.0 we used to also check if the master user of the site is connected + * by calling the Connection related `is_active` method. + * As of 1.4.0 we have removed this check in order to resolve the + * circular dependencies it was introducing to composer packages. + * + * @since 1.4.0 + */ + return $this->get_raw_has_agreed(); + } + + /** + * Abstracted for testing purposes. + * Tells us if the site is in dev mode. + * + * @return bool + */ + protected function is_offline_mode() { + return ( new Status() )->is_offline_mode(); + } + + /** + * Gets just the Jetpack Option that contains the terms of service state. + * Abstracted for testing purposes. + * + * @return bool + */ + protected function get_raw_has_agreed() { + return \Jetpack_Options::get_option( self::OPTION_NAME, false ); + } + + /** + * Sets the correct Jetpack Option to mark the that the site has agreed to the terms of service. + * Abstracted for testing purposes. + */ + protected function set_agree() { + \Jetpack_Options::update_option( self::OPTION_NAME, true ); + } + + /** + * Sets the correct Jetpack Option to mark that the site has rejected the terms of service. + * Abstracted for testing purposes. + */ + protected function set_reject() { + \Jetpack_Options::update_option( self::OPTION_NAME, false ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php new file mode 100644 index 00000000..98a01d9b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php @@ -0,0 +1,687 @@ +remove_lock(); + } + + /** + * Perform the API request to validate the blog and user tokens. + * + * @param int|null $user_id ID of the user we need to validate token for. Current user's ID by default. + * + * @return array|false|WP_Error The API response: `array( 'blog_token_is_healthy' => true|false, 'user_token_is_healthy' => true|false )`. + */ + public function validate( $user_id = null ) { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-token-health' + ); + + $user_token = $this->get_access_token( $user_id ? $user_id : get_current_user_id() ); + $blog_token = $this->get_access_token(); + + // Cannot validate non-existent tokens. + if ( false === $user_token || false === $blog_token ) { + return false; + } + + $method = 'POST'; + $body = array( + 'user_token' => $this->get_signed_token( $user_token ), + 'blog_token' => $this->get_signed_token( $blog_token ), + ); + $response = Client::_wp_remote_request( $url, compact( 'body', 'method' ) ); + + if ( is_wp_error( $response ) || ! wp_remote_retrieve_body( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + return $body ? $body : false; + } + + /** + * Perform the API request to validate only the blog. + * + * @return bool|WP_Error Boolean with the test result. WP_Error if test cannot be performed. + */ + public function validate_blog_token() { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + return new WP_Error( 'site_not_registered', 'Site not registered.' ); + } + $url = sprintf( + '%s/%s/v%s/%s', + Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ), + 'wpcom', + '2', + 'sites/' . $blog_id . '/jetpack-token-health/blog' + ); + + $method = 'GET'; + $response = Client::remote_request( compact( 'url', 'method' ) ); + + if ( is_wp_error( $response ) || ! wp_remote_retrieve_body( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return false; + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + return is_array( $body ) && isset( $body['is_healthy'] ) && true === $body['is_healthy']; + } + + /** + * Obtains the auth token. + * + * @param array $data The request data. + * @param string $token_api_url The URL of the Jetpack "token" API. + * @return object|WP_Error Returns the auth token on success. + * Returns a WP_Error on failure. + */ + public function get( $data, $token_api_url ) { + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + + if ( ! $role ) { + return new WP_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack-connection' ) ); + } + + $client_secret = $this->get_access_token(); + if ( ! $client_secret ) { + return new WP_Error( 'client_secret', __( 'You need to register your Jetpack before connecting it.', 'jetpack-connection' ) ); + } + + /** + * Filter the URL of the first time the user gets redirected back to your site for connection + * data processing. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site admin URL. + */ + $processing_url = apply_filters( 'jetpack_token_processing_url', admin_url( 'admin.php' ) ); + + $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; + + /** + * Filter the URL to redirect the user back to when the authentication process + * is complete. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param string $redirect_url Defaults to the site URL. + */ + $redirect = apply_filters( 'jetpack_token_redirect_url', $redirect ); + + $redirect_uri = ( 'calypso' === $data['auth_type'] ) + ? $data['redirect_uri'] + : add_query_arg( + array( + 'handler' => 'jetpack-connection-webhooks', + 'action' => 'authorize', + '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), + 'redirect' => $redirect ? rawurlencode( $redirect ) : false, + ), + esc_url( $processing_url ) + ); + + /** + * Filters the token request data. + * + * @since 1.7.0 + * @since-jetpack 8.0.0 + * + * @param array $request_data request data. + */ + $body = apply_filters( + 'jetpack_token_request_body', + array( + 'client_id' => Jetpack_Options::get_option( 'id' ), + 'client_secret' => $client_secret->secret, + 'grant_type' => 'authorization_code', + 'code' => $data['code'], + 'redirect_uri' => $redirect_uri, + ) + ); + + $args = array( + 'method' => 'POST', + 'body' => $body, + 'headers' => array( + 'Accept' => 'application/json', + ), + ); + add_filter( 'http_request_timeout', array( $this, 'return_30' ), PHP_INT_MAX - 1 ); + $response = Client::_wp_remote_request( $token_api_url, $args ); + remove_filter( 'http_request_timeout', array( $this, 'return_30' ), PHP_INT_MAX - 1 ); + + if ( is_wp_error( $response ) ) { + return new WP_Error( 'token_http_request_failed', $response->get_error_message() ); + } + + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + + if ( $entity ) { + $json = json_decode( $entity ); + } else { + $json = false; + } + + if ( 200 !== $code || ! empty( $json->error ) ) { + if ( empty( $json->error ) ) { + return new WP_Error( 'unknown', '', $code ); + } + + /* translators: Error description string. */ + $error_description = isset( $json->error_description ) ? sprintf( __( 'Error Details: %s', 'jetpack-connection' ), (string) $json->error_description ) : ''; + + return new WP_Error( (string) $json->error, $error_description, $code ); + } + + if ( empty( $json->access_token ) || ! is_scalar( $json->access_token ) ) { + return new WP_Error( 'access_token', '', $code ); + } + + if ( empty( $json->token_type ) || 'X_JETPACK' !== strtoupper( $json->token_type ) ) { + return new WP_Error( 'token_type', '', $code ); + } + + if ( empty( $json->scope ) ) { + return new WP_Error( 'scope', 'No Scope', $code ); + } + + // TODO: get rid of the error silencer. + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + @list( $role, $hmac ) = explode( ':', $json->scope ); + if ( empty( $role ) || empty( $hmac ) ) { + return new WP_Error( 'scope', 'Malformed Scope', $code ); + } + + if ( $this->sign_role( $role ) !== $json->scope ) { + return new WP_Error( 'scope', 'Invalid Scope', $code ); + } + + $cap = $roles->translate_role_to_cap( $role ); + if ( ! $cap ) { + return new WP_Error( 'scope', 'No Cap', $code ); + } + + if ( ! current_user_can( $cap ) ) { + return new WP_Error( 'scope', 'current_user_cannot', $code ); + } + + return (string) $json->access_token; + } + + /** + * Enters a user token into the user_tokens option + * + * @param int $user_id The user id. + * @param string $token The user token. + * @param bool $is_master_user Whether the user is the master user. + * @return bool + */ + public function update_user_token( $user_id, $token, $is_master_user ) { + // Not designed for concurrent updates. + $user_tokens = $this->get_user_tokens(); + if ( ! is_array( $user_tokens ) ) { + $user_tokens = array(); + } + $user_tokens[ $user_id ] = $token; + if ( $is_master_user ) { + $master_user = $user_id; + $options = compact( 'user_tokens', 'master_user' ); + } else { + $options = compact( 'user_tokens' ); + } + return Jetpack_Options::update_options( $options ); + } + + /** + * Sign a user role with the master access token. + * If not specified, will default to the current user. + * + * @access public + * + * @param string $role User role. + * @param int $user_id ID of the user. + * @return string Signed user role. + */ + public function sign_role( $role, $user_id = null ) { + if ( empty( $user_id ) ) { + $user_id = (int) get_current_user_id(); + } + + if ( ! $user_id ) { + return false; + } + + $token = $this->get_access_token(); + if ( ! $token || is_wp_error( $token ) ) { + return false; + } + + return $role . ':' . hash_hmac( 'md5', "{$role}|{$user_id}", $token->secret ); + } + + /** + * Increases the request timeout value to 30 seconds. + * + * @return int Returns 30. + */ + public function return_30() { + return 30; + } + + /** + * Gets the requested token. + * + * Tokens are one of two types: + * 1. Blog Tokens: These are the "main" tokens. Each site typically has one Blog Token, + * though some sites can have multiple "Special" Blog Tokens (see below). These tokens + * are not associated with a user account. They represent the site's connection with + * the Jetpack servers. + * 2. User Tokens: These are "sub-"tokens. Each connected user account has one User Token. + * + * All tokens look like "{$token_key}.{$private}". $token_key is a public ID for the + * token, and $private is a secret that should never be displayed anywhere or sent + * over the network; it's used only for signing things. + * + * Blog Tokens can be "Normal" or "Special". + * * Normal: The result of a normal connection flow. They look like + * "{$random_string_1}.{$random_string_2}" + * That is, $token_key and $private are both random strings. + * Sites only have one Normal Blog Token. Normal Tokens are found in either + * Jetpack_Options::get_option( 'blog_token' ) (usual) or the JETPACK_BLOG_TOKEN + * constant (rare). + * * Special: A connection token for sites that have gone through an alternative + * connection flow. They look like: + * ";{$special_id}{$special_version};{$wpcom_blog_id};.{$random_string}" + * That is, $private is a random string and $token_key has a special structure with + * lots of semicolons. + * Most sites have zero Special Blog Tokens. Special tokens are only found in the + * JETPACK_BLOG_TOKEN constant. + * + * In particular, note that Normal Blog Tokens never start with ";" and that + * Special Blog Tokens always do. + * + * When searching for a matching Blog Tokens, Blog Tokens are examined in the following + * order: + * 1. Defined Special Blog Tokens (via the JETPACK_BLOG_TOKEN constant) + * 2. Stored Normal Tokens (via Jetpack_Options::get_option( 'blog_token' )) + * 3. Defined Normal Tokens (via the JETPACK_BLOG_TOKEN constant) + * + * @param int|false $user_id false: Return the Blog Token. int: Return that user's User Token. + * @param string|false $token_key If provided, check that the token matches the provided input. + * @param bool|true $suppress_errors If true, return a falsy value when the token isn't found; When false, return a descriptive WP_Error when the token isn't found. + * + * @return object|false|WP_Error + */ + public function get_access_token( $user_id = false, $token_key = false, $suppress_errors = true ) { + if ( $this->is_locked() ) { + $this->delete_all(); + return false; + } + + $possible_special_tokens = array(); + $possible_normal_tokens = array(); + $user_tokens = $this->get_user_tokens(); + + if ( $user_id ) { + if ( ! $user_tokens ) { + return $suppress_errors ? false : new WP_Error( 'no_user_tokens', __( 'No user tokens found', 'jetpack-connection' ) ); + } + if ( true === $user_id ) { // connection owner. + $user_id = Jetpack_Options::get_option( 'master_user' ); + if ( ! $user_id ) { + return $suppress_errors ? false : new WP_Error( 'empty_master_user_option', __( 'No primary user defined', 'jetpack-connection' ) ); + } + } + if ( ! isset( $user_tokens[ $user_id ] ) || ! $user_tokens[ $user_id ] ) { + // translators: %s is the user ID. + return $suppress_errors ? false : new WP_Error( 'no_token_for_user', sprintf( __( 'No token for user %d', 'jetpack-connection' ), $user_id ) ); + } + $user_token_chunks = explode( '.', $user_tokens[ $user_id ] ); + if ( empty( $user_token_chunks[1] ) || empty( $user_token_chunks[2] ) ) { + // translators: %s is the user ID. + return $suppress_errors ? false : new WP_Error( 'token_malformed', sprintf( __( 'Token for user %d is malformed', 'jetpack-connection' ), $user_id ) ); + } + if ( $user_token_chunks[2] !== (string) $user_id ) { + // translators: %1$d is the ID of the requested user. %2$d is the user ID found in the token. + return $suppress_errors ? false : new WP_Error( 'user_id_mismatch', sprintf( __( 'Requesting user_id %1$d does not match token user_id %2$d', 'jetpack-connection' ), $user_id, $user_token_chunks[2] ) ); + } + $possible_normal_tokens[] = "{$user_token_chunks[0]}.{$user_token_chunks[1]}"; + } else { + $stored_blog_token = Jetpack_Options::get_option( 'blog_token' ); + if ( $stored_blog_token ) { + $possible_normal_tokens[] = $stored_blog_token; + } + + $defined_tokens_string = Constants::get_constant( 'JETPACK_BLOG_TOKEN' ); + + if ( $defined_tokens_string ) { + $defined_tokens = explode( ',', $defined_tokens_string ); + foreach ( $defined_tokens as $defined_token ) { + if ( ';' === $defined_token[0] ) { + $possible_special_tokens[] = $defined_token; + } else { + $possible_normal_tokens[] = $defined_token; + } + } + } + } + + if ( self::MAGIC_NORMAL_TOKEN_KEY === $token_key ) { + $possible_tokens = $possible_normal_tokens; + } else { + $possible_tokens = array_merge( $possible_special_tokens, $possible_normal_tokens ); + } + + if ( ! $possible_tokens ) { + // If no user tokens were found, it would have failed earlier, so this is about blog token. + return $suppress_errors ? false : new WP_Error( 'no_possible_tokens', __( 'No blog token found', 'jetpack-connection' ) ); + } + + $valid_token = false; + + if ( false === $token_key ) { + // Use first token. + $valid_token = $possible_tokens[0]; + } elseif ( self::MAGIC_NORMAL_TOKEN_KEY === $token_key ) { + // Use first normal token. + $valid_token = $possible_tokens[0]; // $possible_tokens only contains normal tokens because of earlier check. + } else { + // Use the token matching $token_key or false if none. + // Ensure we check the full key. + $token_check = rtrim( $token_key, '.' ) . '.'; + + foreach ( $possible_tokens as $possible_token ) { + if ( hash_equals( substr( $possible_token, 0, strlen( $token_check ) ), $token_check ) ) { + $valid_token = $possible_token; + break; + } + } + } + + if ( ! $valid_token ) { + if ( $user_id ) { + // translators: %d is the user ID. + return $suppress_errors ? false : new WP_Error( 'no_valid_user_token', sprintf( __( 'Invalid token for user %d', 'jetpack-connection' ), $user_id ) ); + } else { + return $suppress_errors ? false : new WP_Error( 'no_valid_blog_token', __( 'Invalid blog token', 'jetpack-connection' ) ); + } + } + + return (object) array( + 'secret' => $valid_token, + 'external_user_id' => (int) $user_id, + ); + } + + /** + * Updates the blog token to a new value. + * + * @access public + * + * @param string $token the new blog token value. + * @return Boolean Whether updating the blog token was successful. + */ + public function update_blog_token( $token ) { + return Jetpack_Options::update_option( 'blog_token', $token ); + } + + /** + * Unlinks the current user from the linked WordPress.com user. + * + * @access public + * @static + * + * @todo Refactor to properly load the XMLRPC client independently. + * + * @param int $user_id The user identifier. + * + * @return bool Whether the disconnection of the user was successful. + */ + public function disconnect_user( $user_id ) { + $tokens = $this->get_user_tokens(); + if ( ! $tokens ) { + return false; + } + + if ( ! isset( $tokens[ $user_id ] ) ) { + return false; + } + + unset( $tokens[ $user_id ] ); + + $this->update_user_tokens( $tokens ); + + return true; + } + + /** + * Returns an array of user_id's that have user tokens for communicating with wpcom. + * Able to select by specific capability. + * + * @deprecated 1.30.0 + * @see Manager::get_connected_users + * + * @param string $capability The capability of the user. + * @param int|null $limit How many connected users to get before returning. + * @return array Array of WP_User objects if found. + */ + public function get_connected_users( $capability = 'any', $limit = null ) { + _deprecated_function( __METHOD__, '1.30.0' ); + return ( new Manager( 'jetpack' ) )->get_connected_users( $capability, $limit ); + } + + /** + * Fetches a signed token. + * + * @param object $token the token. + * @return WP_Error|string a signed token + */ + public function get_signed_token( $token ) { + if ( ! isset( $token->secret ) || empty( $token->secret ) ) { + return new WP_Error( 'invalid_token' ); + } + + list( $token_key, $token_secret ) = explode( '.', $token->secret ); + + $token_key = sprintf( + '%s:%d:%d', + $token_key, + Constants::get_constant( 'JETPACK__API_VERSION' ), + $token->external_user_id + ); + + $timestamp = time(); + + if ( function_exists( 'wp_generate_password' ) ) { + $nonce = wp_generate_password( 10, false ); + } else { + $nonce = substr( sha1( wp_rand( 0, 1000000 ) ), 0, 10 ); + } + + $normalized_request_string = join( + "\n", + array( + $token_key, + $timestamp, + $nonce, + ) + ) . "\n"; + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + $signature = base64_encode( hash_hmac( 'sha1', $normalized_request_string, $token_secret, true ) ); + + $auth = array( + 'token' => $token_key, + 'timestamp' => $timestamp, + 'nonce' => $nonce, + 'signature' => $signature, + ); + + $header_pieces = array(); + foreach ( $auth as $key => $value ) { + $header_pieces[] = sprintf( '%s="%s"', $key, $value ); + } + + return join( ' ', $header_pieces ); + } + + /** + * Gets the list of user tokens + * + * @since 1.30.0 + * + * @return bool|array An array of user tokens where keys are user IDs and values are the tokens. False if no user token is found. + */ + public function get_user_tokens() { + return Jetpack_Options::get_option( 'user_tokens' ); + } + + /** + * Updates the option that stores the user tokens + * + * @since 1.30.0 + * + * @param array $tokens An array of user tokens where keys are user IDs and values are the tokens. + * @return bool Was the option successfully updated? + * + * @todo add validate the input. + */ + public function update_user_tokens( $tokens ) { + return Jetpack_Options::update_option( 'user_tokens', $tokens ); + } + + /** + * Lock the tokens to the current site URL. + * + * @param int $timespan How long the tokens should be locked, in seconds. + * + * @return bool + */ + public function set_lock( $timespan = HOUR_IN_SECONDS ) { + try { + $expires = ( new DateTime() )->add( DateInterval::createFromDateString( (int) $timespan . ' seconds' ) ); + } catch ( Exception $e ) { + return false; + } + + if ( false === $expires ) { + return false; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + return Jetpack_Options::update_option( 'token_lock', $expires->format( static::DATE_FORMAT_ATOM ) . '|||' . base64_encode( Urls::site_url() ) ); + } + + /** + * Remove the site lock from tokens. + * + * @return bool + */ + public function remove_lock() { + Jetpack_Options::delete_option( 'token_lock' ); + + return true; + } + + /** + * Check if the domain is locked, remove the lock if needed. + * Possible scenarios: + * - lock expired, site URL matches the lock URL: remove the lock, return false. + * - lock not expired, site URL matches the lock URL: return false. + * - site URL does not match the lock URL (expiration date is ignored): return true, do not remove the lock. + * + * @return bool + */ + public function is_locked() { + $the_lock = Jetpack_Options::get_option( 'token_lock' ); + if ( ! $the_lock ) { + // Not locked. + return false; + } + + $the_lock = explode( '|||', $the_lock, 2 ); + if ( count( $the_lock ) !== 2 ) { + // Something's wrong with the lock. + $this->remove_lock(); + return false; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + $locked_site_url = base64_decode( $the_lock[1] ); + $expires = $the_lock[0]; + + $expiration_date = DateTime::createFromFormat( static::DATE_FORMAT_ATOM, $expires ); + if ( false === $expiration_date || ! $locked_site_url ) { + // Something's wrong with the lock. + $this->remove_lock(); + return false; + } + + if ( Urls::site_url() === $locked_site_url ) { + if ( new DateTime() > $expiration_date ) { + // Site lock expired. + // Site URL matches, removing the lock. + $this->remove_lock(); + } + + return false; + } + + // Site URL doesn't match. + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php new file mode 100644 index 00000000..1ff9f06c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php @@ -0,0 +1,318 @@ +product_name = $product_name; + $this->connection = $connection; + if ( $this->connection === null ) { + // TODO We should always pass a Connection. + $this->connection = new Connection\Manager(); + } + + if ( ! did_action( 'jetpack_set_tracks_ajax_hook' ) ) { + add_action( 'wp_ajax_jetpack_tracks', array( $this, 'ajax_tracks' ) ); + + /** + * Fires when the Tracking::ajax_tracks() callback has been hooked to the + * wp_ajax_jetpack_tracks action. This action is used to ensure that + * the callback is hooked only once. + * + * @since 1.13.11 + */ + do_action( 'jetpack_set_tracks_ajax_hook' ); + } + } + + /** + * Universal method for for all tracking events triggered via the JavaScript client. + * + * @access public + */ + public function ajax_tracks() { + // Check for nonce. + if ( + empty( $_REQUEST['tracksNonce'] ) + || ! wp_verify_nonce( $_REQUEST['tracksNonce'], 'jp-tracks-ajax-nonce' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP core doesn't pre-sanitize nonces either. + ) { + wp_send_json_error( + __( 'You aren’t authorized to do that.', 'jetpack-connection' ), + 403 + ); + } + + if ( ! isset( $_REQUEST['tracksEventName'] ) || ! isset( $_REQUEST['tracksEventType'] ) ) { + wp_send_json_error( + __( 'No valid event name or type.', 'jetpack-connection' ), + 403 + ); + } + + $tracks_data = array(); + if ( 'click' === $_REQUEST['tracksEventType'] && isset( $_REQUEST['tracksEventProp'] ) ) { + if ( is_array( $_REQUEST['tracksEventProp'] ) ) { + $tracks_data = array_map( 'filter_var', wp_unslash( $_REQUEST['tracksEventProp'] ) ); + } else { + $tracks_data = array( 'clicked' => filter_var( wp_unslash( $_REQUEST['tracksEventProp'] ) ) ); + } + } + + $this->record_user_event( filter_var( wp_unslash( $_REQUEST['tracksEventName'] ) ), $tracks_data, null, false ); + + wp_send_json_success(); + } + + /** + * Register script necessary for tracking. + * + * @param boolean $enqueue Also enqueue? defaults to false. + */ + public static function register_tracks_functions_scripts( $enqueue = false ) { + + // Register jp-tracks as it is a dependency. + wp_register_script( + 'jp-tracks', + '//stats.wp.com/w.js', + array(), + gmdate( 'YW' ), + true + ); + + Assets::register_script( + 'jp-tracks-functions', + '../dist/tracks-callables.js', + __FILE__, + array( + 'dependencies' => array( 'jp-tracks' ), + 'enqueue' => $enqueue, + 'in_footer' => true, + ) + ); + } + + /** + * Enqueue script necessary for tracking. + */ + public function enqueue_tracks_scripts() { + Assets::register_script( + 'jptracks', + '../dist/tracks-ajax.js', + __FILE__, + array( + 'dependencies' => array( 'jquery' ), + 'enqueue' => true, + 'in_footer' => true, + ) + ); + + wp_localize_script( + 'jptracks', + 'jpTracksAJAX', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ), + ) + ); + } + + /** + * Send an event in Tracks. + * + * @param string $event_type Type of the event. + * @param array $data Data to send with the event. + * @param mixed $user Username, user_id, or WP_user object. + * @param bool $use_product_prefix Whether to use the object's product name as a prefix to the event type. If + * set to false, the prefix will be 'jetpack_'. + */ + public function record_user_event( $event_type, $data = array(), $user = null, $use_product_prefix = true ) { + if ( ! $user ) { + $user = wp_get_current_user(); + } + $site_url = get_option( 'siteurl' ); + + $data['_via_ua'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; + $data['_via_ip'] = isset( $_SERVER['REMOTE_ADDR'] ) ? filter_var( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : ''; + $data['_lg'] = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) : ''; + $data['blog_url'] = $site_url; + $data['blog_id'] = \Jetpack_Options::get_option( 'id' ); + + // Top level events should not be namespaced. + if ( '_aliasUser' !== $event_type ) { + $prefix = $use_product_prefix ? $this->product_name : 'jetpack'; + $event_type = $prefix . '_' . $event_type; + } + + $data['jetpack_version'] = defined( 'JETPACK__VERSION' ) ? JETPACK__VERSION : '0'; + + return $this->tracks_record_event( $user, $event_type, $data ); + } + + /** + * Record an event in Tracks - this is the preferred way to record events from PHP. + * + * @param mixed $user username, user_id, or WP_user object. + * @param string $event_name The name of the event. + * @param array $properties Custom properties to send with the event. + * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred. + * + * @return bool true for success | \WP_Error if the event pixel could not be fired + */ + public function tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { + + // We don't want to track user events during unit tests/CI runs. + if ( $user instanceof \WP_User && 'wptests_capabilities' === $user->cap_key ) { + return false; + } + $terms_of_service = new Terms_Of_Service(); + $status = new Status(); + // Don't track users who have not agreed to our TOS. + if ( ! $this->should_enable_tracking( $terms_of_service, $status ) ) { + return false; + } + + $event_obj = $this->tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis ); + + if ( is_wp_error( $event_obj->error ) ) { + return $event_obj->error; + } + + return $event_obj->record(); + } + + /** + * Determines whether tracking should be enabled. + * + * @param Automattic\Jetpack\Terms_Of_Service $terms_of_service A Terms_Of_Service object. + * @param Automattic\Jetpack\Status $status A Status object. + * + * @return boolean True if tracking should be enabled, else false. + */ + public function should_enable_tracking( $terms_of_service, $status ) { + if ( $status->is_offline_mode() ) { + return false; + } + + return $terms_of_service->has_agreed() || $this->connection->is_user_connected(); + } + + /** + * Procedurally build a Tracks Event Object. + * NOTE: Use this only when the simpler Automattic\Jetpack\Tracking->jetpack_tracks_record_event() function won't work for you. + * + * @param WP_user $user WP_user object. + * @param string $event_name The name of the event. + * @param array $properties Custom properties to send with the event. + * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred. + * + * @return \Jetpack_Tracks_Event|\WP_Error + */ + private function tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { + $identity = $this->tracks_get_identity( $user->ID ); + + $properties['user_lang'] = $user->get( 'WPLANG' ); + + $blog_details = array( + 'blog_lang' => isset( $properties['blog_lang'] ) ? $properties['blog_lang'] : get_bloginfo( 'language' ), + ); + + $timestamp = ( false !== $event_timestamp_millis ) ? $event_timestamp_millis : round( microtime( true ) * 1000 ); + $timestamp_string = is_string( $timestamp ) ? $timestamp : number_format( $timestamp, 0, '', '' ); + + return new \Jetpack_Tracks_Event( + array_merge( + $blog_details, + (array) $properties, + $identity, + array( + '_en' => $event_name, + '_ts' => $timestamp_string, + ) + ) + ); + } + + /** + * Get the identity to send to tracks. + * + * @param int $user_id The user id of the local user. + * + * @return array $identity + */ + public function tracks_get_identity( $user_id ) { + + // Meta is set, and user is still connected. Use WPCOM ID. + $wpcom_id = get_user_meta( $user_id, 'jetpack_tracks_wpcom_id', true ); + if ( $wpcom_id && $this->connection->is_user_connected( $user_id ) ) { + return array( + '_ut' => 'wpcom:user_id', + '_ui' => $wpcom_id, + ); + } + + // User is connected, but no meta is set yet. Use WPCOM ID and set meta. + if ( $this->connection->is_user_connected( $user_id ) ) { + $wpcom_user_data = $this->connection->get_connected_user_data( $user_id ); + update_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'] ); + + return array( + '_ut' => 'wpcom:user_id', + '_ui' => $wpcom_user_data['ID'], + ); + } + + // User isn't linked at all. Fall back to anonymous ID. + $anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true ); + if ( ! $anon_id ) { + $anon_id = \Jetpack_Tracks_Client::get_anon_id(); + add_user_meta( $user_id, 'jetpack_tracks_anon_id', $anon_id, false ); + } + + if ( ! isset( $_COOKIE['tk_ai'] ) && ! headers_sent() ) { + setcookie( 'tk_ai', $anon_id, 0, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), false ); // phpcs:ignore Jetpack.Functions.SetCookie -- This is a random string and should be fine. + } + + return array( + '_ut' => 'anon', + '_ui' => $anon_id, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php new file mode 100644 index 00000000..2b1b149d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php @@ -0,0 +1,187 @@ +update_user_token() instead. + * + * @param int $user_id The user id. + * @param string $token The user token. + * @param bool $is_master_user Whether the user is the master user. + * @return bool + */ + public static function update_user_token( $user_id, $token, $is_master_user ) { + _deprecated_function( __METHOD__, '1.24.0', 'Automattic\\Jetpack\\Connection\\Tokens->update_user_token' ); + return ( new Tokens() )->update_user_token( $user_id, $token, $is_master_user ); + } + + /** + * Filters the value of the api constant. + * + * @param String $constant_value The constant value. + * @param String $constant_name The constant name. + * @return mixed | null + */ + public static function jetpack_api_constant_filter( $constant_value, $constant_name ) { + if ( $constant_value !== null ) { + // If the constant value was already set elsewhere, use that value. + return $constant_value; + } + + if ( defined( "self::DEFAULT_$constant_name" ) ) { + return constant( "self::DEFAULT_$constant_name" ); + } + + return null; + } + + /** + * Add a filter to initialize default values of the constants. + */ + public static function init_default_constants() { + add_filter( + 'jetpack_constant_default_value', + array( __CLASS__, 'jetpack_api_constant_filter' ), + 10, + 2 + ); + } + + /** + * Filters the registration request body to include tracking properties. + * + * @param array $properties Already prepared tracking properties. + * @return array amended properties. + */ + public static function filter_register_request_body( $properties ) { + $tracking = new Tracking(); + $tracks_identity = $tracking->tracks_get_identity( get_current_user_id() ); + + return array_merge( + $properties, + array( + '_ui' => $tracks_identity['_ui'], + '_ut' => $tracks_identity['_ut'], + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php new file mode 100644 index 00000000..8d57421b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php @@ -0,0 +1,211 @@ +connection = $connection; + } + + /** + * Initialize the webhooks. + * + * @param Manager $connection The Connection Manager object. + */ + public static function init( $connection ) { + $webhooks = new static( $connection ); + + add_action( 'init', array( $webhooks, 'controller' ) ); + add_action( 'load-toplevel_page_jetpack', array( $webhooks, 'fallback_jetpack_controller' ) ); + } + + /** + * Jetpack plugin used to trigger this webhooks in Jetpack::admin_page_load() + * + * The Jetpack toplevel menu is still accessible for stand-alone plugins, and while there's no content for that page, there are still + * actions from Calypso and WPCOM that reach that route regardless of the site having the Jetpack plugin or not. That's why we are still handling it here. + */ + public function fallback_jetpack_controller() { + $this->controller( true ); + } + + /** + * The "controller" decides which handler we need to run. + * + * @param bool $force Do not check if it's a webhook request and just run the controller. + */ + public function controller( $force = false ) { + if ( ! $force ) { + // The nonce is verified in specific handlers. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( empty( $_GET['handler'] ) || 'jetpack-connection-webhooks' !== $_GET['handler'] ) { + return; + } + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['connect_url_redirect'] ) ) { + $this->handle_connect_url_redirect(); + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( empty( $_GET['action'] ) ) { + return; + } + + // The nonce is verified in specific handlers. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + switch ( $_GET['action'] ) { + case 'authorize': + $this->handle_authorize(); + $this->do_exit(); + break; + case 'authorize_redirect': + $this->handle_authorize_redirect(); + $this->do_exit(); + break; + // Class Jetpack::admin_page_load() still handles other cases. + } + } + + /** + * Perform the authorization action. + */ + public function handle_authorize() { + if ( $this->connection->is_connected() && $this->connection->is_user_connected() ) { + $redirect_url = apply_filters( 'jetpack_client_authorize_already_authorized_url', admin_url() ); + wp_safe_redirect( $redirect_url ); + + return; + } + do_action( 'jetpack_client_authorize_processing' ); + + $data = stripslashes_deep( $_GET ); + $data['auth_type'] = 'client'; + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; + + check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" ); + + $tracking = new Tracking(); + + $result = $this->connection->authorize( $data ); + + if ( is_wp_error( $result ) ) { + do_action( 'jetpack_client_authorize_error', $result ); + + $tracking->record_user_event( + 'jpc_client_authorize_fail', + array( + 'error_code' => $result->get_error_code(), + 'error_message' => $result->get_error_message(), + ) + ); + } else { + /** + * Fires after the Jetpack client is authorized to communicate with WordPress.com. + * + * @param int Jetpack Blog ID. + * + * @since 1.7.0 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_client_authorized', Jetpack_Options::get_option( 'id' ) ); + + $tracking->record_user_event( 'jpc_client_authorize_success' ); + } + + $fallback_redirect = apply_filters( 'jetpack_client_authorize_fallback_url', admin_url() ); + $redirect = wp_validate_redirect( $redirect ) ? $redirect : $fallback_redirect; + + wp_safe_redirect( $redirect ); + } + + /** + * The authorhize_redirect webhook handler + */ + public function handle_authorize_redirect() { + $authorize_redirect_handler = new Webhooks\Authorize_Redirect( $this->connection ); + $authorize_redirect_handler->handle(); + } + + /** + * The `exit` is wrapped into a method so we could mock it. + */ + protected function do_exit() { + exit; + } + + /** + * Handle the `connect_url_redirect` action, + * which is usually called to repeat an attempt for user to authorize the connection. + * + * @return void + */ + public function handle_connect_url_redirect() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + $from = ! empty( $_GET['from'] ) ? sanitize_text_field( wp_unslash( $_GET['from'] ) ) : 'iframe'; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- no site changes, sanitization happens in get_authorization_url() + $redirect = ! empty( $_GET['redirect_after_auth'] ) ? wp_unslash( $_GET['redirect_after_auth'] ) : false; + + add_filter( 'allowed_redirect_hosts', array( Host::class, 'allow_wpcom_environments' ) ); + + if ( ! $this->connection->is_user_connected() ) { + if ( ! $this->connection->is_connected() ) { + $this->connection->register(); + } + + $connect_url = add_query_arg( 'from', $from, $this->connection->get_authorization_url( null, $redirect ) ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + if ( isset( $_GET['notes_iframe'] ) ) { + $connect_url .= '¬es_iframe'; + } + wp_safe_redirect( $connect_url ); + $this->do_exit(); + } elseif ( ! isset( $_GET['calypso_env'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. + ( new CookieState() )->state( 'message', 'already_authorized' ); + wp_safe_redirect( $redirect ); + $this->do_exit(); + } else { + $connect_url = add_query_arg( + array( + 'from' => $from, + 'already_authorized' => true, + ), + $this->connection->get_authorization_url() + ); + wp_safe_redirect( $connect_url ); + $this->do_exit(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php new file mode 100644 index 00000000..f27090c9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php @@ -0,0 +1,105 @@ + [ + * $user_id => [ + * arrat of Jetpack_IXR_ClientMulticall + * ] + * ] + * ] + * + * @var array + */ + public static $clients = array(); + + /** + * Adds a new XMLRPC call to the queue to be processed on shutdown + * + * @param string $method The XML-RPC method. + * @param integer $user_id The user ID used to make the request (will use this user's token); Use 0 for the blog token. + * @param mixed ...$args This function accepts any number of additional arguments, that will be passed to the call. + * @return void + */ + public static function add_call( $method, $user_id = 0, ...$args ) { + global $blog_id; + + $client_blog_id = is_multisite() ? $blog_id : 0; + + if ( ! isset( self::$clients[ $client_blog_id ] ) ) { + self::$clients[ $client_blog_id ] = array(); + } + + if ( ! isset( self::$clients[ $client_blog_id ][ $user_id ] ) ) { + self::$clients[ $client_blog_id ][ $user_id ] = new Jetpack_IXR_ClientMulticall( array( 'user_id' => $user_id ) ); + } + + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + array_unshift( $args, $method ); + + call_user_func_array( array( self::$clients[ $client_blog_id ][ $user_id ], 'addCall' ), $args ); + + if ( false === has_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ) ) { + add_action( 'shutdown', array( 'Automattic\Jetpack\Connection\XMLRPC_Async_Call', 'do_calls' ) ); + } + } + + /** + * Trigger the calls at shutdown + * + * @return void + */ + public static function do_calls() { + foreach ( self::$clients as $client_blog_id => $blog_clients ) { + if ( $client_blog_id > 0 ) { + $switch_success = switch_to_blog( $client_blog_id, true ); + + if ( ! $switch_success ) { + continue; + } + } + + foreach ( $blog_clients as $client ) { + if ( empty( $client->calls ) ) { + continue; + } + + flush(); + $client->query(); + } + + if ( $client_blog_id > 0 ) { + restore_current_blog(); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php new file mode 100644 index 00000000..c3d786d8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php @@ -0,0 +1,83 @@ +connection = $connection; + + // Adding the filter late to avoid being overwritten by Jetpack's XMLRPC server. + add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ), 20 ); + } + + /** + * Attached to the `xmlrpc_methods` filter. + * + * @param array $methods The already registered XML-RPC methods. + * @return array + */ + public function xmlrpc_methods( $methods ) { + return array_merge( + $methods, + array( + 'jetpack.verifyRegistration' => array( $this, 'verify_registration' ), + ) + ); + } + + /** + * Handles verification that a site is registered. + * + * @param array $registration_data The data sent by the XML-RPC client: + * [ $secret_1, $user_id ]. + * + * @return string|IXR_Error + */ + public function verify_registration( $registration_data ) { + return $this->output( $this->connection->handle_registration( $registration_data ) ); + } + + /** + * Normalizes output for XML-RPC. + * + * @param mixed $data The data to output. + */ + private function output( $data ) { + if ( is_wp_error( $data ) ) { + $code = $data->get_error_data(); + if ( ! $code ) { + $code = -10520; + } + + if ( ! class_exists( \IXR_Error::class ) ) { + require_once ABSPATH . WPINC . '/class-IXR.php'; + } + return new \IXR_Error( + $code, + sprintf( 'Jetpack: [%s] %s', $data->get_error_code(), $data->get_error_message() ) + ); + } + + return $data; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php new file mode 100644 index 00000000..804f3848 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php @@ -0,0 +1,17 @@ +connection = $connection; + } + + /** + * Handle the webhook + * + * This method implements what's in Jetpack::admin_page_load when the Jetpack plugin is not present + */ + public function handle() { + + add_filter( + 'allowed_redirect_hosts', + function ( $domains ) { + $domains[] = 'jetpack.com'; + $domains[] = 'jetpack.wordpress.com'; + $domains[] = 'wordpress.com'; + // Calypso envs. + $domains[] = 'calypso.localhost'; + $domains[] = 'wpcalypso.wordpress.com'; + $domains[] = 'horizon.wordpress.com'; + return array_unique( $domains ); + } + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $dest_url = empty( $_GET['dest_url'] ) ? null : esc_url_raw( wp_unslash( $_GET['dest_url'] ) ); + + if ( ! $dest_url || ( 0 === stripos( $dest_url, 'https://jetpack.com/' ) && 0 === stripos( $dest_url, 'https://wordpress.com/' ) ) ) { + // The destination URL is missing or invalid, nothing to do here. + exit; + } + + // The user is either already connected, or finished the connection process. + if ( $this->connection->is_connected() && $this->connection->is_user_connected() ) { + if ( class_exists( '\Automattic\Jetpack\Licensing' ) && method_exists( '\Automattic\Jetpack\Licensing', 'handle_user_connected_redirect' ) ) { + Licensing::instance()->handle_user_connected_redirect( $dest_url ); + } + + wp_safe_redirect( $dest_url ); + exit; + } elseif ( ! empty( $_GET['done'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + // The user decided not to proceed with setting up the connection. + + wp_safe_redirect( Admin_Menu::get_top_level_menu_item_url() ); + exit; + } + + $redirect_args = array( + 'page' => 'jetpack', + 'action' => 'authorize_redirect', + 'dest_url' => rawurlencode( $dest_url ), + 'done' => '1', + ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! empty( $_GET['from'] ) && 'jetpack_site_only_checkout' === $_GET['from'] ) { + $redirect_args['from'] = 'jetpack_site_only_checkout'; + } + + wp_safe_redirect( $this->build_authorize_url( add_query_arg( $redirect_args, admin_url( 'admin.php' ) ) ) ); + exit; + } + + /** + * Create the Jetpack authorization URL. Copied from Jetpack class. + * + * @param bool|string $redirect URL to redirect to. + * + * @todo Update default value for redirect since the called function expects a string. + * + * @return mixed|void + */ + public function build_authorize_url( $redirect = false ) { + + add_filter( 'jetpack_connect_request_body', array( __CLASS__, 'filter_connect_request_body' ) ); + add_filter( 'jetpack_connect_redirect_url', array( __CLASS__, 'filter_connect_redirect_url' ) ); + + $url = $this->connection->get_authorization_url( wp_get_current_user(), $redirect ); + + remove_filter( 'jetpack_connect_request_body', array( __CLASS__, 'filter_connect_request_body' ) ); + remove_filter( 'jetpack_connect_redirect_url', array( __CLASS__, 'filter_connect_redirect_url' ) ); + + /** + * This filter is documented in plugins/jetpack/class-jetpack.php + */ + return apply_filters( 'jetpack_build_authorize_url', $url ); + } + + /** + * Filters the redirection URL that is used for connect requests. The redirect + * URL should return the user back to the Jetpack console. + * Copied from Jetpack class. + * + * @param String $redirect the default redirect URL used by the package. + * @return String the modified URL. + */ + public static function filter_connect_redirect_url( $redirect ) { + $jetpack_admin_page = esc_url_raw( admin_url( 'admin.php?page=jetpack' ) ); + $redirect = $redirect + ? wp_validate_redirect( esc_url_raw( $redirect ), $jetpack_admin_page ) + : $jetpack_admin_page; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_REQUEST['is_multisite'] ) ) { + $redirect = Jetpack_Network::init()->get_url( 'network_admin_page' ); + } + + return $redirect; + } + + /** + * Filters the connection URL parameter array. + * Copied from Jetpack class. + * + * @param array $args default URL parameters used by the package. + * @return array the modified URL arguments array. + */ + public static function filter_connect_request_body( $args ) { + if ( + Constants::is_defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) + && include_once Constants::get_constant( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) + ) { + $gp_locale = GP_Locales::by_field( 'wp_locale', get_locale() ); + $args['locale'] = isset( $gp_locale ) && isset( $gp_locale->slug ) + ? $gp_locale->slug + : ''; + } + + $tracking = new Tracking(); + $tracks_identity = $tracking->tracks_get_identity( $args['state'] ); + + $args = array_merge( + $args, + array( + '_ui' => $tracks_identity['_ui'], + '_ut' => $tracks_identity['_ut'], + ) + ); + + $calypso_env = self::get_calypso_env(); + + if ( ! empty( $calypso_env ) ) { + $args['calypso_env'] = $calypso_env; + } + + return $args; + } + + /** + * Return Calypso environment value; used for developing Jetpack and pairing + * it with different Calypso enrionments, such as localhost. + * Copied from Jetpack class. + * + * @since 1.37.1 + * + * @return string Calypso environment + */ + public static function get_calypso_env() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['calypso_env'] ) ) { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + return sanitize_key( $_GET['calypso_env'] ); + } + + if ( getenv( 'CALYPSO_ENV' ) ) { + return sanitize_key( getenv( 'CALYPSO_ENV' ) ); + } + + if ( defined( 'CALYPSO_ENV' ) && CALYPSO_ENV ) { + return sanitize_key( CALYPSO_ENV ); + } + + return ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md new file mode 100644 index 00000000..0320469d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/CHANGELOG.md @@ -0,0 +1,184 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.6.22] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.6.21] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.6.20] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.6.19] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.6.18] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.6.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.6.16] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.6.15] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.6.14] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.6.13] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.6.12] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.6.11] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.6.10] - 2021-10-26 +### Fixed +- Updated is_true docblock to be more accurate. + +## [1.6.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.6.8] - 2021-10-06 +### Changed +- Updated package dependencies + +## [1.6.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.6.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Updated versions in annotations + +## [1.6.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.6.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.6.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.6.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.6.1] - 2021-01-19 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.6.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.5.1] - 2020-10-28 + +- Updated PHPCS: Packages and Debugger + +## [1.5.0] - 2020-08-13 + +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.4.0] - 2020-07-01 + +- Package Unit tests: update test file names to make sure they runs in Travis + +## [1.3.0] - 2020-06-22 + +- PHPCS: Clean up the packages + +## [1.2.0] - 2020-04-15 + +- Use jp.com redirect in all links +- Connection: add a filter for setting Jetpack api constants + +## [1.1.3] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.1.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.1.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## [1.1.0] - 2019-09-14 + +## 1.0.0 - 2019-07-09 + +- Packages: Finish the constants package + +[1.6.22]: https://github.com/Automattic/jetpack-constants/compare/v1.6.21...v1.6.22 +[1.6.21]: https://github.com/Automattic/jetpack-constants/compare/v1.6.20...v1.6.21 +[1.6.20]: https://github.com/Automattic/jetpack-constants/compare/v1.6.19...v1.6.20 +[1.6.19]: https://github.com/Automattic/jetpack-constants/compare/v1.6.18...v1.6.19 +[1.6.18]: https://github.com/Automattic/jetpack-constants/compare/v1.6.17...v1.6.18 +[1.6.17]: https://github.com/Automattic/jetpack-constants/compare/v1.6.16...v1.6.17 +[1.6.16]: https://github.com/Automattic/jetpack-constants/compare/v1.6.15...v1.6.16 +[1.6.15]: https://github.com/Automattic/jetpack-constants/compare/v1.6.14...v1.6.15 +[1.6.14]: https://github.com/Automattic/jetpack-constants/compare/v1.6.13...v1.6.14 +[1.6.13]: https://github.com/Automattic/jetpack-constants/compare/v1.6.12...v1.6.13 +[1.6.12]: https://github.com/Automattic/jetpack-constants/compare/v1.6.11...v1.6.12 +[1.6.11]: https://github.com/Automattic/jetpack-constants/compare/v1.6.10...v1.6.11 +[1.6.10]: https://github.com/Automattic/jetpack-constants/compare/v1.6.9...v1.6.10 +[1.6.9]: https://github.com/Automattic/jetpack-constants/compare/v1.6.8...v1.6.9 +[1.6.8]: https://github.com/Automattic/jetpack-constants/compare/v1.6.7...v1.6.8 +[1.6.7]: https://github.com/Automattic/jetpack-constants/compare/v1.6.6...v1.6.7 +[1.6.6]: https://github.com/Automattic/jetpack-constants/compare/v1.6.5...v1.6.6 +[1.6.5]: https://github.com/Automattic/jetpack-constants/compare/v1.6.4...v1.6.5 +[1.6.4]: https://github.com/Automattic/jetpack-constants/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-constants/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-constants/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-constants/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-constants/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-constants/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-constants/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-constants/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-constants/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-constants/compare/v1.1.3...v1.2.0 +[1.1.3]: https://github.com/Automattic/jetpack-constants/compare/v1.1.2...v1.1.3 +[1.1.2]: https://github.com/Automattic/jetpack-constants/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-constants/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-constants/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json new file mode 100644 index 00000000..7bc57adf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/composer.json @@ -0,0 +1,40 @@ +{ + "name": "automattic/jetpack-constants", + "description": "A wrapper for defining constants in a more testable way.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-constants", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-constants/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.6.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php new file mode 100644 index 00000000..eaad50be --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php @@ -0,0 +1,124 @@ + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json new file mode 100644 index 00000000..7a806dca --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/composer.json @@ -0,0 +1,39 @@ +{ + "name": "automattic/jetpack-device-detection", + "description": "A way to detect device types based on User-Agent header.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-device-detection", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-device-detection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php new file mode 100644 index 00000000..684e568c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php @@ -0,0 +1,219 @@ + (bool) Whether the current device is a mobile phone. + * 'is_smartphone' => (bool) Whether the current device is a smartphone. + * 'is_tablet' => (bool) Whether the current device is a tablet device. + * 'is_handheld' => (bool) Whether the current device is a handheld device. + * 'is_desktop' => (bool) Whether the current device is a laptop / desktop device. + * 'platform' => (string) Detected platform. + * 'is_phone_matched_ua' => (string) Matched UA. + * ); + */ + public static function get_info( $ua = '' ) { + $ua_info = new User_Agent_Info( $ua ); + + $info = array( + 'is_phone' => self::is_mobile( 'any', false, $ua_info ), + 'is_phone_matched_ua' => self::is_mobile( 'any', true, $ua_info ), + 'is_smartphone' => self::is_mobile( 'smart', false, $ua_info ), + 'is_tablet' => $ua_info->is_tablet(), + 'platform' => $ua_info->get_platform(), + ); + + $info['is_handheld'] = $info['is_phone'] || $info['is_tablet']; + $info['is_desktop'] = ! $info['is_handheld']; + + if ( function_exists( 'apply_filters' ) ) { + /** + * Filter the value of Device_Detection::get_info. + * + * @since 1.0.0 + * + * @param array $info Array of device information. + * @param string $ua User agent string passed to Device_Detection::get_info. + * @param User_Agent_Info $ua_info Instance of Automattic\Jetpack\Device_Detection\User_Agent_Info. + */ + $info = apply_filters( 'jetpack_device_detection_get_info', $info, $ua, $ua_info ); + } + return $info; + } + + /** + * Detects phone devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_phone( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_phone']; + } + + /** + * Detects smartphone devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_smartphone( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_smartphone']; + } + + /** + * Detects tablet devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_tablet( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_tablet']; + } + + /** + * Detects desktop devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_desktop( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_desktop']; + } + + /** + * Detects handheld (i.e. phone + tablet) devices. + * + * @param string $ua User-Agent string. + * + * @return bool + */ + public static function is_handheld( $ua = '' ) { + $device_info = self::get_info( $ua ); + return true === $device_info['is_handheld']; + } + + /** + * Determine if the current User Agent matches the passed $kind. + * + * @param string $kind Category of mobile device to check for. Either: any, dumb, smart. + * @param bool $return_matched_agent Boolean indicating if the UA should be returned. + * @param User_Agent_Info $ua_info Boolean indicating if the UA should be returned. + * + * @return bool|string Boolean indicating if current UA matches $kind. If `$return_matched_agent` is true, returns the UA string. + */ + private static function is_mobile( $kind, $return_matched_agent, $ua_info ) { + $kinds = array( + 'smart' => false, + 'dumb' => false, + 'any' => false, + ); + $first_run = true; + $matched_agent = ''; + + // If an invalid kind is passed in, reset it to default. + if ( ! isset( $kinds[ $kind ] ) ) { + $kind = 'any'; + } + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ); + if ( strpos( $agent, 'ipad' ) ) { + return false; + } + + // Remove Samsung Galaxy tablets (SCH-I800) from being mobile devices. + if ( strpos( $agent, 'sch-i800' ) ) { + return false; + } + + if ( $ua_info->is_android_tablet() && false === $ua_info->is_kindle_touch() ) { + return false; + } + + if ( $ua_info->is_blackberry_tablet() ) { + return false; + } + + if ( $first_run ) { + $first_run = false; + + // checks for iPhoneTier devices & RichCSS devices. + if ( $ua_info->isTierIphone() || $ua_info->isTierRichCSS() ) { + $kinds['smart'] = true; + $matched_agent = $ua_info->matched_agent; + } + + if ( ! $kinds['smart'] ) { + // if smart, we are not dumb so no need to check. + $dumb_agents = $ua_info->dumb_agents; + + foreach ( $dumb_agents as $dumb_agent ) { + if ( false !== strpos( $agent, $dumb_agent ) ) { + $kinds['dumb'] = true; + $matched_agent = $dumb_agent; + + break; + } + } + + if ( ! $kinds['dumb'] ) { + if ( isset( $_SERVER['HTTP_X_WAP_PROFILE'] ) ) { + $kinds['dumb'] = true; + $matched_agent = 'http_x_wap_profile'; + } elseif ( isset( $_SERVER['HTTP_ACCEPT'] ) && ( preg_match( '/wap\.|\.wap/i', $_SERVER['HTTP_ACCEPT'] ) || false !== strpos( strtolower( $_SERVER['HTTP_ACCEPT'] ), 'application/vnd.wap.xhtml+xml' ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- This is doing the validating. + $kinds['dumb'] = true; + $matched_agent = 'vnd.wap.xhtml+xml'; + } + } + } + + if ( $kinds['dumb'] || $kinds['smart'] ) { + $kinds['any'] = true; + } + } + + $value = $kinds[ $kind ]; + + if ( $return_matched_agent ) { + $value = $matched_agent; + } + return $value; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php new file mode 100644 index 00000000..d7a99de8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php @@ -0,0 +1,1568 @@ +useragent = $ua; + } elseif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + $this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating. + } + } + + /** + * This method detects the mobile User Agent name. + * + * @return string The matched User Agent name, false otherwise. + */ + public function get_mobile_user_agent_name() { + if ( $this->is_chrome_for_iOS() ) { // Keep this check before the safari rule. + return 'chrome-for-ios'; + } elseif ( $this->is_iphone_or_ipod( 'iphone-safari' ) ) { + return 'iphone'; + } elseif ( $this->is_ipad( 'ipad-safari' ) ) { + return 'ipad'; + } elseif ( $this->is_android_tablet() ) { // Keep this check before the android rule. + return 'android_tablet'; + } elseif ( $this->is_android() ) { + return 'android'; + } elseif ( $this->is_blackberry_10() ) { + return 'blackberry_10'; + } elseif ( $this->is_blackbeberry() ) { + return 'blackberry'; + } elseif ( $this->is_WindowsPhone7() ) { + return 'win7'; + } elseif ( $this->is_windows_phone_8() ) { + return 'winphone8'; + } elseif ( $this->is_opera_mini() ) { + return 'opera-mini'; + } elseif ( $this->is_opera_mini_dumb() ) { + return 'opera-mini-dumb'; + } elseif ( $this->is_opera_mobile() ) { + return 'opera-mobi'; + } elseif ( $this->is_blackberry_tablet() ) { + return 'blackberry_tablet'; + } elseif ( $this->is_kindle_fire() ) { + return 'kindle-fire'; + } elseif ( $this->is_PalmWebOS() ) { + return 'webos'; + } elseif ( $this->is_S60_OSSBrowser() ) { + return 'series60'; + } elseif ( $this->is_firefox_os() ) { + return 'firefoxOS'; + } elseif ( $this->is_firefox_mobile() ) { + return 'firefox_mobile'; + } elseif ( $this->is_MaemoTablet() ) { + return 'maemo'; + } elseif ( $this->is_MeeGo() ) { + return 'meego'; + } elseif ( $this->is_TouchPad() ) { + return 'hp_tablet'; + } elseif ( $this->is_facebook_for_iphone() ) { + return 'facebook-for-iphone'; + } elseif ( $this->is_facebook_for_ipad() ) { + return 'facebook-for-ipad'; + } elseif ( $this->is_twitter_for_iphone() ) { + return 'twitter-for-iphone'; + } elseif ( $this->is_twitter_for_ipad() ) { + return 'twitter-for-ipad'; + } elseif ( $this->is_wordpress_for_ios() ) { + return 'ios-app'; + } elseif ( $this->is_iphone_or_ipod( 'iphone-not-safari' ) ) { + return 'iphone-unknown'; + } elseif ( $this->is_ipad( 'ipad-not-safari' ) ) { + return 'ipad-unknown'; + } elseif ( $this->is_Nintendo_3DS() ) { + return 'nintendo-3ds'; + } else { + $agent = $this->useragent; + $dumb_agents = $this->dumb_agents; + foreach ( $dumb_agents as $dumb_agent ) { + if ( false !== strpos( $agent, $dumb_agent ) ) { + return $dumb_agent; + } + } + } + + return false; + } + + /** + * This method detects the mobile device's platform. All return strings are from the class constants. + * Note that this function returns the platform name, not the UA name/type. You should use a different function + * if you need to test the UA capabilites. + * + * @return string Name of the platform, false otherwise. + */ + public function get_platform() { + if ( isset( $this->platform ) ) { + return $this->platform; + } + + if ( strpos( $this->useragent, 'windows phone' ) !== false ) { + $this->platform = self::PLATFORM_WINDOWS; + } elseif ( strpos( $this->useragent, 'windows ce' ) !== false ) { + $this->platform = self::PLATFORM_WINDOWS; + } elseif ( strpos( $this->useragent, 'ipad' ) !== false ) { + $this->platform = self::PLATFORM_IPAD; + } elseif ( strpos( $this->useragent, 'ipod' ) !== false ) { + $this->platform = self::PLATFORM_IPOD; + } elseif ( strpos( $this->useragent, 'iphone' ) !== false ) { + $this->platform = self::PLATFORM_IPHONE; + } elseif ( strpos( $this->useragent, 'android' ) !== false ) { + if ( $this->is_android_tablet() ) { + $this->platform = self::PLATFORM_ANDROID_TABLET; + } else { + $this->platform = self::PLATFORM_ANDROID; + } + } elseif ( $this->is_kindle_fire() ) { + $this->platform = self::PLATFORM_ANDROID_TABLET; + } elseif ( $this->is_blackberry_10() ) { + $this->platform = self::PLATFORM_BLACKBERRY_10; + } elseif ( strpos( $this->useragent, 'blackberry' ) !== false ) { + $this->platform = self::PLATFORM_BLACKBERRY; + } elseif ( $this->is_blackberry_tablet() ) { + $this->platform = self::PLATFORM_BLACKBERRY; + } elseif ( $this->is_symbian_platform() ) { + $this->platform = self::PLATFORM_SYMBIAN; + } elseif ( $this->is_symbian_s40_platform() ) { + $this->platform = self::PLATFORM_SYMBIAN_S40; + } elseif ( $this->is_J2ME_platform() ) { + $this->platform = self::PLATFORM_J2ME_MIDP; + } elseif ( $this->is_firefox_os() ) { + $this->platform = self::PLATFORM_FIREFOX_OS; + } else { + $this->platform = false; + } + + return $this->platform; + } + + /** + * This method detects for UA which can display iPhone-optimized web content. + * Includes iPhone, iPod Touch, Android, WebOS, Fennec (Firefox mobile), etc. + */ + public function isTierIphone() { + if ( isset( $this->isTierIphone ) ) { + return $this->isTierIphone; + } + if ( $this->is_iphoneOrIpod() ) { + $this->matched_agent = 'iphone'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_android() ) { + $this->matched_agent = 'android'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_windows_phone_8() ) { + $this->matched_agent = 'winphone8'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_WindowsPhone7() ) { + $this->matched_agent = 'win7'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_blackberry_10() ) { + $this->matched_agent = 'blackberry-10'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_blackbeberry() && 'blackberry-webkit' === $this->detect_blackberry_browser_version() ) { + $this->matched_agent = 'blackberry-webkit'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_blackberry_tablet() ) { + $this->matched_agent = 'blackberry_tablet'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_PalmWebOS() ) { + $this->matched_agent = 'webos'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_TouchPad() ) { + $this->matched_agent = 'hp_tablet'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_firefox_os() ) { + $this->matched_agent = 'firefoxOS'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_firefox_mobile() ) { + $this->matched_agent = 'fennec'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_opera_mobile() ) { + $this->matched_agent = 'opera-mobi'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_MaemoTablet() ) { + $this->matched_agent = 'maemo'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_MeeGo() ) { + $this->matched_agent = 'meego'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_kindle_touch() ) { + $this->matched_agent = 'kindle-touch'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_Nintendo_3DS() ) { + $this->matched_agent = 'nintendo-3ds'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } else { + $this->isTierIphone = false; + } + return $this->isTierIphone; + } + + /** + * This method detects for UA which are likely to be capable + * but may not necessarily support JavaScript. + * Excludes all iPhone Tier UA. + */ + public function isTierRichCss() { + if ( isset( $this->isTierRichCss ) ) { + return $this->isTierRichCss; + } + if ( $this->isTierIphone() ) { + return false; + } + + // The following devices are explicitly ok. + if ( $this->is_S60_OSSBrowser() ) { + $this->matched_agent = 'series60'; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } elseif ( $this->is_opera_mini() ) { + $this->matched_agent = 'opera-mini'; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } elseif ( $this->is_blackbeberry() ) { + $detectedDevice = $this->detect_blackberry_browser_version(); + if ( + 'blackberry-5' === $detectedDevice + || 'blackberry-4.7' === $detectedDevice + || 'blackberry-4.6' === $detectedDevice + ) { + $this->matched_agent = $detectedDevice; + $this->isTierIphone = false; + $this->isTierRichCss = true; + $this->isTierGenericMobile = false; + } + } else { + $this->isTierRichCss = false; + } + + return $this->isTierRichCss; + } + + /** + * Detects if the user is using a tablet. + * props Corey Gilmore, BGR.com + * + * @return bool + */ + public function is_tablet() { + return ( 0 // Never true, but makes it easier to manage our list of tablet conditions. + || self::is_ipad() + || self::is_android_tablet() + || self::is_blackberry_tablet() + || self::is_kindle_fire() + || self::is_MaemoTablet() + || self::is_TouchPad() + ); + } + + /** + * Detects if the current UA is the default iPhone or iPod Touch Browser. + * + * DEPRECATED: use is_iphone_or_ipod + */ + public function is_iphoneOrIpod() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua, 'ipod' ) !== false ) ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser. + * + * They type can check for any iPhone, an iPhone using Safari, or an iPhone using something other than Safari. + * + * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPhone browser), + * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'. + * Otherwise those browsers will be 'catched' by the iphone string. + * + * @param string $type Type of iPhone detection. + */ + public static function is_iphone_or_ipod( $type = 'iphone-any' ) { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $is_iphone = ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua, 'ipod' ) !== false ); + $is_safari = ( false !== strpos( $ua, 'safari' ) ); + + if ( 'iphone-safari' === $type ) { + return $is_iphone && $is_safari; + } elseif ( 'iphone-not-safari' === $type ) { + return $is_iphone && ! $is_safari; + } else { + return $is_iphone; + } + } + + /** + * Detects if the current UA is Chrome for iOS + * + * The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/ instead of Version/. + * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3 + */ + public static function is_chrome_for_iOS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( self::is_iphone_or_ipod( 'iphone-safari' ) === false ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'crios/' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Twitter for iPhone + * + * Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone + * Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone + */ + public static function is_twitter_for_iphone() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'ipad' ) !== false ) { + return false; + } + + if ( strpos( $ua, 'twitter for iphone' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Twitter for iPad + * + * Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad + * Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone + */ + public static function is_twitter_for_ipad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'twitter for ipad' ) !== false ) { + return true; + } elseif ( strpos( $ua, 'ipad' ) !== false && strpos( $ua, 'twitter for iphone' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Facebook for iPhone + * - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR) + * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0] + * - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US] + */ + public static function is_facebook_for_iphone() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'iphone' ) ) { + return false; + } + + if ( false !== strpos( $ua, 'facebook' ) && false === strpos( $ua, 'ipad' ) ) { + return true; + } elseif ( false !== strpos( $ua, 'fbforiphone' ) && false === strpos( $ua, 'tablet' ) ) { + return true; + } elseif ( false !== strpos( $ua, 'fban/fbios;' ) && false === strpos( $ua, 'tablet' ) ) { // FB app v5.0 or higher. + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is Facebook for iPad + * - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US) + * - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0] + * - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US] + */ + public static function is_facebook_for_ipad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'ipad' ) ) { + return false; + } + + if ( false !== strpos( $ua, 'facebook' ) || false !== strpos( $ua, 'fbforiphone' ) || false !== strpos( $ua, 'fban/fbios;' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current UA is WordPress for iOS + */ + public static function is_wordpress_for_ios() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( false !== strpos( $ua, 'wp-iphone' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current device is an iPad. + * They type can check for any iPad, an iPad using Safari, or an iPad using something other than Safari. + * + * Note: If you want to check for Opera mini, Opera mobile or Firefox mobile (or any 3rd party iPad browser), + * you should put the check condition before the check for 'iphone-any' or 'iphone-not-safari'. + * Otherwise those browsers will be 'catched' by the ipad string. + * + * @param string $type iPad type. + */ + public static function is_ipad( $type = 'ipad-any' ) { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $is_ipad = ( false !== strpos( $ua, 'ipad' ) ); + $is_safari = ( false !== strpos( $ua, 'safari' ) ); + + if ( 'ipad-safari' === $type ) { + return $is_ipad && $is_safari; + } elseif ( 'ipad-not-safari' === $type ) { + return $is_ipad && ! $is_safari; + } else { + return $is_ipad; + } + } + + /** + * Detects if the current browser is Firefox Mobile (Fennec) + * + * See http://www.useragentstring.com/pages/Fennec/ + * Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 + * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1 + */ + public static function is_firefox_mobile() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'fennec' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Firefox for desktop + * + * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox + * Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion + * The platform section will include 'Mobile' for phones and 'Tablet' for tablets. + */ + public static function is_firefox_desktop() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is FirefoxOS Native browser + * + * Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0 + */ + public static function is_firefox_os() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'mozilla' ) !== false && strpos( $ua, 'mobile' ) !== false && strpos( $ua, 'gecko' ) !== false && strpos( $ua, 'firefox' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detect modern Opera desktop + * + * Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 OPR/74.0.3911.203 + * + * Looking for "OPR/" specifically. + */ + public static function is_opera_desktop() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'OPR/' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return false; + } + + return true; + } + + /** + * Detects if the current browser is Opera Mobile + * + * What is the difference between Opera Mobile and Opera Mini? + * - Opera Mobile is a full Internet browser for mobile devices. + * - Opera Mini always uses a transcoder to convert the page for a small display. + * (it uses Opera advanced server compression technology to compress web content before it gets to a device. + * The rendering engine is on Opera's server.) + * + * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" + * Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) + */ + public static function is_opera_mobile() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false ) { + return true; + } elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Opera Mini + * + * Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr) + * Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454 + * Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15 + * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 + * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 + * Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54 + * Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54 + */ + public static function is_opera_mini() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mini' ) !== false ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc) + * Used to send users on dumb devices to m.wor + */ + public static function is_opera_mini_dumb() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( self::is_opera_mini() ) { + if ( strpos( $ua, 'android' ) !== false || strpos( $ua, 'iphone' ) !== false || strpos( $ua, 'ipod' ) !== false + || strpos( $ua, 'ipad' ) !== false || strpos( $ua, 'blackberry' ) !== false ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is a Windows Phone 7 device. + * ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910) + */ + public static function is_WindowsPhone7() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'windows phone os 7' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is a Windows Phone 8 device. + * ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; ; [;]) + */ + public static function is_windows_phone_8() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( strpos( $ua, 'windows phone 8' ) === false ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad. + * + * Ex1: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.1 + * Ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1 + */ + public static function is_PalmWebOS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'webos' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * Detects if the current browser is the HP TouchPad default browser. This excludes phones wt WebOS. + * + * TouchPad Emulator: Mozilla/5.0 (hp-desktop; Linux; hpwOS/2.0; U; it-IT) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 Desktop/1.0 + * TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0 + */ + public static function is_TouchPad() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $http_user_agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( false !== strpos( $http_user_agent, 'hp-tablet' ) || false !== strpos( $http_user_agent, 'hpwos' ) || false !== strpos( $http_user_agent, 'touchpad' ) ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Series 60 Open Source Browser. + * + * OSS Browser 3.2 on E75: Mozilla/5.0 (SymbianOS/9.3; U; Series60/3.2 NokiaE75-1/110.48.125 Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 + * + * 7.0 Browser (Nokia 5800 XpressMusic (v21.0.025)) : Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/21.0.025; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 + * + * Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344 + */ + public static function is_S60_OSSBrowser() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } + + $pos_webkit = strpos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // First, test for WebKit, then make sure it's either Symbian or S60. + if ( strpos( $agent, 'symbian' ) !== false || strpos( $agent, 'series60' ) !== false ) { + return true; + } else { + return false; + } + } elseif ( strpos( $agent, 'symbianos' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'nokia' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } + + return false; + } + + /** + * Detects if the device platform is the Symbian Series 60. + */ + public static function is_symbian_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_webkit = strpos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // First, test for WebKit, then make sure it's either Symbian or S60. + if ( strpos( $agent, 'symbian' ) !== false || strpos( $agent, 'series60' ) !== false ) { + return true; + } else { + return false; + } + } elseif ( strpos( $agent, 'symbianos' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'nokia' ) !== false && strpos( $agent, 'series60' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'opera mini' ) !== false ) { + if ( strpos( $agent, 'symbianos' ) !== false || strpos( $agent, 'symbos' ) !== false || strpos( $agent, 'series 60' ) !== false ) { + return true; + } + } + + return false; + } + + /** + * Detects if the device platform is the Symbian Series 40. + * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser. + * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'. + */ + public static function is_symbian_s40_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $agent, 'series40' ) !== false ) { + if ( strpos( $agent, 'nokia' ) !== false || strpos( $agent, 'ovibrowser' ) !== false || strpos( $agent, 'nokiabrowser' ) !== false ) { + return true; + } + } + + return false; + } + + /** + * Returns if the device belongs to J2ME capable family. + * + * @return bool + */ + public static function is_J2ME_platform() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( strpos( $agent, 'j2me/midp' ) !== false ) { + return true; + } elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) { + return true; + } + return false; + } + + /** + * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets. + */ + public static function is_MaemoTablet() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_maemo = strpos( $agent, 'maemo' ); + if ( false === $pos_maemo ) { + return false; + } + + // Must be Linux + Tablet, or else it could be something else. + if ( strpos( $agent, 'tablet' ) !== false && strpos( $agent, 'linux' ) !== false ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current UA is a MeeGo device (Nokia Smartphone). + */ + public static function is_MeeGo() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( false === strpos( $ua, 'meego' ) ) { + return false; + } elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } + + /** + * The is_webkit() method can be used to check the User Agent for an webkit generic browser. + */ + public static function is_webkit() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_webkit = strpos( $agent, 'webkit' ); + + if ( false !== $pos_webkit ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is the Native Android browser. + * + * @return boolean true if the browser is Android otherwise false + */ + public static function is_android() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_android = strpos( $agent, 'android' ); + if ( false !== $pos_android ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Native Android Tablet browser. + * Assumes 'Android' should be in the user agent, but not 'mobile' + * + * @return boolean true if the browser is Android and not 'mobile' otherwise false + */ + public static function is_android_tablet() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_android = strpos( $agent, 'android' ); + $pos_mobile = strpos( $agent, 'mobile' ); + $post_android_app = strpos( $agent, 'wp-android' ); + + if ( false !== $pos_android && false === $pos_mobile && false === $post_android_app ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Detects if the current browser is the Kindle Fire Native browser. + * + * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true + * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false + * + * @return boolean true if the browser is Kindle Fire Native browser otherwise false + */ + public static function is_kindle_fire() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_silk = strpos( $agent, 'silk/' ); + $pos_silk_acc = strpos( $agent, 'silk-accelerated=' ); + if ( false !== $pos_silk && false !== $pos_silk_acc ) { + return true; + } else { + return false; + } + } + + /** + * Detects if the current browser is the Kindle Touch Native browser + * + * Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+ + * + * @return boolean true if the browser is Kindle monochrome Native browser otherwise false + */ + public static function is_kindle_touch() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_kindle_touch = strpos( $agent, 'kindle/3.0+' ); + if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) + */ + public static function is_windows8_auth() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'msauthhost' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Windows 8 app. + */ + public static function is_wordpress_for_win8() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'wp-windows8' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * Detect if user agent is the WordPress.com Desktop app. + */ + public static function is_wordpress_desktop_app() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos = strpos( $agent, 'WordPressDesktop' ); + if ( false !== $pos ) { + return true; + } else { + return false; + } + } + + /** + * The is_blackberry_tablet() method can be used to check the User Agent for a RIM blackberry tablet. + * The user agent of the BlackBerry® Tablet OS follows a format similar to the following: + * Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+ + */ + public static function is_blackberry_tablet() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + $pos_playbook = stripos( $agent, 'PlayBook' ); + $pos_rim_tablet = stripos( $agent, 'RIM Tablet' ); + + if ( ( false === $pos_playbook ) || ( false === $pos_rim_tablet ) ) { + return false; + } else { + return true; + } + } + + /** + * The is_blackbeberry() method can be used to check the User Agent for a blackberry device. + * Note that opera mini on BB matches this rule. + */ + public static function is_blackbeberry() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_blackberry = strpos( $agent, 'blackberry' ); + if ( false !== $pos_blackberry ) { + if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * The is_blackberry_10() method can be used to check the User Agent for a BlackBerry 10 device. + */ + public static function is_blackberry_10() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + return ( strpos( $agent, 'bb10' ) !== false ) && ( strpos( $agent, 'mobile' ) !== false ); + } + + /** + * Retrieve the blackberry OS version. + * + * Return strings are from the following list: + * - blackberry-10 + * - blackberry-7 + * - blackberry-6 + * - blackberry-torch //only the first edition. The 2nd edition has the OS7 onboard and doesn't need any special rule. + * - blackberry-5 + * - blackberry-4.7 + * - blackberry-4.6 + * - blackberry-4.5 + * + * @return string Version of the BB OS. + * If version is not found, get_blackbeberry_OS_version will return boolean false. + */ + public static function get_blackbeberry_OS_version() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( self::is_blackberry_10() ) { + return 'blackberry-10'; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + $pos_blackberry = stripos( $agent, 'blackberry' ); + if ( false === $pos_blackberry ) { + // Not a blackberry device. + return false; + } + + // Blackberry devices OS 6.0 or higher. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9670; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+. + // Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0 Mobile Safari/534.11+. + $pos_webkit = stripos( $agent, 'webkit' ); + if ( false !== $pos_webkit ) { + // Detected blackberry webkit browser. + $pos_torch = stripos( $agent, 'BlackBerry 9800' ); + if ( false !== $pos_torch ) { + return 'blackberry-torch'; // Match the torch first edition. the 2nd edition should use the OS7 and doesn't need any special rule. + } elseif ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher. + $version = $matches[1]; + $version_num = explode( '.', $version ); + if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) { + return 'blackberry-6'; // not a BB device that match our rule. + } else { + return 'blackberry-' . $version_num[0]; + } + } else { + // if doesn't match returns the minimun version with a webkit browser. we should never fall here. + return 'blackberry-6'; // not a BB device that match our rule. + } + } + + // Blackberry devices <= 5.XX. + // BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179. + if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) { + $version = $matches[1]; + } else { + return false; // not a BB device that match our rule. + } + + $version_num = explode( '.', $version ); + + if ( is_array( $version_num ) === false || count( $version_num ) <= 1 ) { + return false; + } + + $version_num_major = (int) $version_num[0]; + $version_num_minor = (int) $version_num[1]; + + if ( 5 === $version_num_major ) { + return 'blackberry-5'; + } elseif ( 4 === $version_num_major && 7 === $version_num_minor ) { + return 'blackberry-4.7'; + } elseif ( 4 === $version_num_major && 6 === $version_num_minor ) { + return 'blackberry-4.6'; + } elseif ( 4 === $version_num_major && 5 === $version_num_minor ) { + return 'blackberry-4.5'; + } else { + return false; + } + } + + /** + * Retrieve the blackberry browser version. + * + * Return string are from the following list: + * - blackberry-10 + * - blackberry-webkit + * - blackberry-5 + * - blackberry-4.7 + * - blackberry-4.6 + * + * @return string Type of the BB browser. + * If browser's version is not found, detect_blackbeberry_browser_version will return boolean false. + */ + public static function detect_blackberry_browser_version() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( self::is_blackberry_10() ) { + return 'blackberry-10'; + } + + $pos_blackberry = strpos( $agent, 'blackberry' ); + if ( false === $pos_blackberry ) { + // Not a blackberry device. + return false; + } + + $pos_webkit = strpos( $agent, 'webkit' ); + + if ( ! ( false === $pos_webkit ) ) { + return 'blackberry-webkit'; + } else { + if ( ! preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) { + return false; // not a BB device that match our rule. + } + + $version_num = explode( '.', $matches[1] ); + + if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) { + return false; + } + + $version_num_major = (int) $version_num[0]; + $version_num_minor = (int) $version_num[1]; + + if ( 5 === $version_num_major ) { + return 'blackberry-5'; + } elseif ( 4 === $version_num_major && 7 === $version_num_minor ) { + return 'blackberry-4.7'; + } elseif ( 4 === $version_num_major && 6 === $version_num_minor ) { + return 'blackberry-4.6'; + } else { + // A very old BB device is found or this is a BB device that doesn't match our rules. + return false; + } + } + } + + /** + * Checks if a visitor is coming from one of the WordPress mobile apps. + * + * @return bool + */ + public static function is_mobile_app() { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + + if ( isset( $_SERVER['X_USER_AGENT'] ) && preg_match( '|wp-webos|', $_SERVER['X_USER_AGENT'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- This is validating. + return true; // Wp4webos 1.1 or higher. + } + + $app_agents = array( 'wp-android', 'wp-blackberry', 'wp-iphone', 'wp-nokia', 'wp-webos', 'wp-windowsphone' ); + // the mobile reader on iOS has an incorrect UA when loading the reader + // currently it is the default one provided by the iOS framework which + // causes problems with 2-step-auth + // User-Agent WordPress/3.1.4 CFNetwork/609 Darwin/13.0.0. + $app_agents[] = 'wordpress/3.1'; + + foreach ( $app_agents as $app_agent ) { + if ( false !== strpos( $agent, $app_agent ) ) { + return true; + } + } + return false; + } + + /** + * Detects if the current browser is Nintendo 3DS handheld. + * + * Example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US + * can differ in language, version and region + */ + public static function is_Nintendo_3DS() { + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + if ( strpos( $ua, 'nintendo 3ds' ) !== false ) { + return true; + } + return false; + } + + /** + * Was the current request made by a known bot? + * + * @return boolean + */ + public static function is_bot() { + static $is_bot = null; + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } + + if ( $is_bot === null ) { + $is_bot = self::is_bot_user_agent( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. + } + + return $is_bot; + } + + /** + * Is the given user-agent a known bot? + * If you want an is_bot check for the current request's UA, use is_bot() instead of passing a user-agent to this method. + * + * @param string $ua A user-agent string. + * + * @return boolean + */ + public static function is_bot_user_agent( $ua = null ) { + + if ( empty( $ua ) ) { + return false; + } + + $bot_agents = array( + 'alexa', + 'altavista', + 'ask jeeves', + 'attentio', + 'baiduspider', + 'bingbot', + 'chtml generic', + 'crawler', + 'fastmobilecrawl', + 'feedfetcher-google', + 'firefly', + 'froogle', + 'gigabot', + 'googlebot', + 'googlebot-mobile', + 'heritrix', + 'httrack', + 'ia_archiver', + 'irlbot', + 'iescholar', + 'infoseek', + 'jumpbot', + 'linkcheck', + 'lycos', + 'mediapartners', + 'mediobot', + 'motionbot', + 'msnbot', + 'mshots', + 'openbot', + 'pss-webkit-request', + 'pythumbnail', + 'scooter', + 'slurp', + 'snapbot', + 'spider', + 'taptubot', + 'technoratisnoop', + 'teoma', + 'twiceler', + 'yahooseeker', + 'yahooysmcm', + 'yammybot', + 'ahrefsbot', + 'pingdom.com_bot', + 'kraken', + 'yandexbot', + 'twitterbot', + 'tweetmemebot', + 'openhosebot', + 'queryseekerspider', + 'linkdexbot', + 'grokkit-crawler', + 'livelapbot', + 'germcrawler', + 'domaintunocrawler', + 'grapeshotcrawler', + 'cloudflare-alwaysonline', + ); + + foreach ( $bot_agents as $bot_agent ) { + if ( false !== stripos( $ua, $bot_agent ) ) { + return true; + } + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php new file mode 100644 index 00000000..a530e7f9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-device-detection/src/functions.php @@ -0,0 +1,36 @@ + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.asset.php new file mode 100644 index 00000000..2e8c7097 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.asset.php @@ -0,0 +1 @@ + array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'fb59dccf666add58f6fb'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css new file mode 100644 index 00000000..1d966e8d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.css @@ -0,0 +1 @@ +#wpadminbar #wp-admin-bar-jetpack-idc{margin-right:5px}#wpadminbar #wp-admin-bar-jetpack-idc .jp-idc-admin-bar{border-radius:2px;color:#efeff0;font-size:14px;font-weight:500;line-height:20px;padding:6px 8px}#wpadminbar #wp-admin-bar-jetpack-idc.hide{display:none}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons{font-family:dashicons;margin-top:-6px}#wpadminbar #wp-admin-bar-jetpack-idc .dashicons:before{font-size:18px}#wpadminbar #wp-admin-bar-jetpack-idc .ab-item{background:#e68b28;padding:0}#jp-identity-crisis-container .jp-idc__idc-screen{margin-bottom:40px;margin-top:40px}#jp-identity-crisis-container.notice{background:none;border:none}.jp-idc__idc-screen{background:#fff;border-left:4px solid #e68b28;border-radius:4px;box-shadow:0 0 40px rgba(0,0,0,.04);box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0 auto;max-width:1128px;padding:10px}.jp-idc__idc-screen.jp-idc__idc-screen__success{border-color:#069e08}@media(min-width:600px){.jp-idc__idc-screen{padding:48px}}.jp-idc__idc-screen .jp-idc__idc-screen__header{align-items:center;display:flex}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-image{max-height:100px;max-width:100px}.jp-idc__idc-screen .jp-idc__idc-screen__header .jp-idc__idc-screen__logo-label{font-size:14px;line-height:22px;margin:-7px 0 0 8px}.jp-idc__idc-screen h2{font-size:24px;font-weight:600;line-height:28px;margin:32px 0 0}.jp-idc__idc-screen h3{font-size:20px;font-weight:600;line-height:28px;margin:24px 0 0}.jp-idc__idc-screen p{color:#2c3338;font-size:16px;line-height:24px;margin:16px 0 0;max-width:710px}.jp-idc__idc-screen a{color:#2c3338}.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap}@media only screen and (min-width:1403px){.jp-idc__idc-screen .jp-idc__idc-screen__cards{align-items:normal;flex-direction:row}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__cards-separator{align-self:center;color:#23282d;font-size:20px;font-weight:600;line-height:28px;margin:0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{border:1px solid #c3c4c7;border-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:24px 0;max-width:100%;padding:10px;width:480px}@media(min-width:600px){.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base{padding:24px}}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base h4{font-size:20px;font-weight:400;line-height:28px;margin:0 0 8px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base p{margin:0 0 24px}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-sitename{background:#f9f9f6;border-radius:33px;box-sizing:border-box;color:#2c3338;font-size:16px;font-weight:700;line-height:24px;overflow-wrap:anywhere;padding:16px;text-align:center;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-separator{display:block;margin:12px auto}.jp-idc__idc-screen .jp-idc__idc-screen__cards .jp-idc__idc-screen__card-action-base .jp-idc__idc-screen__card-action-button{padding:8px 24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button{background:#000;border-radius:4px;color:#fff;font-size:16px;font-weight:600;height:auto;justify-content:center;line-height:24px;margin-top:24px;min-height:40px;padding:8px}.jp-idc__idc-screen .jp-idc__idc-screen__card-action-button-migrated{margin-top:64px;width:141px}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{align-items:center;display:flex;flex-direction:column;flex-wrap:wrap;margin-top:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{border:1px solid #c3c4c7;border-radius:4px;color:#2c3338;flex-grow:1;font-size:16px;font-weight:700;line-height:24px;padding:24px;width:100%}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator,.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{margin:28px}@media only screen and (min-width:1400px){.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated{flex-direction:row;width:auto}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator{display:none}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-separator-wide{display:block}.jp-idc__idc-screen .jp-idc__idc-screen__card-migrated .jp-idc__idc-screen__card-migrated-hostname{width:auto}}@keyframes rotate-spinner{to{transform:rotate(1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-right-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-10:#f2cf75;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var( --jp-green-40 );--jp-green-secondary:var( --jp-green-30 );--jp-border-radius:4px;--jp-menu-border-height:1px;--jp-underline-thickness:2px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.jp-idc__idc-screen .jp-idc__error-message{align-items:center;color:var(--jp-red);display:flex;flex-direction:row;justify-content:center;margin:15px 0}.jp-idc__idc-screen .jp-idc__error-message .error-gridicon{fill:var(--jp-red);margin-right:8px}.jp-idc__idc-screen .jp-idc__error-message a,.jp-idc__idc-screen .jp-idc__error-message span{color:var(--jp-red);font-size:var(--font-body)}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__error-message{margin-top:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base{padding-bottom:75px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base.jp-idc__idc-screen__card-action-error{padding-bottom:5px}.jp-idc__idc-screen .jp-idc__idc-screen__cards.jp-idc__idc-screen__cards-error .jp-idc__idc-screen__card-action-base .jp-idc__error-message{height:40px}.jp-idc__idc-screen .jp-idc__safe-mode{text-align:center}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe{display:flex;justify-content:center;padding:6px}.jp-idc__idc-screen .jp-idc__safe-mode .jp-idc__safe-mode__staying-safe .jp-components-spinner{margin:0 10px}.jp-idc__idc-screen .jp-idc__safe-mode,.jp-idc__idc-screen .jp-idc__safe-mode button{color:#2c3338;font-size:16px;line-height:24px}.jp-idc__idc-screen .jp-idc__safe-mode button{padding:0;text-decoration:underline} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js new file mode 100644 index 00000000..7d3b8547 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/build/index.js @@ -0,0 +1,5 @@ +/*! For license information please see index.js.LICENSE.txt */ +!function(){var e={5235:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e=[],t=0;t{"%%"!==e&&(r++,"%c"===e&&(s=r))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(1741)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1741:function(e,t,n){e.exports=function(e){function t(e){let n,s,i,o=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),i=s-(n||s);r.diff=i,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";o++;const i=t.formatters[s];if("function"==typeof i){const t=e[o];n=i.call(r,t),e.splice(o,1),o--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=s)return a(e,i,s,"day");if(i>=r)return a(e,i,r,"hour");if(i>=n)return a(e,i,n,"minute");if(i>=t)return a(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=s)return Math.round(e/s)+"d";if(i>=r)return Math.round(e/r)+"h";if(i>=n)return Math.round(e/n)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},469:function(e,t,n){"use strict";var r=n(758);function s(){}function i(){}i.resetWarningCache=s,e.exports=function(){function e(e,t,n,s,i,o){if(o!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:s};return n.PropTypes=n,n}},5162:function(e,t,n){e.exports=n(469)()},758:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6975:function(e,t,n){"use strict";var r=n(951);const s=n.n(r)()("dops:analytics");let i,o;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const a={initialize:function(e,t,n){a.setUser(e,t),a.setSuperProps(n),a.identifyUser()},setGoogleAnalyticsEnabled:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){o={ID:e,username:t}},setSuperProps:function(e){i=e},assignSuperProps:function(e){i=Object.assign(i||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Built stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){a.tracks.recordPageView(e),a.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,r,s,i,o){a.ga.recordPurchase(e,t,n,r,s,i,o)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(i&&(s("- Super Props: %o",i),t=Object.assign(t,i)),s('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):s('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};a.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){a.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){s("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};a.ga.initialized||(o&&(e={userId:"u-"+o.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),a.ga.initialized=!0)},recordPageView:function(e,t){a.ga.initialize(),s("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,r){a.ga.initialize();let i="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(i+=" [Option Label: "+n+"]"),void 0!==r&&(i+=" [Option Value: "+r+"]"),s(i),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,r)},recordPurchase:function(e,t,n,r,s,i,o){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:r,currency:o}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:s,quantity:i}),window.ga("ecommerce:send")}},identifyUser:function(){o&&window._tkq.push(["identifyUser",o.ID,o.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}};t.Z=a},4743:function(e,t,n){"use strict";var r=n(1132),s=n(6483);function i(e){class t extends Error{constructor(){super(...arguments),this.name=e}}return t}const o=i("JsonParseError"),a=i("JsonParseAfterRedirectError"),c=i("Api404Error"),l=i("Api404AfterRedirectError"),u=i("FetchNetworkError");const d=new function(e,t){let n=e,i=e,o={"X-WP-Nonce":t},a={credentials:"same-origin",headers:o},c={method:"post",credentials:"same-origin",headers:Object.assign({},o,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",r=n.length?n.split("&"):[];return r.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+r.join("&")};const u={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){i=e},setApiNonce(e){o={"X-WP-Nonce":e},a={credentials:"same-origin",headers:o},c={method:"post",credentials:"same-origin",headers:Object.assign({},o,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t)=>{const s={registration_nonce:e,no_iframe:!0};return(0,r.jetpackConfigHas)("consumer_slug")&&(s.plugin_slug=(0,r.jetpackConfigGet)("consumer_slug")),null!==t&&(s.redirect_uri=t),h(`${n}jetpack/v4/connection/register`,c,{body:JSON.stringify(s)}).then(p).then(m)},fetchAuthorizationUrl:e=>d((0,s.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),a).then(p).then(m),fetchSiteConnectionData:()=>d(`${n}jetpack/v4/connection/data`,a).then(m),fetchSiteConnectionStatus:()=>d(`${n}jetpack/v4/connection`,a).then(m),fetchSiteConnectionTest:()=>d(`${n}jetpack/v4/connection/test`,a).then(p).then(m),fetchUserConnectionData:()=>d(`${n}jetpack/v4/connection/data`,a).then(m),fetchUserTrackingSettings:()=>d(`${n}jetpack/v4/tracking/settings`,a).then(p).then(m),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),disconnectSite:()=>h(`${n}jetpack/v4/connection`,c,{body:JSON.stringify({isActive:!1})}).then(p).then(m),fetchConnectUrl:()=>d(`${n}jetpack/v4/connection/url`,a).then(p).then(m),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,c,{body:JSON.stringify({linked:!1})}).then(p).then(m),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,c).then(p).then(m),fetchConnectedPlugins:()=>d(`${n}jetpack/v4/connection/plugins`,a).then(p).then(m),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,c).then(p).then(m),fetchModules:()=>d(`${n}jetpack/v4/module/all`,a).then(p).then(m),fetchModule:e=>d(`${n}jetpack/v4/module/${e}`,a).then(p).then(m),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!0})}).then(p).then(m),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,c,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,c,{body:JSON.stringify(t)}).then(p).then(m),updateSettings:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),getProtectCount:()=>d(`${n}jetpack/v4/module/protect/data`,a).then(p).then(m),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,c,{body:JSON.stringify({reset:!0})}).then(p).then(m),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(p).then(m),getVaultPressData:()=>d(`${n}jetpack/v4/module/vaultpress/data`,a).then(p).then(m),installPlugin:(e,t)=>{const r={slug:e,status:"active"};return t&&(r.source=t),h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify(r)}).then(p).then(m)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,c,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(p).then(m),getAkismetData:()=>d(`${n}jetpack/v4/module/akismet/data`,a).then(p).then(m),checkAkismetKey:()=>d(`${n}jetpack/v4/module/akismet/key/check`,a).then(p).then(m),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,c,{body:JSON.stringify({api_key:e})}).then(p).then(m),fetchStatsData:e=>d(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),a).then(p).then(m).then(f),getPluginUpdates:()=>d(`${n}jetpack/v4/updates/plugins`,a).then(p).then(m),getPlans:()=>d(`${n}jetpack/v4/plans`,a).then(p).then(m),fetchSettings:()=>d(`${n}jetpack/v4/settings`,a).then(p).then(m),updateSetting:e=>h(`${n}jetpack/v4/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchSiteData:()=>d(`${n}jetpack/v4/site`,a).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>d(`${n}jetpack/v4/site/features`,a).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>d(`${n}jetpack/v4/site/products`,a).then(p).then(m),fetchSitePurchases:()=>d(`${n}jetpack/v4/site/purchases`,a).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>d(`${n}jetpack/v4/site/benefits`,a).then(p).then(m).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>d(`${n}jetpack/v4/site/discount`,a).then(p).then(m).then((e=>e.data)),fetchSetupQuestionnaire:()=>d(`${n}jetpack/v4/setup/questionnaire`,a).then(p).then(m),fetchRecommendationsData:()=>d(`${n}jetpack/v4/recommendations/data`,a).then(p).then(m),fetchRecommendationsProductSuggestions:()=>d(`${n}jetpack/v4/recommendations/product-suggestions`,a).then(p).then(m),fetchRecommendationsUpsell:()=>d(`${n}jetpack/v4/recommendations/upsell`,a).then(p).then(m),fetchRecommendationsConditional:()=>d(`${n}jetpack/v4/recommendations/conditional`,a).then(p).then(m),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,c,{body:JSON.stringify({data:e})}).then(p),fetchProducts:()=>d(`${n}jetpack/v4/products`,a).then(p).then(m),fetchRewindStatus:()=>d(`${n}jetpack/v4/rewind`,a).then(p).then(m).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>d(`${n}jetpack/v4/scan`,a).then(p).then(m).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,c,{body:JSON.stringify({dismissed:!0})}).then(p).then(m),fetchPluginsData:()=>d(`${n}jetpack/v4/plugins`,a).then(p).then(m),fetchIntroOffers:()=>d(`${n}jetpack/v4/intro-offers`,a).then(p).then(m),fetchVerifySiteGoogleStatus:e=>d(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,a).then(p).then(m),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,c,{body:JSON.stringify({keyring_id:e})}).then(p).then(m),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,c,{body:JSON.stringify(e)}).then(p).then(m),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,c,{body:JSON.stringify(e)}).then(p).then(m),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,c,{body:JSON.stringify(e)}).then(p).then(m),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,c,{body:JSON.stringify({license:e})}).then(p).then(m),getUserLicensesCounts:()=>d(`${n}jetpack/v4/licensing/user/counts`,a).then(p).then(m),getUserLicenses:()=>d(`${n}jetpack/v4/licensing/user/licenses`,a).then(p).then(m),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,c,{body:JSON.stringify({last_detached_count:e})}).then(p).then(m),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,c,{body:JSON.stringify({step:e})}).then(p),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,c).then(p),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,c,{body:JSON.stringify({redirect_uri:e})}).then(p).then(m),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,c).then(p),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,c,{body:JSON.stringify({licenses:e})}).then(p).then(m),fetchSearchPlanInfo:()=>d(`${i}jetpack/v4/search/plan`,a).then(p).then(m),fetchSearchSettings:()=>d(`${i}jetpack/v4/search/settings`,a).then(p).then(m),updateSearchSettings:e=>h(`${i}jetpack/v4/search/settings`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchSearchStats:()=>d(`${i}jetpack/v4/search/stats`,a).then(p).then(m),fetchWafSettings:()=>d(`${n}jetpack/v4/waf`,a).then(p).then(m),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,c,{body:JSON.stringify(e)}).then(p).then(m),fetchWordAdsSettings:()=>d(`${n}jetpack/v4/wordads/settings`,a).then(p).then(m),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,c,{body:JSON.stringify(e)}),fetchSearchPricing:()=>d(`${i}jetpack/v4/search/pricing`,a).then(p).then(m),fetchMigrationStatus:()=>d(`${n}jetpack/v4/migration/status`,a).then(p).then(m)};function d(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(g)}function f(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,u)};function p(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new c})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function m(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new a(n):new o}function g(){throw new u}t.ZP=d},8868:function(e,t,n){"use strict";var r=n(2674),s=n.n(r),i=n(5736),o=n(5235),a=n.n(o),c=n(9196),l=n.n(c);const __=i.__;t.Z=e=>{let{logoColor:t="#069e08",showText:n=!0,className:r,height:i=32,...o}=e;const c=n?"0 0 118 32":"0 0 32 32";return l().createElement("svg",s()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:c,className:a()("jetpack-logo",r),"aria-labelledby":"jetpack-logo-title",height:i},o),l().createElement("desc",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-idc")),l().createElement("path",{fill:t,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),n&&l().createElement(l().Fragment,null,l().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),l().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),l().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),l().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),l().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),l().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),l().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},5033:function(e,t,n){"use strict";var r=n(5162),s=n.n(r),i=n(9196),o=n.n(i);n(1683);const a=e=>{const t=e.className+" jp-components-spinner",n={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},r={borderTopColor:e.color,borderRightColor:e.color};return o().createElement("div",{className:t},o().createElement("div",{className:"jp-components-spinner__outer",style:n},o().createElement("div",{className:"jp-components-spinner__inner",style:r})))};a.propTypes={color:s().string,className:s().string,size:s().number},a.defaultProps={color:"#FFFFFF",className:"",size:20},t.Z=a},6895:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};let r;if("undefined"!=typeof window&&(r=window.Initial_State?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,n.url=encodeURIComponent(e)}else n.source=encodeURIComponent(e);Object.keys(t).map((e=>{n[e]=encodeURIComponent(t[e])})),!Object.keys(n).includes("site")&&"undefined"!=typeof jetpack_redirects&&jetpack_redirects.hasOwnProperty("currentSiteRawUrl")&&(n.site=jetpack_redirects.currentSiteRawUrl),r&&(n.calypso_env=r);return"https://jetpack.com/redirect/?"+Object.keys(n).map((e=>e+"="+n[e])).join("&")}n.d(t,{Z:function(){return r}})},1132:function(e,t,n){let r={};try{r=n(8510)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),r={missingConfig:!0}}const s=e=>r.hasOwnProperty(e);e.exports={jetpackConfigHas:s,jetpackConfigGet:e=>{if(!s(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return r[e]}}},9477:function(e,t,n){"use strict";var r=n(6895),s=n(5033),i=n(5609),o=n(9818),a=n(9307),c=n(5736),l=n(5162),u=n.n(l),d=n(9196),p=n.n(d),m=n(2678),h=n(7144),g=n(2115),f=n(6637);const __=c.__,y=e=>{const{isStartingFresh:t,startFreshCallback:n,customContent:l,hasError:u}=e,d=(0,g.Z)(e.wpcomHomeUrl),h=(0,g.Z)(e.currentUrl),y=(0,o.useSelect)((e=>e(m.t).getIsActionInProgress()),[]),k=l.startFreshButtonLabel||__("Create a fresh connection","jetpack-idc");return p().createElement("div",{className:"jp-idc__idc-screen__card-action-base"+(u?" jp-idc__idc-screen__card-action-error":"")},p().createElement("div",{className:"jp-idc__idc-screen__card-action-top"},p().createElement("h4",null,l.startFreshCardTitle?(0,a.createInterpolateElement)(l.startFreshCardTitle,{em:p().createElement("em",null)}):__("Treat each site as independent sites","jetpack-idc")),p().createElement("p",null,(0,a.createInterpolateElement)(l.startFreshCardBodyText||(0,c.sprintf)(/* translators: %1$s: The current site domain name. %2$s: The original site domain name. */ +__("%1$s settings, stats, and subscribers will start fresh. %2$s will keep its data as is.","jetpack-idc"),h,d),{hostname:p().createElement("strong",null),em:p().createElement("em",null),strong:p().createElement("strong",null)}))),p().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},d),p().createElement(i.Dashicon,{icon:"minus",className:"jp-idc__idc-screen__card-action-separator"}),p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},h),p().createElement(i.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:n,disabled:y},t?p().createElement(s.Z,null):k),u&&(v=l.supportURL,p().createElement(f.Z,null,(0,a.createInterpolateElement)(__("Could not create the connection. Retry or find out more here.","jetpack-idc"),{a:p().createElement("a",{href:v||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var v};y.propTypes={wpcomHomeUrl:u().string.isRequired,currentUrl:u().string.isRequired,isStartingFresh:u().bool.isRequired,startFreshCallback:u().func.isRequired,customContent:u().shape(h.Z),hasError:u().bool.isRequired},y.defaultProps={isStartingFresh:!1,startFreshCallback:()=>{},customContent:{},hasError:!1},t.Z=y},6596:function(e,t,n){"use strict";var r=n(6895),s=n(5033),i=n(5609),o=n(9818),a=n(9307),c=n(5736),l=n(5162),u=n.n(l),d=n(9196),p=n.n(d),m=n(2678),h=n(7144),g=n(2115),f=n(6637);const __=c.__,y=e=>{const t=(0,g.Z)(e.wpcomHomeUrl),n=(0,g.Z)(e.currentUrl),l=(0,o.useSelect)((e=>e(m.t).getIsActionInProgress()),[]),{isMigrating:u,migrateCallback:d,customContent:h,hasError:y}=e,k=h.migrateButtonLabel||__("Move your settings","jetpack-idc");return p().createElement("div",{className:"jp-idc__idc-screen__card-action-base"+(y?" jp-idc__idc-screen__card-action-error":"")},p().createElement("div",{className:"jp-idc__idc-screen__card-action-top"},p().createElement("h4",null,h.migrateCardTitle?(0,a.createInterpolateElement)(h.migrateCardTitle,{em:p().createElement("em",null)}):__("Move Jetpack data","jetpack-idc")),p().createElement("p",null,(0,a.createInterpolateElement)(h.migrateCardBodyText||(0,c.sprintf)(/* translators: %1$s: The current site domain name. %2$s: The original site domain name. */ +__("Move all your settings, stats and subscribers to your other URL, %1$s. %2$s will be disconnected from Jetpack.","jetpack-idc"),n,t),{hostname:p().createElement("strong",null),em:p().createElement("em",null),strong:p().createElement("strong",null)}))),p().createElement("div",{className:"jp-idc__idc-screen__card-action-bottom"},p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},t),p().createElement(i.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-action-separator"}),p().createElement("div",{className:"jp-idc__idc-screen__card-action-sitename"},n),p().createElement(i.Button,{className:"jp-idc__idc-screen__card-action-button",label:k,onClick:d,disabled:l},u?p().createElement(s.Z,null):k),y&&(v=h.supportURL,p().createElement(f.Z,null,(0,a.createInterpolateElement)(__("Could not move your settings. Retry or find out more here.","jetpack-idc"),{a:p().createElement("a",{href:v||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})})))));var v};y.propTypes={wpcomHomeUrl:u().string.isRequired,currentUrl:u().string.isRequired,isMigrating:u().bool.isRequired,migrateCallback:u().func.isRequired,customContent:u().shape(h.Z),hasError:u().bool.isRequired},y.defaultProps={isMigrating:!1,migrateCallback:()=>{},customContent:{},hasError:!1},t.Z=y},5489:function(e,t,n){"use strict";var r=n(9196),s=n.n(r);t.Z=()=>s().createElement("svg",{className:"error-gridicon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24},s().createElement("rect",{x:"0",fill:"none",width:"24",height:"24"}),s().createElement("g",null,s().createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))},6637:function(e,t,n){"use strict";var r=n(9196),s=n.n(r),i=n(5489);n(6611);t.Z=e=>{const{children:t}=e;return s().createElement("div",{className:"jp-idc__error-message"},s().createElement(i.Z,null),s().createElement("span",null,t))}},7381:function(e,t,n){"use strict";var r=n(4743),s=n(9818),i=n(5162),o=n.n(i),a=n(9196),c=n.n(a),l=n(970),u=n(1272),d=n(3105),p=n(2678),m=n(7144),h=n(6521),g=n(567);const f=e=>{const{logo:t,customContent:n,wpcomHomeUrl:i,currentUrl:o,apiNonce:m,apiRoot:f,redirectUri:y,tracksUserData:k,tracksEventData:v,isAdmin:C,possibleDynamicSiteUrlDetected:_}=e,[b,E]=(0,a.useState)(!1),w=(0,s.useSelect)((e=>e(p.t).getErrorType()),[]),{isMigrating:j,migrateCallback:S}=(0,l.Z)((0,a.useCallback)((()=>{E(!0)}),[E])),{isStartingFresh:F,startFreshCallback:I}=(0,d.Z)(y),{isFinishingMigration:U,finishMigrationCallback:R}=(0,u.Z)();return(0,a.useEffect)((()=>{r.ZP.setApiRoot(f),r.ZP.setApiNonce(m),(0,h.M)(v,k),v&&(v.hasOwnProperty("isAdmin")&&v.isAdmin?(0,h.Z)("notice_view"):(0,h.Z)("non_admin_notice_view",{page:!!v.hasOwnProperty("currentScreen")&&v.currentScreen}))}),[f,m,k,v]),c().createElement(g.Z,{logo:t,customContent:n,wpcomHomeUrl:i,currentUrl:o,redirectUri:y,isMigrating:j,migrateCallback:S,isMigrated:b,finishMigrationCallback:R,isFinishingMigration:U,isStartingFresh:F,startFreshCallback:I,isAdmin:C,hasStaySafeError:"safe-mode"===w,hasFreshError:"start-fresh"===w,hasMigrateError:"migrate"===w,possibleDynamicSiteUrlDetected:_})};f.propTypes={logo:o().object,customContent:o().shape(m.Z),wpcomHomeUrl:o().string.isRequired,currentUrl:o().string.isRequired,redirectUri:o().string.isRequired,apiRoot:o().string.isRequired,apiNonce:o().string.isRequired,tracksUserData:o().object,tracksEventData:o().object,isAdmin:o().bool.isRequired,possibleDynamicSiteUrlDetected:o().bool},f.defaultProps={customContent:{}},t.Z=f},5533:function(e,t,n){"use strict";var r=n(6895),s=n(9307),i=n(5736),o=n(5162),a=n.n(o),c=n(9196),l=n.n(c),u=n(7144),d=n(9477),p=n(6596),m=n(2533);const __=i.__,h=e=>{const{wpcomHomeUrl:t,currentUrl:n,isMigrating:i,migrateCallback:o,isStartingFresh:a,startFreshCallback:c,customContent:u,hasMigrateError:h,hasFreshError:g,hasStaySafeError:f,possibleDynamicSiteUrlDetected:y}=e;return l().createElement(l().Fragment,null,l().createElement("h2",null,u.mainTitle?(0,s.createInterpolateElement)(u.mainTitle,{em:l().createElement("em",null)}):__("Safe Mode has been activated","jetpack-idc")),l().createElement("p",null,(0,s.createInterpolateElement)(u.mainBodyText||__("Your site is in Safe Mode because you have 2 Jetpack-powered sites that appear to be duplicates. 2 sites that are telling Jetpack they’re the same site. Learn more about safe mode.","jetpack-idc"),{safeModeLink:l().createElement("a",{href:u.supportURL||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),y&&l().createElement("p",null,(0,s.createInterpolateElement)(u.dynamicSiteUrlText||__("Notice: It appears that your 'wp-config.php' file might be using dynamic site URL values. Dynamic site URLs could cause Jetpack to enter Safe Mode. Learn how to set a static site URL.","jetpack-idc"),{dynamicSiteUrlSupportLink:l().createElement("a",{href:u.dynamicSiteUrlSupportLink||(0,r.Z)("jetpack-idcscreen-dynamic-site-urls"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),l().createElement("h3",null,__("Please select an option","jetpack-idc")),l().createElement("div",{className:"jp-idc__idc-screen__cards"+(h||g?" jp-idc__idc-screen__cards-error":"")},l().createElement(p.Z,{wpcomHomeUrl:t,currentUrl:n,isMigrating:i,migrateCallback:o,customContent:u,hasError:h}),l().createElement("div",{className:"jp-idc__idc-screen__cards-separator"},"or"),l().createElement(d.Z,{wpcomHomeUrl:t,currentUrl:n,isStartingFresh:a,startFreshCallback:c,customContent:u,hasError:g})),l().createElement(m.Z,{hasError:f,customContent:u}))};h.propTypes={wpcomHomeUrl:a().string.isRequired,currentUrl:a().string.isRequired,isMigrating:a().bool.isRequired,migrateCallback:a().func,isStartingFresh:a().bool.isRequired,startFreshCallback:a().func,customContent:a().shape(u.Z),hasMigrateError:a().bool.isRequired,hasFreshError:a().bool.isRequired,hasStaySafeError:a().bool.isRequired,possibleDynamicSiteUrlDetected:a().bool},h.defaultProps={isMigrating:!1,isStartingFresh:!1,customContent:{},hasMigrateError:!1,hasFreshError:!1,hasStaySafeError:!1,possibleDynamicSiteUrlDetected:!1},t.Z=h},1052:function(e,t,n){"use strict";var r=n(5033),s=n(5609),i=n(9307),o=n(5736),a=n(5162),c=n.n(a),l=n(9196),u=n.n(l),d=n(7144),p=n(2115);const __=o.__,m=e=>{const{finishCallback:t,isFinishing:n,customContent:a}=e,c=(0,p.Z)(e.wpcomHomeUrl),l=(0,p.Z)(e.currentUrl),d=__("Got it, thanks","jetpack-idc");return u().createElement(u().Fragment,null,u().createElement("h2",null,a.migratedTitle?(0,i.createInterpolateElement)(a.migratedTitle,{em:u().createElement("em",null)}):__("Your Jetpack settings have migrated successfully","jetpack-idc")),u().createElement("p",null,(0,i.createInterpolateElement)(a.migratedBodyText||(0,o.sprintf)(/* translators: %1$s: The current site domain name. */ +__("Safe Mode has been switched off for %1$s website and Jetpack is fully functional.","jetpack-idc"),l),{hostname:u().createElement("strong",null),em:u().createElement("em",null),strong:u().createElement("strong",null)})),u().createElement("div",{className:"jp-idc__idc-screen__card-migrated"},u().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},c),u().createElement(s.Dashicon,{icon:"arrow-down-alt",className:"jp-idc__idc-screen__card-migrated-separator"}),u().createElement(s.Dashicon,{icon:"arrow-right-alt",className:"jp-idc__idc-screen__card-migrated-separator-wide"}),u().createElement("div",{className:"jp-idc__idc-screen__card-migrated-hostname"},l)),u().createElement(s.Button,{className:"jp-idc__idc-screen__card-action-button jp-idc__idc-screen__card-action-button-migrated",onClick:t,label:d},n?u().createElement(r.Z,null):d))};m.propTypes={wpcomHomeUrl:c().string.isRequired,currentUrl:c().string.isRequired,finishCallback:c().func,isFinishing:c().bool.isRequired,customContent:c().shape(d.Z)},m.defaultProps={finishCallback:()=>{},isFinishing:!1,customContent:{}},t.Z=m},1064:function(e,t,n){"use strict";var r=n(6895),s=n(9307),i=n(5736),o=n(5162),a=n.n(o),c=n(9196),l=n.n(c),u=n(7144);const __=i.__,d=e=>{const{customContent:t}=e;return l().createElement(l().Fragment,null,l().createElement("h2",null,t.nonAdminTitle?(0,s.createInterpolateElement)(t.nonAdminTitle,{em:l().createElement("em",null)}):__("Safe Mode has been activated","jetpack-idc")),l().createElement("p",null,(0,s.createInterpolateElement)(t.nonAdminBodyText||__("This site is in Safe Mode because there are 2 Jetpack-powered sites that appear to be duplicates. 2 sites that are telling Jetpack they’re the same site. Learn more about safe mode.","jetpack-idc"),{safeModeLink:l().createElement("a",{href:t.supportURL||(0,r.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"}),em:l().createElement("em",null),strong:l().createElement("strong",null)})),t.nonAdminBodyText?"":l().createElement("p",null,__("An administrator of this site can take Jetpack out of Safe Mode.","jetpack-idc")))};d.propTypes={customContent:a().shape(u.Z)},d.defaultProps={customContent:{}},t.Z=d},567:function(e,t,n){"use strict";var r=n(8868),s=n(9307),i=n(5736),o=n(5162),a=n.n(o),c=n(9196),l=n.n(c),u=n(7144),d=n(5533),p=n(1052),m=n(1064);n(7724);const __=i.__,h=e=>{const{logo:t,customContent:n,wpcomHomeUrl:r,currentUrl:i,redirectUri:o,isMigrating:a,migrateCallback:c,isMigrated:u,finishMigrationCallback:h,isFinishingMigration:g,isStartingFresh:f,startFreshCallback:y,isAdmin:k,hasMigrateError:v,hasFreshError:C,hasStaySafeError:_,possibleDynamicSiteUrlDetected:b}=e,E=k?"":l().createElement(m.Z,{customContent:n});let w="";return k&&(w=u?l().createElement(p.Z,{wpcomHomeUrl:r,currentUrl:i,finishCallback:h,isFinishing:g,customContent:n}):l().createElement(d.Z,{wpcomHomeUrl:r,currentUrl:i,redirectUri:o,customContent:n,isMigrating:a,migrateCallback:c,isStartingFresh:f,startFreshCallback:y,hasMigrateError:v,hasFreshError:C,hasStaySafeError:_,possibleDynamicSiteUrlDetected:b})),l().createElement("div",{className:"jp-idc__idc-screen"+(u?" jp-idc__idc-screen__success":"")},l().createElement("div",{className:"jp-idc__idc-screen__header"},l().createElement("div",{className:"jp-idc__idc-screen__logo"},((e,t)=>"string"==typeof e||e instanceof String?l().createElement("img",{src:e,alt:t,className:"jp-idc__idc-screen__logo-image"}):e)(t,n.logoAlt||"")),l().createElement("div",{className:"jp-idc__idc-screen__logo-label"},n.headerText?(0,s.createInterpolateElement)(n.headerText,{em:l().createElement("em",null),strong:l().createElement("strong",null)}):__("Safe Mode","jetpack-idc"))),E,w)};h.propTypes={logo:a().object.isRequired,customContent:a().shape(u.Z),wpcomHomeUrl:a().string.isRequired,currentUrl:a().string.isRequired,redirectUri:a().string.isRequired,isMigrating:a().bool.isRequired,migrateCallback:a().func,isMigrated:a().bool.isRequired,finishMigrationCallback:a().func,isFinishingMigration:a().bool.isRequired,isStartingFresh:a().bool.isRequired,startFreshCallback:a().func,isAdmin:a().bool.isRequired,hasMigrateError:a().bool.isRequired,hasFreshError:a().bool.isRequired,hasStaySafeError:a().bool.isRequired,possibleDynamicSiteUrlDetected:a().bool},h.defaultProps={logo:l().createElement(r.Z,{height:24}),isMigrated:!1,isFinishingMigration:!1,isMigrating:!1,isStartingFresh:!1,customContent:{},hasMigrateError:!1,hasFreshError:!1,hasStaySafeError:!1,possibleDynamicSiteUrlDetected:!1},t.Z=h},2533:function(e,t,n){"use strict";var r=n(4743),s=n(5033),i=n(6895),o=n(5609),a=n(4333),c=n(9818),l=n(9307),u=n(5736),d=n(6483),p=n(5162),m=n.n(p),h=n(9196),g=n.n(h),f=n(2678),y=n(7144),k=n(6521),v=n(6637);n(310);const __=u.__,C=e=>{const{isActionInProgress:t,setIsActionInProgress:n,setErrorType:a,clearErrorType:c,hasError:u,customContent:p}=e,[m,f]=(0,h.useState)(!1),y=(0,h.useCallback)((()=>{t||(f(!0),n(!0),c(),(0,k.Z)("confirm_safe_mode"),r.ZP.confirmIDCSafeMode().then((()=>{window.location.href=(0,d.removeQueryArgs)(window.location.href,"jetpack_idc_clear_confirmation","_wpnonce")})).catch((e=>{throw n(!1),f(!1),a("safe-mode"),e})))}),[t,n,a,c]);return g().createElement("div",{className:"jp-idc__safe-mode"},m?g().createElement("div",{className:"jp-idc__safe-mode__staying-safe"},g().createElement(s.Z,{color:"black"}),g().createElement("span",null,__("Finishing setting up Safe mode…","jetpack-idc"))):(_=y,b=t,(0,l.createInterpolateElement)(__("Or decide later and stay in ","jetpack-idc"),{button:g().createElement(o.Button,{label:__("Safe mode","jetpack-idc"),variant:"link",onClick:_,disabled:b})})),u&&(C=p.supportURL,g().createElement(v.Z,null,(0,l.createInterpolateElement)(__("Could not stay in safe mode. Retry or find out more here.","jetpack-idc"),{a:g().createElement("a",{href:C||(0,i.Z)("jetpack-support-safe-mode"),rel:"noopener noreferrer",target:"_blank"})}))));var C,_,b};C.propTypes={isActionInProgress:m().bool,setIsActionInProgress:m().func.isRequired,setErrorType:m().func.isRequired,clearErrorType:m().func.isRequired,hasError:m().bool.isRequired,customContent:m().shape(y.Z)},C.defaultProps={hasError:!1},t.Z=(0,a.compose)([(0,c.withSelect)((e=>({isActionInProgress:e(f.t).getIsActionInProgress()}))),(0,c.withDispatch)((e=>({setIsActionInProgress:e(f.t).setIsActionInProgress,setErrorType:e(f.t).setErrorType,clearErrorType:e(f.t).clearErrorType})))])(C)},1272:function(e,t,n){"use strict";var r=n(9196);t.Z=()=>{const[e,t]=(0,r.useState)(!1),n=(0,r.useCallback)((()=>{e||(t(!0),window.location.reload())}),[e,t]);return{isFinishingMigration:e,finishMigrationCallback:n}}},970:function(e,t,n){"use strict";var r=n(4743),s=n(9818),i=n(9196),o=n(2678),a=n(6521);t.Z=e=>{const[t,n]=(0,i.useState)(!1),c=(0,s.useSelect)((e=>e(o.t).getIsActionInProgress()),[]),{setIsActionInProgress:l,setErrorType:u,clearErrorType:d}=(0,s.useDispatch)(o.t);return{isMigrating:t,migrateCallback:(0,i.useCallback)((()=>{c||((0,a.Z)("migrate"),l(!0),n(!0),d(),r.ZP.migrateIDC().then((()=>{n(!1),e&&"[object Function]"==={}.toString.call(e)&&e()})).catch((e=>{throw l(!1),n(!1),u("migrate"),e})))}),[n,e,c,l,u,d])}}},3105:function(e,t,n){"use strict";var r=n(4743),s=n(9818),i=n(9196),o=n(2678),a=n(6521);t.Z=e=>{const[t,n]=(0,i.useState)(!1),c=(0,s.useSelect)((e=>e(o.t).getIsActionInProgress()),[]),{setIsActionInProgress:l,setErrorType:u,clearErrorType:d}=(0,s.useDispatch)(o.t);return{isStartingFresh:t,startFreshCallback:(0,i.useCallback)((()=>{c||((0,a.Z)("start_fresh"),l(!0),n(!0),d(),r.ZP.startIDCFresh(e).then((e=>{window.location.href=e+"&from=idc-notice"})).catch((e=>{throw l(!1),n(!1),u("start-fresh"),e})))}),[n,c,l,e,u,d])}}},136:function(e,t,n){"use strict";n.d(t,{ZP:function(){return o},hG:function(){return r},jk:function(){return i},vC:function(){return s}});const r="SET_IS_ACTION_IN_PROGRESS",s="SET_ERROR_TYPE",i="CLEAR_ERROR_TYPE",o={setIsActionInProgress:e=>({type:r,isInProgress:e}),setErrorType:e=>({type:s,errorType:e}),clearErrorType:()=>({type:i})}},7773:function(e,t,n){"use strict";var r=n(9818),s=n(136);const i=(0,r.combineReducers)({isActionInProgress:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===s.hG?t.isInProgress:e},errorType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.vC:return t.errorType;case s.jk:return null}return e}});t.Z=i},9416:function(e,t){"use strict";t.Z={getIsActionInProgress:e=>e.isActionInProgress||!1,getErrorType:e=>e.errorType||null}},5943:function(e,t,n){"use strict";var r=n(17),s=n.n(r),i=n(9818);class o{static mayBeInit(e,t){null===o.store&&(o.store=(0,i.createReduxStore)(e,t),(0,i.register)(o.store))}}s()(o,"store",null),t.Z=o},2678:function(e,t,n){"use strict";n.d(t,{t:function(){return a}});var r=n(136),s=n(7773),i=n(9416),o=n(5943);const a="jetpack-idc";o.Z.mayBeInit(a,{reducer:s.Z,actions:r.ZP,selectors:i.Z})},7144:function(e,t,n){"use strict";var r=n(5162),s=n.n(r);t.Z={headerText:s().string,logoAlt:s().string,mainTitle:s().string,mainBodyText:s().string,migratedTitle:s().string,migratedBodyText:s().string,migrateCardTitle:s().string,migrateButtonLabel:s().string,migrateCardBodyText:s().string,startFreshCardTitle:s().string,startFreshCardBodyText:s().string,startFreshButtonLabel:s().string,nonAdminTitle:s().string,nonAdminBodyText:s().string,supportURL:s().string}},2115:function(e,t){"use strict";t.Z=e=>/^https?:\/\//.test(e)?new URL(e).hostname:e.replace(/\/$/,"")},6521:function(e,t,n){"use strict";n.d(t,{M:function(){return s},Z:function(){return i}});var r=n(6975);function s(e,t){t&&t.hasOwnProperty("userid")&&t.hasOwnProperty("username")&&r.Z.initialize(t.userid,t.username),e&&(e.hasOwnProperty("blogID")&&r.Z.assignSuperProps({blog_id:e.blogID}),e.hasOwnProperty("platform")&&r.Z.assignSuperProps({platform:e.platform})),r.Z.setMcAnalyticsEnabled(!0)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0!==t&&"object"==typeof t||(t={}),e&&e.length&&void 0!==r.Z&&r.Z.tracks&&r.Z.mc&&(e=0!==(e=e.replace(/-/g,"_")).indexOf("jetpack_idc_")?"jetpack_idc_"+e:e,r.Z.tracks.recordEvent(e,t),e=(e=e.replace("jetpack_idc_","")).replace(/_/g,"-"),r.Z.mc.bumpStat("jetpack-idc",e))}},8510:function(e){"use strict";if(void 0==={consumer_slug:"identity_crisis"}){var t=new Error('Cannot find module \'{"consumer_slug":"identity_crisis"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"identity_crisis"}},9196:function(e){"use strict";e.exports=window.React},5609:function(e){"use strict";e.exports=window.wp.components},4333:function(e){"use strict";e.exports=window.wp.compose},9818:function(e){"use strict";e.exports=window.wp.data},9307:function(e){"use strict";e.exports=window.wp.element},5736:function(e){"use strict";e.exports=window.wp.i18n},6483:function(e){"use strict";e.exports=window.wp.url},17:function(e,t,n){var r=n(6930);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},2674:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t + ); + if ( WPElement.createRoot ) { + WPElement.createRoot( container ).render( component ); + } else { + WPElement.render( component, container ); + } + } +} + +render(); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/style.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/style.scss new file mode 100644 index 00000000..14f09db9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/_inc/style.scss @@ -0,0 +1,9 @@ +#jp-identity-crisis-container .jp-idc__idc-screen { + margin-top: 40px; + margin-bottom: 40px; +} + +#jp-identity-crisis-container.notice { + background: none; + border: none; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php new file mode 100644 index 00000000..46ab3c6a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php @@ -0,0 +1,1289 @@ +disconnect_site( true ); + } else { + $connection->disconnect_site( false ); + } + + // Clear IDC options. + self::clear_all_idc_options(); + } + + /** + * Filter to prevent site from disconnecting from WPCOM if it's in an IDC. + * + * @see jetpack_connection_disconnect_site_wpcom filter. + * + * @return bool False if the site is in IDC, true otherwise. + */ + public static function jetpack_connection_disconnect_site_wpcom_filter() { + return ! self::validate_sync_error_idc_option(); + } + + /** + * Gets the link to the support document used to explain Safe Mode to users. + * + * @return string + */ + public static function get_safe_mod_doc_url() { + return Redirect::get_url( 'jetpack-support-safe-mode' ); + } + + /** + * This method loops through the array of processed items from sync and checks if one of the items was the + * home_url or site_url callable. If so, then we delete the jetpack_migrate_for_idc option. + * + * @param array $processed_items Array of processed items that were synced to WordPress.com. + */ + public function maybe_clear_migrate_option( $processed_items ) { + foreach ( (array) $processed_items as $item ) { + + // First, is this item a jetpack_sync_callable action? If so, then proceed. + $callable_args = ( is_array( $item ) && isset( $item[0], $item[1] ) && 'jetpack_sync_callable' === $item[0] ) + ? $item[1] + : null; + + // Second, if $callable_args is set, check if the callable was home_url or site_url. If so, + // clear the migrate option. + if ( + isset( $callable_args, $callable_args[0] ) + && ( 'home_url' === $callable_args[0] || 'site_url' === $callable_args[1] ) + ) { + Jetpack_Options::delete_option( 'migrate_for_idc' ); + break; + } + } + } + + /** + * WordPress init. + * + * @return void + */ + public function wordpress_init() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + if ( + isset( $_GET['jetpack_idc_clear_confirmation'], $_GET['_wpnonce'] ) && + wp_verify_nonce( $_GET['_wpnonce'], 'jetpack_idc_clear_confirmation' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WordPress core doesn't unslash or verify nonces either. + ) { + Jetpack_Options::delete_option( 'safe_mode_confirmed' ); + self::$is_safe_mode_confirmed = false; + } else { + self::$is_safe_mode_confirmed = (bool) Jetpack_Options::get_option( 'safe_mode_confirmed' ); + } + } + + // 121 Priority so that it's the most inner Jetpack item in the admin bar. + add_action( 'admin_bar_menu', array( $this, 'display_admin_bar_button' ), 121 ); + + UI::init(); + } + + /** + * Add the idc query arguments to the url. + * + * @param string $url The remote request url. + */ + public function add_idc_query_args_to_url( $url ) { + $status = new Status(); + if ( ! is_string( $url ) + || $status->is_offline_mode() + || self::validate_sync_error_idc_option() ) { + return $url; + } + + $query_args = array( + 'home' => Urls::home_url(), + 'siteurl' => Urls::site_url(), + ); + + if ( self::should_handle_idc() ) { + $query_args['idc'] = true; + } + + if ( \Jetpack_Options::get_option( 'migrate_for_idc', false ) ) { + $query_args['migrate_for_idc'] = true; + } + + return add_query_arg( $query_args, $url ); + } + + /** + * Non-admins current screen check. + * + * @param object $current_screen Current screen. + * + * @return null + * @deprecated 0.5.0 Use `@automattic/jetpack-idc` instead. + */ + public function non_admins_current_screen_check( $current_screen ) { + _deprecated_function( __METHOD__, '0.5.0' ); + + self::$current_screen = $current_screen; + if ( isset( $current_screen->id ) && 'toplevel_page_jetpack' === $current_screen->id ) { + return null; + } + + return null; + } + + /** + * Renders the admin bar button. + * + * @return void + */ + public function display_admin_bar_button() { + global $wp_admin_bar; + + $href = is_admin() + ? add_query_arg( 'jetpack_idc_clear_confirmation', '1' ) + : add_query_arg( 'jetpack_idc_clear_confirmation', '1', admin_url() ); + + $href = wp_nonce_url( $href, 'jetpack_idc_clear_confirmation' ); + + $consumer_data = UI::get_consumer_data(); + $label = isset( $consumer_data['customContent']['adminBarSafeModeLabel'] ) + ? esc_html( $consumer_data['customContent']['adminBarSafeModeLabel'] ) + : esc_html__( 'Jetpack Safe Mode', 'jetpack-idc' ); + + $title = sprintf( + '', + '', + $label + ); + + $menu = array( + 'id' => 'jetpack-idc', + 'title' => $title, + 'href' => esc_url( $href ), + 'parent' => 'top-secondary', + ); + + if ( ! self::$is_safe_mode_confirmed ) { + $menu['meta'] = array( + 'class' => 'hide', + ); + } + + $wp_admin_bar->add_node( $menu ); + } + + /** + * Checks if the site is currently in an identity crisis. + * + * @return array|bool Array of options that are in a crisis, or false if everything is OK. + */ + public static function check_identity_crisis() { + $connection = new Connection_Manager( 'jetpack' ); + + if ( ! $connection->is_connected() || ( new Status() )->is_offline_mode() || ! self::validate_sync_error_idc_option() ) { + return false; + } + + return Jetpack_Options::get_option( 'sync_error_idc' ); + } + + /** + * Checks the HTTP response body for the 'idc_detected' key. If the key exists, + * checks the idc_detected value for a valid idc error. + * + * @param array|WP_Error $http_response The HTTP response. + * + * @return bool Whether the site is in an identity crisis. + */ + public function check_http_response_for_idc_detected( $http_response ) { + if ( ! is_array( $http_response ) ) { + return false; + } + $response_body = json_decode( wp_remote_retrieve_body( $http_response ), true ); + + if ( isset( $response_body['idc_detected'] ) ) { + return $this->check_response_for_idc( $response_body['idc_detected'] ); + } + + if ( isset( $response_body['migrated_for_idc'] ) ) { + Jetpack_Options::delete_option( 'migrate_for_idc' ); + } + + return false; + } + + /** + * Checks the WPCOM response to determine if the site is in an identity crisis. Updates the + * sync_error_idc option if it is. + * + * @param array $response The response data. + * + * @return bool Whether the site is in an identity crisis. + */ + public function check_response_for_idc( $response ) { + if ( ! is_array( $response ) ) { + return false; + } + + if ( is_array( $response ) && isset( $response['error_code'] ) ) { + $error_code = $response['error_code']; + $allowed_idc_error_codes = array( + 'jetpack_url_mismatch', + 'jetpack_home_url_mismatch', + 'jetpack_site_url_mismatch', + ); + + if ( in_array( $error_code, $allowed_idc_error_codes, true ) ) { + \Jetpack_Options::update_option( + 'sync_error_idc', + self::get_sync_error_idc_option( $response ) + ); + } + + return true; + } + + return false; + } + + /** + * Prepare URL for display. + * + * @param string $url URL to display. + * + * @return string + */ + public static function prepare_url_for_display( $url ) { + return untrailingslashit( self::normalize_url_protocol_agnostic( $url ) ); + } + + /** + * Clears all IDC specific options. This method is used on disconnect and reconnect. + * + * @return void + */ + public static function clear_all_idc_options() { + // If the site is currently in IDC, let's also clear the VaultPress connection options. + // We have to check if the site is in IDC, otherwise we'd be clearing the VaultPress + // connection any time the Jetpack connection is cycled. + if ( self::validate_sync_error_idc_option() ) { + delete_option( 'vaultpress' ); + delete_option( 'vaultpress_auto_register' ); + } + + Jetpack_Options::delete_option( + array( + 'sync_error_idc', + 'safe_mode_confirmed', + 'migrate_for_idc', + ) + ); + + delete_transient( 'jetpack_idc_possible_dynamic_site_url_detected' ); + } + + /** + * Checks whether the sync_error_idc option is valid or not, and if not, will do cleanup. + * + * @return bool + * @since-jetpack 5.4.0 Do not call get_sync_error_idc_option() unless site is in IDC + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + public static function validate_sync_error_idc_option() { + $is_valid = false; + + // Is the site opted in and does the stored sync_error_idc option match what we now generate? + $sync_error = Jetpack_Options::get_option( 'sync_error_idc' ); + if ( $sync_error && self::should_handle_idc() ) { + $local_options = self::get_sync_error_idc_option(); + + // Ensure all values are set. + if ( isset( $sync_error['home'] ) && isset( $local_options['home'] ) && isset( $sync_error['siteurl'] ) && isset( $local_options['siteurl'] ) ) { + // If the WP.com expected home and siteurl match local home and siteurl it is not valid IDC. + if ( + isset( $sync_error['wpcom_home'] ) && + isset( $sync_error['wpcom_siteurl'] ) && + $sync_error['wpcom_home'] === $local_options['home'] && + $sync_error['wpcom_siteurl'] === $local_options['siteurl'] + ) { + $is_valid = false; + // Enable migrate_for_idc so that sync actions are accepted. + Jetpack_Options::update_option( 'migrate_for_idc', true ); + } elseif ( $sync_error['home'] === $local_options['home'] && $sync_error['siteurl'] === $local_options['siteurl'] ) { + $is_valid = true; + } + } + } + + /** + * Filters whether the sync_error_idc option is valid. + * + * @param bool $is_valid If the sync_error_idc is valid or not. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + $is_valid = (bool) apply_filters( 'jetpack_sync_error_idc_validation', $is_valid ); + + if ( ! $is_valid && $sync_error ) { + // Since the option exists, and did not validate, delete it. + Jetpack_Options::delete_option( 'sync_error_idc' ); + } + + return $is_valid; + } + + /** + * Normalizes a url by doing three things: + * - Strips protocol + * - Strips www + * - Adds a trailing slash + * + * @param string $url URL to parse. + * + * @return WP_Error|string + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + public static function normalize_url_protocol_agnostic( $url ) { + $parsed_url = wp_parse_url( trailingslashit( esc_url_raw( $url ) ) ); + if ( ! $parsed_url || empty( $parsed_url['host'] ) || empty( $parsed_url['path'] ) ) { + return new WP_Error( + 'cannot_parse_url', + sprintf( + /* translators: %s: URL to parse. */ + esc_html__( 'Cannot parse URL %s', 'jetpack-idc' ), + $url + ) + ); + } + + // Strip www and protocols. + $url = preg_replace( '/^www\./i', '', $parsed_url['host'] . $parsed_url['path'] ); + + return $url; + } + + /** + * Gets the value that is to be saved in the jetpack_sync_error_idc option. + * + * @param array $response HTTP response. + * + * @return array Array of the local urls, wpcom urls, and error code. + * @since 0.2.0 + * @since-jetpack 4.4.0 + * @since-jetpack 5.4.0 Add transient since home/siteurl retrieved directly from DB. + */ + public static function get_sync_error_idc_option( $response = array() ) { + // Since the local options will hit the database directly, store the values + // in a transient to allow for autoloading and caching on subsequent views. + $local_options = get_transient( 'jetpack_idc_local' ); + if ( false === $local_options ) { + $local_options = array( + 'home' => Urls::home_url(), + 'siteurl' => Urls::site_url(), + ); + set_transient( 'jetpack_idc_local', $local_options, MINUTE_IN_SECONDS ); + } + + $options = array_merge( $local_options, $response ); + + $returned_values = array(); + foreach ( $options as $key => $option ) { + if ( 'error_code' === $key ) { + $returned_values[ $key ] = $option; + continue; + } + + $normalized_url = self::normalize_url_protocol_agnostic( $option ); + if ( is_wp_error( $normalized_url ) ) { + continue; + } + + $returned_values[ $key ] = $normalized_url; + } + + return $returned_values; + } + + /** + * Returns the value of the jetpack_sync_idc_optin filter, or constant. + * If set to true, the site will be put into staging mode. + * + * @return bool + * @since 0.2.0 + * @since-jetpack 4.3.2 + * @deprecated 0.2.6 Use should_handle_idc() + * @see Automattic\Jetpack\Identity_Crisis::should_handle_idc + */ + public static function sync_idc_optin() { + _deprecated_function( __METHOD__, '0.2.6', 'Automattic\\Jetpack\\Identity_Crisis::should_handle_idc' ); + return self::should_handle_idc(); + } + + /** + * Returns the value of the jetpack_should_handle_idc filter or constant. + * If set to true, the site will be put into staging mode. + * + * This method uses both the current jetpack_should_handle_idc filter and constant and the + * legacy jetpack_sync_idc_optin filter and constant to determine whether an IDC should be + * handled. + * + * @return bool + * @since 0.2.6 + */ + public static function should_handle_idc() { + if ( Constants::is_defined( 'JETPACK_SHOULD_HANDLE_IDC' ) ) { + $default = Constants::get_constant( 'JETPACK_SHOULD_HANDLE_IDC' ); + } elseif ( Constants::is_defined( 'JETPACK_SYNC_IDC_OPTIN' ) ) { + // Check the legacy constant. This constant should be considered deprecated as of version 0.2.6. + $default = Constants::get_constant( 'JETPACK_SYNC_IDC_OPTIN' ); + } else { + $default = ! Constants::is_defined( 'SUNRISE' ) && ! is_multisite(); + } + + // Add a callback which uses the legacy filter 'jetpack_sync_idc_optin'. + add_filter( 'jetpack_should_handle_idc', array( __CLASS__, 'legacy_jetpack_sync_idc_optin_filter' ) ); + + /** + * Allows sites to opt in for IDC mitigation which blocks the site from syncing to WordPress.com when the home + * URL or site URL do not match what WordPress.com expects. The default value is either true, or the value of + * JETPACK_SHOULD_HANDLE_IDC constant if set. + * + * @param bool $default Whether the site is opted in to IDC mitigation. + * + * @since 0.2.6 + */ + return (bool) apply_filters( 'jetpack_should_handle_idc', $default ); + } + + /** + * Returns the value for the deprecated filter, 'jetpack_sync_idc_optin'. That filter has been replaced with the + * 'jetpack_should_handle_idc' filter. + * + * @since 0.2.6 + * + * @param bool $default Whether the site is opted in to IDC mitigation. + */ + public static function legacy_jetpack_sync_idc_optin_filter( $default ) { + /** + * Allows sites to opt in for IDC mitigation which blocks the site from syncing to WordPress.com when the home + * URL or site URL do not match what WordPress.com expects. The default value is either true, or the value of + * JETPACK_SYNC_IDC_OPTIN constant if set. + * + * @param bool $default Whether the site is opted in to IDC mitigation. + * + * @since 0.2.0 + * @since-jetpack 4.3.2 + * @deprecated 0.2.6 Use jetpack_should_handle_idc + */ + return (bool) apply_filters_deprecated( 'jetpack_sync_idc_optin', array( $default ), '0.2.6', 'jetpack_should_handle_idc' ); + } + + /** + * Does the current admin page have help tabs? + * + * @return bool + * @deprecated 0.5.0 Use `@automattic/jetpack-idc` instead. + */ + public function admin_page_has_help_tabs() { + _deprecated_function( __METHOD__, '0.5.0' ); + + if ( ! function_exists( 'get_current_screen' ) ) { + return false; + } + + $current_screen = get_current_screen(); + $tabs = $current_screen->get_help_tabs(); + + return ! empty( $tabs ); + } + + /** + * Renders the non-admin IDC notice. + * + * @return void + * @deprecated 0.5.0 Use `@automattic/jetpack-idc` instead. + */ + public function display_non_admin_idc_notice() { + _deprecated_function( __METHOD__, '0.5.0' ); + + $classes = 'jp-idc-notice inline is-non-admin notice notice-warning'; + if ( isset( self::$current_screen ) && 'toplevel_page_jetpack' !== self::$current_screen->id ) { + $classes .= ' is-dismissible'; + } + + if ( $this->admin_page_has_help_tabs() ) { + $classes .= ' has-help-tabs'; + } + ?> + +
        + render_notice_header(); ?> + +
        + admin_page_has_help_tabs() ) { + $classes .= ' has-help-tabs'; + } + ?> +
        + render_notice_header(); ?> + render_notice_first_step(); ?> + render_notice_second_step(); ?> +
        + + + + + + + + + + + Safe mode because we noticed this is an exact copy of %3$s.', 'jetpack-idc' ), + esc_url( self::get_safe_mod_doc_url() ), + esc_url( self::$wpcom_home_url ), + self::prepare_url_for_display( esc_url_raw( self::$wpcom_home_url ) ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default header text in the first step of the Safe Mode notice. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_first_step_header_lead', $html ); + } + + /** + * Returns the first step header explanation. + * + * @return string + */ + public function get_first_step_header_explanation() { + $html = wp_kses( + sprintf( + /* translators: %s: Safe mode docs URL. */ + __( 'Please confirm Safe Mode or fix the Jetpack connection. Select one of the options below or learn more about Safe Mode.', 'jetpack-idc' ), + esc_url( self::get_safe_mod_doc_url() ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default header explanation text in the first step of the Safe Mode notice. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_first_step_header_explanation', $html ); + } + + /** + * Returns the confirm safe mode explanation. + * + * @return string + */ + public function get_confirm_safe_mode_action_explanation() { + $html = wp_kses( + sprintf( + /* translators: %s: Site URL. */ + __( 'Is this website a temporary duplicate of %2$s for the purposes of testing, staging or development? If so, we recommend keeping it in Safe Mode.', 'jetpack-idc' ), + esc_url( untrailingslashit( self::$wpcom_home_url ) ), + self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text used to explain the confirm safe mode action. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_confirm_safe_mode_explanation', $html ); + } + + /** + * Returns the confirm safe mode button text. + * + * @return string + */ + public function get_confirm_safe_mode_button_text() { + $string = esc_html__( 'Confirm Safe Mode', 'jetpack-idc' ); + + /** + * Allows overriding of the default text used for the confirm safe mode action button. + * + * @param string $string The string to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_confirm_safe_mode_button_text', $string ); + } + + /** + * Returns the first step fix connection action explanation. + * + * @return string + */ + public function get_first_step_fix_connection_action_explanation() { + $html = wp_kses( + sprintf( + /* translators: %s: Site URL. */ + __( 'If this is a separate and new website, or the new home of %2$s, we recommend turning Safe Mode off, and re-establishing your connection to WordPress.com.', 'jetpack-idc' ), + esc_url( untrailingslashit( self::$wpcom_home_url ) ), + self::prepare_url_for_display( esc_url( self::$wpcom_home_url ) ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text used to explain the fix Jetpack connection action. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_first_fix_connection_explanation', $html ); + } + + /** + * Returns the first step fix connection button text. + * + * @return string + */ + public function get_first_step_fix_connection_button_text() { + $string = esc_html__( "Fix Jetpack's Connection", 'jetpack-idc' ); + + /** + * Allows overriding of the default text used for the fix Jetpack connection action button. + * + * @param string $string The string to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_first_step_fix_connection_button_text', $string ); + } + + /** + * Returns the second step header lead. + * + * @return string + */ + public function get_second_step_header_lead() { + $string = sprintf( + /* translators: %s: Site URL. */ + esc_html__( 'Is %1$s the new home of %2$s?', 'jetpack-idc' ), + untrailingslashit( self::normalize_url_protocol_agnostic( get_home_url() ) ), + untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) ) + ); + + /** + * Allows overriding of the default header text in the second step of the Safe Mode notice. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_second_step_header_lead', $string ); + } + + /** + * Returns the site action explanation. + * + * @return string + */ + public function get_migrate_site_action_explanation() { + $html = wp_kses( + sprintf( + /* translators: %s: Site URL. */ + __( 'Yes. %2$s is replacing %4$s. I would like to migrate my stats and subscribers from %4$s to %2$s.', 'jetpack-idc' ), + esc_url( get_home_url() ), + self::prepare_url_for_display( get_home_url() ), + esc_url( self::$wpcom_home_url ), + untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text for explaining the migrate site action. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_migrate_site_explanation', $html ); + } + + /** + * Returns the migrate site button text. + * + * @return string + */ + public function get_migrate_site_button_text() { + $string = esc_html__( 'Migrate Stats & Subscribers', 'jetpack-idc' ); + + /** + * Allows overriding of the default text used for the migrate site action button. + * + * @param string $string The string to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_migrate_site_button_text', $string ); + } + + /** + * Returns the start fresh explanation. + * + * @return string + */ + public function get_start_fresh_action_explanation() { + $html = wp_kses( + sprintf( + /* translators: %s: Site URL. */ + __( 'No. %2$s is a new and different website that\'s separate from %4$s. It requires a new connection to WordPress.com for new stats and subscribers.', 'jetpack-idc' ), + esc_url( get_home_url() ), + self::prepare_url_for_display( get_home_url() ), + esc_url( self::$wpcom_home_url ), + untrailingslashit( self::normalize_url_protocol_agnostic( esc_url_raw( self::$wpcom_home_url ) ) ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text for explaining the start fresh action. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_start_fresh_explanation', $html ); + } + + /** + * Returns the start fresh button text. + * + * @return string + */ + public function get_start_fresh_button_text() { + $string = esc_html__( 'Start Fresh & Create New Connection', 'jetpack-idc' ); + + /** + * Allows overriding of the default text used for the start fresh action button. + * + * @param string $string The string to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_start_fresh_button_text', $string ); + } + + /** + * Returns the unsure prompt text. + * + * @return string + */ + public function get_unsure_prompt() { + $html = wp_kses( + sprintf( + /* translators: %s: Safe mode docs URL. */ + __( 'Unsure what to do? Read more about Jetpack Safe Mode', 'jetpack-idc' ), + esc_url( self::get_safe_mod_doc_url() ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text using in the "Unsure what to do?" prompt. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_unsure_prompt', $html ); + } + + /** + * Returns the non-admin notice text. + * + * @return string + * @deprecated 0.5.0 Use `@automattic/jetpack-idc` instead. + */ + public function get_non_admin_notice_text() { + _deprecated_function( __METHOD__, '0.5.0' ); + + $html = wp_kses( + sprintf( + /* translators: %s: Safe mode docs URL. */ + __( 'Jetpack has been placed into Safe Mode. Learn more about Safe Mode.', 'jetpack-idc' ), + esc_url( self::get_safe_mod_doc_url() ) + ), + array( 'a' => array( 'href' => array() ) ) + ); + + /** + * Allows overriding of the default text that is displayed to non-admin on the Jetpack admin page. + * + * @param string $html The HTML to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_non_admin_notice_text', $html ); + } + + /** + * Returns the non-admin contact admin text. + * + * @return string + * @deprecated 0.5.0 Use `@automattic/jetpack-idc` instead. + */ + public function get_non_admin_contact_admin_text() { + _deprecated_function( __METHOD__, '0.5.0' ); + + $string = esc_html__( 'An administrator of this site can take Jetpack out of Safe Mode.', 'jetpack-idc' ); + + /** + * Allows overriding of the default text that is displayed to non-admins prompting them to contact an admin. + * + * @param string $string The string to be displayed. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + */ + return apply_filters( 'jetpack_idc_non_admin_contact_admin_text', $string ); + } + + /** + * Whether the site is undergoing identity crisis. + * + * @return bool + */ + public static function has_identity_crisis() { + return false !== static::check_identity_crisis() && ! static::$is_safe_mode_confirmed; + } + + /** + * Whether an admin has confirmed safe mode. + * Unlike `static::$is_safe_mode_confirmed` this function always returns the actual flag value. + * + * @return bool + */ + public static function safe_mode_is_confirmed() { + return Jetpack_Options::get_option( 'safe_mode_confirmed' ); + } + + /** + * Returns the mismatched URLs. + * + * @return array|bool The mismatched urls, or false if the site is not connected, offline, in safe mode, or the IDC error is not valid. + */ + public static function get_mismatched_urls() { + if ( ! static::has_identity_crisis() ) { + return false; + } + + $data = static::check_identity_crisis(); + + if ( ! $data || + ! isset( $data['error_code'] ) || + ! isset( $data['wpcom_home'] ) || + ! isset( $data['home'] ) || + ! isset( $data['wpcom_siteurl'] ) || + ! isset( $data['siteurl'] ) + ) { + // The jetpack_sync_error_idc option is missing a key. + return false; + } + + if ( 'jetpack_site_url_mismatch' === $data['error_code'] ) { + return array( + 'wpcom_url' => $data['wpcom_siteurl'], + 'current_url' => $data['siteurl'], + ); + } + + return array( + 'wpcom_url' => $data['wpcom_home'], + 'current_url' => $data['home'], + ); + } + + /** + * Try to detect $_SERVER['HTTP_HOST'] being used within WP_SITEURL or WP_HOME definitions inside of wp-config. + * + * If `HTTP_HOST` usage is found, it's possbile (though not certain) that site URLs are dynamic. + * + * When a site URL is dynamic, it can lead to a Jetpack IDC. If potentially dynamic usage is detected, + * helpful support info will be shown on the IDC UI about setting a static site/home URL. + * + * @return bool True if potentially dynamic site urls were detected in wp-config, false otherwise. + */ + public static function detect_possible_dynamic_site_url() { + $transient_key = 'jetpack_idc_possible_dynamic_site_url_detected'; + $transient_val = get_transient( $transient_key ); + + if ( false !== $transient_val ) { + return (bool) $transient_val; + } + + $path = self::locate_wp_config(); + $wp_config = $path ? file_get_contents( $path ) : false; // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + if ( $wp_config ) { + $matched = preg_match( + '/define ?\( ?[\'"](?:WP_SITEURL|WP_HOME).+(?:HTTP_HOST).+\);/', + $wp_config + ); + + if ( $matched ) { + set_transient( $transient_key, 1, HOUR_IN_SECONDS ); + return true; + } + } + + set_transient( $transient_key, 0, HOUR_IN_SECONDS ); + return false; + } + + /** + * Gets path to WordPress configuration. + * Source: https://github.com/wp-cli/wp-cli/blob/master/php/utils.php + * + * @return string + */ + public static function locate_wp_config() { + static $path; + + if ( null === $path ) { + $path = false; + + if ( getenv( 'WP_CONFIG_PATH' ) && file_exists( getenv( 'WP_CONFIG_PATH' ) ) ) { + $path = getenv( 'WP_CONFIG_PATH' ); + } elseif ( file_exists( ABSPATH . 'wp-config.php' ) ) { + $path = ABSPATH . 'wp-config.php'; + } elseif ( file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { + $path = dirname( ABSPATH ) . '/wp-config.php'; + } + + if ( $path ) { + $path = realpath( $path ); + } + } + + return $path; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php new file mode 100644 index 00000000..d3197e46 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php @@ -0,0 +1,187 @@ + WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::confirm_safe_mode', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + ) + ); + + // Handles the request to migrate stats and subscribers during an identity crisis. + register_rest_route( + 'jetpack/v4', + 'identity-crisis/migrate', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::migrate_stats_and_subscribers', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + ) + ); + + // IDC resolve: create an entirely new shadow site for this URL. + register_rest_route( + 'jetpack/v4', + '/identity-crisis/start-fresh', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::start_fresh_connection', + 'permission_callback' => __CLASS__ . '::identity_crisis_mitigation_permission_check', + 'args' => array( + 'redirect_uri' => array( + 'description' => __( 'URI of the admin page where the user should be redirected after connection flow', 'jetpack-idc' ), + 'type' => 'string', + ), + ), + ) + ); + } + + /** + * Handles identity crisis mitigation, confirming safe mode for this site. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return bool | WP_Error True if option is properly set. + */ + public static function confirm_safe_mode() { + $updated = Jetpack_Options::update_option( 'safe_mode_confirmed', true ); + if ( $updated ) { + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + + return new WP_Error( + 'error_setting_jetpack_safe_mode', + esc_html__( 'Could not confirm safe mode.', 'jetpack-idc' ), + array( 'status' => 500 ) + ); + } + + /** + * Handles identity crisis mitigation, migrating stats and subscribers from old url to this, new url. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return bool | WP_Error True if option is properly set. + */ + public static function migrate_stats_and_subscribers() { + if ( Jetpack_Options::get_option( 'sync_error_idc' ) && ! Jetpack_Options::delete_option( 'sync_error_idc' ) ) { + return new WP_Error( + 'error_deleting_sync_error_idc', + esc_html__( 'Could not delete sync error option.', 'jetpack-idc' ), + array( 'status' => 500 ) + ); + } + + if ( Jetpack_Options::get_option( 'migrate_for_idc' ) || Jetpack_Options::update_option( 'migrate_for_idc', true ) ) { + return rest_ensure_response( + array( + 'code' => 'success', + ) + ); + } + return new WP_Error( + 'error_setting_jetpack_migrate', + esc_html__( 'Could not confirm migration.', 'jetpack-idc' ), + array( 'status' => 500 ) + ); + } + + /** + * This IDC resolution will disconnect the site and re-connect to a completely new + * and separate shadow site than the original. + * + * It will first will disconnect the site without phoning home as to not disturb the production site. + * It then builds a fresh connection URL and sends it back along with the response. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function start_fresh_connection( $request ) { + /** + * Fires when Users have requested through Identity Crisis for the connection to be reset. + * Should be used to disconnect any connections and reset options. + * + * @since 0.2.0 + */ + do_action( 'jetpack_idc_disconnect' ); + + $connection = new Connection_Manager(); + $result = $connection->try_registration( true ); + + // early return if site registration fails. + if ( ! $result || is_wp_error( $result ) ) { + return rest_ensure_response( $result ); + } + + $redirect_uri = $request->get_param( 'redirect_uri' ) ? admin_url( $request->get_param( 'redirect_uri' ) ) : null; + + /** + * Filters the connection url that users should be redirected to for re-establishing their connection. + * + * @since 0.2.0 + * + * @param \WP_REST_Response|WP_Error $connection_url Connection URL user should be redirected to. + */ + return apply_filters( 'jetpack_idc_authorization_url', rest_ensure_response( $connection->get_authorization_url( null, $redirect_uri ) ) ); + } + + /** + * Verify that user can mitigate an identity crisis. + * + * @since 0.2.0 + * @since-jetpack 4.4.0 + * + * @return true|WP_Error True if the user has capability 'jetpack_disconnect', an error object otherwise. + */ + public static function identity_crisis_mitigation_permission_check() { + if ( current_user_can( 'jetpack_disconnect' ) ) { + return true; + } + $error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-idc' + ); + + return new WP_Error( 'invalid_user_permission_identity_crisis', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php new file mode 100644 index 00000000..0b0a31e4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php @@ -0,0 +1,193 @@ + true, + 'textdomain' => 'jetpack-idc', + ) + ); + Assets::enqueue_script( 'jp_identity_crisis_banner' ); + wp_add_inline_script( 'jp_identity_crisis_banner', static::get_initial_state(), 'before' ); + + add_action( 'admin_notices', array( static::class, 'render_container' ) ); + } + } + + /** + * Create the container element for the IDC banner. + */ + public static function render_container() { + ?> +
        + esc_url_raw( rest_url() ), + 'WP_API_nonce' => wp_create_nonce( 'wp_rest' ), + 'wpcomHomeUrl' => ( is_array( $idc_urls ) && array_key_exists( 'wpcom_url', $idc_urls ) ) ? $idc_urls['wpcom_url'] : null, + 'currentUrl' => ( is_array( $idc_urls ) && array_key_exists( 'current_url', $idc_urls ) ) ? $idc_urls['current_url'] : null, + 'redirectUri' => isset( $_SERVER['REQUEST_URI'] ) ? str_replace( '/wp-admin/', '/', filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) : '', + 'tracksUserData' => Jetpack_Tracks_Client::get_connected_user_tracks_identity(), + 'tracksEventData' => array( + 'isAdmin' => $is_admin, + 'currentScreen' => $current_screen ? $current_screen->id : false, + 'blogID' => Jetpack_Options::get_option( 'id' ), + 'platform' => static::get_platform(), + ), + 'isSafeModeConfirmed' => Identity_Crisis::$is_safe_mode_confirmed, + 'consumerData' => static::get_consumer_data(), + 'isAdmin' => $is_admin, + 'possibleDynamicSiteUrlDetected' => $possible_dynamic_site_url_detected, + ); + } + + /** + * Get the package consumer data. + * + * @return array + */ + public static function get_consumer_data() { + if ( null !== static::$consumers ) { + return static::$consumers; + } + + $consumers = apply_filters( 'jetpack_idc_consumers', array() ); + + if ( ! $consumers ) { + return array(); + } + + usort( + $consumers, + function ( $c1, $c2 ) { + $priority1 = ( array_key_exists( 'priority', $c1 ) && (int) $c1['priority'] ) ? (int) $c1['priority'] : 10; + $priority2 = ( array_key_exists( 'priority', $c2 ) && (int) $c2['priority'] ) ? (int) $c2['priority'] : 10; + + return $priority1 > $priority2 ? 1 : -1; + } + ); + + $consumer_chosen = null; + $consumer_url_length = 0; + + foreach ( $consumers as $consumer ) { + if ( empty( $consumer['admin_page'] ) || ! is_string( $consumer['admin_page'] ) ) { + continue; + } + + if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ), $consumer['admin_page'] ) && strlen( $consumer['admin_page'] ) > $consumer_url_length ) { + $consumer_chosen = $consumer; + $consumer_url_length = strlen( $consumer['admin_page'] ); + } + } + + static::$consumers = $consumer_chosen ? $consumer_chosen : array_shift( $consumers ); + + return static::$consumers; + } + + /** + * Get the site platform. + * + * @return string + */ + private static function get_platform() { + $host = new Host(); + + if ( $host->is_woa_site() ) { + return 'woa'; + } + + if ( $host->is_vip_site() ) { + return 'vip'; + } + + if ( $host->is_newspack_site() ) { + return 'newspack'; + } + + return 'self-hosted'; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md new file mode 100644 index 00000000..3a987c9c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.1.1] - 2023-03-28 +### Changed +- Update README.md [#28401] + +## 0.1.0 - 2023-02-28 +### Added +- Added a utility function to extract an array of IP addresses from a given string. [#29131] +- Add jetpack-ip package functionality [#28846] +- Initialized the package. [#28765] + +[0.1.2]: https://github.com/automattic/jetpack-ip/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/automattic/jetpack-ip/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json new file mode 100644 index 00000000..45cf2864 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/composer.json @@ -0,0 +1,44 @@ +{ + "name": "automattic/jetpack-ip", + "description": "Utilities for working with IP addresses.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-ip", + "changelogger": { + "link-template": "https://github.com/automattic/jetpack-ip/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "textdomain": "jetpack-ip", + "version-constants": { + "::PACKAGE_VERSION": "src/class-utils.php" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php new file mode 100644 index 00000000..7b92ba78 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php @@ -0,0 +1,246 @@ +trusted_header ) && isset( $_SERVER[ $trusted_header_data->trusted_header ] ) ) { + $ip = wp_unslash( $_SERVER[ $trusted_header_data->trusted_header ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it below. + $segments = $trusted_header_data->segments; + $reverse_order = $trusted_header_data->reverse; + } else { + $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it below. + } + + if ( ! $ip ) { + return false; + } + + $ips = explode( ',', $ip ); + if ( ! isset( $segments ) || ! $segments ) { + $segments = 1; + } + if ( isset( $reverse_order ) && $reverse_order ) { + $ips = array_reverse( $ips ); + } + $ip_count = count( $ips ); + if ( 1 === $ip_count ) { + return self::clean_ip( $ips[0] ); + } elseif ( $ip_count >= $segments ) { + $the_one = $ip_count - $segments; + return self::clean_ip( $ips[ $the_one ] ); + } else { + return self::clean_ip( isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- clean_ip does it. + } + } + + /** + * Clean IP address. + * + * @param string $ip The IP address to clean. + * @return string|false The cleaned IP address. + */ + public static function clean_ip( $ip ) { + + // Some misconfigured servers give back extra info, which comes after "unless". + $ips = explode( ' unless ', $ip ); + $ip = $ips[0]; + + $ip = strtolower( trim( $ip ) ); + + // Check for IPv4 with port. + if ( preg_match( '/^(\d+\.\d+\.\d+\.\d+):\d+$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Check for IPv6 (or IPvFuture) with brackets and optional port. + if ( preg_match( '/^\[([a-z0-9\-._~!$&\'()*+,;=:]+)\](?::\d+)?$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Check for IPv4 IP cast as IPv6. + if ( preg_match( '/^::ffff:(\d+\.\d+\.\d+\.\d+)$/', $ip, $matches ) ) { + $ip = $matches[1]; + } + + // Validate and return. + return filter_var( $ip, FILTER_VALIDATE_IP ) ? $ip : false; + } + + /** + * Checks an IP to see if it is within a private range. + * + * @param int $ip IP address. + * @return bool True if IP address is private, false otherwise. + */ + public static function ip_is_private( $ip ) { + // We are dealing with ipv6, so we can simply rely on filter_var. + if ( false === strpos( $ip, '.' ) ) { + return ! filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ); + } + // We are dealing with ipv4. + $private_ip4_addresses = array( + '10.0.0.0|10.255.255.255', // Single class A network. + '172.16.0.0|172.31.255.255', // 16 contiguous class B network. + '192.168.0.0|192.168.255.255', // 256 contiguous class C network. + '169.254.0.0|169.254.255.255', // Link-local address also referred to as Automatic Private IP Addressing. + '127.0.0.0|127.255.255.255', // localhost. + ); + $long_ip = ip2long( $ip ); + if ( -1 !== $long_ip ) { + foreach ( $private_ip4_addresses as $pri_addr ) { + list ( $start, $end ) = explode( '|', $pri_addr ); + if ( $long_ip >= ip2long( $start ) && $long_ip <= ip2long( $end ) ) { + return true; + } + } + } + return false; + } + + /** + * Uses inet_pton if available to convert an IP address to a binary string. + * If inet_pton is not available, ip2long will convert the address to an integer. + * Returns false if an invalid IP address is given. + * + * NOTE: ip2long will return false for any ipv6 address. servers that do not support + * inet_pton will not support ipv6 + * + * @param mixed $ip IP address. + * @return int|string|bool + */ + public static function convert_ip_address( $ip ) { + if ( function_exists( 'inet_pton' ) ) { + return inet_pton( $ip ); + } + return ip2long( $ip ); + } + + /** + * Checks that a given IP address is within a given low - high range. + * Servers that support inet_pton will use that function to convert the ip to number, + * while other servers will use ip2long. + * + * NOTE: servers that do not support inet_pton cannot support ipv6. + * + * @param mixed $ip IP. + * @param mixed $range_low Range Low. + * @param mixed $range_high Range High. + * @return Bool + */ + public static function ip_address_is_in_range( $ip, $range_low, $range_high ) { + // The inet_pton will give us binary string of an ipv4 or ipv6. + // We can then use strcmp to see if the address is in range. + if ( function_exists( 'inet_pton' ) ) { + $ip_num = inet_pton( $ip ); + $ip_low = inet_pton( $range_low ); + $ip_high = inet_pton( $range_high ); + if ( $ip_num && $ip_low && $ip_high && strcmp( $ip_num, $ip_low ) >= 0 && strcmp( $ip_num, $ip_high ) <= 0 ) { + return true; + } + // The ip2long will give us an integer of an ipv4 address only. it will produce FALSE for ipv6. + } else { + $ip_num = ip2long( $ip ); + $ip_low = ip2long( $range_low ); + $ip_high = ip2long( $range_high ); + if ( $ip_num && $ip_low && $ip_high && $ip_num >= $ip_low && $ip_num <= $ip_high ) { + return true; + } + } + return false; + } + + /** + * Extracts IP addresses from a given string. + * + * We allow for both, one IP per line or comma-; semicolon; or whitespace-separated lists. This also validates the IP addresses + * and only returns the ones that look valid. IP ranges using the "-" character are also supported. + * + * @param string $ips List of ips - example: "8.8.8.8\n4.4.4.4,2.2.2.2;1.1.1.1 9.9.9.9,5555.5555.5555.5555,1.1.1.10-1.1.1.20". + * @return array List of valid IP addresses. - example based on input example: array('8.8.8.8', '4.4.4.4', '2.2.2.2', '1.1.1.1', '9.9.9.9', '1.1.1.10-1.1.1.20') + */ + public static function get_ip_addresses_from_string( $ips ) { + $ips = (string) $ips; + $ips = preg_split( '/[\s,;]/', $ips ); + + $result = array(); + + foreach ( $ips as $ip ) { + // Validate both IP values from the range. + $range = explode( '-', $ip ); + if ( count( $range ) === 2 ) { + if ( self::validate_ip_range( $range[0], $range[1] ) ) { + $result[] = $ip; + } + continue; + } + + // Validate the single IP value. + if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) { + $result[] = $ip; + } + } + + return $result; + } + + /** + * Validates the low and high IP addresses of a range. + * + * NOTE: servers that do not support inet_pton cannot support ipv6. + * + * @param string $range_low Low IP address. + * @param string $range_high High IP address. + * @return bool True if the range is valid, false otherwise. + */ + public static function validate_ip_range( $range_low, $range_high ) { + // Validate that both IP addresses are valid. + if ( ! filter_var( $range_low, FILTER_VALIDATE_IP ) || ! filter_var( $range_high, FILTER_VALIDATE_IP ) ) { + return false; + } + + // Validate that the $range_low is lower or equal to $range_high. + if ( function_exists( 'inet_pton' ) ) { + // The inet_pton will give us binary string of an ipv4 or ipv6. + // We can then use strcmp to see if the address is in range. + $ip_low = inet_pton( $range_low ); + $ip_high = inet_pton( $range_high ); + if ( false === $ip_low || false === $ip_high ) { + return false; + } + if ( strcmp( $ip_low, $ip_high ) > 0 ) { + return false; + } + } else { + // The ip2long will give us an integer of an ipv4 address only. it will produce FALSE for ipv6. + $ip_low = ip2long( $range_low ); + $ip_high = ip2long( $range_high ); + if ( false === $ip_low || false === $ip_high ) { + return false; + } + if ( $ip_low > $ip_high ) { + return false; + } + } + + return true; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md new file mode 100644 index 00000000..cbdf993d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md @@ -0,0 +1,678 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.3.4] - 2023-03-28 +### Fixed +- JITM: Fix button overflow when text length is too big [#29749] + +## [2.3.3] - 2023-03-27 +### Changed +- JITM: Update styles [#29709] + +## [2.3.2] - 2023-03-20 +### Changed +- Updated package dependencies. [#29471] + +## [2.3.1] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [2.3.0] - 2023-02-20 +### Changed +- Moving deleting connection owner notice from JITM to Connection package. [#28516] + +## [2.2.42] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [2.2.41] - 2023-02-06 +### Fixed +- JITM: minor fix for styles on Safari browser. + +## [2.2.40] - 2023-01-30 +### Changed +- Updated styles for Just in Time Messages (notices) [#27515] + +## [2.2.39] - 2023-01-25 +### Changed +- Minor internal updates. + +## [2.2.38] - 2023-01-23 +### Fixed +- Prevent the activation page from displaying the JP License Activation JITM. [#27959] + +## [2.2.37] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [2.2.36] - 2022-12-27 +### Removed +- Remove src/js files from final bundle [#27930] + +## [2.2.35] - 2022-12-02 +### Changed +- Updated package dependencies. [#27696] + +## [2.2.34] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [2.2.33] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [2.2.32] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [2.2.31] - 2022-11-01 +### Changed +- Updated package dependencies. [#27196] + +## [2.2.30] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [2.2.29] - 2022-10-13 +### Changed +- Updated package dependencies. [#26791] + +## [2.2.28] - 2022-10-05 +### Changed +- Updated package dependencies. [#26568] + +## [2.2.27] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [2.2.26] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [2.2.25] - 2022-08-25 +### Changed +- Updated package dependencies. [#25814] + +## [2.2.24] - 2022-08-23 +### Added +- Add custom styling rules for the JITMs displayed in My Jetpack. [#22452] +- Updated JITM readme. [#25739] + +### Changed +- Updated package dependencies. [#25628] + +## [2.2.23] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [2.2.22] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [2.2.21] - 2022-07-12 +### Changed +- Updated package dependencies. + +## [2.2.20] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [2.2.19] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [2.2.18] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] + +## [2.2.17] - 2022-05-18 +### Changed +- Updated package dependencies [#24372] + +## [2.2.16] - 2022-05-10 +### Changed +- Updated package dependencies. [#24302] + +## [2.2.15] - 2022-05-04 +### Changed +- Remove use of `pnpx` in preparation for pnpm 7.0. [#24210] +- Updated package dependencies. [#24095] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [2.2.14] - 2022-04-26 +### Changed +- Updated package dependencies. +- Update package.json metadata. + +## [2.2.13] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [2.2.12] - 2022-04-12 +### Changed +- Updated package dependencies. + +## [2.2.11] - 2022-04-06 +### Changed +- Updated package dependencies + +### Removed +- Removed tracking dependency. + +## [2.2.10] - 2022-03-29 +### Changed +- Updated package dependencies. + +## [2.2.9] - 2022-03-23 +### Changed +- Updated package dependencies. + +## [2.2.8] - 2022-03-02 +### Changed +- Updated package dependencies + +## [2.2.7] - 2022-02-22 +### Changed +- Updated package dependencies. + +## [2.2.6] - 2022-02-16 +### Changed +- Updated package dependencies. + +## [2.2.5] - 2022-02-09 +### Changed +- Updated package dependencies. + +## [2.2.4] - 2022-02-02 +### Changed +- Build: remove unneeded files from production build. +- Update use of old jQuery interfaces + +## [2.2.3] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [2.2.2] - 2022-01-18 +### Changed +- General: update required node version to v16.13.2 + +## [2.2.1] - 2022-01-11 +### Changed +- Updated package dependencies. + +## [2.2.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies. +- Updated package textdomain from `jetpack` to `jetpack-jitm`. + +## [2.1.1] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [2.1.0] - 2021-11-30 +### Added +- Add proper JS and CSS builder. +- Adds filters to allow sideloading of the Jetpack Backup plugin through JITMs. +- JITM: Added ability to sideload Jetpack Boost plugin. + +### Changed +- Add `output.filename` in Webpack config to override changed default. +- Colors: update Jetpack Primary color to match latest brand book. + +### Fixed +- JITM: wrap CTA below text on small viewports + +## [2.0.8] - 2021-11-23 +### Changed +- Updated package dependencies. + +## [2.0.7] - 2021-11-16 +### Added +- Use monorepo `validate-es` script to validate Webpack builds. + +### Changed +- Updated package dependencies. + +## [2.0.6] - 2021-11-09 +### Changed +- Update webpack build config. + +## [2.0.5] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [2.0.4] - 2021-10-26 +### Changed +- Updated package dependencies. + +## [2.0.3] - 2021-10-19 +### Changed +- Updated package dependencies. + +## [2.0.2] - 2021-10-12 +### Changed +- Updated package dependencies + +## [2.0.1] - 2021-09-28 +### Changed +- Allow Node ^14.17.6 to be used in this project. This shouldn't change the behavior of the code itself. +- Updated package dependencies. + +## [2.0.0] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Update annotations versions. +- Updated package dependencies. +- Update to latest webpack, webpack-cli and calypso-build. +- Upgrade to Webpack 5. +- Use Node 16.7.0 in tooling. + +### Removed +- Removed IE11 support. + +## [1.16.2] - 2021-07-27 +### Changed +- Updated package dependencies. + +## [1.16.1] - 2021-06-29 +### Changed +- Update package dependencies. +- Update node version requirement to 14.16.1 +- Update the usage of Redirect lib and passes the unlinked param as a query argument. + +## [1.16.0] - 2021-05-25 +### Added +- JITM: allow the plugin to set the icon for pre-connection JITMs. +- JITM: move sync updated option hook to the JITM package. + +### Changed +- JITM: prevent JITMs from being registered more than once. +- JITM: remove jetpack-constants dependency from composer.json +- JITM: set the default values of the jetpack_just_in_time_msgs and jetpack_just_in_time_msg_cache filters to true. +- JITM: Use an action instead of a property to prevent JITMs from being registered multiple times +- JITM: Use the Device_Detection package to determine if the device is mobile. +- Updated package dependencies +- update jetpack-redirect dependency + +## [1.15.1] - 2021-05-03 +### Changed +- JITM: Use manager::get_authorization_url to obtain the authorization url in the user deletion notice. + +## [1.15.0] - 2021-04-27 +### Added +- Move JITM's REST API endpoints into the package + +### Changed +- Always display pre-connection JITMs, without the need to set a filter. +- Avoid wrapping text in the main CTA button. +- Bump JITM package version requirement. +- JITM: Update CTA redirect url with unlinked query arg to indicate current user is not connected. +- Update package dependencies. +- Use the a8c-mc-stats package to generate stats. + +## [1.14.1] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Use is_connected instead of is_active to instantiate Pre/Post_Connection_JITM +- Add a jetpack_pre_connection_jitms filter. +- Update colors to match upcoming WP 5.7 color changes +- Update Node to match latest LTS 12 +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.14.0] - 2021-02-23 + +- Recommendations: Hide JITMs when banner is displaying +- Setup Wizard: Remove setup wizard +- JITM: move jetpack-jitm.js to the JITM package +- CI: Make tests more generic + +## [1.13.5] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.13.4] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.13.3] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.13.2] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.13.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.13.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.12.2] - 2020-12-09 + +- Update dependencies to latest stable + +## [1.12.1] - 2020-11-24 + +- Version packages for release + +## [1.12.0] - 2020-11-24 + +- Status: Introduce get_site_suffix method +- General: update minimum required version to WordPress 5.5 +- Updated PHPCS: Packages and Debugger + +## [1.11.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.11.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.11.0] - 2020-10-27 + +- JITM: add a Pre_Connection_JITM::generate_admin_url method +- JITM: use is_active from the connection package +- JITM: regenerate assets + +## [1.10.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.10.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.10.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.10.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.10.0] - 2020-09-29 + +- Update dependencies to latest stable + +## [1.9.1] - 2020-09-09 + +- Update dependencies to latest stable + +## [1.9.0] - 2020-08-26 + +- Compat: add new Creative Mail compat file +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.8.2] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.8.1] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.8.0] - 2020-07-28 + +- Core Compat: Site Environment +- Core REST API: Add permission callback to delete_jitm_message endpoint + +## [1.7.2] - 2020-07-06 + +- Update dependencies to latest stable + +## [1.7.1] - 2020-07-01 + +- Update dependencies to latest stable + +## [1.7.0] - 2020-06-30 + +- PHPCS: Clean up the packages +- Hide pre-connection JITM on the posts page when few posts are published +- Jetpack Setup Wizard: Do not show pre-connection JITMs to non admins +- JITM: change 'setup' to 'set up' in pre-connection JITMs +- Pre-connection JITMS: Link to connect-in-place flow +- JITM: add Redirect use statement + +## [1.6.5] - 2020-06-01 + +- Hide pre-connection JITM on the posts page when few posts are published + +## [1.6.4] - 2020-06-01 + +- Update dependencies to latest stable + +## [1.6.3] - 2020-05-29 + +- Jetpack Setup Wizard: Do not show pre-connection JITMs to non admins + +## [1.6.2] - 2020-05-29 + +- JITM: change 'setup' to 'set up' in pre-connection JITMs +- Pre-connection JITMS: Link to connect-in-place flow + +## [1.6.1] - 2020-05-28 + +- JITM: add Redirect use statement + +## [1.6.0] - 2020-05-26 + +- JITM: expand docs and tests to account for pre-connection messages +- Improve responsiveness of JITMs +- JITM: fix the use statements +- Implement pre-connection JITMs +- JITM: Allow JITM on stats pages + +## [1.5.1] - 2020-04-30 + +- JITM: Allow JITM on stats pages + +## [1.5.0] - 2020-04-28 + +- Use jp.com redirect in all links + +## [1.4.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.3.0] - 2020-03-31 + +- Use dynamic Jetpack logos on JITMs + +## [1.2.0] - 2020-02-25 + +- JITM: Show ToS update notice + +## [1.1.2] - 2020-02-14 + +- SSO: do not display JITM when not in wp-admin + +## [1.1.1] - 2020-01-23 + +- Moved JITM initialization to plugins_loaded. + +## [1.1.0] - 2020-01-07 + +- Add partner subsidiary id to upgrade URLs. + +## [1.0.10] - 2019-11-25 + +- Connection Owner Deletion Notice: Fix display bug and sanitize… + +## [1.0.9] - 2019-11-19 + +- Don't show JITMs on Gutenberg editor pages (for now) + +## [1.0.8] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.7] - 2019-11-08 + +- Remove unused get_emblem method + +## [1.0.6] - 2019-10-31 + +- Inherit 400 weight for button fonts + +## [1.0.5] - 2019-10-28 + +- PHPCS: JITM and Assets packages + +## [1.0.4] - 2019-10-24 + +- Update Jetpack button and card styles to match WordPress 5.3 + +## [1.0.3] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.0.2] - 2019-10-17 + +- Change the class in the add_filter() calls to $this. Also fix some + +## [1.0.1] - 2019-09-27 + +- Initial trial of prefer-dist +- JITM: Send the user's role in the request for JITM messages + +## 1.0.0 - 2019-09-14 + +- Update Jetpack to use new JITM package + +[2.3.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.2...v2.3.3 +[2.3.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.1...v2.3.2 +[2.3.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.3.0...v2.3.1 +[2.3.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.42...v2.3.0 +[2.2.42]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.41...v2.2.42 +[2.2.41]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.40...v2.2.41 +[2.2.40]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.39...v2.2.40 +[2.2.39]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.38...v2.2.39 +[2.2.38]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.37...v2.2.38 +[2.2.37]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.36...v2.2.37 +[2.2.36]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.35...v2.2.36 +[2.2.35]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.34...v2.2.35 +[2.2.34]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.33...v2.2.34 +[2.2.33]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.32...v2.2.33 +[2.2.32]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.31...v2.2.32 +[2.2.31]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.30...v2.2.31 +[2.2.30]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.29...v2.2.30 +[2.2.29]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.28...v2.2.29 +[2.2.28]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.27...v2.2.28 +[2.2.27]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.26...v2.2.27 +[2.2.26]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.25...v2.2.26 +[2.2.25]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.24...v2.2.25 +[2.2.24]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.23...v2.2.24 +[2.2.23]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.22...v2.2.23 +[2.2.22]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.21...v2.2.22 +[2.2.21]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.20...v2.2.21 +[2.2.20]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.19...v2.2.20 +[2.2.19]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.18...v2.2.19 +[2.2.18]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.17...v2.2.18 +[2.2.17]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.16...v2.2.17 +[2.2.16]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.15...v2.2.16 +[2.2.15]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.14...v2.2.15 +[2.2.14]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.13...v2.2.14 +[2.2.13]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.12...v2.2.13 +[2.2.12]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.11...v2.2.12 +[2.2.11]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.10...v2.2.11 +[2.2.10]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.9...v2.2.10 +[2.2.9]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.8...v2.2.9 +[2.2.8]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.7...v2.2.8 +[2.2.7]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.6...v2.2.7 +[2.2.6]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.5...v2.2.6 +[2.2.5]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.4...v2.2.5 +[2.2.4]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.3...v2.2.4 +[2.2.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.2...v2.2.3 +[2.2.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.1...v2.2.2 +[2.2.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.1.1...v2.2.0 +[2.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.8...v2.1.0 +[2.0.8]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.7...v2.0.8 +[2.0.7]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.6...v2.0.7 +[2.0.6]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.5...v2.0.6 +[2.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.4...v2.0.5 +[2.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.2...v2.0.0 +[1.16.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.15.1...v1.16.0 +[1.15.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.14.1...v1.15.0 +[1.14.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.5...v1.14.0 +[1.13.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.4...v1.13.5 +[1.13.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.3...v1.13.4 +[1.13.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.2...v1.13.3 +[1.13.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.2...v1.13.0 +[1.12.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.1...v1.12.2 +[1.12.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.12.0...v1.12.1 +[1.12.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.2...v1.12.0 +[1.11.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.4...v1.11.0 +[1.10.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.3...v1.10.4 +[1.10.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.2...v1.10.3 +[1.10.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.1...v1.10.2 +[1.10.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.10.0...v1.10.1 +[1.10.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.9.1...v1.10.0 +[1.9.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.2...v1.9.0 +[1.8.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.2...v1.8.0 +[1.7.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.5...v1.7.0 +[1.6.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.4...v1.6.5 +[1.6.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.2...v1.2.0 +[1.1.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.10...v1.1.0 +[1.0.10]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.9...v1.0.10 +[1.0.9]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.8...v1.0.9 +[1.0.8]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.7...v1.0.8 +[1.0.7]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.6...v1.0.7 +[1.0.6]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.5...v1.0.6 +[1.0.5]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.4...v1.0.5 +[1.0.4]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-jitm/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png new file mode 100644 index 00000000..c2d50e1b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php new file mode 100644 index 00000000..cc667d80 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.asset.php @@ -0,0 +1 @@ + array('jquery', 'wp-polyfill'), 'version' => 'ef911dd8f37f702652eb'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css new file mode 100644 index 00000000..ed102882 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.css @@ -0,0 +1 @@ +.jitm-button{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #000;border-radius:4px;box-sizing:border-box;color:#000;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;margin:0;min-width:90px;outline:0;overflow:hidden;padding:7px 14px 9px;text-align:center;text-decoration:none;text-overflow:ellipsis;vertical-align:top;width:100%}.jitm-button.is-primary{background:#000;color:#fff}.jitm-button:focus,.jitm-button:hover{background:#414141;border-color:#414141;color:#fff}.jitm-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2271b1}.jitm-button:disabled,.jitm-button[disabled]{background:#dcdcde;border-color:#dcdcde;color:#a7aaad;cursor:default}.jitm-button.is-compact{font-size:14px;height:32px;line-height:1;white-space:nowrap}.jitm-button.is-compact .gridicon{margin-top:-8px;top:4px}.jitm-button.is-compact .gridicons-plus-small{margin-left:-4px}.jitm-button.is-compact .gridicons-plus-small:last-of-type{margin-left:0}.jitm-button.is-compact .gridicons-plus-small+.gridicon{margin-left:-4px}.jitm-button.hidden{display:none}.jitm-card{background-color:#fff;background-image:url(images/background-165b2f00927a762c8cf4.png);background-position:100%;background-repeat:no-repeat;border:1px solid #fff;border-radius:2px;box-shadow:0 1px 4px rgba(0,0,0,.16);box-sizing:border-box;clear:both;display:block;margin:3rem 1.25rem 0 auto;padding:1rem 1rem 1rem 1.25rem;position:relative}.jitm-card:after{clear:both;content:".";display:block;height:0;visibility:hidden}.jitm-card.is-compact{margin-bottom:.0625rem}@media(min-width:481px){.jitm-card.is-compact{margin-bottom:1px;padding:1rem 1.5rem}}.jitm-card.is-card-link{padding-right:3rem}.my-jetpack-jitm-card .jitm-card{margin-bottom:0;margin-right:0}#screen-meta-links+.jitm-card{margin:2.5rem 1.5385em 0 auto}.post-php .jitm-card{margin-right:0}.jp-lower .jitm-card{margin:0 0 1.5rem}.jitm-banner.jitm-card{display:flex;position:relative;z-index:2}.jitm-banner.jitm-card:before{border-bottom-left-radius:1px;border-top-left-radius:1px;content:"";height:100%;left:0;position:absolute;top:0;width:4px}@media(max-width:480px){.jitm-banner.jitm-card{display:flex;flex-direction:column}}.jitm-banner.jitm-card.is-card-link{padding:.75rem 3rem .75rem 1rem}.jitm-banner.jitm-card.is-dismissible{padding-right:3rem}.jitm-banner.jitm-card:before{background-color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon{color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon-circle{background-color:#4ab866}.jitm-banner.jitm-card.is-upgrade-personal:before{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon{color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon-circle{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-premium:before{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon{color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon-circle{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-business:before,.jitm-banner.jitm-card.woo-jitm:before{background-color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon{color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon-circle,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon-circle{background-color:#855da6}.jitm-banner.jitm-card .jitm-card__link-indicator{align-items:center;color:#0087be;display:flex}.jitm-banner.jitm-card:hover{transition:all .1s ease-in-out}.jitm-banner.jitm-card:hover.is-card-link{box-shadow:0 0 0 1px #a2a2a2,0 2px 4px #d5d5d5}.jitm-banner.jitm-card:hover .jitm-card__link-indicator{color:#005082}@media(min-width:481px){.jitm-banner.jitm-card{padding:1rem 1rem 1rem 1.25rem}.jitm-banner.jitm-card.is-dismissible{padding-right:1rem}}.jitm-banner__buttons_container{display:flex;gap:1rem;height:50%;margin:auto 1rem auto 0;overflow:hidden}@media(min-width:481px){.jitm-banner__buttons_container{margin-left:1rem}}.jitm-banner__icons{display:flex}.jitm-banner__icons .jitm-banner__icon,.jitm-banner__icons .jitm-banner__icon-circle{border-radius:50%;flex-shrink:0;height:1.5rem;margin-right:1rem;margin-top:-.125rem;text-align:center;top:.25rem;width:1.5rem}.jitm-banner__icons .jitm-banner__icon{align-self:center;color:#fff;display:block}.jitm-banner__icons .jitm-banner__icon-circle{color:#fff;display:none;padding:.1875rem .25rem .25rem .1875rem}@media(min-width:481px){.jitm-banner__icons{align-items:center}.jitm-banner__icons .jitm-banner__icon{display:none}.jitm-banner__icons .jitm-banner__icon-circle{display:block}}.jitm-banner__icon-plan{display:flex;margin-right:1rem}.jitm-banner__icon-plan .dops-plan-icon{height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem{position:relative;top:.125rem}@media(max-width:480px){.jitm-banner__icon-plan .jp-emblem{margin-bottom:1rem}}.jitm-banner__icon-plan .jp-emblem svg{fill:#069e08;height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem .jitm-jp-logo{fill:inherit;height:inherit;width:2.5rem}@media(min-width:481px){.jitm-banner__icon-plan{align-items:center}}.jitm-banner__content{align-items:center;display:flex;flex-grow:1;flex-shrink:100000;flex-wrap:wrap}@media(max-width:480px){.jitm-banner__content{margin-right:0}}@media(min-width:481px){.jitm-banner__content{flex-wrap:nowrap}}@media(max-width:960px){.jitm-banner__content{margin-right:5px}}.jitm-banner__info{flex-grow:1;line-height:1.4}@media(min-width:481px){.jitm-banner__info{flex-basis:50%}}@media(min-width:961px){.jitm-banner__info{flex-basis:70%}}.jitm-banner__info .jitm-banner__description,.jitm-banner__info .jitm-banner__description a,.jitm-banner__info .jitm-banner__title{color:#000}.jitm-banner__info .jitm-banner__title{font-size:.9375rem;font-weight:700;line-height:136%}.jitm-banner__info .jitm-banner__description{font-size:.8125rem;line-height:150%;margin-top:.125rem}.jitm-banner__info .banner__list{font-size:12px;list-style:none;margin:10px 0}.jitm-banner__info .banner__list li{margin:6px 0}.jitm-banner__info .banner__list li .gridicon{fill:#a2a2a2;display:inline;margin-right:12px;vertical-align:bottom}.jitm-banner__action{align-self:center;font-size:.75rem;overflow:hidden;text-align:left}.jitm-banner__action .jitm-banner__prices{display:flex;justify-content:flex-start}.jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:0}.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted,.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted .dops-plan-price__currency-symbol{color:#414141}.has-call-to-action .jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:.5rem}@media(max-width:480px){.jitm-banner__action{margin-top:1rem}}@media(min-width:481px){.jitm-banner__action{text-align:center;width:auto}.jitm-banner__action .is-dismissible{margin-top:2.5rem}.jitm-banner__action .jitm-banner__prices{justify-content:flex-end;text-align:right}}.jitm-banner__dismiss{display:block;line-height:.5;margin-bottom:auto;margin-top:auto;text-decoration:none}.jitm-banner__dismiss:before{color:#6f6f6f;content:"";font:400 20px/1 dashicons}@media(min-width:661px){.jitm-banner__dismiss{margin-right:-.5rem}}@media(max-width:480px){.jitm-banner__dismiss{align-items:center;display:flex;height:48px;justify-content:center;margin:0;position:absolute;right:0;top:0;width:48px}}.jitm-banner__action+.jitm-banner__dismiss{margin-left:.625rem}#dolly+.jitm-card{margin:3rem 1rem 0 auto} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js new file mode 100644 index 00000000..0a82f88b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.js @@ -0,0 +1 @@ +!function(){"use strict";var t,e={567:function(t){t.exports=window.jQuery}},a={};function n(t){var i=a[t];if(void 0!==i)return i.exports;var c=a[t]={exports:{}};return e[t](c,c.exports,n),c.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t=n(567),n.n(t)()(document).ready((function(t){var e={default:function(e){var a='
        ';if(a+='
        ',a+='
        '+e.content.icon+"
        ",a+='
        ',a+='
        '+e.content.message+"
        ",e.content.description&&""!==e.content.description){if(a+='
        '+e.content.description,e.content.list.length>0){a+='
        "}if(a+="
        ",a+="
        ",a+='
        ',e.activate_module&&(a+='"),e.CTA.message){var c="jitm-button is-compact jptracks";e.CTA.primary&&null===e.activate_module&&(c+=" is-primary");var o=e.CTA.ajax_action;a+='
        ',a+='"+e.CTA.message+"",a+="
        "}return a+="
        ",e.is_dismissible&&(a+=''),t(a+="
        ")}},a=function(){t(".jetpack-jitm-message").each((function(){var a=t(this),n=a.data("message-path"),i=a.data("query"),c=a.data("redirect"),o=location.hash;o=o.replace(/#\//,"_"),n.includes("jetpack_page_my-jetpack")?n=n.replace("jetpack_page_my-jetpack","jetpack_page_my-jetpack"+o):"_dashboard"!==o&&(n=n.replace("toplevel_page_jetpack","toplevel_page_jetpack"+o));var r=!!t(".jetpack-logo__masthead").length;t.get(window.jitm_config.api_root+"jetpack/v4/jitm",{message_path:n,query:i,full_jp_logo_exists:r,_wpnonce:a.data("nonce")}).then((function(n){"object"==typeof n&&n[1]&&(n=[n[1]]),0!==n.length&&n[0].content&&function(a,n,i){var c;(c=n.template)&&e[c]||(c="default"),n.url=n.url+"&redirect="+i;var o,r=e[c](n);r.find(".jitm-banner__dismiss").on("click",(o=r,function(e){e.preventDefault(),o.hide(),t.ajax({url:window.jitm_config.api_root+"jetpack/v4/jitm",method:"POST",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",window.jitm_config.nonce)},data:{id:n.id,feature_class:n.feature_class}})})),t("#jp-admin-notices").length>0?(a.innerHTML=r,t("#jp-admin-notices").find(".jitm-card")&&t(".jitm-card").replaceWith(r),r.prependTo(t("#jp-admin-notices"))):a.replaceWith(r),r.find("#jitm-banner__activate a").on("click",(function(){var e=t(this);if(e.attr("disabled"))return!1;t.ajax({url:window.jitm_config.api_root+"jetpack/v4/module/"+e.data("module")+"/active",method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",a.data("nonce")),t("#jitm-banner__activate a").text(window.jitm_config.activating_module_text),t("#jitm-banner__activate a").attr("disabled",!0)}}).done((function(){t("#jitm-banner__activate a").text(window.jitm_config.activated_module_text),t("#jitm-banner__activate a").attr("disabled",!0),setTimeout((function(){r.fadeOut("slow")}),2e3)}))})),r.find(".jitm-button[data-ajax-action]").on("click",(function(e){e.preventDefault();var n=t(this);return n.attr("disabled",!0),t.post(window.ajaxurl,{action:n.data("ajax-action"),_nonce:a.data("ajax-nonce")}).done((function(){r.fadeOut("slow")})).fail((function(){n.attr("disabled",!1)})),!1}))}(a,n[0],c)}))}))};a(),t(window).on("hashchange",(function(t){const e=t.originalEvent.newURL;if(e.indexOf("jetpack#/")>=0||e.indexOf("my-jetpack")>=0){var n=document.querySelector(".jitm-card");n&&n.remove(),a()}}))}))}(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css new file mode 100644 index 00000000..d8e4247d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/build/index.rtl.css @@ -0,0 +1 @@ +.jitm-button{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #000;border-radius:4px;box-sizing:border-box;color:#000;cursor:pointer;display:inline-block;font-size:14px;font-weight:600;margin:0;min-width:90px;outline:0;overflow:hidden;padding:7px 14px 9px;text-align:center;text-decoration:none;text-overflow:ellipsis;vertical-align:top;width:100%}.jitm-button.is-primary{background:#000;color:#fff}.jitm-button:focus,.jitm-button:hover{background:#414141;border-color:#414141;color:#fff}.jitm-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2271b1}.jitm-button:disabled,.jitm-button[disabled]{background:#dcdcde;border-color:#dcdcde;color:#a7aaad;cursor:default}.jitm-button.is-compact{font-size:14px;height:32px;line-height:1;white-space:nowrap}.jitm-button.is-compact .gridicon{margin-top:-8px;top:4px}.jitm-button.is-compact .gridicons-plus-small{margin-right:-4px}.jitm-button.is-compact .gridicons-plus-small:last-of-type{margin-right:0}.jitm-button.is-compact .gridicons-plus-small+.gridicon{margin-right:-4px}.jitm-button.hidden{display:none}.jitm-card{background-color:#fff;background-image:url(images/background-165b2f00927a762c8cf4.png);background-position:0;background-repeat:no-repeat;border:1px solid #fff;border-radius:2px;box-shadow:0 1px 4px rgba(0,0,0,.16);box-sizing:border-box;clear:both;display:block;margin:3rem auto 0 1.25rem;padding:1rem 1.25rem 1rem 1rem;position:relative}.jitm-card:after{clear:both;content:".";display:block;height:0;visibility:hidden}.jitm-card.is-compact{margin-bottom:.0625rem}@media(min-width:481px){.jitm-card.is-compact{margin-bottom:1px;padding:1rem 1.5rem}}.jitm-card.is-card-link{padding-left:3rem}.my-jetpack-jitm-card .jitm-card{margin-bottom:0;margin-left:0}#screen-meta-links+.jitm-card{margin:2.5rem auto 0 1.5385em}.post-php .jitm-card{margin-left:0}.jp-lower .jitm-card{margin:0 0 1.5rem}.jitm-banner.jitm-card{display:flex;position:relative;z-index:2}.jitm-banner.jitm-card:before{border-bottom-right-radius:1px;border-top-right-radius:1px;content:"";height:100%;position:absolute;right:0;top:0;width:4px}@media(max-width:480px){.jitm-banner.jitm-card{display:flex;flex-direction:column}}.jitm-banner.jitm-card.is-card-link{padding:.75rem 1rem .75rem 3rem}.jitm-banner.jitm-card.is-dismissible{padding-left:3rem}.jitm-banner.jitm-card:before{background-color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon{color:#4ab866}.jitm-banner.jitm-card .jitm-banner__icon-circle{background-color:#4ab866}.jitm-banner.jitm-card.is-upgrade-personal:before{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon{color:#f0b849}.jitm-banner.jitm-card.is-upgrade-personal .jitm-banner__icon-circle{background-color:#f0b849}.jitm-banner.jitm-card.is-upgrade-premium:before{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon{color:#069e08}.jitm-banner.jitm-card.is-upgrade-premium .jitm-banner__icon-circle{background-color:#069e08}.jitm-banner.jitm-card.is-upgrade-business:before,.jitm-banner.jitm-card.woo-jitm:before{background-color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon{color:#855da6}.jitm-banner.jitm-card.is-upgrade-business .jitm-banner__icon-circle,.jitm-banner.jitm-card.woo-jitm .jitm-banner__icon-circle{background-color:#855da6}.jitm-banner.jitm-card .jitm-card__link-indicator{align-items:center;color:#0087be;display:flex}.jitm-banner.jitm-card:hover{transition:all .1s ease-in-out}.jitm-banner.jitm-card:hover.is-card-link{box-shadow:0 0 0 1px #a2a2a2,0 2px 4px #d5d5d5}.jitm-banner.jitm-card:hover .jitm-card__link-indicator{color:#005082}@media(min-width:481px){.jitm-banner.jitm-card{padding:1rem 1.25rem 1rem 1rem}.jitm-banner.jitm-card.is-dismissible{padding-left:1rem}}.jitm-banner__buttons_container{display:flex;gap:1rem;height:50%;margin:auto 0 auto 1rem;overflow:hidden}@media(min-width:481px){.jitm-banner__buttons_container{margin-right:1rem}}.jitm-banner__icons{display:flex}.jitm-banner__icons .jitm-banner__icon,.jitm-banner__icons .jitm-banner__icon-circle{border-radius:50%;flex-shrink:0;height:1.5rem;margin-left:1rem;margin-top:-.125rem;text-align:center;top:.25rem;width:1.5rem}.jitm-banner__icons .jitm-banner__icon{align-self:center;color:#fff;display:block}.jitm-banner__icons .jitm-banner__icon-circle{color:#fff;display:none;padding:.1875rem .1875rem .25rem .25rem}@media(min-width:481px){.jitm-banner__icons{align-items:center}.jitm-banner__icons .jitm-banner__icon{display:none}.jitm-banner__icons .jitm-banner__icon-circle{display:block}}.jitm-banner__icon-plan{display:flex;margin-left:1rem}.jitm-banner__icon-plan .dops-plan-icon{height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem{position:relative;top:.125rem}@media(max-width:480px){.jitm-banner__icon-plan .jp-emblem{margin-bottom:1rem}}.jitm-banner__icon-plan .jp-emblem svg{fill:#069e08;height:2rem;width:2rem}.jitm-banner__icon-plan .jp-emblem .jitm-jp-logo{fill:inherit;height:inherit;width:2.5rem}@media(min-width:481px){.jitm-banner__icon-plan{align-items:center}}.jitm-banner__content{align-items:center;display:flex;flex-grow:1;flex-shrink:100000;flex-wrap:wrap}@media(max-width:480px){.jitm-banner__content{margin-left:0}}@media(min-width:481px){.jitm-banner__content{flex-wrap:nowrap}}@media(max-width:960px){.jitm-banner__content{margin-left:5px}}.jitm-banner__info{flex-grow:1;line-height:1.4}@media(min-width:481px){.jitm-banner__info{flex-basis:50%}}@media(min-width:961px){.jitm-banner__info{flex-basis:70%}}.jitm-banner__info .jitm-banner__description,.jitm-banner__info .jitm-banner__description a,.jitm-banner__info .jitm-banner__title{color:#000}.jitm-banner__info .jitm-banner__title{font-size:.9375rem;font-weight:700;line-height:136%}.jitm-banner__info .jitm-banner__description{font-size:.8125rem;line-height:150%;margin-top:.125rem}.jitm-banner__info .banner__list{font-size:12px;list-style:none;margin:10px 0}.jitm-banner__info .banner__list li{margin:6px 0}.jitm-banner__info .banner__list li .gridicon{fill:#a2a2a2;display:inline;margin-left:12px;vertical-align:bottom}.jitm-banner__action{align-self:center;font-size:.75rem;overflow:hidden;text-align:right}.jitm-banner__action .jitm-banner__prices{display:flex;justify-content:flex-start}.jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:0}.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted,.jitm-banner__action .jitm-banner__prices .dops-plan-price.is-discounted .dops-plan-price__currency-symbol{color:#414141}.has-call-to-action .jitm-banner__action .jitm-banner__prices .dops-plan-price{margin-bottom:.5rem}@media(max-width:480px){.jitm-banner__action{margin-top:1rem}}@media(min-width:481px){.jitm-banner__action{text-align:center;width:auto}.jitm-banner__action .is-dismissible{margin-top:2.5rem}.jitm-banner__action .jitm-banner__prices{justify-content:flex-end;text-align:left}}.jitm-banner__dismiss{display:block;line-height:.5;margin-bottom:auto;margin-top:auto;text-decoration:none}.jitm-banner__dismiss:before{color:#6f6f6f;content:"";font:400 20px/1 dashicons}@media(min-width:661px){.jitm-banner__dismiss{margin-left:-.5rem}}@media(max-width:480px){.jitm-banner__dismiss{align-items:center;display:flex;height:48px;justify-content:center;left:0;margin:0;position:absolute;top:0;width:48px}}.jitm-banner__action+.jitm-banner__dismiss{margin-right:.625rem}#dolly+.jitm-card{margin:3rem auto 0 1rem} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json new file mode 100644 index 00000000..9a217104 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/composer.json @@ -0,0 +1,60 @@ +{ + "name": "automattic/jetpack-jitm", + "description": "Just in time messages for Jetpack", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-a8c-mc-stats": "^1.4.19", + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-connection": "^1.51.4", + "automattic/jetpack-device-detection": "^1.4.24", + "automattic/jetpack-logo": "^1.5.22", + "automattic/jetpack-partner": "^1.7.22", + "automattic/jetpack-redirect": "^1.7.24", + "automattic/jetpack-status": "^1.16.3" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-production": [ + "pnpm run build-production" + ], + "build-development": [ + "pnpm run build" + ], + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-jitm", + "textdomain": "jetpack-jitm", + "version-constants": { + "::PACKAGE_VERSION": "src/class-jitm.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-jitm/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.3.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php new file mode 100644 index 00000000..b33fe606 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php @@ -0,0 +1,312 @@ +register(); + } + + /** + * Pre/Post Connection JITM factory metod + * + * @return Post_Connection_JITM|Pre_Connection_JITM JITM instance. + */ + public static function get_instance() { + if ( ( new Connection_Manager() )->is_connected() ) { + $jitm = new Post_Connection_JITM(); + } else { + $jitm = new Pre_Connection_JITM(); + } + return $jitm; + } + + /** + * Sets up JITM action callbacks if needed. + */ + public function register() { + if ( did_action( 'jetpack_registered_jitms' ) ) { + // JITMs have already been registered. + return; + } + + if ( ! $this->jitms_enabled() ) { + // Do nothing. + return; + } + + add_action( 'rest_api_init', array( __NAMESPACE__ . '\\Rest_Api_Endpoints', 'register_endpoints' ) ); + + add_action( 'current_screen', array( $this, 'prepare_jitms' ) ); + + /** + * These are sync actions that we need to keep track of for jitms. + */ + add_filter( 'jetpack_sync_before_send_updated_option', array( $this, 'jetpack_track_last_sync_callback' ), 99 ); + + /** + * Fires when the JITMs are registered. This action is used to ensure that + * JITMs are registered only once. + * + * @since 1.16.0 + */ + do_action( 'jetpack_registered_jitms' ); + } + + /** + * Checks the jetpack_just_in_time_msgs filters and whether the site + * is offline to determine whether JITMs are enabled. + * + * @return bool True if JITMs are enabled, else false. + */ + public function jitms_enabled() { + /** + * Filter to turn off all just in time messages + * + * @since 1.1.0 + * @since-jetpack 3.7.0 + * @since-jetpack 5.4.0 Correct docblock to reflect default arg value + * + * @param bool true Whether to show just in time messages. + */ + if ( ! apply_filters( 'jetpack_just_in_time_msgs', true ) ) { + return false; + } + + // Folks cannot connect to WordPress.com and won't really be able to act on the pre-connection messages. So bail. + if ( ( new Status() )->is_offline_mode() ) { + return false; + } + + return true; + } + + /** + * Prepare actions according to screen and post type. + * + * @since 1.1.0 + * @since-jetpack 3.8.2 + * + * @uses Jetpack_Autoupdate::get_possible_failures() + * + * @param \WP_Screen $screen WP Core's screen object. + */ + public function prepare_jitms( $screen ) { + /** + * Filter to hide JITMs on certain screens. + * + * @since 1.14.0 + * + * @param bool true Whether to show just in time messages. + * @param string $string->id The ID of the current screen. + */ + if ( apply_filters( 'jetpack_display_jitms_on_screen', true, $screen->id ) ) { + add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) ); + add_action( 'admin_notices', array( $this, 'ajax_message' ) ); + add_action( 'edit_form_top', array( $this, 'ajax_message' ) ); + } + } + + /** + * Function to enqueue jitm css and js + */ + public function jitm_enqueue_files() { + if ( $this->is_gutenberg_page() ) { + return; + } + + Assets::register_script( + 'jetpack-jitm', + '../build/index.js', + __FILE__, + array( + 'in_footer' => true, + 'dependencies' => array( 'jquery' ), + ) + ); + Assets::enqueue_script( 'jetpack-jitm' ); + wp_localize_script( + 'jetpack-jitm', + 'jitm_config', + array( + 'api_root' => esc_url_raw( rest_url() ), + 'activate_module_text' => esc_html__( 'Activate', 'jetpack-jitm' ), + 'activated_module_text' => esc_html__( 'Activated', 'jetpack-jitm' ), + 'activating_module_text' => esc_html__( 'Activating', 'jetpack-jitm' ), + 'nonce' => wp_create_nonce( 'wp_rest' ), + ) + ); + } + + /** + * Is the current page a block editor page? + * + * @since 1.1.0 + * @since-jetpack 8.0.0 + */ + public function is_gutenberg_page() { + $current_screen = get_current_screen(); + return ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ); + } + + /** + * Get's the current message path for display of a JITM + * + * @return string The message path + */ + public function get_message_path() { + $screen = get_current_screen(); + + return 'wp:' . $screen->id . ':' . current_filter(); + } + + /** + * Injects the dom to show a JITM inside of wp-admin. + */ + public function ajax_message() { + if ( ! is_admin() ) { + return; + } + + // do not display on Gutenberg pages. + if ( $this->is_gutenberg_page() ) { + return; + } + + $message_path = $this->get_message_path(); + $query_string = _http_build_query( $_GET, '', ',' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $current_screen = isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- Escaped below + ?> +
        + ' . ( ( $full_jp_logo_exists ) ? $jetpack_logo->get_jp_emblem() : $jetpack_logo->get_jp_emblem_larger() ) . ''; + break; + case 'woocommerce': + $content_icon = ''; + break; + default: + $content_icon = ''; + break; + } + return $content_icon; + } + + /** + * Returns an array containing the supported icons for JITMs. + * + * The list includes an empty string, which is used when no icon should be displayed. + * + * @return array The list of supported icons. + */ + public function get_supported_icons() { + return array( + 'jetpack', + 'woocommerce', + '', + ); + } + + /** + * Stores dismiss data into an option + * + * @param string $key Dismiss key. + */ + public function save_dismiss( $key ) { + $hide_jitm = \Jetpack_Options::get_option( 'hide_jitm' ); + if ( ! is_array( $hide_jitm ) ) { + $hide_jitm = array(); + } + + if ( ! isset( $hide_jitm[ $key ] ) || ! is_array( $hide_jitm[ $key ] ) ) { + $hide_jitm[ $key ] = array( + 'last_dismissal' => 0, + 'number' => 0, + ); + } + + $hide_jitm[ $key ] = array( + 'last_dismissal' => time(), + 'number' => $hide_jitm[ $key ]['number'] + 1, + ); + + \Jetpack_Options::update_option( 'hide_jitm', $hide_jitm ); + } + + /** + * Sets the 'jetpack_last_plugin_sync' transient when the active_plugins option is synced. + * + * @param array $params The action parameters. + * + * @return array Returns the action parameters unchanged. + */ + public function jetpack_track_last_sync_callback( $params ) { + /** + * This filter is documented in the Automattic\Jetpack\JITMS\Post_Connection_JITM class. + */ + if ( ! apply_filters( 'jetpack_just_in_time_msg_cache', true ) ) { + return $params; + } + + if ( is_array( $params ) && isset( $params[0] ) ) { + $option = $params[0]; + if ( 'active_plugins' === $option ) { + // Use the cache if we can, but not terribly important if it gets evicted. + set_transient( 'jetpack_last_plugin_sync', time(), HOUR_IN_SECONDS ); + } + } + + return $params; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php new file mode 100644 index 00000000..4ff2eb76 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php @@ -0,0 +1,416 @@ +tracking = new Tracking(); + } + + /** + * A special filter for WooCommerce, to set a message based on local state. + * + * @param string $content The current message. + * + * @return array The new message. + */ + public static function jitm_woocommerce_services_msg( $content ) { + if ( ! function_exists( 'wc_get_base_location' ) ) { + return $content; + } + + $base_location = wc_get_base_location(); + + switch ( $base_location['country'] ) { + case 'US': + $content->message = esc_html__( 'New free service: Show USPS shipping rates on your store! Added bonus: print shipping labels without leaving WooCommerce.', 'jetpack-jitm' ); + break; + case 'CA': + $content->message = esc_html__( 'New free service: Show Canada Post shipping rates on your store!', 'jetpack-jitm' ); + break; + default: + $content->message = ''; + } + + return $content; + } + + /** + * A special filter for WooCommerce Call To Action button + * + * @return string The new CTA + */ + public static function jitm_jetpack_woo_services_install() { + return wp_nonce_url( + add_query_arg( + array( + 'wc-services-action' => 'install', + ), + admin_url( 'admin.php?page=wc-settings' ) + ), + 'wc-services-install' + ); + } + + /** + * A special filter for WooCommerce Call To Action button. + * + * @return string The new CTA + */ + public static function jitm_jetpack_woo_services_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'wc-services-action' => 'activate', + ), + admin_url( 'admin.php?page=wc-settings' ) + ), + 'wc-services-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Creative Mail plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_creative_mail_install() { + return wp_nonce_url( + add_query_arg( + array( + 'creative-mail-action' => 'install', + ), + admin_url( 'edit.php?post_type=feedback' ) + ), + 'creative-mail-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Creative Mail plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_creative_mail_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'creative-mail-action' => 'activate', + ), + admin_url( 'edit.php?post_type=feedback' ) + ), + 'creative-mail-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Jetpack Backup plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_backup_install() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-backup-action' => 'install', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-backup-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Jetpack Backup plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_backup_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-backup-action' => 'activate', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-backup-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to install the Jetpack Boost plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_boost_install() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-boost-action' => 'install', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-boost-install' + ); + } + + /** + * A special filter used in the CTA of a JITM offering to activate the Jetpack Boost plugin. + * + * @return string The new CTA + */ + public static function jitm_jetpack_boost_activate() { + return wp_nonce_url( + add_query_arg( + array( + 'jetpack-boost-action' => 'activate', + ), + admin_url( 'admin.php?page=jetpack' ) + ), + 'jetpack-boost-install' + ); + } + + /** + * Dismisses a JITM feature class so that it will no longer be shown. + * + * @param string $id The id of the JITM that was dismissed. + * @param string $feature_class The feature class of the JITM that was dismissed. + * + * @return bool Always true. + */ + public function dismiss( $id, $feature_class ) { + $this->tracking->record_user_event( + 'jitm_dismiss_client', + array( + 'jitm_id' => $id, + 'feature_class' => $feature_class, + ) + ); + $this->save_dismiss( $feature_class ); + return true; + } + + /** + * Asks the wpcom API for the current message to display keyed on query string and message path + * + * @param string $message_path The message path to ask for. + * @param string $query The query string originally from the front end. + * @param bool $full_jp_logo_exists If there is a full Jetpack logo already on the page. + * + * @return array The JITM's to show, or an empty array if there is nothing to show + */ + public function get_messages( $message_path, $query, $full_jp_logo_exists ) { + // WooCommerce Services. + add_filter( 'jitm_woocommerce_services_msg', array( $this, 'jitm_woocommerce_services_msg' ) ); + add_filter( 'jitm_jetpack_woo_services_install', array( $this, 'jitm_jetpack_woo_services_install' ) ); + add_filter( 'jitm_jetpack_woo_services_activate', array( $this, 'jitm_jetpack_woo_services_activate' ) ); + + // Creative Mail. + add_filter( 'jitm_jetpack_creative_mail_install', array( $this, 'jitm_jetpack_creative_mail_install' ) ); + add_filter( 'jitm_jetpack_creative_mail_activate', array( $this, 'jitm_jetpack_creative_mail_activate' ) ); + + // Jetpack Backup. + add_filter( 'jitm_jetpack_backup_install', array( $this, 'jitm_jetpack_backup_install' ) ); + add_filter( 'jitm_jetpack_backup_activate', array( $this, 'jitm_jetpack_backup_activate' ) ); + + // Jetpack Boost. + add_filter( 'jitm_jetpack_boost_install', array( $this, 'jitm_jetpack_boost_install' ) ); + add_filter( 'jitm_jetpack_boost_activate', array( $this, 'jitm_jetpack_boost_activate' ) ); + + $user = wp_get_current_user(); + + // Unauthenticated or invalid requests just bail. + if ( ! $user ) { + return array(); + } + + $user_roles = implode( ',', $user->roles ); + $site_id = \Jetpack_Options::get_option( 'id' ); + + // Build our jitm request. + $path = add_query_arg( + array( + 'external_user_id' => urlencode_deep( $user->ID ), + 'user_roles' => urlencode_deep( $user_roles ), + 'query_string' => urlencode_deep( $query ), + 'mobile_browser' => Device_Detection::is_smartphone() ? 1 : 0, + '_locale' => get_user_locale(), + ), + sprintf( '/sites/%d/jitm/%s', $site_id, $message_path ) + ); + + // Attempt to get from cache. + $envelopes = get_transient( 'jetpack_jitm_' . substr( md5( $path ), 0, 31 ) ); + + // If something is in the cache and it was put in the cache after the last sync we care about, use it. + $use_cache = false; + + /** + * Filter to turn off jitm caching + * + * @since 1.1.0 + * @since-jetpack 5.4.0 + * + * @param bool true Whether to cache just in time messages + */ + if ( apply_filters( 'jetpack_just_in_time_msg_cache', true ) ) { + $use_cache = true; + } + + if ( $use_cache ) { + $last_sync = (int) get_transient( 'jetpack_last_plugin_sync' ); + $from_cache = $envelopes && $last_sync > 0 && $last_sync < $envelopes['last_response_time']; + } else { + $from_cache = false; + } + + // Otherwise, ask again. + if ( ! $from_cache ) { + $wpcom_response = Client::wpcom_json_api_request_as_blog( + $path, + '2', + array( + 'user_id' => $user->ID, + 'user_roles' => implode( ',', $user->roles ), + ), + null, + 'wpcom' + ); + + // silently fail...might be helpful to track it? + if ( is_wp_error( $wpcom_response ) ) { + return array(); + } + + $envelopes = json_decode( $wpcom_response['body'] ); + + if ( ! is_array( $envelopes ) ) { + return array(); + } + + $expiration = isset( $envelopes[0] ) ? $envelopes[0]->ttl : 300; + + // Do not cache if expiration is 0 or we're not using the cache. + if ( 0 !== $expiration && $use_cache ) { + $envelopes['last_response_time'] = time(); + + set_transient( 'jetpack_jitm_' . substr( md5( $path ), 0, 31 ), $envelopes, $expiration ); + } + } + + $hidden_jitms = \Jetpack_Options::get_option( 'hide_jitm' ); + unset( $envelopes['last_response_time'] ); + + /** + * Allow adding your own custom JITMs after a set of JITMs has been received. + * + * @since 1.1.0 + * @since-jetpack 6.9.0 + * @since-jetpack 8.3.0 - Added Message path. + * + * @param array $envelopes array of existing JITMs. + * @param string $message_path The message path to ask for. + */ + $envelopes = apply_filters( 'jetpack_jitm_received_envelopes', $envelopes, $message_path ); + + foreach ( $envelopes as $idx => &$envelope ) { + + $dismissed_feature = isset( $hidden_jitms[ $envelope->feature_class ] ) && is_array( $hidden_jitms[ $envelope->feature_class ] ) ? $hidden_jitms[ $envelope->feature_class ] : null; + + // If the this feature class has been dismissed and the request has not passed the ttl, skip it as it's been dismissed. + if ( is_array( $dismissed_feature ) && ( time() - $dismissed_feature['last_dismissal'] < $envelope->expires || $dismissed_feature['number'] >= $envelope->max_dismissal ) ) { + unset( $envelopes[ $idx ] ); + continue; + } + + $this->tracking->record_user_event( + 'jitm_view_client', + array( + 'jitm_id' => $envelope->id, + ) + ); + + $url_params = array( + 'u' => $user->ID, + ); + + // Get affiliate code and add it to the array of URL parameters. + $aff = Partner::init()->get_partner_code( Partner::AFFILIATE_CODE ); + if ( '' !== $aff ) { + $url_params['aff'] = $aff; + } + + // Check if the current user has connected their WP.com account + // and if not add this information to the the array of URL parameters. + if ( ! ( new Manager() )->is_user_connected( $user->ID ) ) { + $url_params['query'] = 'unlinked=1'; + } + $envelope->url = esc_url( Redirect::get_url( "jitm-$envelope->id", $url_params ) ); + + $stats = new A8c_Mc_Stats(); + + $envelope->jitm_stats_url = $stats->build_stats_url( array( 'x_jetpack-jitm' => $envelope->id ) ); + + // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + // $CTA is not valid per PHPCS, but it is part of the return from WordPress.com, so allowing. + if ( $envelope->CTA->hook ) { + $envelope->url = apply_filters( 'jitm_' . $envelope->CTA->hook, $envelope->url ); + unset( $envelope->CTA->hook ); + } + // phpcs:enable + + if ( isset( $envelope->content->hook ) ) { + $envelope->content = apply_filters( 'jitm_' . $envelope->content->hook, $envelope->content ); + unset( $envelope->content->hook ); + } + + // No point in showing an empty message. + if ( empty( $envelope->content->message ) ) { + unset( $envelopes[ $idx ] ); + continue; + } + + $envelope->content->icon = $this->generate_icon( $envelope->content->icon, $full_jp_logo_exists ); + + $stats->add( 'jitm', $envelope->id . '-viewed' ); + $stats->do_server_side_stats(); + } + + return $envelopes; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php new file mode 100644 index 00000000..6a779873 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php @@ -0,0 +1,171 @@ +validate_messages( $messages ); + + $formatted_messages = array(); + + foreach ( $messages as $message ) { + if ( ! preg_match( $message['message_path'], $message_path ) ) { + continue; + } + + $obj = new \stdClass(); + $obj->CTA = array( // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'message' => $message['button_caption'], + 'newWindow' => false, + ); + $obj->url = $message['button_link']; + $obj->id = $message['id']; + $obj->is_dismissible = true; + $obj->content = array( + 'message' => $message['message'], + 'description' => $message['description'], + 'list' => array(), + 'icon' => $this->get_message_icon( $message ), + ); + + $formatted_messages[] = $obj; + } + + return $formatted_messages; + } + + /** + * Validates that each of the messages contains all of the required keys: + * - id + * - message_path + * - message + * - description + * - button_link + * - button_caption + * + * @param array $messages An array of JITM messages. + * + * @return array An array of JITM messages that contain all of the required keys. + */ + private function validate_messages( $messages ) { + if ( ! is_array( $messages ) ) { + return array(); + } + + $expected_keys = array_flip( array( 'id', 'message_path', 'message', 'description', 'button_link', 'button_caption' ) ); + + foreach ( $messages as $index => $message ) { + if ( count( array_intersect_key( $expected_keys, $message ) ) !== count( $expected_keys ) ) { + // Remove any messages that are missing expected keys. + unset( $messages[ $index ] ); + } + } + + return $messages; + } + + /** + * Get the icon for the message. + * + * The message may contain an 'icon' key. If the value of the 'icon' key matches a supported icon (or empty string), the value is used. + * If the message does not contain an icon key or if the value does not match a supported icon, the Jetpack icon is used by default. + * + * @param array $message A pre-connection JITM. + * + * @return string The icon to use in the JITM. + */ + private function get_message_icon( $message ) { + // Default to the Jetpack icon. + $icon = 'jetpack'; + + if ( ! isset( $message['icon'] ) ) { + return $icon; + } + + $supported_icons = $this->get_supported_icons(); + + if ( in_array( $message['icon'], $supported_icons, true ) ) { + // Only use the message icon if it's a supported icon or an empty string (for no icon). + $icon = $message['icon']; + } + + return $icon; + } + + /** + * Retrieve the current message to display keyed on query string and message path + * + * @param string $message_path The message path to ask for. + * @param string $query The query string originally from the front end. Unused in this subclass. + * @param bool $full_jp_logo_exists If there is a full Jetpack logo already on the page. + * + * @return array The JITMs to show, or an empty array if there is nothing to show + */ + public function get_messages( $message_path, $query, $full_jp_logo_exists ) { + if ( ! current_user_can( 'install_plugins' ) ) { + return array(); + } + + $messages = $this->filter_messages( $message_path ); + + if ( empty( $messages ) ) { + return array(); + } + + $hidden_jitms = \Jetpack_Options::get_option( 'hide_jitm' ); + + foreach ( $messages as $idx => &$envelope ) { + $dismissed_feature = isset( $hidden_jitms[ 'pre-connection-' . $envelope->id ] ) && + is_array( $hidden_jitms[ 'pre-connection-' . $envelope->id ] ) ? $hidden_jitms[ 'pre-connection-' . $envelope->id ] : null; + + if ( is_array( $dismissed_feature ) ) { + unset( $messages[ $idx ] ); + continue; + } + + $envelope->content['icon'] = $this->generate_icon( $envelope->content['icon'], $full_jp_logo_exists ); + } + + return $messages; + } + + /** + * Dismisses a JITM ID so that it will no longer be shown. + * + * @param string $id The id of the JITM that was dismissed. + * + * @return bool Always true + */ + public function dismiss( $id ) { + $this->save_dismiss( 'pre-connection-' . $id ); + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php new file mode 100644 index 00000000..ce8338ea --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php @@ -0,0 +1,91 @@ + WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_jitm_message', + 'permission_callback' => '__return_true', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/jitm', + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => __CLASS__ . '::delete_jitm_message', + 'permission_callback' => __CLASS__ . '::delete_jitm_message_permission_callback', + ) + ); + } + + /** + * Asks for a jitm, unless they've been disabled, in which case it returns an empty array + * + * @param WP_REST_Request $request The request object. + * + * @return array An array of jitms + */ + public static function get_jitm_message( $request ) { + $jitm = JITM::get_instance(); + + if ( ! $jitm->jitms_enabled() ) { + return array(); + } + + return $jitm->get_messages( $request['message_path'], urldecode_deep( $request['query'] ), 'true' === $request['full_jp_logo_exists'] ? true : false ); + } + + /** + * Dismisses a jitm. + * + * @param WP_REST_Request $request The request object. + * + * @return bool Always True + */ + public static function delete_jitm_message( $request ) { + $jitm = JITM::get_instance(); + + if ( ! $jitm->jitms_enabled() ) { + return true; + } + + return $jitm->dismiss( $request['id'], $request['feature_class'] ); + } + + /** + * Verify that the user can dismiss JITM messages. + * + * @return bool|WP_Error True if user is able to dismiss JITM messages. + */ + public static function delete_jitm_message_permission_callback() { + if ( current_user_can( 'read' ) ) { + return true; + } + + return new \WP_Error( 'invalid_user_permission_jetpack_delete_jitm_message', REST_Connector::get_user_permissions_error_msg(), array( 'status' => rest_authorization_required_code() ) ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss new file mode 100644 index 00000000..f9670ad5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/css/jetpack-admin-jitm.scss @@ -0,0 +1,478 @@ +// Just in Time Messaging - message prompts + +// TODO: Switch to using the `@automattic/jetpack-base-styles` package when its ready. +@import '../../plugins/jetpack/_inc/client/scss/functions/rem'; +@import '../../plugins/jetpack/_inc/client/scss/variables/colors'; +@import '../../plugins/jetpack/_inc/client/scss/mixins/breakpoints'; +@import '../../plugins/jetpack/_inc/client/scss/calypso-colors'; + +@mixin clear-fix { + &::after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } +} + +@mixin jitm-banner-color( $color ) { + &::before { + background-color: $color; + } + + .jitm-banner__icon { + color: $color; + } + + .jitm-banner__icon-circle { + background-color: $color; + } +} + +// New JITMS - modified calypso banner styles +$blue-medium-dark: #2271b1; +$jp-gray: #dcdcde; +$jp-gray-20: #a7aaad; + +.jitm-button { + border-style: solid; + border-width: 1px; + cursor: pointer; + display: inline-block; + margin: 0; + outline: 0; + overflow: hidden; + text-overflow: ellipsis; + text-decoration: none; + vertical-align: top; + box-sizing: border-box; + font-size: 14px; + border-radius: 4px; + padding: 7px 14px 9px; + -webkit-appearance: none; + appearance: none; + text-align: center; + min-width: 90px; + font-weight: 600; + border-color: black; + background: $white; + color: black; + width: 100%; + + // Primary buttons + &.is-primary { + background: black; + color: $white; + } + + &:hover, + &:focus { + border-color: $gray-dark; + background: $gray-dark; + color: $white; + } + &:focus { + box-shadow: + 0 0 0 1px $white, + 0 0 0 3px $blue-medium-dark; + } + + &[disabled], + &:disabled { + color: $jp-gray-20; + background: $jp-gray; + border-color: $jp-gray; + cursor: default; + } + &.is-compact { + height: 32px; + font-size: 14px; + line-height: 1; + white-space: nowrap; + + .gridicon { + top: 4px; + margin-top: -8px; + } + // Make the left margin of the small plus icon visually less huge + .gridicons-plus-small { + margin-left: -4px; + } + // Reset the left margin if the button contains only the plus icon + .gridicons-plus-small:last-of-type { + margin-left: 0; + } + // Make plus icon nudged closer to adjacent icons for add-people and add-plugin type buttons + .gridicons-plus-small + .gridicon { + margin-left: -4px; + } + } + &.hidden { + display: none; + } +} + +.jitm-card { + display: block; + clear: both; + position: relative; + margin: rem( 48px ) rem( 20px ) 0 auto; + padding: rem( 16px ); + padding-left: rem( 20px ); + box-sizing: border-box; + background-color: $white; + background-image: url( "../images/background.png" ); + background-repeat: no-repeat; + background-position: right center; + border: 1px solid $white; + border-radius: 2px; + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.16); + + @include clear-fix; + + // Compact Card + &.is-compact { + margin-bottom: rem( 1px ); + + @include breakpoint( ">480px" ) { + margin-bottom: 1px; + padding: rem( 16px ) rem( 24px ); + } + } + + &.is-card-link { + padding-right: rem( 48px ); + } +} + +// Minor adjustments for the display in My Jetpack. +.my-jetpack-jitm-card { + .jitm-card { + margin-right: 0; + margin-bottom: 0; + } +} + +// if JITM appears directly below WordPress "help" menu adjust margins +#screen-meta-links+.jitm-card { + margin: rem( 40px ) 1.5385em 0 auto; +} + +// if JITM appears directly below WordPress hello dolly adjust margins +#dolly+.jitm-card { + margin: 3rem 1rem 0 auto; +} + +// remove right margin for jitms in the editor +.post-php .jitm-card { + margin-right: 0; +} + + // if JITM appears inside of the jetpack dashboard adjust margins + .jp-lower .jitm-card { + margin: 0 0 rem( 24px ); + } + +.jitm-banner.jitm-card { + display: flex; + position: relative; + z-index: 2; + + &::before { + content: ''; + width: 4px; + position: absolute; + top: 0; + left: 0; + height: 100%; + border-top-left-radius: 1px; + border-bottom-left-radius: 1px; + } + + @include breakpoint( "<480px" ) { + display: flex; + flex-direction: column; + } + + &.is-card-link { + padding: rem( 12px ) rem( 48px ) rem( 12px ) rem( 16px ); + } + &.is-dismissible { + padding-right: rem( 48px ); + } + + @include jitm-banner-color( $alert-green ); + + &.is-upgrade-personal { + @include jitm-banner-color( $alert-yellow ); + } + &.is-upgrade-premium { + @include jitm-banner-color( #069e08 ); + } + &.is-upgrade-business, + &.woo-jitm { + @include jitm-banner-color( $alert-purple ); + } + + .jitm-card__link-indicator { + align-items: center; + color: $blue-wordpress; + display: flex; + } + + &:hover { + transition: all 100ms ease-in-out; + &.is-card-link { + box-shadow: 0 0 0 1px $gray, 0 2px 4px lighten( $gray, 20% ); + } + .jitm-card__link-indicator { + color: $blue-dark; + } + } + + @include breakpoint( ">480px" ) { + padding: rem( 16px ); + padding-left: rem( 20px ); + + &.is-dismissible { + padding-right: rem( 16px ); + } + } +} + +.jitm-banner__buttons_container { + display: flex; + height: 50%; + margin: auto rem( 16px ) auto 0; + gap: rem( 16px ); + overflow: hidden; + + @include breakpoint( ">480px" ) { + margin-left: rem( 16px ); + } +} + +.jitm-banner__icons { + display: flex; + + .jitm-banner__icon, + .jitm-banner__icon-circle { + border-radius: 50%; + flex-shrink: 0; + height: rem( 24px ); + width: rem( 24px ); + margin-right: rem( 16px ); + margin-top: rem( -2px ); + text-align: center; + top: rem( 4px ); + } + + .jitm-banner__icon { + align-self: center; + color: $white; + display: block; + } + + .jitm-banner__icon-circle { + color: white; + display: none; + padding: rem( 3px ) rem( 4px ) rem( 4px ) rem( 3px ); + } + + @include breakpoint( ">480px" ) { + align-items: center; + + .jitm-banner__icon { + display: none; + } + .jitm-banner__icon-circle { + display: block; + } + } +} + +.jitm-banner__icon-plan { + display: flex; + margin-right: rem( 16px ); + + .dops-plan-icon { + height: rem( 32px ); + width: rem( 32px ); + } + + .jp-emblem { + position: relative; + top: rem( 2px ); + + @include breakpoint( "<480px" ) { + margin-bottom: rem( 16px ); + } + + svg { + height: rem( 32px ); + width: rem( 32px ); + fill: $green-primary; + } + + .jitm-jp-logo { + height: inherit; + width: rem( 40px ); + fill: inherit; + } + } + + @include breakpoint( ">480px" ) { + align-items: center; + } +} + +.jitm-banner__content { + align-items: center; + display: flex; + flex-grow: 1; + flex-wrap: wrap; + flex-shrink: 100000; + + @include breakpoint( "<480px" ) { + margin-right: 0; + } + + @include breakpoint( ">480px" ) { + flex-wrap: nowrap; + } + + @include breakpoint( "<960px" ) { + margin-right: 5px; + } +} + +.jitm-banner__info { + flex-grow: 1; + line-height: 1.4; + + @include breakpoint( ">480px" ) { + flex-basis: 50%; + } + + @include breakpoint( ">960px" ) { + flex-basis: 70%; + } + + .jitm-banner__title, + .jitm-banner__description, + .jitm-banner__description a { + color: black; + } + + .jitm-banner__title { + font-size: rem( 15px ); + font-weight: 700; + line-height: 136%; + } + + .jitm-banner__description { + font-size: rem( 13px ); + line-height: 150%; + margin-top: rem( 2px ); + } + + .banner__list { + font-size: 12px; + list-style: none; + margin: 10px 0; + li { + margin: 6px 0; + .gridicon { + fill: $gray; + display: inline; + margin-right: 12px; + vertical-align: bottom; + } + } + } +} + +.jitm-banner__action { + align-self: center; + font-size: rem( 12px ); + text-align: left; + overflow: hidden; + + .jitm-banner__prices { + display: flex; + justify-content: flex-start; + + .dops-plan-price { + margin-bottom: 0; + } + + .dops-plan-price.is-discounted, + .dops-plan-price.is-discounted .dops-plan-price__currency-symbol { + color: $gray-dark; + } + + .has-call-to-action & .dops-plan-price { + margin-bottom: rem( 8px ); + } + } + + @include breakpoint( "<480px" ) { + margin-top: 1rem; + } + + @include breakpoint( ">480px" ) { + text-align: center; + width: auto; + + .is-dismissible { + margin-top: rem( 40px ); + } + + .jitm-banner__prices { + justify-content: flex-end; + text-align: right; + } + } +} + +.jitm-banner__dismiss { + display: block; + text-decoration: none; + line-height: .5; + margin-top: auto; + margin-bottom: auto; + + &::before { + color: darken($gray, 20%); + font: 400 20px/1 dashicons; + content: '\f335'; + } + + @include breakpoint( ">660px" ) { + margin-right: rem( -8px ); + } + + @include breakpoint( "<480px" ) { + position: absolute; + top: 0; + right: 0; + + display: flex; + justify-content: center; + align-items: center; + margin: 0; + + // Minimum touch area + width: 48px; + height: 48px; + } +} + +.jitm-banner__action + .jitm-banner__dismiss { + margin-left: rem( 10px ); +} + +#dolly + .jitm-card { + margin: 3rem 1rem 0 auto; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png new file mode 100644 index 00000000..c2d50e1b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-jitm/src/images/background.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md new file mode 100644 index 00000000..11d9fbf4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/CHANGELOG.md @@ -0,0 +1,297 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.8.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.8.1] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.8.0] - 2023-02-08 +### Added +- After connection flow, load unattached licenses. If any of them match the product that's being connected, redirect users to the license activation page. [#28509] + +## [1.7.14] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.7.13] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.7.12] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.7.11] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [1.7.10] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [1.7.9] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [1.7.8] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [1.7.7] - 2022-08-23 +### Changed +- Updated package dependencies. [#25628] + +## [1.7.6] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.7.5] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.7.4] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.7.3] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.7.2] - 2022-05-04 +### Changed +- Updated package dependencies. [#24095] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.7.1] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.7.0] - 2022-04-19 +### Changed +- Moved licensing endpoints from the Jetpack plugin to the Licensing package + +## [1.6.4] - 2022-04-12 +### Changed +- Updated package dependencies. + +## [1.6.3] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.6.2] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.6.1] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [1.6.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-licensing`. + +## [1.5.4] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.5.3] - 2021-12-03 +### Changed +- Increases the timeout of the license activation request from 10 to 30 seconds. + +## [1.5.2] - 2021-11-30 +### Changed +- Updated package dependencies. + +## [1.5.1] - 2021-11-23 +### Changed +- Updated package dependencies. + +## [1.5.0] - 2021-11-16 +### Added +- Add a test for update to WPCOM return change. +- Added get_license_activation_notice_dismiss() function. + +## [1.4.9] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.8] - 2021-10-19 +### Changed +- Updated package dependencies. + +## [1.4.7] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.6] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.5] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- Updated versions in annotations. + +## [1.4.4] - 2021-07-27 +### Changed +- Updated package dependencies. + +## [1.4.3] - 2021-06-29 +### Changed +- Updated package dependencies. + +## [1.4.2] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.1] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.4.0] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies +- Dashboard: add new option to input license key. + +### Changed +- Replace usage of deprecated is_active method +- Update package dependencies. + +### Fixed +- Fix stored licenses not being attached on option creation +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.3.4] - 2021-02-23 + +- CI: Make tests more generic +- codesniffer: Hack around mediawiki-codesniffer bug + +## [1.3.3] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.3.2] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.3.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.3.0] - 2021-01-05 + +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.2.4] - 2020-11-24 + +- Version packages for release + +## [1.2.3] - 2020-11-24 + +- Updated PHPCS: Packages and Debugger + +## [1.2.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.2.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.2.0] - 2020-10-27 + +- Licensing: use Oxford comma in error message + +## [1.1.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.1.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.1.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.1.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.1.0] - 2020-09-29 + +- Update dependencies to latest stable + +## 1.0.0 - 2020-09-24 + +- Licensing: Add support for Jetpack licenses + +[1.8.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.14...v1.8.0 +[1.7.14]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.13...v1.7.14 +[1.7.13]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.12...v1.7.13 +[1.7.12]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.11...v1.7.12 +[1.7.11]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.10...v1.7.11 +[1.7.10]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.9...v1.7.10 +[1.7.9]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.8...v1.7.9 +[1.7.8]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.7...v1.7.8 +[1.7.7]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.6...v1.7.7 +[1.7.6]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.4...v1.7.0 +[1.6.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.4...v1.6.0 +[1.5.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.9...v1.5.0 +[1.4.9]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.4...v1.4.0 +[1.3.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.3...v1.3.4 +[1.3.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.2...v1.3.3 +[1.3.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.4...v1.3.0 +[1.2.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.3...v1.2.4 +[1.2.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.2...v1.2.3 +[1.2.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.1...v1.2.2 +[1.2.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.4...v1.2.0 +[1.1.4]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.3...v1.1.4 +[1.1.3]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.2...v1.1.3 +[1.1.2]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-licensing/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-licensing/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json new file mode 100644 index 00000000..24999814 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/composer.json @@ -0,0 +1,50 @@ +{ + "name": "automattic/jetpack-licensing", + "description": "Everything needed to manage Jetpack licenses client-side.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-connection": "^1.51.7" + }, + "require-dev": { + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-licensing", + "textdomain": "jetpack-licensing", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-licensing/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.8.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php new file mode 100644 index 00000000..39e40d23 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php @@ -0,0 +1,447 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_licensing_error', + 'permission_callback' => __CLASS__ . '::can_manage_options_check', + ), + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_licensing_error', + 'permission_callback' => __CLASS__ . '::can_manage_options_check', + 'args' => array( + 'error' => array( + 'required' => true, + 'type' => 'string', + 'validate_callback' => __CLASS__ . '::validate_string', + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + ), + ) + ); + + /** + * Sets a license. This is still used as part of the first pass at licensing done for partners. + * + * See https://github.com/Automattic/jetpack/pull/23687 for more details. + */ + register_rest_route( + 'jetpack/v4', + '/licensing/set-license', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::set_jetpack_license', + 'permission_callback' => __CLASS__ . '::set_jetpack_license_key_permission_check', + 'args' => array( + 'license' => array( + 'required' => true, + 'type' => 'string', + 'validate_callback' => __CLASS__ . '::validate_string', + 'sanitize_callback' => 'sanitize_text_field', + ), + ), + ) + ); + + /** + * Get Jetpack user licenses. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/licenses', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_licenses', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + ) + ); + + /** + * Get Jetpack user license counts. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/counts', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_user_license_counts', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + ) + ); + + /** + * Update user-licensing activation notice dismiss info. + */ + register_rest_route( + 'jetpack/v4', + 'licensing/user/activation-notice-dismiss', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_licensing_activation_notice_dismiss', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + 'args' => array( + 'last_detached_count' => array( + 'required' => true, + 'type' => 'integer', + 'validate_callback' => __CLASS__ . '::validate_non_neg_int', + ), + ), + ) + ); + + /** + * Attach licenses to user account + */ + register_rest_route( + 'jetpack/v4', + '/licensing/attach-licenses', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::attach_jetpack_licenses', + 'permission_callback' => __CLASS__ . '::user_licensing_permission_check', + 'args' => array( + 'licenses' => array( + 'required' => true, + 'type' => 'array', + 'items' => array( + 'type' => 'string', + ), + ), + ), + ) + ); + } + + /** + * Verify that the user can set a Jetpack license key + * + * @since 1.7.0 + * + * @since-jetpack 9.5.0 + * + * @return bool|WP_Error True if user is able to set a Jetpack license key + */ + public static function set_jetpack_license_key_permission_check() { + if ( Licensing::instance()->is_licensing_input_enabled() ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_set_jetpack_license_key', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Verify that user can view and update user-licensing data. + * + * @since 1.7.0 + * + * @return bool Whether the user is currently connected and they are the connection owner. + */ + public static function user_licensing_permission_check() { + $connection_manager = new Connection_Manager( 'jetpack' ); + + if ( $connection_manager->is_user_connected() && $connection_manager->is_connection_owner() ) { + return true; + } + + return new WP_Error( 'invalid_permission_manage_user_licenses', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Verify that user can manage_options + * + * @since 1.7.0 + * + * @return bool Whether user has the capability 'manage_options'. + */ + public static function can_manage_options_check() { + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + return new WP_Error( 'invalid_user_permission_view_admin', self::$user_permissions_error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Validates that the parameter is a string. + * + * @since 1.7.0 + * + * @since-jetpack 4.3.0 + * + * @param string $value Value to check. + * @param WP_REST_Request $request The request sent to the WP REST API. + * @param string $param Name of the parameter passed to endpoint holding $value. + * + * @return bool|WP_Error + */ + public static function validate_string( $value, $request, $param ) { + if ( ! is_string( $value ) ) { + /* translators: %s: The literal parameter name. Should not be translated. */ + return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be a string.', 'jetpack-licensing' ), $param ) ); + } + return true; + } + + /** + * Validates that the parameter is a non-negative integer (includes 0). + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param int $value Value to check. + * @param WP_REST_Request $request The request sent to the WP REST API. + * @param string $param Name of the parameter passed to endpoint holding $value. + * + * @return bool|WP_Error + */ + public static function validate_non_neg_int( $value, $request, $param ) { + if ( ! is_numeric( $value ) || $value < 0 ) { + return new WP_Error( + 'invalid_param', + /* translators: %s: The literal parameter name. Should not be translated. */ + sprintf( esc_html__( '%s must be a non-negative integer.', 'jetpack-licensing' ), $param ) + ); + } + return true; + } + + /** + * Update the last licensing error message. + * + * @since 1.7.0 + * + * @since-jetpack 9.0.0 + * + * @param WP_REST_Request $request The request. + * + * @return bool true. + */ + public static function update_licensing_error( $request ) { + Licensing::instance()->log_error( $request['error'] ); + + return true; + } + + /** + * Get the last licensing error message, if any. + * + * @since 1.7.0 + * + * @since-jetpack 9.0.0 + * + * @return string Licensing error message or empty string. + */ + public static function get_licensing_error() { + return Licensing::instance()->last_error(); + } + + /** + * Set a Jetpack license + * + * @since 1.7.0 + * + * @since-jetpack 9.6.0 + * + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response|WP_Error A response object if the option was successfully updated, or a WP_Error if it failed. + */ + public static function set_jetpack_license( $request ) { + $license = trim( sanitize_text_field( $request['license'] ) ); + + if ( Licensing::instance()->append_license( $license ) ) { + return rest_ensure_response( array( 'code' => 'success' ) ); + } + + return new WP_Error( + 'setting_license_key_failed', + esc_html__( 'Could not set this license key. Please try again.', 'jetpack-licensing' ), + array( 'status' => 500 ) + ); + } + + /** + * Gets the users licenses. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @return string|WP_Error A JSON object of user licenses if the request was successful, or a WP_Error otherwise. + */ + public static function get_user_licenses() { + $wpcom_request = Client::wpcom_json_api_request_as_user( + '/jetpack-licensing/user/licenses', + '2', + array( + 'method' => 'GET', + 'headers' => array( + 'Content-Type' => 'application/json', + 'X-Forwarded-For' => ( new Visitor() )->get_ip( true ), + ), + ) + ); + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + if ( 200 === $response_code ) { + $licenses = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + return $licenses; + } else { + return new WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-licensing' ), + array( 'status' => $response_code ) + ); + } + } + + /** + * Gets the users licenses counts. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @return string|WP_Error A JSON object of user license counts if the request was successful, or a WP_Error otherwise. + */ + public static function get_user_license_counts() { + $wpcom_request = Client::wpcom_json_api_request_as_user( + '/jetpack-licensing/user/licenses/counts', + '2', + array( + 'method' => 'GET', + 'headers' => array( + 'Content-Type' => 'application/json', + 'X-Forwarded-For' => ( new Visitor() )->get_ip( true ), + ), + ) + ); + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + if ( 200 === $response_code ) { + $license_counts = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + return $license_counts; + } else { + return new WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-licensing' ), + array( 'status' => $response_code ) + ); + } + } + + /** + * Update the user-licenses activation notice dismissal data. + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * + * @return array|WP_Error + */ + public static function update_licensing_activation_notice_dismiss( $request ) { + + if ( ! isset( $request['last_detached_count'] ) ) { + return new WP_Error( 'invalid_param', esc_html__( 'Missing parameter "last_detached_count".', 'jetpack-licensing' ), array( 'status' => 404 ) ); + } + + $default = array( + 'last_detached_count' => null, + 'last_dismissed_time' => null, + ); + $last_detached_count = ( '' === $request['last_detached_count'] ) + ? $default['last_detached_count'] + : $request['last_detached_count']; + $last_dismissed_time = ( '' === $request['last_detached_count'] ) + ? $default['last_dismissed_time'] + // Use UTC timezone and convert to ISO8601 format(DateTime::W3C) for best compatibility with JavaScript Date in all browsers. + : ( new \DateTime( 'NOW', new \DateTimeZone( 'UTC' ) ) )->format( \DateTime::W3C ); + + $notice_data = array( + 'last_detached_count' => $last_detached_count, + 'last_dismissed_time' => $last_dismissed_time, + ); + + Jetpack_Options::update_option( 'licensing_activation_notice_dismiss', $notice_data, true ); + return rest_ensure_response( $notice_data ); + } + + /** + * Attach Jetpack licenses + * + * @since 1.7.0 + * + * @since-jetpack 10.4.0 + * + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response|WP_Error A response object + */ + public static function attach_jetpack_licenses( $request ) { + $licenses = array_map( + function ( $license ) { + return trim( sanitize_text_field( $license ) ); + }, + $request['licenses'] + ); + return rest_ensure_response( Licensing::instance()->attach_licenses( $licenses ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php new file mode 100644 index 00000000..13982d71 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php @@ -0,0 +1,359 @@ +register_endpoints(); + } + + /** + * Get Jetpack connection manager instance. + * + * @return Connection_Manager + */ + protected function connection() { + static $connection; + + if ( null === $connection ) { + $connection = new Connection_Manager(); + } + + return $connection; + } + + /** + * Get the last license attach request error that has occurred, if any. + * + * @return string Human-readable error message or an empty string. + */ + public function last_error() { + return Jetpack_Options::get_option( 'licensing_error', '' ); + } + + /** + * Log an error to be surfaced to the user at a later time. + * + * @param string $error Human-readable error message. + * @return void + */ + public function log_error( $error ) { + $substr = function_exists( 'mb_substr' ) ? 'mb_substr' : 'substr'; + Jetpack_Options::update_option( 'licensing_error', $substr( $error, 0, 1024 ) ); + } + + /** + * Get all stored licenses. + * + * @return string[] License keys. + */ + public function stored_licenses() { + $licenses = (array) get_option( self::LICENSES_OPTION_NAME, array() ); + $licenses = array_filter( $licenses, 'is_scalar' ); + $licenses = array_map( 'strval', $licenses ); + $licenses = array_filter( $licenses ); + + return $licenses; + } + + /** + * Append a license + * + * @param string $license A jetpack license key. + * @return bool True if the option was updated with the new license, false otherwise. + */ + public function append_license( $license ) { + $licenses = $this->stored_licenses(); + + array_push( $licenses, $license ); + + return update_option( self::LICENSES_OPTION_NAME, $licenses ); + } + + /** + * Make an authenticated WP.com XMLRPC multicall request to attach the provided license keys. + * + * @param string[] $licenses License keys to attach. + * @return Jetpack_IXR_ClientMulticall + */ + protected function attach_licenses_request( array $licenses ) { + $xml = new Jetpack_IXR_ClientMulticall( array( 'timeout' => 30 ) ); + + foreach ( $licenses as $license ) { + $xml->addCall( 'jetpack.attachLicense', $license ); + } + + $xml->query(); + + return $xml; + } + + /** + * Attach the given licenses. + * + * @param string[] $licenses Licenses to attach. + * @return array|WP_Error Results for each license (which may include WP_Error instances) or a WP_Error instance. + */ + public function attach_licenses( array $licenses ) { + if ( ! $this->connection()->has_connected_owner() ) { + return new WP_Error( 'not_connected', __( 'Jetpack doesn\'t have a connected owner.', 'jetpack-licensing' ) ); + } + + if ( empty( $licenses ) ) { + return array(); + } + + $xml = $this->attach_licenses_request( $licenses ); + + if ( $xml->isError() ) { + $error = new WP_Error( 'request_failed', __( 'License attach request failed.', 'jetpack-licensing' ) ); + $error->add( $xml->getErrorCode(), $xml->getErrorMessage() ); + return $error; + } + + $results = array_map( + function ( $response ) { + if ( isset( $response['faultCode'] ) || isset( $response['faultString'] ) ) { + return new WP_Error( $response['faultCode'], $response['faultString'] ); + } + + return $response; + }, + (array) $xml->getResponse() + ); + + return $results; + } + + /** + * Attach all stored licenses. + * + * @return array|WP_Error Results for each license (which may include WP_Error instances) or a WP_Error instance. + */ + public function attach_stored_licenses() { + $licenses = $this->stored_licenses(); + $results = $this->attach_licenses( $licenses ); + + if ( is_wp_error( $results ) ) { + if ( 'request_failed' === $results->get_error_code() ) { + $this->log_error( + __( 'Failed to attach your Jetpack license(s). Please try reconnecting Jetpack.', 'jetpack-licensing' ) + ); + } + + return $results; + } + + $failed = array(); + + foreach ( $results as $index => $result ) { + if ( isset( $licenses[ $index ] ) && is_wp_error( $result ) ) { + $failed[] = $licenses[ $index ]; + } + } + + if ( ! empty( $failed ) ) { + $this->log_error( + sprintf( + /* translators: %s is a comma-separated list of license keys. */ + __( 'The following Jetpack licenses are invalid, already in use, or revoked: %s', 'jetpack-licensing' ), + implode( ', ', $failed ) + ) + ); + } + + return $results; + } + + /** + * Attach all stored licenses during connection flow for the connection owner. + * + * @return void + */ + public function attach_stored_licenses_on_connection() { + if ( $this->connection()->is_connection_owner() ) { + $this->attach_stored_licenses(); + } + } + + /** + * Is the current user allowed to use the Licensing Input UI? + * + * @since 1.4.0 + * @return bool + */ + public static function is_licensing_input_enabled() { + /** + * Filter that checks if the user is allowed to see the Licensing UI. `true` enables it. + * + * @since 1.4.0 + * + * @param bool False by default. + */ + return apply_filters( 'jetpack_licensing_ui_enabled', false ) && current_user_can( 'jetpack_connect_user' ); + } + + /** + * Gets the user-licensing activation notice dismissal info. + * + * @since 10.4.0 + * @return array + */ + public function get_license_activation_notice_dismiss() { + + $default = array( + 'last_detached_count' => null, + 'last_dismissed_time' => null, + ); + + if ( $this->connection()->is_user_connected() && $this->connection()->is_connection_owner() ) { + return Jetpack_Options::get_option( 'licensing_activation_notice_dismiss', $default ); + } + + return $default; + } + + /** + * Load current user's licenses. + * + * @param bool $unattached_only Only return unattached licenses. + * + * @return array + */ + public function get_user_licenses( $unattached_only = false ) { + $licenses = Endpoints::get_user_licenses(); + + if ( empty( $licenses->items ) ) { + return array(); + } + + $items = $licenses->items; + + if ( $unattached_only ) { + $items = array_filter( + $items, + static function ( $item ) { + return $item->attached_at === null; + } + ); + } + + return $items; + } + + /** + * If the destination URL is checkout page, + * see if there are unattached licenses they could use instead of getting a new one. + * If found, redirect the user to license activation. + * + * @param string $dest_url User's destination URL. + * + * @return void + */ + public function handle_user_connected_redirect( $dest_url ) { + if ( ! preg_match( '#^https://[^/]+/checkout/#i', $dest_url ) ) { + return; + } + + $licenses = $this->get_user_licenses( true ); + $plugin_slug = null; + + $query_string = wp_parse_url( $dest_url, PHP_URL_QUERY ); + if ( $query_string ) { + parse_str( $query_string, $query_args ); + + if ( $query_args['redirect_to'] + && preg_match( '/^admin\.php\?page=(jetpack-\w+)/i', $query_args['redirect_to'], $matches ) + ) { + $plugin_slug = $matches[1]; + } + } + + /** + * Check for the user's unattached licenses. + * + * @since 3.8.2 + * + * @param bool $has_license Whether a license was already found. + * @param array $licenses Unattached licenses belonging to the user. + * @param string $plugin_slug Slug of the plugin that initiated the flow. + */ + if ( $plugin_slug && count( $licenses ) + && apply_filters( 'jetpack_connection_user_has_license', false, $licenses, $plugin_slug ) + ) { + wp_safe_redirect( '/wp-admin/admin.php?page=my-jetpack#/add-license' ); + exit; + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md new file mode 100644 index 00000000..b968c069 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/CHANGELOG.md @@ -0,0 +1,188 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.6.1] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.6.0] - 2023-04-04 +### Added +- Add new method to get a base64 encoded SVG of the Jetpack logo. [#29418] + +## [1.5.22] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.5.21] - 2023-01-30 +### Changed +- Updated styles for Just in Time Messages (notices) [#27515] + +## [1.5.20] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.5.19] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.5.18] - 2022-11-07 +### Changed +- Updated package dependencies. + +## [1.5.17] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.5.16] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [1.5.15] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.5.14] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.5.13] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.5.12] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.5.11] - 2021-11-30 +### Changed +- Colors: update Jetpack Primary color to match latest brand book. + +## [1.5.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.5.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.5.8] - 2021-10-07 +### Changed +- Updated package dependencies + +## [1.5.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.5.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.5.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.5.4] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.5.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.5.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.5.1] - 2021-01-19 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.5.0] - 2020-12-07 + +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.4.0] - 2020-08-13 + +- CI: Try collect js coverage + +## [1.3.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- PHPCS Updates after WPCS 2.3 + +## [1.2.0] - 2020-03-27 + +- Use dynamic Jetpack logos on JITMs + +## [1.1.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.1.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.1.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## [1.1.0] - 2019-06-11 + +- Feature/jetpack packages pt 1. (May 31 - June 6) +- Update/package logo add gray +- Packages: Move JITM tests to package and fix deps +- Update Jetpack to use new JITM package +- Packages: Make logo package tests independent + +## 1.0.0 - 2019-05-29 + +- Packages: Add a basic Jetpack Logo package + +[1.6.1]: https://github.com/Automattic/jetpack-logo/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-logo/compare/v1.5.22...v1.6.0 +[1.5.22]: https://github.com/Automattic/jetpack-logo/compare/v1.5.21...v1.5.22 +[1.5.21]: https://github.com/Automattic/jetpack-logo/compare/v1.5.20...v1.5.21 +[1.5.20]: https://github.com/Automattic/jetpack-logo/compare/v1.5.19...v1.5.20 +[1.5.19]: https://github.com/Automattic/jetpack-logo/compare/v1.5.18...v1.5.19 +[1.5.18]: https://github.com/Automattic/jetpack-logo/compare/v1.5.17...v1.5.18 +[1.5.17]: https://github.com/Automattic/jetpack-logo/compare/v1.5.16...v1.5.17 +[1.5.16]: https://github.com/Automattic/jetpack-logo/compare/v1.5.15...v1.5.16 +[1.5.15]: https://github.com/Automattic/jetpack-logo/compare/v1.5.14...v1.5.15 +[1.5.14]: https://github.com/Automattic/jetpack-logo/compare/v1.5.13...v1.5.14 +[1.5.13]: https://github.com/Automattic/jetpack-logo/compare/v1.5.12...v1.5.13 +[1.5.12]: https://github.com/Automattic/jetpack-logo/compare/v1.5.11...v1.5.12 +[1.5.11]: https://github.com/Automattic/jetpack-logo/compare/v1.5.10...v1.5.11 +[1.5.10]: https://github.com/Automattic/jetpack-logo/compare/v1.5.9...v1.5.10 +[1.5.9]: https://github.com/Automattic/jetpack-logo/compare/v1.5.8...v1.5.9 +[1.5.8]: https://github.com/Automattic/jetpack-logo/compare/v1.5.7...v1.5.8 +[1.5.7]: https://github.com/Automattic/jetpack-logo/compare/v1.5.6...v1.5.7 +[1.5.6]: https://github.com/Automattic/jetpack-logo/compare/v1.5.5...v1.5.6 +[1.5.5]: https://github.com/Automattic/jetpack-logo/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/Automattic/jetpack-logo/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-logo/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-logo/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-logo/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-logo/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-logo/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-logo/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-logo/compare/v1.1.4...v1.2.0 +[1.1.4]: https://github.com/Automattic/jetpack-logo/compare/v1.1.2...v1.1.4 +[1.1.2]: https://github.com/Automattic/jetpack-logo/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/Automattic/jetpack-logo/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-logo/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json new file mode 100644 index 00000000..3fc88421 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/composer.json @@ -0,0 +1,39 @@ +{ + "name": "automattic/jetpack-logo", + "description": "A logo for Jetpack", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-logo", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.6.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php new file mode 100644 index 00000000..05622de3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php @@ -0,0 +1,122 @@ + tag. + * - jetpack-logo__icon-circle: the circle of the Jetpack mark. + * - jetpack-logo__icon-triangle: two shapes that correspond to each triangle in the Jetpack mark. + * - jetpack-logo__icon-text: the Jetpack lettering. + * + * @var string + */ +const JETPACK_LOGO_SVG = <<<'EOSVG' + +EOSVG; + +/** + * Create and render a Jetpack logo. + */ +class Logo { + + /** + * Return the Jetpack logo. + * + * @return string The Jetpack logo. + */ + public function render() { + return JETPACK_LOGO_SVG; + } + + /** + * Return string containing the Jetpack logo. + * + * @since 1.1.4 + * @since-jetpack 7.5.0 + * + * @param bool $logotype Should we use the full logotype (logo + text). Default to false. + * + * @return string + */ + public function get_jp_emblem( $logotype = false ) { + $logo_text = $this->get_jp_logo_parts(); + return sprintf( + '%2$s', + ( true === $logotype ? '118' : '32' ), + ( true === $logotype ? $logo_text['logo'] . $logo_text['text'] : $logo_text['logo'] ) + ); + } + + /** + * Return string containing the Jetpack logo in a slightly larger format than get_jp_emblem(). + * + * @since 1.1.4 + * @param bool $logotype Should we use the full logotype (logo + text). Default to false. + * @return string + */ + public function get_jp_emblem_larger( $logotype = false ) { + $logo_text = $this->get_jp_logo_parts(); + return sprintf( + '', + ( true === $logotype ? '118' : '32' ), + ( true === $logotype ? $logo_text['logo'] . $logo_text['text'] : $logo_text['logo'] ) + ); + } + + /** + * Return array containing the Jetpack logo and text + * + * @since 1.6.0 - Added $color parameter. + * + * @param string $color The color of the logo. + * + * @return array + */ + private function get_jp_logo_parts( $color = '#069e08' ) { + return array( + 'logo' => '', + 'text' => ' + + + + + + ', + ); + } + + /** + * Return a base64 encoded SVG of the Jetpack logo. + * Can be used as a data URI to use the logo inline in CSS. + * + * @since 1.6.0 + * + * @param string $color The color of the logo. + * + * @return string + */ + public function get_base64_logo( $color = '#ffffff' ) { + $logo_text = $this->get_jp_logo_parts( $color ); + $base_logo = sprintf( + '%1$s', + $logo_text['logo'] + ); + $encoded_logo = base64_encode( $base_logo ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- The encoded version is used as data URI to use the logo in CSS. + + return 'data:image/svg+xml;base64,' . $encoded_logo; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md new file mode 100644 index 00000000..d6cd221e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md @@ -0,0 +1,870 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [2.9.1] - 2023-03-28 +### Changed +- Move GoldenTokenModal component to licensing package. [#29748] + +## [2.9.0] - 2023-03-27 +### Added +- Adds new route for Golden Token. Also the experience of redeeming one [#29644] +- Clarified when license activation fails that a user connection is required, added a link to complete the connection, and added functionality to redirect back to license activation when the connection is done. [#29443] + +## [2.8.1] - 2023-03-20 +### Changed +- Product Interstitial: Use browser history to go back, in case they're coming from somewhere outside of the app. [#29138] +- Updated My Jetpack wpwrap color to --jp-white-off [#29568] +- Updated package dependencies. [#29471] + +## [2.8.0] - 2023-03-13 +### Added +- Add Zendesk chat module to My Jetpack page [#28712] + +## [2.7.13] - 2023-03-08 +### Changed +- Updated package dependencies. [#29216] + +## [2.7.12] - 2023-02-28 +### Changed +- Update billing language [#29126] + +## [2.7.11] - 2023-02-20 +### Fixed +- My Jetpack: Fix button to add bundle in product interstitial component [#28984] + +## [2.7.10] - 2023-02-15 +### Changed +- Update to React 18. [#28710] + +## [2.7.9] - 2023-02-08 +### Changed +- Updated package dependencies. [#28682, #28700] + +## [2.7.8] - 2023-02-06 +### Changed +- Updated package dependencies. + +## [2.7.7] - 2023-01-26 +### Changed +- Use `flex-start` instead of `start` for better browser compatibility. [#28530] + +## [2.7.6] - 2023-01-25 +### Changed +- Minor internal updates. + +## [2.7.5] - 2023-01-23 +### Fixed +- Components: Fix usage of box-sizing across the elements [#28489] +- Fixes the price display for products with intro offers for the first month. [#28424] + +## [2.7.4] - 2023-01-16 +### Changed +- Updated package dependencies. [#28303] + +## [2.7.3] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [2.7.2] - 2023-01-02 +### Added +- My Jetpack: Move VideoPress from Hybrid [#28097] + +### Changed +- My Jetpack: Move Search out of hybrid and deprecate Hybrid_Product class [#28113] + +## [2.7.1] - 2022-12-27 +### Changed +- Fix layout visual issues [#28055] +- My Jetpack: Move Backup out of hybrid product [#28022] +- My Jetpack: Move Social out of hybrid product [#28074] + +## [2.7.0] - 2022-12-19 +### Added +- Implement detached licenses redux store. [#27609] + +### Changed +- Updated package dependencies. [#27916] + +### Fixed +- Add translation context to Security product name. [#27920] + +## [2.6.1] - 2022-12-12 +### Changed +- Updated package dependencies. [#27888] + +## [2.6.0] - 2022-12-05 +### Changed +- Improve design of the error notice. [#27340] +- Updated package dependencies. [#27340] + +## [2.5.2] - 2022-12-02 +### Changed +- My Jetpack: Requires connection only if needed [#27615] +- Updated package dependencies. [#27697] + +## [2.5.1] - 2022-11-30 + +## [2.5.0] - 2022-11-28 +### Changed +- My Jetpack: rename Backup and Anti-Spam to new product names [#27377] +- Show My Jetpack even if site is disconnected [#26967] +- Updated package dependencies. [#27576] + +## [2.4.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [2.4.0] - 2022-11-17 +### Added +- Added Jetpack Protect to My Jetpack. [#26069] + +### Changed +- Updated package dependencies. [#26736] + +## [2.3.5] - 2022-11-10 +### Changed +- Updated package dependencies. [#27319] + +## [2.3.4] - 2022-11-08 +### Changed +- Updated package dependencies. [#27289] + +## [2.3.3] - 2022-11-01 +### Changed +- Updated package dependencies. [#27196] + +## [2.3.2] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [2.3.1] - 2022-10-25 +### Added +- Add a flag to indicate if the pricing is introductory with product price [#26982] +- My Jetpack: Support trial [#27033] + +### Changed +- Search: now support 38 languages [#27025] + +### Fixed +- Don't show old price when it's the same as new one [#27015] +- Search: check if free plan and new pricing is active using wpcom API [#27016] + +## [2.3.0] - 2022-10-19 +### Added +- Added support for free product and added free product for Search [#26808] + +### Changed +- Updated package dependencies. [#26883] + +## [2.2.3] - 2022-10-17 +### Changed +- Updated package dependencies. [#26851] + +## [2.2.2] - 2022-10-13 +### Changed +- Updated package dependencies. [#26790] + +## [2.2.1] - 2022-10-11 +### Changed +- Updated package dependencies. [#25973] + +## [2.2.0] - 2022-10-05 +### Added +- Integrate the new connection error message React component into My Jetpack. [#26485] +- Search: add post type breakdown endpoint [#26463] +- Trigger restore connection flow. [#26489] + +### Changed +- Updated package dependencies. [#26457] + +## [2.1.1] - 2022-09-27 +### Changed +- Updated package dependencies. + +## [2.1.0] - 2022-09-20 +### Added +- Added the ConnectionErrorNotice React component. [#26259] + +### Changed +- Updated package dependencies. + +### Fixed +- Fixed the tests for the Module_Product class by creating and using a sample, test-only module product class as the test subject instead of relying on Videopress or other concrete products. [#26227] + +## [2.0.5] - 2022-09-08 +### Changed +- Change VideoPress into a Hybrid product in My Jetpack [#25954] +- Updated package dependencies. + +## [2.0.4] - 2022-08-31 +### Added +- Allow plugins to override a product class. [#25891] + +### Changed +- Updated package dependencies. [#25856] + +## [2.0.3] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [2.0.2] - 2022-08-25 +### Changed +- Activate plugins in normal mode to trigger plugin_activated hooks [#25727] +- Updated package dependencies. [#25814] + +### Fixed +- Licensing: do not enable the Licensing UI if My Jetpack cannot be enabled. [#25667] +- Search: increased search plan/pricing API timeouts to 5s [#25775] + +## [2.0.1] - 2022-08-23 +### Added +- My Jetpack: Add container for JITMs [#22452] + +### Changed +- Updated package dependencies. [#25338, #25339, #25377, #25422, #25628, #25762, #25764] + +## [2.0.0] - 2022-08-09 +### Added +- Make product cards compatible with disclaimers and add disclaimer for backup card [#25265] + +### Changed +- Search: changed to only require site level connection [#24477] + +## [1.8.3] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.8.2] - 2022-07-27 +### Changed +- My Jetpack: changed link used in ProductCard component to a button when the plugin is absent + +## [1.8.1] - 2022-07-26 +### Changed +- My Jetpack: changed button used in ProductCard component from WordPress to Jetpack default [#25146] +- Updated package dependencies. [#25147] + +## [1.8.0] - 2022-07-19 +### Added +- My Jetpack: scroll window to top on route change [#25086] + +### Changed +- Updated package dependencies. [#24710] + +## [1.7.4] - 2022-07-12 +### Changed +- Updated package dependencies. [#25048, #25055] + +## [1.7.3] - 2022-07-06 +### Added +- Display alert when we cant automatically install the plugin [#24884] + +### Changed +- Updated package dependencies. [#24923] + +## [1.7.2] - 2022-06-28 +### Changed +- Disambiguate redirectUrls vars [#24839] +- Search: use centralized search pricing API [#24795] +- Updated package dependencies. [#24826] + +### Fixed +- Search Pricing: fix pricing fetch issue before site is connected [#24826] + +## [1.7.1] - 2022-06-21 +### Fixed +- My Jetpack: Replace wordpress from PNG to SVG at Connection [#24793] + +## [1.7.0] - 2022-06-21 +### Changed +- My Jetpack: set products grid to 3x3 for large viewport size +- Renaming master to trunk. +- Renaming `master` references to `trunk` + +## [1.6.2] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.6.1] - 2022-06-08 +### Changed +- Reorder JS imports for `import/order` eslint rule. [#24601] +- Updated package dependencies. [#24510] + +## [1.6.0] - 2022-05-30 +### Added +- Added Social to My Jetpack. + +### Changed +- Make My Jetpack use the new Modules class +- Replace deprecated external-link variation by using isExternalLink prop +- Updated package dependencies + +## [1.5.0] - 2022-05-24 +### Changed +- Default licensing UI in My Jetpack to be enabled [#24396] +- Updated package dependencies. [#24449] + +## [1.4.1] - 2022-05-19 +### Changed +- Updated package dependencies. [#24395] + +## [1.4.0] - 2022-05-18 +### Added +- Added a filter to allow stand-alone plugins to add product specific activation routines [#24334] +- My Jetpack: Add Protect class [#24347] +- My Jetpack: compute Search plugin price based on price tier [#24337] + +### Changed +- Add tiered pricing copy and update titles for Jetpack Search [#24357] +- Hide Activate a license link if there is no user connection since user connection is required [#24251] +- My Jetpack Hybrid products: Install Jetpack if stand-alone plugin installation fails [#24335] +- Updated Jetpack Scan feature list. [#23863] [#23795] [#24361] [#24372] + +## [1.3.0] - 2022-05-10 +### Changed +- Adds from arg to connection screen in My Jetpack so that we can begin tracking connections originating from My Jetpack [#24283] +- Updated package dependencies. [#24189] +- Updated references to old licensing activation UI to licensing activation UI in My Jetpack [#24189] + +## [1.2.1] - 2022-05-04 +### Added +- Add missing JavaScript dependencies. [#24096] + +### Changed +- My Jetpack: remove duplicated site suffix stored on rawUrl. Use siteSuffix instead. [#24094] +- Updated package dependencies. [#24095] [#24198] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.2.0] - 2022-04-26 +### Added +- Added activation screen component to My Jetpack licensing page + +### Changed +- Updated package dependencies. +- Update package.json metadata. + +## [1.1.0] - 2022-04-19 +### Added +- Adds a skeleton for the licensing UI along with a feature flag +- Better error handling for when the WPCOM server is unreachable +- Introduced ConnectedProductOffer component + +### Changed +- Turn Search into a Hybrid Product +- Updated package dependencies +- use connected plugin list from the connection store and ask for an update after activating a product + +## [1.0.2] - 2022-04-12 +### Changed +- Updated package dependencies. + +### Fixed +- Fixed bug in checkout URLs for sites installed in subdirs. + +## [1.0.1] - 2022-04-06 +### Removed +- Removed tracking dependency. + +## [1.0.0] - 2022-04-05 +### Added +- My Jetpack: improve Product and Interstitial components. + +### Changed +- Bump My Jetpack package to major version 1.0.0. +- My Jetpack: align price boxes in the interstitial product page. +- Updated package dependencies. + +## [0.6.13] - 2022-03-31 +### Added +- Added tracking events to Plans section external links + +### Changed +- My Jetpack: tweak plans section typography and descriptive text + +## [0.6.12] - 2022-03-29 +### Added +- Add missing JS peer dependencies. + +### Changed +- Microperformance: Use === null instead of is_null +- My Jetpack: Moved in product icon components +- My Jetpack: Tweak plan sections styles/sizes +- My Jetpack: Update ProductDetailCard to use components and theme variables +- My Jetpack: Use components to render headers elements +- Use different URLs for manage and purchase links in plans section + +### Fixed +- My Jetpack: Connect Screen logos quality + +## [0.6.11] - 2022-03-23 +### Added +- My Jetpack: add error styles to the whole Product card component +- My Jetpack: Make whole Product card clickable + +### Changed +- Changed opacity of product icons to 40% +- Changed title +- Improved should_initialize method +- My Jetpack: remove dropdown from CTA button in Product cards +- My Jetpack: Use Text and CSS vars on ProductCard +- Updated Boost product icon for clarity +- Updated package dependencies. +- Updated package dependencies. +- Updated styles for each product card status +- Update organization and copy of the Plans section + +### Removed +- My Jetpack: Remove client code that allows to deactivate a product + +### Fixed +- Fix Plans section top margin for plan list +- My Jetpack: jetpack_my_jetpack_should_initialize filter now respected when set to true. + +## [0.6.10] - 2022-03-15 +### Changed +- Make Backup go through the purchase flow after activation +- My Jetpack: Use ThemeProvider instead base-styles +- Updated package dependencies + +### Removed +- Removed Beta badge from menu item + +## [0.6.9] - 2022-03-09 +### Changed +- Updated package dependencies. + +## [0.6.8] - 2022-03-08 +### Added +- Added connected plugins slugs to My Jetpack tracking events +- Add link to jetpack.com in the footer +- My Jetpack: Add jetpack features link on connection screen +- My Jetpack: tidy Product card component +- My Jetpack: update Spinner in checkout button + +### Changed +- Components: update attributes used within the Button component to match recent deprecations and changes. +- My Jetpack: Add Connected Product Card stories +- My Jetpack: Add connection screen footer +- My Jetpack: clean/tidy Product data +- My Jetpack: Remove Layout component +- Only consider Backup product active when the plan is purchased + +### Fixed +- Fixed Backup flow when Jetpack plugin is active +- My Jetpack: align CTA buttons of My Jetpack overview +- My Jetpack: Fix button height in the Interstitial pages + +## [0.6.7] - 2022-03-02 +### Added +- Add My Jetpack action link to all Jetpack plugins +- My Jetpack: Handle cosmetic tweaks +- My Jetpack: Pass requiresUserConnection to ConnectionStatusCard + +### Changed +- Refactor and simplify Products class +- Updated package dependencies. + +### Fixed +- Disable browser cache for My Jetpack +- My Jetpack: fix products card section story +- My Jetpack: fix stories for the Interstitial pages + +## [0.6.6] - 2022-02-28 +### Fixed +- Re-doing 0.6.5 to fixup bad release. + +## [0.6.5] - 2022-02-28 +### Changed +- Tweak product card box model. + +### Fixed +- Use namespace in My Jetpack REST Products class to prevent fatal + +## [0.6.4] - 2022-02-25 +### Added +- Activate Jetpack plugin from Extras product card +- Added list of connected plugins to Disconnect dialog in My Jetpack +- Add Extras interstitial page +- My Jetpack: Handle cosmetic tweaks +- My Jetpack: Remove global notices when in my jetpack page +- My Jetpack: set height of Jetpack logo in the footer +- My Jetpack: tweak height of Jetpack Logo +- My Jetpack: update Product logos + +### Changed +- Disable My Jetpack on MS +- My Jetpack: compress extras product image +- Updated package dependencies. +- Update My Jetpack dashboard headline + +### Removed +- Remove unnecessary line from My Jetpack Initial state + +### Fixed +- Fix beta badge for RTL languages +- Handle plugin activating from Hybrid class +- Memoized RecordEvent from usAnalytics hook +- My Jetpack: Fix post activation url redirect +- My Jetpack: Move product list that requires user connection to selector +- Products::get_products_names should not load all product information +- Update automattic logo href in the footer + +## [0.6.3] - 2022-02-22 +### Changed +- Updated inline documentation + +### Fixed +- Use Jetpack namespace to fix fatal error + +## [0.6.2] - 2022-02-22 +### Added +- Add Beta badge +- Add Extras class +- Apply coupon discount to Product price when it exists +- Filesystem write access to the initial state +- Improve Product detail layout +- Implement close link on layout nav +- Prevent calling activation hook when activating backup + +### Changed +- Bump package versions. +- Improve My Jetpack link styles +- Improve redirect process after installing Product +- Fix interstitial CTA buttons layout +- Move from isPressed to CSS vars +- Redirect connect user to connection interstitial +- Point the link of the Manage button of CRM to its dashboard +- Redirect to post_activation_url after product activation from iterstitial screen +- Remove conditional loading depending on constant +- Send My Jetpack version with fired events +- Update the layout of interstitial page when it has an upgradable bundle + +### Fixed +- Check if product is active before checking if requires plan +- Fix check for plugin installation for hybrid products +- Fix click on security and add click on My Jetpack interstitial +- Fix clicks on VideoPress and CRM cards +- Fix Product prices +- Make Scan and Search interstitials install the plugin +- Purchases: ensure we retrieve translated version of active purchases +- Return needs purchase status for products module + +## [0.6.1] - 2022-02-16 +### Added +- Add Anti-Spam Product detail card +- Add CRM interstitial page +- Added wpcom plan slug to product info +- add manage and post activation urls +- Add Scan product: interstitial, route, data, etc... +- Add Security Product Bundle +- Add VideoPress data +- Add VideoPress interstitial cmp. Story. +- Add `#/add-videopress` route +- Change the discount value for all Products to 50 +- checks and activation for Security Bundle +- consume prices dynamically +- Do not show Porduct price when plan has required plan +- Finish Backup, Anti-Spam and Scan interstitial pages +- Fire Tracks Event when user clicks on Product Interstitial Back link +- Install proudcts from interstitial pages +- Make click on Fix connection show connection route +- package version to main class +- Pull product discount from wpcom +- Refactoring -> add icons component -> tweak icons for interstitial pages +- Register `#/add-anti-spam` route. Connect with interstitial page +- Restore Security bundle card in the UI +- Set default values for product data in the client (custom hook) +- set product status as error if active and requiring a missing user connection +- Set properly the checkout link for Products +- Set unlink=1 in the checkout URL when the user is not connected +- Tidy Product stories +- Update Backup product data. Tweak Icon. +- Update mock data for Search product. useMyJetpackNavigate() hook + +### Changed +- Adapt Scan actiavtion behavior as it is not a module +- Add global notices for activate/deactivate failures +- Add manage redirect +- Apply correct style for CTA buttons on Interstitial +- Avoid usage of 100vh on layout +- Fix setting height of the Product title in the detail component +- Implement is fulfilled handler for product resolver +- Improve global notice layout +- Reduce size of boost and search interstitial images +- Update structure with Layout component +- Only pass a productUrl if the product is not free on interstitial pages +- Only show the deactivate action when it makes sense +- Pass slug prop to event firing on product card button actions instead of name +- Remove unnecessary payload from request to activate or deactivate a product +- Replace renderActionButton function for ActionButton component +- Updated package dependencies. +- Use useMyJetpackNavigate when it's worth it + +### Fixed +- Fixed connection check labels and error message +- Fix upgradability for anti-spam and backup products +- Remove duplicted Icon in Product Card story +- Use key when looping through product detail icons + +## [0.6.0] - 2022-02-09 +### Added +- Add Boost interstitial cmp. +- Add has_required_plan to product info and implement method in Search +- Add Product princign harcoded data +- Add search product data +- Add title and features to products data +- anti spam product class +- Connect Boost card with the interstitial page via /add-boost root +- Fire Tracks event when clicking CTA button on product Interstitial page +- Fire Tracks event when clicking Manage button on product card +- Fire Tracks event when clickn Add link on My Jetpack product card +- Fire Tracks event when showing the Interstitial page +- Implement Free price for Boost product +- Implement Search product interstitial +- Introduce basic Layout component. Add GoBackLink component +- Introduce ProductDetailCard component +- My Jetpack: Add Connection screen +- Pass slug prop to ProductCard' +- Plan verification for Backup and Scan +- Restore getProduct() resolver +- Set the checkout URL for the Product detail component +- useCallback for functions that are bound to onEvents + +### Changed +- My Jetpack: Implement handler of connection notices +- My Jetpack: Update notice style and implements redirect for connection route +- Support multiple possible folder for each plugin +- Updated package dependencies + +### Removed +- dependency from search package + +### Fixed +- Fix My Jetpack's reducer for SET_PRODUCT_STATUS +- Fix the redirect URL value +- Show discounted price in Product Detail card +- typo + +## [0.5.0] - 2022-02-02 +### Added +- Added plugin installation functionality +- Adds Tracks events for activating and deactivating products from the product cards +- Fixes stories for ProductCard component +- Handle when site is not connected +- Initial approach to handle global notice +- Module Products +- My Jetpack: Add route handling +- My Jetpack: connect all product cards with data provider +- My Jetpack: connect Backup product class with Product class. Add long description and features fields. +- My Jetpack: handle redirect when no connection #22549 +- My Jetpack: reorganize stores by project/name +- Remove getProduct() resolver +- Support to Hybrid products +- Tweak dimms of the Product card status +- Update data handling - Implement request status in Product Card +- User connection requirement to product info +- uses the Plugin Installer package to safely checks plugins statuses + +### Changed +- Added filter for disabling the initialization of the My Jetpack package +- Build: remove unneeded files from production build. +- Do not initialize My Jetpack id site is not connected +- My Jetpack: Refactor styles to use layout components and theme provider +- My Jetpack: Update gap between product cards section +- Pick API root and nonce values from a new window var myJetpackRest +- Updated package dependencies. +- Update plugin absent status consistently + +### Fixed +- added unit test mock for new global variable myJetpackRest +- Fix tests +- Fix unsafe optional chaining. +- my-jetpack: fix tracking event when activating product +- Resolved minor code standard violation after implementing a stricter rule. + +## [0.4.0] - 2022-01-25 +### Added +- add API endpoints to manipulate products +- Added css module for My Jetpack Plans Section +- Added useAnalytics hook +- Added Visitor class for status regarding the site visitor. +- Add first data approach +- Add Products and REST_Products basic classes +- Adds very basic product cards section component to my jetpack +- My Jetpack: Add Product Card component +- My Jetpack: check user connectivity before to hit wpcom side +- My Jetpack: Implement data handling for enable/disable products +- Removed endpoint plans superseded by purchases + +### Changed +- Add Connections Section wrapping the Connection Status Card to My Jetpack +- Build: do not ship raw files in production bundle. + +### Removed +- Remove unused usePlans() custom react hook + +### Fixed +- Fixed svg attribute strokeWidth for Boost Card + +## [0.3.3] - 2022-01-18 +### Added +- Added redux store specific to my-jetpack +- Implement plans list properly in the PlansSection +- My Jetpack: Add scripts for JS tests +- My Jetpack: Include wordpress components as dep +- Reduxify purchases data + +### Changed +- General: update required node version to v16.13.2 +- Properly style the Plans Section according to proposed design +- Updated package dependencies. + +## [0.3.2] - 2022-01-13 +### Added +- My Jetpack: add story to `` component +- My Jetpack: first PlanSection implementation + +### Fixed +- Rename method enqueue_scritps to enqueue_scripts + +## [0.3.1] - 2022-01-11 +### Added +- Add devvelopment testing instructions to doc. + +### Changed +- Updated package dependencies. + +### Removed +- Remove use of deprecated `~` in sass-loader imports. + +## [0.3.0] - 2022-01-04 +### Changed +- Drop isRegistered and isUserConnected params from ConnectionStatusCard component +- Switch to pcov for code coverage. +- Updated package dependencies. +- Updated package textdomain from `jetpack` to `jetpack-my-jetpack`. + +## [0.2.0] - 2021-12-14 +### Added +- Added Connection Status Card to the page. +- Janitorial: add watch command to the plugin. + +### Changed +- Adapt to new layout components. +- Build: do not ship scss and jsx files in production build. + +### Fixed +- Build minimized JS for the production build. +- Fix JavaScript i18n strings. + +## [0.1.3] - 2021-12-07 +### Changed +- Updated package dependencies. + +## [0.1.2] - 2021-11-30 +### Added +- Janitorial: create mirror repo for the package. + +### Changed +- Remove now-redundant `output.filename` from Webpack config. + +## 0.1.1 - 2021-11-23 +### Changed +- Updated package dependencies. + +## 0.1.0 - 2021-11-17 +### Added +- Created package + +[2.9.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.8.1...2.9.0 +[2.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.8.0...2.8.1 +[2.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.13...2.8.0 +[2.7.13]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.12...2.7.13 +[2.7.12]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.11...2.7.12 +[2.7.11]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.10...2.7.11 +[2.7.10]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.9...2.7.10 +[2.7.9]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.8...2.7.9 +[2.7.8]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.7...2.7.8 +[2.7.7]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.6...2.7.7 +[2.7.6]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.5...2.7.6 +[2.7.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.4...2.7.5 +[2.7.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.3...2.7.4 +[2.7.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.2...2.7.3 +[2.7.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.1...2.7.2 +[2.7.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.7.0...2.7.1 +[2.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.6.1...2.7.0 +[2.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.6.0...2.6.1 +[2.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.2...2.6.0 +[2.5.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.1...2.5.2 +[2.5.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.5.0...2.5.1 +[2.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.1...2.5.0 +[2.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.4.0...2.4.1 +[2.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.5...2.4.0 +[2.3.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.4...2.3.5 +[2.3.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.3...2.3.4 +[2.3.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.2...2.3.3 +[2.3.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.1...2.3.2 +[2.3.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.3.0...2.3.1 +[2.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.3...2.3.0 +[2.2.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.2...2.2.3 +[2.2.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.1...2.2.2 +[2.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.2.0...2.2.1 +[2.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.1.1...2.2.0 +[2.1.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.5...2.1.0 +[2.0.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.4...2.0.5 +[2.0.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.3...2.0.0 +[1.8.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.2...1.8.3 +[1.8.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.1...1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.8.0...1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.4...1.8.0 +[1.7.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.3...1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.2...1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.1...1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.7.0...1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.2...1.7.0 +[1.6.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.1...1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.6.0...1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.5.0...1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.4.1...1.5.0 +[1.4.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.3.0...1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.2.1...1.3.0 +[1.2.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.2...1.1.0 +[1.0.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.13...1.0.0 +[0.6.13]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.12...0.6.13 +[0.6.12]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.11...0.6.12 +[0.6.11]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.10...0.6.11 +[0.6.10]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.9...0.6.10 +[0.6.9]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.8...0.6.9 +[0.6.8]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.7...0.6.8 +[0.6.7]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.6...0.6.7 +[0.6.6]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.5...0.6.6 +[0.6.5]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.4...0.6.5 +[0.6.4]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.3...0.6.4 +[0.6.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.2...0.6.3 +[0.6.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.1...0.6.2 +[0.6.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.6.0...0.6.1 +[0.6.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.5.0...0.6.0 +[0.5.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.4.0...0.5.0 +[0.4.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.3...0.4.0 +[0.3.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.2...0.3.3 +[0.3.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.2.0...0.3.0 +[0.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.3...0.2.0 +[0.1.3]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/0.1.1...0.1.2 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg new file mode 100644 index 00000000..478fcfd9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/apple-92dacafad84e79708a74.svg @@ -0,0 +1,3 @@ + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png new file mode 100644 index 00000000..dd818e46 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg new file mode 100644 index 00000000..a033545d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/cloud-81ac85ba680343200f54.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png new file mode 100644 index 00000000..66f8710a Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png new file mode 100644 index 00000000..cfec3eed Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg new file mode 100644 index 00000000..13f5651c Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg new file mode 100644 index 00000000..a191ec9e Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/disconnect-thanks-5873bfac56a9bd7322cd.jpg differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg new file mode 100644 index 00000000..d648cc87 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/empty-avatar-fea23feddfa99b07c2e8.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png new file mode 100644 index 00000000..d4d49627 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg new file mode 100644 index 00000000..5794583d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/google-dec2a429bf1d8e83f9ad.svg @@ -0,0 +1 @@ + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg new file mode 100644 index 00000000..f8dbeb91 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-9de1caef5eb5c22da5d6.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png new file mode 100644 index 00000000..ea421dc0 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png new file mode 100644 index 00000000..a2562d9b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png new file mode 100644 index 00000000..0f77309b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png new file mode 100644 index 00000000..9a8f1dfb Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg new file mode 100644 index 00000000..b1cd75b6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/images/wordpress-1fc3e0ba6c52e9707900.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php new file mode 100644 index 00000000..17448b06 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.asset.php @@ -0,0 +1 @@ + array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '9fc14b80f5a467303947'); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css new file mode 100644 index 00000000..eb4beab9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.css @@ -0,0 +1 @@ +#my-jetpack-container{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);height:100%}#my-jetpack-container .jetpack-logo{height:40px}#my-jetpack-container .jp-dashboard-footer__jetpack-symbol{height:16px}#wpbody-content>.notice{display:none}#wpwrap{background-color:var(--jp-white-off)}.pIsYsXFAJ9KX2VrS5rmY{--actions-size:28px;--status-size:8px;background:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px rgba(0,0,0,.08);box-shadow:0 0 0 1px var(--jp-gray-10) inset;display:flex;flex-direction:column;height:100%;padding:calc(var(--spacing-base)*3)}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9{background:none;background-color:var(--jp-white-off);color:var(--jp-black-80);text-decoration:none}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9:hover{background-color:var(--jp-white)}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9:focus{background-color:var(--jp-white);box-shadow:0 0 0 1.5px var(--jp-black);outline:3px solid transparent}.pIsYsXFAJ9KX2VrS5rmY.Pp9cMIaESLYelLOX3tkI{box-shadow:0 0 0 1.5px var(--jp-red-60)}.w56ueQLYexqzTybA7015{align-items:center;display:flex;justify-content:space-between;margin-bottom:var(--spacing-base);width:100%}.gmPKCDKZcfQt9WieTyKS{flex-grow:1}.fDBaV7I4yUO6w5AWVEtr{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:calc(var(--spacing-base)*2);min-height:var(--actions-size);width:100%}.f5VJYwuJmjxH8PVxEbbv{align-items:center;display:flex;height:var(--actions-size);margin-left:var(--spacing-base);white-space:nowrap}.f5VJYwuJmjxH8PVxEbbv:before{border-radius:50%;content:"";display:inline-block;height:var(--status-size);margin-right:var(--spacing-base);width:var(--status-size)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3{color:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3:before{background:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr{color:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr:before{background:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02{color:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02:before{background:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.PdsJCfyyjSgrNDheF2qi:before{animation:dWP7ypkVXudMbAa38W5Z .5s linear infinite}@keyframes dWP7ypkVXudMbAa38W5Z{0%{opacity:0}50%{opacity:.5}to{opacity:0}}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.5px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-right:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-left:calc(var(--spacing-base)/2)}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-right:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-left:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-right:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-left:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-right:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-left:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-right:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-left:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-right:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-left:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-right:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-left:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-right:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-left:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-right:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-left:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-right:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-left:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-right:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-left:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-right:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-left:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-right:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-left:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-right:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-left:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-right:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-left:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-right:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-left:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-right:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-left:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-right:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-left:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-right:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-left:calc(var( --spacing-base )*8)}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.jErCC9oKHSM15BxzFyQK{margin-bottom:0}.oVoYbwbFB6U2o90Njusk{border:1px solid var(--jp-gray);border-left:6px solid var(--jp-red-50);border-radius:var(--jp-border-radius);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.oVoYbwbFB6U2o90Njusk.is-error{background-color:var(--jp-white)}.oVoYbwbFB6U2o90Njusk .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.oVoYbwbFB6U2o90Njusk .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.oVoYbwbFB6U2o90Njusk .components-notice__dismiss{align-self:center}.oVoYbwbFB6U2o90Njusk .components-notice__action{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;height:auto;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-left:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.oVoYbwbFB6U2o90Njusk.Snc8NEmDelsbhlH4285s .components-notice__action{margin-left:0;margin-top:0;white-space:nowrap}.oVoYbwbFB6U2o90Njusk.Snc8NEmDelsbhlH4285s .components-notice__content{align-items:center;flex-direction:row}.wBVXH4OTNwLHPRpN4nsq{display:flex;flex-grow:1;margin-right:var(--spacing-base)}.wBVXH4OTNwLHPRpN4nsq>svg{fill:var(--jp-red-60);align-self:flex-start;flex-shrink:0;margin-right:calc(var(--spacing-base)*2)}.wBVXH4OTNwLHPRpN4nsq>svg.F1qvEnFfHs5nz3zFZUOV{fill:none}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-left:6px solid var(--jp-red-50);border-radius:var(--jp-border-radius);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-left:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-left:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-right:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-right:calc(var(--spacing-base)*2)}@keyframes rotate-spinner{to{transform:rotate(1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-right-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.sexr0jUxC1jVixdKiDnC{margin-left:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-left:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.jp-dashboard-footer{align-items:center;color:#000;display:flex;flex-flow:row wrap;justify-content:space-between;max-width:1128px;width:100%}.jp-dashboard-footer a,.jp-dashboard-footer a:hover,.jp-dashboard-footer a:visited{color:#000;text-decoration:none}.jp-dashboard-footer__jetpack-symbol,.jp-dashboard-footer__module-name{display:inline-block;vertical-align:middle}.jp-dashboard-footer__module-name{font-size:12px;font-weight:600;margin-left:5px}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off)}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook);border-radius:50%!important}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cAbGtJDGgLubucBnz7vM{background-color:var(--jp-white)}.wiobThfXJCuhGNrbFIT6 a,.wiobThfXJCuhGNrbFIT6 a:active,.wiobThfXJCuhGNrbFIT6 a:hover{color:var(--jp-black)}.VgAxgahF9bC2M__FiIgV{display:flex;margin-bottom:calc(var(--spacing-base)*3)}.dbRwkMLqcMF67njPoAF7{margin-right:8px}.Doju0RxvvN9JS12mf489{line-height:calc(var(--spacing-base)*3);margin:0 0 var(--spacing-base) 0}.yWUvvF4WJLNDSpMgBMfm{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ka1fVHj2HOkHjhdoEFOZ{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.JMOO4Y_9yhTO9lwLnRUx{grid-column-end:span 1}.PFDPAqk51qox_ChLqJwm{grid-column-end:span 2}.ault0jHVfWpShqOGooIP{grid-column-end:span 3}.GqpvdRzmzPJELtSm4FEN{grid-column-end:span 4}@media(min-width:600px){.Ym4_YneEGD_iZD6W1C2o{grid-column-end:span 1}.NbvHnnDtWw8n9BEUQ0Oy{grid-column-end:span 2}.ElMT7rhxe5ZJKO41MnhW{grid-column-end:span 3}.yKjnqjibn_wW_1tWWt5Q{grid-column-end:span 4}.Pb30lOcQFpzUX57GwflS{grid-column-end:span 5}.pC1wxc_R8y4pNILHsiiY{grid-column-end:span 6}.pChscSCnudQoWGjMFKI_{grid-column-end:span 7}.qw1H2gAgF3lDCI2Tbkmb{grid-column-end:span 8}}@media(min-width:960px){.VzcA_rrxBK3g4ozA0oD9{grid-column-end:span 1}.pNAa7O2adRZD8Slgk9iR{grid-column-end:span 2}.tlIMLlipexblj8CeOx4B{grid-column-end:span 3}.Dvt0u5l2Rr1BhBmvYAzl{grid-column-end:span 4}.BiUsgNTc0tyc7tC5jnzE{grid-column-end:span 5}.ulJXAsj7G2ROJ1g3_s28{grid-column-end:span 6}.HsoVlyVLsXYClx9Atox0{grid-column-end:span 7}.oXxjRQNNj2cfIpFBqC1W{grid-column-end:span 8}.qXgUn4Adg9xE_JnbuDio{grid-column-end:span 9}.xMpqTLiLfYFEJiRPQQQq{grid-column-end:span 10}.IiGo3Sz2FDZN7_eGElwA{grid-column-end:span 11}.Om8BNCjfgqQ_wmPQjfOY{grid-column-end:span 12}}@media(max-width:960px){.t10ZWzP7ADjJnR4tqxRS{display:none}}@media(max-width:600px){.eOUlZG8Pelh_Xj0aSoHG{display:none}}.l546LrwBEePz434NFK5Q{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.l546LrwBEePz434NFK5Q span{display:block}.l546LrwBEePz434NFK5Q span:last-of-type{font-weight:600}.l546LrwBEePz434NFK5Q:focus span:last-of-type,.l546LrwBEePz434NFK5Q:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.l546LrwBEePz434NFK5Q:focus:after,.l546LrwBEePz434NFK5Q:hover:after{transform:translateY(-50%) translateX(8px)}.l546LrwBEePz434NFK5Q:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.Q7w4fcEcemZ2nlwaYNog{fill:var(--jp-yellow-30)!important;display:inline-block!important;width:1.1em!important}.AoNQsOaTt6gSf0H6Yasz{display:inline-block;position:relative}.v13ZwGzUnecPA7Y3URAl{height:18px;left:-53px;pointer-events:none;position:absolute;top:0;width:124px}.EeDbu9pXFWTsCzfTpv2v{pointer-events:all}.BmSvoIi3rErkcrRiOi2W{color:var(--jp-black);font-size:16px;font-weight:600;line-height:19px}.BmSvoIi3rErkcrRiOi2W:not(:last-child){margin-bottom:8px}.mojRoVuWdDJo0E6LEjJw{font-size:14px;font-weight:400;line-height:24px}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-right:-62px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-left:-62px}.golden-token-icon-tooltip .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.golden-token-icon-tooltip .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.golden-token-icon-tooltip .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.golden-token-icon-tooltip .components-button.is-link:focus:not(:disabled){box-shadow:none}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe{align-items:center;display:flex;gap:var(--spacing-base);margin-bottom:calc(var(--spacing-base)*3)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .VmtuLc2xRqmsO6cK8qjF{position:relative}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:30px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .TD4AUM9gcTVAB6JHB5ZR{border-radius:50%;margin-left:-10px;position:absolute;width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .yjl73qv0VWoPP8IhGreh{border-top-style:solid;border-top:2px dashed var(--jp-black);height:0;width:67px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .rq8YRaj9OyUUXJUHiUgI{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(180deg)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz{margin-bottom:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz,.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp{align-items:center;display:flex;gap:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.J0GIu2rNR7rXocQTyd8p{fill:var(--jp-red);color:var(--jp-red)}.jp-connection__manage-dialog{--spacing-base:8px;border-radius:3px;margin:auto;width:1200px}.jp-connection__manage-dialog__content{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:center;padding:80px;text-align:center}.jp-connection__manage-dialog__content h1{font-size:var(--font-title-large);font-weight:700;line-height:1.2;margin:0}.jp-connection__manage-dialog__large-text{font-size:1.25rem;font-weight:600;margin-bottom:calc(var(--spacing-base)*4);margin-top:calc(var(--spacing-base)*3);max-width:60%}.jp-connection__manage-dialog__actions{align-items:center;background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;box-sizing:border-box;margin:0!important;max-width:1200px!important;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*5);position:sticky}.jp-connection__manage-dialog__link{color:var(--jp-black)}.jp-connection__manage-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__manage-dialog__link:focus{color:var(--jp-black)}.jp-connection__manage-dialog__button-wrap button{float:right}.jp-connection__manage-dialog__action-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:var(--spacing-base) auto;max-width:100%;padding:1rem 2rem;text-align:left;width:750px}.jp-connection__manage-dialog__action-card__card-headline{font-size:var(--font-body);font-weight:600;line-height:calc(var(--spacing-base)*3);text-decoration:none}.jp-connection__manage-dialog__action-card__icon{float:right}.jp-connection__manage-dialog__action-card .transfer{fill:var(--jp-black);color:var(--jp-black)}.jp-connection__manage-dialog__action-card .disconnect{fill:var(--jp-red);color:var(--jp-red)}.jp-connection__manage-dialog .components-modal__header{display:none}.jp-connection__manage-dialog .components-modal__content{margin:0;padding:0}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-small);font-weight:600;line-height:1.2;margin-top:0}.jp-connection__disconnect-dialog h2{font-size:var(--font-title-small);font-weight:400;line-height:1.2;margin:0}.jp-connection__disconnect-dialog p{font-size:var(--font-body);margin-top:0}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.25rem}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link,.jp-connection__disconnect-dialog__link{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:hover,.jp-connection__disconnect-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:focus,.jp-connection__disconnect-dialog__link:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link--bold,.jp-connection__disconnect-dialog__link--bold{font-weight:700}.jp-connection__disconnect-dialog .components-button{border-radius:4px;font-size:var(--font-body-small);height:40px}.jp-connection__disconnect-dialog .components-modal__content{display:flex;flex-direction:column;flex-grow:1;margin:0;padding:0}.jp-connection__disconnect-dialog .components-modal__content:before,.jp-connection__disconnect-dialog .components-modal__header{display:none}.jp-connection__disconnect-dialog .jp-row{align-items:center;width:calc(100% - 48px)}.jp-connection__disconnect-dialog__content{align-items:center;background:var(--jp-white-off);border-radius:4px;display:flex;flex-direction:column;flex-grow:1;justify-content:center;margin:0;padding:2rem 1rem;text-align:center}.jp-connection__disconnect-dialog__actions{background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;padding:2rem 0;position:sticky}.jp-connection__disconnect-dialog__actions p{margin-bottom:0}.jp-connection__disconnect-dialog__actions:before{background:linear-gradient(to bottom,transparent,var(--jp-white-off));bottom:calc(100% + 1px);content:"";display:block;height:80px;left:0;position:absolute;width:100%}.jp-connection__disconnect-dialog__btn-dismiss,.jp-connection__disconnect-dialog__btn-dismiss.components-button{background:var(--jp-black)!important;margin-right:10px}.jp-connection__disconnect-dialog__btn-disconnect{background:var(--jp-red)!important}.jp-connection__disconnect-dialog__btn-back-to-wp{background:var(--jp-black)!important}.jp-connection__disconnect-dialog__button-wrap{text-align:left}@media(min-width:960px){.jp-connection__disconnect-dialog__button-wrap{text-align:center}}.jp-connection__disconnect-dialog__error{color:var(--jp-red)}.jp-connection__disconnect-dialog__survey{margin-bottom:1.5rem;max-width:100%}.jp-connection__disconnect-dialog__step-copy{margin:0 auto;max-width:800px}.jp-connection__disconnect-dialog__step-copy--narrow{max-width:600px}@media(max-height:900px){.jp-connection__disconnect-dialog__content .jp-components__decorative-card{display:none}}@media(min-width:600px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{max-width:calc(100% - 32px);width:100%}.jp-connection__disconnect-dialog__actions,.jp-connection__disconnect-dialog__content{padding:2rem}}@media(min-width:960px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{display:flex;flex-direction:column;height:900px;width:1200px}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-large)}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.5rem}.jp-connection__disconnect-dialog__content{padding:80px}.jp-connection__disconnect-dialog__actions{padding:2rem 3rem}.jp-row{margin-left:0}}.jp-connection__disconnect-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:0 auto 1rem;max-width:100%;padding:1rem 2rem;text-align:left;width:800px}.jp-connection__disconnect-card__group{margin-bottom:1rem;max-width:100%}.jp-connection__disconnect-card__card-content{display:block;font-size:.875rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-content{align-items:center;display:flex;justify-content:space-between}}.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{flex-shrink:0;font-size:1.25rem;font-weight:600;margin-bottom:0;margin-top:0}@media only screen and (min-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{font-size:1.5rem;margin-right:1.5rem}}@media only screen and (max-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block,.jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block{margin-top:.5rem}}.jp-connection__disconnect-card__card-stat-block{align-items:baseline;display:flex;flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat-block{flex-direction:row-reverse}}.jp-connection__disconnect-card__card-description{flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-description{text-align:right}}.jp-connection__disconnect-card__card-stat{font-size:1rem;font-weight:600;margin-right:.5rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat{font-size:1.5rem;margin-left:1rem;margin-right:0}}.jp-components__decorative-card{border-radius:8px;box-shadow:0 0 15px var(--jp-gray);display:flex;height:280px;margin:0 auto 3rem;max-width:100%;overflow:hidden;position:relative;width:360px}.jp-components__decorative-card__content,.jp-components__decorative-card__image{width:50%}.jp-components__decorative-card__image{background:var(--jp-gray);background-size:cover;position:relative}.jp-components__decorative-card__image:before{background-image:url('data:image/svg+xml;uf8,');content:"";display:block;height:8px;left:24px;position:absolute;top:24px;width:38px}.jp-components__decorative-card__content{background:#fff;padding:2rem}.jp-components__decorative-card__icon-container{background:var(--jp-red);border-radius:50px;height:80px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:80px}.jp-components__decorative-card__icon{background-position:50%,50%;background-repeat:no-repeat;height:40px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:40px}.jp-components__decorative-card__icon--unlink{background-image:url('data:image/svg+xml;uf8, ')}.jp-components__decorative-card__lines,.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{background:#e9eff5;border-radius:6px;display:block;height:12px;position:relative;width:100%}.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{content:"";top:calc(100% + 16px)}.jp-components__decorative-card__lines:after{top:calc(100% + 32px);width:75%}.jp-components__decorative-card--vertical{flex-direction:column}.jp-components__decorative-card--vertical .jp-components__decorative-card__content,.jp-components__decorative-card--vertical .jp-components__decorative-card__image{height:50%;width:100%}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines{margin-left:auto;margin-right:auto;max-width:135px}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:after,.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:before{margin-left:auto;margin-right:auto}.jp-connect__disconnect-survey-card{border:2px solid transparent;border-radius:4px;box-shadow:0 0 15px var(--jp-gray-off);margin-left:auto;margin-right:auto;max-width:100%;padding:1rem;position:relative;text-align:left;width:800px}.jp-connect__disconnect-survey-card--selected{background:var(--jp-gray-off);border-color:var(--jp-black)}.jp-connect__disconnect-survey-card:after{border-right:2px solid var(--jp-black);border-top:2px solid var(--jp-black);content:"";display:block;height:5px;position:absolute;right:1.5rem;top:50%;transform:translateY(-50%) rotate(45deg);width:5px}.jp-connect__disconnect-survey-card:hover{cursor:pointer}.jp-connect__disconnect-survey-card:focus:not(.jp-disconnect-survey-card--selected),.jp-connect__disconnect-survey-card:hover:not(.jp-disconnect-survey-card--selected){border-color:var(--jp-black-80)}.jp-connect__disconnect-survey-card__answer{align-items:center;display:flex;font-weight:700;margin:0}input.jp-connect__disconnect-survey-card__input{-webkit-appearance:none;background-color:transparent;border:none;color:var(--jp-black-80);flex-grow:1;max-width:calc(100% - 40px);padding-right:40px}.zvd4dCB_bBDiXJKKDqXm{position:relative}.ly4o9lSswAGHFXqGUEIO{position:absolute;right:32px;top:32px;z-index:1}.u64Go3kwEZ7MD9eji0H1{color:var(--jp-gray-50);font-size:13px;margin-bottom:16px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex}.cFGWJeRiGHjAr8D7CWJW{margin-right:8px;max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px;margin-left:8px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.jp-connection__connect-screen{--spacing-base:8px}.jp-connection__connect-screen__loading{display:none}.jp-connection__connect-screen .terms-of-service{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*4);max-width:360px}.jp-connection__connect-screen .terms-of-service a{text-decoration:underline}.jp-connection__connect-screen .jp-action-button{margin-top:40px}.jp-connection__connect-screen .jp-action-button--button{border-radius:4px;font-weight:600}.jp-connection__connect-screen .jp-action-button button{max-width:100%}.jp-connection__connect-screen .jp-action-button button:disabled{color:hsla(0,0%,100%,.4)}@media(max-width:782px){.jp-connection__connect-screen .jp-action-button button{max-width:none;width:100%}}.jp-connection__connect-screen__footer{margin-top:32px}.jp-connection__connect-screen-layout{background:var(--jp-white);border-radius:4px;box-shadow:0 0 40px rgba(0,0,0,.08)}.jp-connection__connect-screen-layout__loading{display:none}.jp-connection__connect-screen-layout__left,.jp-connection__connect-screen-layout__right{box-sizing:border-box}.jp-connection__connect-screen-layout__left{padding:calc(var(--spacing-base)*3)}@media(min-width:600px){.jp-connection__connect-screen-layout__left{padding:64px 96px}}.jp-connection__connect-screen-layout__left .jetpack-logo{margin-bottom:24px}.jp-connection__connect-screen-layout__left h2{color:var(--jp-black);font-size:36px;font-style:normal;font-weight:700;line-height:40px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left h3{color:var(--jp-black);font-size:24px;font-style:normal;font-weight:500;line-height:32px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left li,.jp-connection__connect-screen-layout__left p{font-size:16px;font-style:normal;font-weight:400;line-height:24px}.jp-connection__connect-screen-layout__left p{color:#101517;margin:16px 0}.jp-connection__connect-screen-layout__left a{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__connect-screen-layout__left a:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__connect-screen-layout__left a:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__connect-screen-layout__left ul{list-style-type:none;padding:0}.jp-connection__connect-screen-layout__left ul li{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwFnwUInggGnggGnggHnAcAnwUFnQcAnwcGnwkFnQgGnQgFnwcGnQYFnQcFnAcGnQkDnwdhiL0pAAAAEnRSTlMAMF//f2Aw7yBQ3+9gcIBgcED+HDbkAAAAZklEQVR4Ae3LNwICARDDQC0+cv7/Y8mwV9odSfWIcf/+VegnGkIvDaGXKvTTn/Gz+Uf5xTL0K1XotS7fs5H6GHvvaO8d7c3j7rdgHne/A/PYt/cO+R42oYdN6OEQetiFHo4A//6dAXqtBEkmtWutAAAAAElFTkSuQmCC) no-repeat;background-size:24px;color:var(--jp-black);margin-bottom:9px;padding-left:30px}.jp-connection__connect-screen-layout__right{padding:64px 0}.jp-connection__connect-screen-layout__right img{max-width:100%}.jp-connection__connect-screen-layout__two-columns{display:flex;flex-wrap:wrap}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:100%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:52%}}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{background:#f9f9f6;display:none;flex-basis:47%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{display:block}}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50)}.TcCZnGE6mad8Dvz9pCZi{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIwYTggOCAwIDEgMCAwLTE2IDggOCAwIDAgMCAwIDE2WiIgc3Ryb2tlPSIjRDYzNjM5IiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Ik0xMyA3aC0ydjZoMlY3Wk0xMyAxNWgtMnYyaDJ2LTJaIiBmaWxsPSIjRDYzNjM5Ii8+PC9zdmc+) no-repeat 0 0;color:var(--jp-red);line-height:25px;padding-left:25px}._mn6o2Dtm5pfFWc8_A1K{--spacing-base:8px;min-width:264px}.SWwV4Pw6OZ5vU3PqPXmr{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.r7tUofa9Z3A5ziKVR1H7{align-items:center;display:flex}.r7tUofa9Z3A5ziKVR1H7 img{object-fit:cover;width:100%}.YcYvLvdvWrb1EUZoVsE8{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.uGTTsKoIOoZdYhk6uPnl{white-space:nowrap}.hdasSNj9k3Sc5PwXK4uE{margin-right:4px;width:16px}.eWN8Hj0SBRDq1F48n_Fg{--gray-70:#3c434a;align-items:center;color:var(--gray-70);display:flex;font-size:14px;text-decoration:none}.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white);height:100%;padding:calc(var(--spacing-base)*8);position:relative}.B7JDqI_vtKxSy5GjvqA1{display:flex;flex-direction:column;height:100%}.zj7xadmhIWeuf7ZwvVTS{align-items:center;background:var(--jp-black);border-radius:var(--jp-border-radius) var(--jp-border-radius) 0 0;color:var(--jp-white);display:flex;height:calc(var(--spacing-base)*4);left:0;padding:0 var(--spacing-base);position:absolute;top:0;width:100%}.GsioW6IsC8EMYE3U6788{fill:var(--jp-white);margin-right:var(--spacing-base)}.cfEO8udWbRGPFJzW8Jg5,.dbz07JqxOlivjKO4vBEF{align-items:center;display:flex;height:calc(var(--spacing-base)*4);margin-bottom:calc(var(--spacing-base)*4)}.zlh3zbjUe4Z8cBs7uVVe{fill:#8c8f94;height:24px;line-height:24px}.qoZuzG5EcDa231hC6t0P{align-items:center;display:flex;justify-content:center}.qoZuzG5EcDa231hC6t0P svg{margin-right:var(--spacing-base)}.Q6uUUQCPWS6_6nLxIn68{display:inline-block;min-height:42px;padding:.5em 2em;text-align:center;width:100%}.Q6uUUQCPWS6_6nLxIn68 .YU4iBCRze09ZP3iCsdcb{margin:0}.Q6uUUQCPWS6_6nLxIn68.components-button.is-primary{height:auto;white-space:normal}.Q6uUUQCPWS6_6nLxIn68.is-secondary:hover:not(:disabled){background-color:var(--jp-black);color:var(--jp-white)}.OrQG7DjDd9Ha2Xj1Mx3L{margin-top:calc(var(--spacing-base)*2)}.Q1jaYDpa2AVfJpA29wT0{flex-grow:1;margin:0;margin-bottom:calc(var(--spacing-base)*2);padding:0}.Q1jaYDpa2AVfJpA29wT0 li{align-items:flex-start;display:flex;list-style:none;margin-bottom:var(--spacing-base)}.Q1jaYDpa2AVfJpA29wT0 svg{fill:var(--jp-green-primary);flex-shrink:0;margin-right:var(--spacing-base)}.sEcLfpWjo0GF7QrxD3Lt{margin-top:calc(var(--spacing-base)*2)}.xgv3jRkeF39aEQELCwru{align-items:flex-end;color:var(--jp-text-color);display:flex;flex-wrap:wrap}.twlleZ5Ehq4bB7CvKVSW{position:relative}.twlleZ5Ehq4bB7CvKVSW:first-child{margin-right:calc(var(--spacing-base)*2)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8{color:var(--jp-gray-20)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.ApsgxIornVy_3KnciVeJ{color:var(--jp-gray-40);margin-bottom:calc(var(--spacing-base)*3)}.NMxcZL17aEP7v81uG3zD{margin-top:calc(var(--spacing-base)*5)}.demNsMJjhi7BLY7xhjU5{align-items:center;display:flex;font-size:var(--font-body);line-height:calc(var(--spacing-base)*3);margin:calc(var(--spacing-base)*2) 0;min-height:calc(var(--spacing-base)*3)}.QiUjdjJSkqh6nH7YMG5A{align-self:flex-start;height:calc(var(--spacing-base)*3);margin-right:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*3)}.Q080AHcq29J2fc68Hhk5{color:var(--jp-red)}.Q080AHcq29J2fc68Hhk5 .hYWbIwhppukXmGnsiT9H{fill:var(--jp-red)}.JjHuxWly0HI9C60gorbq{color:var(--jp-yellow-40)}.JjHuxWly0HI9C60gorbq .hYWbIwhppukXmGnsiT9H{fill:var(--jp-yellow-40)}.Cm8ZFHi3mngl4cj9Gatx{color:var(--jp-blue-40)}.Cm8ZFHi3mngl4cj9Gatx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-blue-40)}.ytGBsU015p3LGwOPwFDx{color:var(--jp-green)}.ytGBsU015p3LGwOPwFDx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-green)}.jp-license-activation-screen-controls{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-controls h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-controls p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-controls label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-controls{padding:64px}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error{max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field .components-input-control__label.components-input-control__label.components-input-control__label,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error .components-input-control__label.components-input-control__label.components-input-control__label{font-size:var(--font-body);font-weight:600}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field select.components-select-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border-radius:var(--jp-border-radius);font-size:18px;line-height:24px;margin:0;min-height:48px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input{border:1px solid var(--jp-gray-40)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border:1px solid var(--jp-red)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error{align-items:flex-start;color:var(--jp-red);display:flex;flex-direction:row;max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error svg{fill:var(--jp-red);margin-right:4px;min-width:24px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error span{font-size:var(--font-body)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);display:flex;font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin-top:24px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{width:auto}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:hover,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:focus,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active[disabled],.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button .jp-components-spinner,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active .jp-components-spinner{width:100%}.jp-license-activation-screen-illustration{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-illustration--wrapper{display:flex;flex:1}.jp-license-activation-screen-illustration--wrapper img{align-self:center;height:auto;max-width:100%}.jp-license-activation-screen-illustration--support-link{flex:0}.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin:0 40px 20px 0;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{width:auto}}.components-button.jp-license-activation-screen-success-info--button:active:hover,.components-button.jp-license-activation-screen-success-info--button:hover,.components-button.jp-license-activation-screen-success-info--button:visited:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:focus,.components-button.jp-license-activation-screen-success-info--button:focus,.components-button.jp-license-activation-screen-success-info--button:visited:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:disabled,.components-button.jp-license-activation-screen-success-info--button:active[disabled],.components-button.jp-license-activation-screen-success-info--button:disabled,.components-button.jp-license-activation-screen-success-info--button:visited:disabled,.components-button.jp-license-activation-screen-success-info--button:visited[disabled],.components-button.jp-license-activation-screen-success-info--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.components-button.jp-license-activation-screen-success-info--button .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:active .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:visited .jp-components-spinner{width:100%}.jp-license-activation-screen-success-info--product-details h1{line-height:52px}.jp-license-activation-screen-success-info--product-details a{color:var(--jp-black);text-decoration:underline!important}.jp-license-activation-screen-success-info--external-link{color:var(--jp-black);font-size:16px;font-style:normal;font-weight:600;text-decoration:underline!important;white-space:nowrap}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.jp-license-activation-screen-success-info{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-success-info h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-success-info p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-success-info label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-success-info{padding:64px}}@media screen and (max-width:480px){.jp-license-activation-screen-success-info .jp-license-activation-screen-success-info--buttons{text-align:center}}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-10:#f2cf75;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.EiaNctK1_P9pPqOeiaSI{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ogHZg_sJCljylz3VJfsf{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.zv7eGvijKRkbPVakubHw{grid-column-end:span 1}.VoJNoiya_1ck3_kXS6_C{grid-column-end:span 2}.ecv0NO526NoTNbpALA1A{grid-column-end:span 3}.OfBdkceMzeHvRbzhqDlP{grid-column-end:span 4}@media(min-width:600px){.JLb3NpEKN8pOaWd7K1bu{grid-column-end:span 1}.fsMPGqPKE4mjMIPFwl77{grid-column-end:span 2}.DIK_zdaGAQ09eKspBJ4E{grid-column-end:span 3}.shXYpxPu3WCJsR8aOHtz{grid-column-end:span 4}.s7ElrOqG_yGd5SIfwqOR{grid-column-end:span 5}.Cxml9uzGvArAL8_RDs_p{grid-column-end:span 6}.aANxBKDGx72eDqU0iUPj{grid-column-end:span 7}.XxyzuTY3mnQcl9EGZadm{grid-column-end:span 8}}@media(min-width:960px){.Sfo4WaSNIWInJ93Abd3w{grid-column-end:span 1}.tQS7SKUGrU4THhWMysbo{grid-column-end:span 2}.I94U7mpY4h16pcOksZNF{grid-column-end:span 3}.uWMb9k77kQxBdS5MTt0s{grid-column-end:span 4}.rKwEEZQxK9s_POMg5Jss{grid-column-end:span 5}.UcPXX_s06IPCkF7ZjH3D{grid-column-end:span 6}.CrQdtiCFkRbzY6K2dFvt{grid-column-end:span 7}.rEUALOmOdUBXO0Us871z{grid-column-end:span 8}.NqXa9TlcTEviVsB53hBV{grid-column-end:span 9}.OnWVeiQiwgQ9lzdGPW66{grid-column-end:span 10}.D2PkTcy7b8u2K9QXY6VQ{grid-column-end:span 11}.EcqBhzAyxo5RDc2Y6m7K{grid-column-end:span 12}}@media(max-width:960px){.gB1mWzHOM38d80lrhBRX{display:none}}@media(max-width:600px){.KNQXLP78ejczOkour3zg{display:none}}.rBVbaVWBnBRtTMrUKZxm{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 64px 16px 24px;position:relative;text-decoration:none}.rBVbaVWBnBRtTMrUKZxm span{display:block}.rBVbaVWBnBRtTMrUKZxm span:last-of-type{font-weight:600}.rBVbaVWBnBRtTMrUKZxm:focus span:last-of-type,.rBVbaVWBnBRtTMrUKZxm:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.rBVbaVWBnBRtTMrUKZxm:focus:after,.rBVbaVWBnBRtTMrUKZxm:hover:after{transform:translateY(-50%) translateX(8px)}.rBVbaVWBnBRtTMrUKZxm:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;position:absolute;right:24px;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.gfM_DIJrVbRhmKdAphIm{background:var(--jp-white);border-radius:var(--jp-modal-radius);box-shadow:0 12px 16px -.5px rgba(0,0,0,.15);height:max-content;margin:3rem auto;max-width:414px;overflow:hidden;position:relative;transition:height .25s cubic-bezier(.59,.37,.18,1.19) 0;width:90%;will-change:height}.gfM_DIJrVbRhmKdAphIm>div:first-child{padding:0}.gfM_DIJrVbRhmKdAphIm *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.gfM_DIJrVbRhmKdAphIm p{color:var(--jp-black)}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:none}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:614px;transition-delay:2.15s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh h2{margin-top:0}._j4GWTmW5psCHFYh6R0x{align-self:flex-start;margin-top:var(--jp-gap)!important;padding:8px var(--jp-modal-padding-small)!important;width:100%}.saSAjv8yulVXQDoqDJEI{font-weight:500;line-height:110%;margin-bottom:8px}.O_hcdbeMivIhBn7ApDnS{line-height:140%}@media(min-width:760px){.gfM_DIJrVbRhmKdAphIm{height:740px;max-width:1360px;position:relative;width:95%}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:block;left:64px;position:absolute;top:64px;z-index:99}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path{fill:#000}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:740px;transition-delay:0}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path{fill:#fff;transition:fill 2s ease .5s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#000;transition:fill 2s ease .5s}}@keyframes OmAVpCQ270MqI4IsT9Ky{20%{transform:translateY(0) scale(1)}65%{transform:translateY(16%) scale(1.4)}to{transform:translateY(0) scale(1)}}.Qn5xayjI_jH2m1d6BEoq{border-radius:var(--jp-button-radius);display:flex;height:50%;justify-content:center;min-height:400px;overflow:hidden;position:relative;transition:height .55s cubic-bezier(.59,.37,.18,1) 0s;will-change:height}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{height:100%;transition-delay:.65s}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq video{animation:OmAVpCQ270MqI4IsT9Ky 1.5s ease-in-out forwards}.Qn5xayjI_jH2m1d6BEoq video{height:100%;left:0;object-fit:cover;position:absolute;top:0;transform:scale(1);transition:all .85s cubic-bezier(1,0,.39,1) 0s;width:100%;will-change:transform}@media(min-width:760px){@keyframes Axe8f2LgqEBZHVcsRgY5{0%{animation-timing-function:cubic-bezier(.86,0,.07,1);left:60%;top:32px}50%{animation-timing-function:cubic-bezier(.17,.84,.44,1);bottom:32px;left:32px;top:32px;width:100%}to{left:32px;width:40%}}.Qn5xayjI_jH2m1d6BEoq{border-radius:12px;bottom:32px;display:block;height:auto;left:60%;overflow:hidden;position:absolute;right:32px;top:32px;transition-delay:0;transition:width .55s ease 0s;z-index:3}.Qn5xayjI_jH2m1d6BEoq video{height:100%;left:0;object-fit:cover;position:absolute;top:0;width:100%}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{animation-delay:.25s;animation-duration:2s;animation-fill-mode:forwards;animation-name:Axe8f2LgqEBZHVcsRgY5;height:auto}}.iBMDoShSmqpt72YfJb36{padding:var(--jp-modal-padding)}.iBMDoShSmqpt72YfJb36 h2{font-size:clamp(1.5rem,-.7353rem + 4.7059vw,3.5rem)}.iBMDoShSmqpt72YfJb36 p{font-size:clamp(1rem,.6974rem + 1.1696vw,1.75rem)}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:none;font-size:clamp(1.25rem,1.1491rem + .3899vw,1.5rem)}@media(min-width:760px){.iBMDoShSmqpt72YfJb36{bottom:15%;display:flex;flex-direction:column;gap:64px;left:64px;padding:0 var(--jp-modal-padding) 0 0;position:absolute;width:55%}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC{align-items:flex-start;display:flex;flex-direction:column;gap:16px;padding:0 32px 0 0}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC h2,.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC p{margin:0}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:block}.iBMDoShSmqpt72YfJb36 ._j4GWTmW5psCHFYh6R0x{align-self:flex-start;padding:16px var(--jp-modal-padding-large)!important;width:auto}.pnwbCuWbV0PNQr1LFpRh .iBMDoShSmqpt72YfJb36{left:-20px;opacity:0;transition:all .55s cubic-bezier(.59,.37,.18,1) .3s}}.HQVDZ6J3x6SJNYFX5khS{background:var(--jp-white);left:0;opacity:0;position:absolute;top:100%;transition:transform .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;width:100%;will-change:transform,opacity;z-index:2}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{opacity:1;transform:translateY(-100%);transition-delay:2s}@media(min-width:760px){.HQVDZ6J3x6SJNYFX5khS{container-type:inline-size;align-items:flex-end;bottom:5%;display:flex;flex-direction:column;gap:40px;left:45%;padding:0;right:32px;transform:translateY(0);transition-delay:0;transition:none;width:auto}.HQVDZ6J3x6SJNYFX5khS h2{width:100%}.HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{margin-right:var(--jp-modal-padding-large)}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{bottom:12%;left:45%;opacity:1;right:32px;top:unset;transform:translateY(0);transition:all .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;transition-delay:2s;width:auto}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS .l35bIyiqYJiZ6tVYvJtC{padding-left:32px}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{align-self:flex-end}}.KdvmPIjelQIFiPQGuIYf{background:var(--jp-gray-0);display:flex;flex-direction:column;gap:var(--jp-gap)}.KdvmPIjelQIFiPQGuIYf div{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-button-radius);box-shadow:0 0 40px 0 rgba(0,0,0,.08);flex:1;padding:var(--jp-modal-padding)}.KdvmPIjelQIFiPQGuIYf h3{font-size:24px;line-height:normal;margin:0}.KdvmPIjelQIFiPQGuIYf p{font-size:14px}@media(min-width:760px){.KdvmPIjelQIFiPQGuIYf{flex-direction:row;padding:var(--jp-modal-padding-large)}.KdvmPIjelQIFiPQGuIYf div{border:none;box-shadow:0 2px 16px rgba(0,0,0,.08),0 2px 2px rgba(0,0,0,.1)}.KdvmPIjelQIFiPQGuIYf div p{margin:8px 0}.KdvmPIjelQIFiPQGuIYf svg{margin-bottom:var(--jp-modal-padding-small)}}@container (max-width: 600px){.KdvmPIjelQIFiPQGuIYf div{padding:var(--jp-modal-padding-small)}}.jp-license-activation-screen{border-radius:4px;box-shadow:0 4px 24px 0 #00000026;display:flex;flex-direction:column;min-height:540px;overflow:hidden}@media screen and (min-width:780px){.jp-license-activation-screen{flex-direction:row}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js new file mode 100644 index 00000000..45ac6f5a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js @@ -0,0 +1,20 @@ +/*! For license information please see index.js.LICENSE.txt */ +(()=>{var e={9487:(e,t,n)=>{"use strict";n.d(t,{X:()=>a});const c={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function a(e){return c[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}},8899:(e,t,n)=>{"use strict";n.d(t,{LR:()=>r});var c=n(9487),a=n(2003);function r(e,t,n={}){const r=(0,c.X)(t);if(!r||isNaN(e))return null;const{decimal:o,grouping:s,precision:i,symbol:l}={...r,...n},p=e<0?"-":"",u=Math.abs(e),d=Math.floor(u);return{sign:p,symbol:l,integer:(0,a.Z)(u,i,o,s).split(o)[0],fraction:i>0?(0,a.Z)(u-d,i,o,s).slice(1):""}}},2003:(e,t,n)=>{"use strict";function c(e,t=0,n=".",c=","){const a=(e+"").replace(/[^0-9+\-Ee.]/g,""),r=isFinite(+a)?+a:0,o=isFinite(+t)?Math.abs(t):0,s=(o?function(e,t){const n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(r,o):""+Math.round(r)).split(".");return s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(s[1]||"").lengthc})},3170:(e,t,n)=>{"use strict";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;tu,RQ:()=>U,WK:()=>M,Zn:()=>P,Zq:()=>L,aU:()=>a,cP:()=>d,fp:()=>y,kG:()=>s,pC:()=>I,q_:()=>o}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(a||(a={}));const r="popstate";function o(e){return void 0===e&&(e={}),g((function(e,t){let{pathname:n="/",search:c="",hash:a=""}=d(e.location.hash.substr(1));return p("",{pathname:n,search:c,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),c="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");c=-1===n?t:t.slice(0,n)}return c+"#"+("string"==typeof t?t:u(t))}),(function(e,t){i("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function s(e,t){if(!1===e||null==e)throw new Error(t)}function i(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function l(e){return{usr:e.state,key:e.key}}function p(e,t,n,a){return void 0===n&&(n=null),c({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:n,key:t&&t.key||a||Math.random().toString(36).substr(2,8)})}function u(e){let{pathname:t="/",search:n="",hash:c=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),c&&"#"!==c&&(t+="#"===c.charAt(0)?c:"#"+c),t}function d(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let c=e.indexOf("?");c>=0&&(t.search=e.substr(c),e=e.substr(0,c)),e&&(t.pathname=e)}return t}function m(e){let t="undefined"!=typeof window&&void 0!==window.location&&"null"!==window.location.origin?window.location.origin:window.location.href,n="string"==typeof e?e:u(e);return s(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}function g(e,t,n,c){void 0===c&&(c={});let{window:o=document.defaultView,v5Compat:s=!1}=c,i=o.history,d=a.Pop,g=null;function h(){d=a.Pop,g&&g({action:d,location:y.location})}let y={get action(){return d},get location(){return e(o,i)},listen(e){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(r,h),g=e,()=>{o.removeEventListener(r,h),g=null}},createHref:e=>t(o,e),encodeLocation(e){let t=m("string"==typeof e?e:u(e));return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d=a.Push;let c=p(y.location,e,t);n&&n(c,e);let r=l(c),u=y.createHref(c);try{i.pushState(r,"",u)}catch(e){o.location.assign(u)}s&&g&&g({action:d,location:y.location})},replace:function(e,t){d=a.Replace;let c=p(y.location,e,t);n&&n(c,e);let r=l(c),o=y.createHref(c);i.replaceState(r,"",o),s&&g&&g({action:d,location:y.location})},go:e=>i.go(e)};return y}var h;function y(e,t,n){void 0===n&&(n="/");let c=P(("string"==typeof t?d(t):t).pathname||"/",n);if(null==c)return null;let a=f(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let r=null;for(let e=0;null==r&&e{let o={relativePath:void 0===r?e.path||"":r,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};o.relativePath.startsWith("/")&&(s(o.relativePath.startsWith(c),'Absolute route path "'+o.relativePath+'" nested under path "'+c+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(c.length));let i=U([c,o.relativePath]),l=n.concat(o);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+i+'".'),f(e.children,t,l,i)),(null!=e.path||e.index)&&t.push({path:i,score:Z(i,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of k(e.path))a(e,t,n);else a(e,t)})),t}function k(e){let t=e.split("/");if(0===t.length)return[];let[n,...c]=t,a=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===c.length)return a?[r,""]:[r];let o=k(c.join("/")),s=[];return s.push(...o.map((e=>""===e?r:[r,e].join("/")))),a&&s.push(...o),s.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(h||(h={}));const v=/^:\w+$/,E=3,b=2,j=1,_=10,C=-2,w=e=>"*"===e;function Z(e,t){let n=e.split("/"),c=n.length;return n.some(w)&&(c+=C),t&&(c+=b),n.filter((e=>!w(e))).reduce(((e,t)=>e+(v.test(t)?E:""===t?j:_)),c)}function N(e,t){let{routesMeta:n}=e,c={},a="/",r=[];for(let e=0;e(c.push(t),"/([^\\/]+)")));e.endsWith("*")?(c.push("*"),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let r=new RegExp(a,t?void 0:"i");return[r,c]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let r=a[0],o=r.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:c.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";o=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return x(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{}),pathname:r,pathnameBase:o,pattern:e}}function R(e){try{return decodeURI(e)}catch(t){return x(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function P(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,c=e.charAt(n);return c&&"/"!==c?null:e.slice(n)||"/"}function x(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function A(e,t,n,c){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(c)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function L(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function I(e,t,n,a){let r;void 0===a&&(a=!1),"string"==typeof e?r=d(e):(r=c({},e),s(!r.pathname||!r.pathname.includes("?"),A("?","pathname","search",r)),s(!r.pathname||!r.pathname.includes("#"),A("#","pathname","hash",r)),s(!r.search||!r.search.includes("#"),A("#","search","hash",r)));let o,i=""===e||""===r.pathname,l=i?"/":r.pathname;if(a||null==l)o=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}o=e>=0?t[e]:"/"}let p=function(e,t){void 0===t&&(t="/");let{pathname:n,search:c="",hash:a=""}="string"==typeof e?d(e):e,r=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:r,search:O(c),hash:F(a)}}(r,o),u=l&&"/"!==l&&l.endsWith("/"),m=(i||"."===l)&&n.endsWith("/");return p.pathname.endsWith("/")||!u&&!m||(p.pathname+="/"),p}const U=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",F=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class D extends Error{}class z{constructor(e,t,n,c){void 0===c&&(c=!1),this.status=e,this.statusText=t||"",this.internal=c,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function M(e){return e instanceof z}const V=["post","put","patch","delete"],B=(new Set(V),["get",...V]);new Set(B),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement},1074:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var c=n(9307);const a=function(e){let{icon:t,size:n=24,...a}=e;return(0,c.cloneElement)(t,{width:n,height:n,...a})}},3259:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}))},9201:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},6936:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}))},9517:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))},5381:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}))},496:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}))},1908:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(a.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}))},797:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9307),a=n(444);const r=(0,c.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,c.createElement)(a.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"}))},5235:(e,t)=>{var n;!function(){"use strict";var c={}.hasOwnProperty;function a(){for(var e=[],t=0;t{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let c=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(a=c))})),t.splice(a,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(1741)(t);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1741:(e,t,n)=>{e.exports=function(e){function t(e){let n,a,r,o=null;function s(...e){if(!s.enabled)return;const c=s,a=Number(new Date),r=a-(n||a);c.diff=r,c.prev=n,c.curr=a,n=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,a)=>{if("%%"===n)return"%";o++;const r=t.formatters[a];if("function"==typeof r){const t=e[o];n=r.call(c,t),e.splice(o,1),o--}return n})),t.formatArgs.call(c,e);(c.log||t.log).apply(c,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=c,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(a!==t.namespaces&&(a=t.namespaces,r=t.enabled(e)),r),set:e=>{o=e}}),"function"==typeof t.init&&t.init(s),s}function c(e,n){const c=t(this.namespace+(void 0===n?":":n)+e);return c.log=this.log,c}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(a),...t.skips.map(a).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),a=c.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"use strict";n.d(t,{Z:()=>c});const c={error:"TcCZnGE6mad8Dvz9pCZi",button:"_mn6o2Dtm5pfFWc8_A1K"}},1494:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"admin-page":"sexr0jUxC1jVixdKiDnC",background:"vKQ11sLeAM45M04P1ccj"}},511:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={section:"cAbGtJDGgLubucBnz7vM"}},281:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"section-hero":"vMa4i_Dza2t5Zi_Bw9Nf"}},9171:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={container:"demNsMJjhi7BLY7xhjU5","icon-wrapper":"QiUjdjJSkqh6nH7YMG5A","is-error":"Q080AHcq29J2fc68Hhk5",icon:"hYWbIwhppukXmGnsiT9H","is-warning":"JjHuxWly0HI9C60gorbq","is-info":"Cm8ZFHi3mngl4cj9Gatx","is-success":"ytGBsU015p3LGwOPwFDx"}},3466:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={button:"zI5tJ_qhWE6Oe6Lk75GY","is-icon-button":"tuBt2DLqimiImoqVzPqo",small:"Na39I683LAaSA99REg14",normal:"ipS7tKy9GntCS4R3vekF",icon:"paGLQwtPEaJmtArCcmyK",regular:"lZAo6_oGfclXOO9CC6Rd","full-width":"xJDOiJxTt0R_wSl8Ipz_",loading:"q_tVWqMjl39RcY6WtQA6","external-icon":"CDuBjJp_8jxzx5j6Nept"}},2404:()=>{},5612:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"star-icon":"cuoSlhSNrqf1dozY22Xb",jetpack:"lAIiifeLMmZAPlQ9n9ZR","checkmark-icon":"JLquNpQVlysAamuh5lJO",socialIcon:"cbOwD8Y4tFjwimmtchQI",facebook:"aHOlEBGD5EA8NKRw3xTw",twitter:"af4Y_zItXvLAOEoSDPSv",linkedin:"f68aqF3XSD1OBvXR1get",tumblr:"xFI0dt3UiXRlRQdqPWkx",google:"q7JEoyymveP6kF747M43",mastodon:"DKOBOTVmTLbh26gUH_73"}},9054:()=>{},3247:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)"}},3080:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",smCols:"4",mdCols:"8",lgCols:"12","col-sm-1":"RuVLl3q4lxTQa3wbhBJB","col-sm-1-start":"f9LZTRG4MMK42rS89afW","col-sm-1-end":"bHe_zKxjjpUwHw_MdYE1","col-sm-2":"QZbNrOqE2aNSn50xVhpU","col-sm-2-start":"ev7W3z7zVYPeHAlYqZjf","col-sm-2-end":"NJWd1m_e7lOiPYru2ZMP","col-sm-3":"Xc6nt1Qc1DI0Z2A3gt1r","col-sm-3-start":"UIcN_GXiPRoIsin8Kohg","col-sm-3-end":"GRKCyqb5LufCSCgykKFc","col-sm-4":"i_qTq8gqhhC3vIUepVRB","col-sm-4-start":"G3qaZ3Jpbvam_1XvGxgc","col-sm-4-end":"VRCNYKZtO9zukEwmgP1y","col-md-1":"tRm008K_WJL79WoNZTNL","col-md-1-start":"l5T2P_bgKts4tdaRkS1d","col-md-1-end":"zOCxfLZpF6BlgC7a_Yq1","col-md-2":"F80DdgVn0m5OpvtSQWka","col-md-2-start":"oI1c7JYfiJtMQHbhngtU","col-md-2-end":"pMQtA_4jh1_1lVknqEP5","col-md-3":"VenqMpdgyKQVUNNQcfqd","col-md-3-start":"seNYL99uoczf9V4MxBxT","col-md-3-end":"YKfF1HFhI9KygA5l3b2J","col-md-4":"yAi0Cv1xDWkoqsaUhvhR","col-md-4-start":"ubhnyZOnkgxNhh6XtVWv","col-md-4-end":"RGOPGQbWMJ9Ei5oFxS7X","col-md-5":"Sz1E2aWbX483ijdi6yge","col-md-5-start":"tku6_bRYrX9tMbgYGmIl","col-md-5-end":"b5JHttOhSEcI1WBlqAjk","col-md-6":"FboSx5MoKTAWbxXyYlCw","col-md-6-start":"Jhs8yEEmodG30edbJvag","col-md-6-end":"IpzbbKVqEqPcfIGkXkwt","col-md-7":"mhCPwfAZ4Kmm_empzJAq","col-md-7-start":"x034ilrJF7rO9UJB2rI1","col-md-7-end":"Wt8t2e16viRrOJ1lLA5v","col-md-8":"S6pIrEy9AMLKx9bgh_Ae","col-md-8-start":"kEfI4tGyuWfHTlRnvIab","col-md-8-end":"PUzX4RRsKq1dnsz3gebS","col-lg-1":"X_pdcLJikd8LS_YAdJlB","col-lg-1-start":"tl936d14Huby4khYp05X","col-lg-1-end":"hnge0LnR69d3NXEtEE1t","col-lg-2":"fj0NUMuyZQcPNgKcjp5Z","col-lg-2-start":"R2ncBX7a2NigdYCcV1OX","col-lg-2-end":"t8vMSDVYno9k9itRwnXb","col-lg-3":"wsDuEN2GqHx6qzo8dUdk","col-lg-3-start":"cIEVPUweWtLBy3xaXnMx","col-lg-3-end":"fajUWBwu1m2B479j3jmz","col-lg-4":"YR0c7fQTgMkDdWzwSyLp","col-lg-4-start":"xlwp8BmplxkKNMI7gamo","col-lg-4-end":"_C4O1w9DUqx1m3gPf8aA","col-lg-5":"Z54F1hAErckAIrKlxnXW","col-lg-5-start":"ezSDWkRHmKSxDJXxuiOH","col-lg-5-end":"T0ChoeAjGJjkkNrYhD4g","col-lg-6":"qtMoMPF6yHvGJnWHSsde","col-lg-6-start":"gdoywN5VPiWERfIBqkph","col-lg-6-end":"wUev_VH5uf_pwFFlbnAU","col-lg-7":"egIPDFJsOpownTClq9XP","col-lg-7-start":"yGhp9yoAW7k0kQik9AB7","col-lg-7-end":"SJ43U9mR5wUg5V2qBeQA","col-lg-8":"cTuyHfMwSUJxN_HdIEgd","col-lg-8-start":"smCr8DaIagcumdvdldiK","col-lg-8-end":"T03NHzQJvzwL6wAfIiTL","col-lg-9":"pMvxM3RJGjqyNdf9qg1Y","col-lg-9-start":"iIVpNRwEnQ_JI5gpp9EN","col-lg-9-end":"ZbQ4u4vGSX5rJOje4uGL","col-lg-10":"gKb5wuIDAlKGbrjK2vxy","col-lg-10-start":"Z7pINdImE2WJiYnZBTqm","col-lg-10-end":"ZTxp6qpvwurMdOnLLSz1","col-lg-11":"NnQTlbfnxPDR6cQ7rygg","col-lg-11-start":"O137wZd6Yl0olSA9PsXR","col-lg-11-end":"zf2OJtQ2MPz6SDoh6CB0","col-lg-12":"U3H6UHW6HqRt9hdzVg3O","col-lg-12-start":"zynnNeS_ZBTxABcVpUQH","col-lg-12-end":"vI8tltFZtFUNAy9Iag9s"}},8730:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={sm:"(max-width: 599px)",md:"(min-width: 600px) and (max-width: 959px)",lg:"(min-width: 960px)",container:"SqdhUZkXCRuIpErj1B3z",fluid:"OZC_9a1LhpWF9dv15Gdh"}},1683:()=>{},7920:()=>{},3280:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={reset:"WQVtrU6q0L1Igcj7wCrQ","headline-medium":"UujoBFTnQNY2cWU2SIsH","headline-small":"TeGO5V_thHw5lDAm1_2M","headline-small-regular":"WolQzb2MsSgiNmLtc7_j","title-medium":"hUB0JT8p1T2Hw28N6qC8","title-medium-semi-bold":"gKZWDv5chz3_O3Syp74H","title-small":"zY2No8Ga4b8shbOQGhnv",body:"tIj0D1t8Cc892ikmgFPZ","body-small":"KdcN0BnOaVeVhyLRKqhS","body-extra-small":"dso3Rh3tl3Xv1GumBktz","body-extra-small-bold":"mQ1UlbN9u4Mg9byO8m7v",label:"PItlW5vRExLnTj4a8eLE","m-0":"TwRpPlktzxhmFVeua7P5","mx-0":"zVfqx7gyb3o9mxfGynn1","my-0":"iSHVzNiB9iVleGljaQxy","mt-0":"xqDIp6cNVr_E6RXaiPyD","mr-0":"S8EwaXk1kyPizt6x4WH2","mb-0":"ODX5Vr1TARoLFkDDFooD","ml-0":"cphJ8dCpfimnky7P2FHg","m-1":"PFgIhNxIyiSuNvQjAIYj","mx-1":"M2jKmUzDxvJjjVEPU3zn","my-1":"io15gAh8tMTNbSEfwJKk","mt-1":"rcTN5uw9xIEeMEGL3Xi_","mr-1":"CQSkybjq2TcRM1Xo9COV","mb-1":"hfqOWgq6_MEGdFE82eOY","ml-1":"I8MxZQYTbuu595yfesWA","m-2":"kQkc6rmdpvLKPkyoJtVQ","mx-2":"j6vFPxWuu4Jan2ldoxpp","my-2":"hqr39dC4H_AbactPAkCG","mt-2":"c3dQnMi16C6J6Ecy4283","mr-2":"YNZmHOuRo6hU7zzKfPdP","mb-2":"Db8lbak1_wunpPk8NwKU","ml-2":"ftsYE5J9hLzquQ0tA5dY","m-3":"Det4MHzLUW7EeDnafPzq","mx-3":"h_8EEAztC29Vve1datb5","my-3":"YXIXJ0h1k47u6hzK8KcM","mt-3":"soADBBkcIKCBXzCTuV9_","mr-3":"zSX59ziEaEWGjnpZa4uV","mb-3":"yrVTnq_WBMbejg89c2ZQ","ml-3":"UKtHPJnI2cXBWtPDm5hM","m-4":"guexok_Tqd5Tf52hRlbT","mx-4":"oS1E2KfTBZkJ3F0tN7T6","my-4":"DN1OhhXi6AoBgEdDSbGd","mt-4":"ot2kkMcYHv53hLZ4LSn0","mr-4":"A1krOZZhlQ6Sp8Cy4bly","mb-4":"pkDbXXXL32237M0hokEh","ml-4":"XXv4kDTGvEnQeuGKOPU3","m-5":"yGqHk1a57gaISwkXwXe6","mx-5":"X8cghM358X3DkXLc9aNK","my-5":"GdfSmGwHlFnN2S6xBn1f","mt-5":"yqeuzwyGQ7zG0avrGqi_","mr-5":"g9emeCkuHvYhveiJbfXO","mb-5":"Lvk3dqcyHbZ07QCRlrUQ","ml-5":"r3yQECDQ9qX0XZzXlVAg","m-6":"aQhlPwht2Cz1X_63Miw0","mx-6":"JyHb0vK3wJgpblL9s5j8","my-6":"cY2gULL1lAv6WPNIRuf3","mt-6":"NBWQ9Lwhh_fnry3lg_p7","mr-6":"yIOniNe5E40C8fWvBm5V","mb-6":"t30usboNSyqfQWIwHvT3","ml-6":"Nm_TyFkYCMhOoghoToKJ","m-7":"C4qJKoBXpgKtpmrqtEKB","mx-7":"S93Srbu6NQ_PBr7DmTiD","my-7":"fJj8k6gGJDks3crUZxOS","mt-7":"cW6D6djs7Ppm7fD7TeoV","mr-7":"DuCnqNfcxcP3Z__Yo5Ro","mb-7":"im8407m2fw5vOg7O2zsw","ml-7":"G0fbeBgvz2sh3uTP9gNl","m-8":"kvW3sBCxRxUqz1jrVMJl","mx-8":"tOjEqjLONQdkiYx_XRnw","my-8":"op5hFSx318zgxsoZZNLN","mt-8":"c9WfNHP6TFKWIfLxv52J","mr-8":"sBA75QqcqRwwYSHJh2wc","mb-8":"GpL6idrXmSOM6jB8Ohsf","ml-8":"HbtWJoQwpgGycz8dGzeT","p-0":"uxX3khU88VQ_Ah49Ejsa","px-0":"KX0FhpBKwKzs9fOUdbNz","py-0":"PfK8vKDyN32dnimlzYjz","pt-0":"emxLHRjQuJsImnPbQIzE","pr-0":"kJ8WzlpTVgdViXt8ukP9","pb-0":"tg_UIUI11VBzrTAn2AzJ","pl-0":"uczvl8kaz84oPQJ2DB2R","p-1":"o7UHPcdVK3lt7q3lqV4o","px-1":"IDqEOxvDoYrFYxELPmtX","py-1":"DdywPW2qSYlu2pt8tpO2","pt-1":"npy3hw4A5QSkDicb2CJJ","pr-1":"LgbptTApNY5NwLQvEFAt","pb-1":"WZQy2SZuZso59bUsXXyl","pl-1":"o331apInxNunbYB3SfPE","p-2":"fMPIyD9Vqki1Lrc_yJnG","px-2":"i2pMcTcdrr10IQoiSm_L","py-2":"eA702gn32kwptiI1obXH","pt-2":"o9bGieUKcYc8o0Ij9oZX","pr-2":"SwZcFez1RDqWsOFjB5iG","pb-2":"eHpLc_idmuEqeqCTvqkN","pl-2":"vU39i2B4P1fUTMB2l6Vo","p-3":"JHWNzBnE29awhdu5BEh1","px-3":"X72lGbb56L3KFzC2xQ9N","py-3":"BzfNhRG8wXdCEB5ocQ6e","pt-3":"srV0KSDC83a2fiimSMMQ","pr-3":"lUWfkmbQjCskhcNwkyCm","pb-3":"Ts0dIlc3aTSL7V4cIHis","pl-3":"CzlqQXXhX6MvorArFZ8B","p-4":"TqMPkQtR_DdZuKb5vBoV","px-4":"a7UrjhI69Vetlcj9ZVzz","py-4":"StEhBzGs2Gi5dDEkjhAv","pt-4":"FGneZfZyvYrt1dG0zcnm","pr-4":"APEH216rpdlJWgD2fHc8","pb-4":"oGwXC3ohCic9XnAj6x69","pl-4":"U6gnT9y42ViPNOcNzBwb","p-5":"IpdRLBwnHqbqFrixgbYC","px-5":"HgNeXvkBa9o3bQ5fvFZm","py-5":"tJtFZM3XfPG9v9TSDfN1","pt-5":"PdifHW45QeXYfK568uD8","pr-5":"mbLkWTTZ0Za_BBbFZ5b2","pb-5":"vVWpZpLlWrkTt0hMk8XU","pl-5":"RxfaJj5a1Nt6IavEo5Zl","p-6":"SppJULDGdnOGcjZNCYBy","px-6":"palY2nLwdoyooPUm9Hhk","py-6":"WYw1JvZC0ppLdvSAPhr_","pt-6":"YEEJ9b90ueQaPfiU8aeN","pr-6":"QE0ssnsKvWJMqlhPbY5u","pb-6":"n8yA3jHlMRyLd5UIfoND","pl-6":"tXHmxYnHzbwtfxEaG51n","p-7":"kBTsPKkO_3g_tLkj77Um","px-7":"RyhrFx6Y1FGDrGAAyaxm","py-7":"CBwRpB0bDN3iEdQPPMJO","pt-7":"vQVSq6SvWKbOMu6r4H6b","pr-7":"oBy5__aEADMsH46mrgFX","pb-7":"KVEXoJqf1s92j0JMdNmN","pl-7":"ZMXGNrNaKW3k_3TLz0Fq","p-8":"tuiR9PhkHXhGyEgzRZRI","px-8":"U7454qyWkQNa2iaSJziu","py-8":"VLYIv2GVocjuN93e8HC8","pt-8":"X1rm9DQ1zLGLfogja5Gn","pr-8":"JS7G6kAuqJo5GIuF8S5t","pb-8":"Y8F9ga1TDCMbM1lj4gUz","pl-8":"AJuyNGrI63BOWql719H8"}},3591:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={global:"_fUXxnSp5pagKBp9gSN7"}},1510:()=>{},9610:()=>{},9836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={heading:"urouayitSUT8zW0V3p_0",notice:"iXXJlk08gFDeCvsTTlNQ",button:"MWqRqr7q6fgvLxitcWYk","bigger-than-medium":"YLcXAoc82nypTPaKSAcd",error:"e6hHy8BZ7ZKPSXbIC0UG",message:"jXz8LnXNzMDdtHqkG0sZ"}},4220:()=>{},287:()=>{},9823:()=>{},7664:()=>{},1008:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"jp-wrap":"EiaNctK1_P9pPqOeiaSI","jp-row":"ogHZg_sJCljylz3VJfsf","sm-col-span-1":"zv7eGvijKRkbPVakubHw","sm-col-span-2":"VoJNoiya_1ck3_kXS6_C","sm-col-span-3":"ecv0NO526NoTNbpALA1A","sm-col-span-4":"OfBdkceMzeHvRbzhqDlP","md-col-span-1":"JLb3NpEKN8pOaWd7K1bu","md-col-span-2":"fsMPGqPKE4mjMIPFwl77","md-col-span-3":"DIK_zdaGAQ09eKspBJ4E","md-col-span-4":"shXYpxPu3WCJsR8aOHtz","md-col-span-5":"s7ElrOqG_yGd5SIfwqOR","md-col-span-6":"Cxml9uzGvArAL8_RDs_p","md-col-span-7":"aANxBKDGx72eDqU0iUPj","md-col-span-8":"XxyzuTY3mnQcl9EGZadm","lg-col-span-1":"Sfo4WaSNIWInJ93Abd3w","lg-col-span-2":"tQS7SKUGrU4THhWMysbo","lg-col-span-3":"I94U7mpY4h16pcOksZNF","lg-col-span-4":"uWMb9k77kQxBdS5MTt0s","lg-col-span-5":"rKwEEZQxK9s_POMg5Jss","lg-col-span-6":"UcPXX_s06IPCkF7ZjH3D","lg-col-span-7":"CrQdtiCFkRbzY6K2dFvt","lg-col-span-8":"rEUALOmOdUBXO0Us871z","lg-col-span-9":"NqXa9TlcTEviVsB53hBV","lg-col-span-10":"OnWVeiQiwgQ9lzdGPW66","lg-col-span-11":"D2PkTcy7b8u2K9QXY6VQ","lg-col-span-12":"EcqBhzAyxo5RDc2Y6m7K","md-col-span-0":"gB1mWzHOM38d80lrhBRX","sm-col-span-0":"KNQXLP78ejczOkour3zg","jp-cut":"rBVbaVWBnBRtTMrUKZxm",modal:"gfM_DIJrVbRhmKdAphIm","jetpack-logo":"zfJfONxRAw0fHjXUS7LN",animating:"pnwbCuWbV0PNQr1LFpRh",button:"_j4GWTmW5psCHFYh6R0x",headline:"saSAjv8yulVXQDoqDJEI",paragraph:"O_hcdbeMivIhBn7ApDnS","jetpack-logo-triangles":"FCnyb_xCK7DhJ63p6TEd","video-wrap":"Qn5xayjI_jH2m1d6BEoq",videoMove:"OmAVpCQ270MqI4IsT9Ky",slidein:"Axe8f2LgqEBZHVcsRgY5","content-wrap":"iBMDoShSmqpt72YfJb36","hi-user":"eQG1KKK8jjKtQyzfv573","content-wrap-text":"l35bIyiqYJiZ6tVYvJtC","powers-wrap":"HQVDZ6J3x6SJNYFX5khS","jetpack-products":"KdvmPIjelQIFiPQGuIYf"}},6234:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={icon:"rV_5QyvhDnsVjCX4pb0h",link:"MO1jDNY8VPqeNS9xL8jE"}},8578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"relative-col":"zvd4dCB_bBDiXJKKDqXm","close-link":"ly4o9lSswAGHFXqGUEIO","account-description":"u64Go3kwEZ7MD9eji0H1","account-images":"_RT41NE3LU4R0ubcij2y",wordpress:"cFGWJeRiGHjAr8D7CWJW",google:"Iz3l7a05TP6HK9S92TIL",apple:"lmQ0wFmnk4kKkGVjokPA","all-features":"AoIs8wD92wKR8RpQj6Uc"}},6322:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"connection-status-card":"kezuOHNvu9vdvlJ86Fwg",status:"qJizORs2q_CVCj9L6XLe","avatar-wrapper":"VmtuLc2xRqmsO6cK8qjF",cloud:"MdTRfQ3eo5qZKChZlzNj",jetpack:"PbEpL02SEH9VNAlbKCfV",avatar:"TD4AUM9gcTVAB6JHB5ZR",line:"yjl73qv0VWoPP8IhGreh",disconnected:"rq8YRaj9OyUUXJUHiUgI",info:"YZ7FNKEm9qpvQ4ZkbAz5","list-item":"oH9tzGE80LnB6Og69RFz","list-item-text":"xXVEWvQllVsFGmJY8WEp",error:"J0GIu2rNR7rXocQTyd8p"}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={icon:"hdasSNj9k3Sc5PwXK4uE",link:"eWN8Hj0SBRDq1F48n_Fg"}},1854:()=>{},4416:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={"jp-wrap":"yWUvvF4WJLNDSpMgBMfm","jp-row":"ka1fVHj2HOkHjhdoEFOZ","sm-col-span-1":"JMOO4Y_9yhTO9lwLnRUx","sm-col-span-2":"PFDPAqk51qox_ChLqJwm","sm-col-span-3":"ault0jHVfWpShqOGooIP","sm-col-span-4":"GqpvdRzmzPJELtSm4FEN","md-col-span-1":"Ym4_YneEGD_iZD6W1C2o","md-col-span-2":"NbvHnnDtWw8n9BEUQ0Oy","md-col-span-3":"ElMT7rhxe5ZJKO41MnhW","md-col-span-4":"yKjnqjibn_wW_1tWWt5Q","md-col-span-5":"Pb30lOcQFpzUX57GwflS","md-col-span-6":"pC1wxc_R8y4pNILHsiiY","md-col-span-7":"pChscSCnudQoWGjMFKI_","md-col-span-8":"qw1H2gAgF3lDCI2Tbkmb","lg-col-span-1":"VzcA_rrxBK3g4ozA0oD9","lg-col-span-2":"pNAa7O2adRZD8Slgk9iR","lg-col-span-3":"tlIMLlipexblj8CeOx4B","lg-col-span-4":"Dvt0u5l2Rr1BhBmvYAzl","lg-col-span-5":"BiUsgNTc0tyc7tC5jnzE","lg-col-span-6":"ulJXAsj7G2ROJ1g3_s28","lg-col-span-7":"HsoVlyVLsXYClx9Atox0","lg-col-span-8":"oXxjRQNNj2cfIpFBqC1W","lg-col-span-9":"qXgUn4Adg9xE_JnbuDio","lg-col-span-10":"xMpqTLiLfYFEJiRPQQQq","lg-col-span-11":"IiGo3Sz2FDZN7_eGElwA","lg-col-span-12":"Om8BNCjfgqQ_wmPQjfOY","md-col-span-0":"t10ZWzP7ADjJnR4tqxRS","sm-col-span-0":"eOUlZG8Pelh_Xj0aSoHG","jp-cut":"l546LrwBEePz434NFK5Q",logo:"Q7w4fcEcemZ2nlwaYNog",wrapper:"AoNQsOaTt6gSf0H6Yasz",helper:"v13ZwGzUnecPA7Y3URAl",container:"EeDbu9pXFWTsCzfTpv2v",title:"BmSvoIi3rErkcrRiOi2W",content:"mojRoVuWdDJo0E6LEjJw"}},1017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={heading:"jErCC9oKHSM15BxzFyQK",notice:"oVoYbwbFB6U2o90Njusk","bigger-than-medium":"Snc8NEmDelsbhlH4285s",message:"wBVXH4OTNwLHPRpN4nsq",nofill:"F1qvEnFfHs5nz3zFZUOV"}},6891:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={container:"wiobThfXJCuhGNrbFIT6","expire-date":"VgAxgahF9bC2M__FiIgV","expire-date--with-icon":"dbRwkMLqcMF67njPoAF7","actions-list-item":"Doju0RxvvN9JS12mf489"}},9720:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={container:"pIsYsXFAJ9KX2VrS5rmY","is-link":"YXHdD0VsFjiTsVRLrrx9","has-error":"Pp9cMIaESLYelLOX3tkI",name:"w56ueQLYexqzTybA7015",description:"gmPKCDKZcfQt9WieTyKS",actions:"fDBaV7I4yUO6w5AWVEtr",status:"f5VJYwuJmjxH8PVxEbbv",active:"ry3pxoGtmQ0ZeSwp7F_3",inactive:"LZzE3EG7m3CDR46wwwEr",error:"Vx_jpT02r8W6NfsRSB02","is-fetching":"PdsJCfyyjSgrNDheF2qi","blink-animation":"dWP7ypkVXudMbAa38W5Z"}},8429:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={card:"q0T8YyQxRawhpDtvJjxI",container:"B7JDqI_vtKxSy5GjvqA1","card-header":"zj7xadmhIWeuf7ZwvVTS","product-bundle-icon":"GsioW6IsC8EMYE3U6788","product-bundle-icons":"dbz07JqxOlivjKO4vBEF","product-icon":"cfEO8udWbRGPFJzW8Jg5","plus-icon":"zlh3zbjUe4Z8cBs7uVVe","product-has-required-plan":"qoZuzG5EcDa231hC6t0P","checkout-button":"Q6uUUQCPWS6_6nLxIn68","components-spinner":"YU4iBCRze09ZP3iCsdcb","free-product-checkout-button":"OrQG7DjDd9Ha2Xj1Mx3L",features:"Q1jaYDpa2AVfJpA29wT0",disclaimers:"sEcLfpWjo0GF7QrxD3Lt","price-container":"xgv3jRkeF39aEQELCwru",price:"twlleZ5Ehq4bB7CvKVSW","is-old":"Qg4rPEvXsqmod1s_31d8","price-description":"ApsgxIornVy_3KnciVeJ","supporting-info":"NMxcZL17aEP7v81uG3zD"}},1287:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={container:"SWwV4Pw6OZ5vU3PqPXmr",imageContainer:"r7tUofa9Z3A5ziKVR1H7","product-interstitial__header":"YcYvLvdvWrb1EUZoVsE8","product-interstitial__license-activation-link":"uGTTsKoIOoZdYhk6uPnl"}},5878:()=>{},3171:e=>{var t=1e3,n=60*t,c=60*n,a=24*c,r=7*a,o=365.25*a;function s(e,t,n,c){var a=t>=1.5*n;return Math.round(e/n)+" "+c+(a?"s":"")}e.exports=function(e,i){i=i||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var i=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*o;case"weeks":case"week":case"w":return i*r;case"days":case"day":case"d":return i*a;case"hours":case"hour":case"hrs":case"hr":case"h":return i*c;case"minutes":case"minute":case"mins":case"min":case"m":return i*n;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===l&&isFinite(e))return i.long?function(e){var r=Math.abs(e);if(r>=a)return s(e,r,a,"day");if(r>=c)return s(e,r,c,"hour");if(r>=n)return s(e,r,n,"minute");if(r>=t)return s(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=a)return Math.round(e/a)+"d";if(r>=c)return Math.round(e/c)+"h";if(r>=n)return Math.round(e/n)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7556:(e,t,n)=>{"use strict";var c=n(3713);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,r,o){if(o!==c){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:a};return n.PropTypes=n,n}},5844:(e,t,n)=>{e.exports=n(7556)()},3713:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},469:(e,t,n)=>{"use strict";var c=n(758);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,r,o){if(o!==c){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:a};return n.PropTypes=n,n}},5162:(e,t,n)=>{e.exports=n(469)()},758:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9997:(e,t,n)=>{"use strict";n.d(t,{UT:()=>p,lr:()=>g,rU:()=>u});var c=n(9196),a=n(6417),r=n(3170);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[n]=e[n]);return a}function i(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let c=e[n];return t.concat(Array.isArray(c)?c.map((e=>[n,e])):[[n,c]])}),[]))}const l=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function p(e){let{basename:t,children:n,window:o}=e,s=c.useRef();null==s.current&&(s.current=(0,r.q_)({window:o,v5Compat:!0}));let i=s.current,[l,p]=c.useState({action:i.action,location:i.location});return c.useLayoutEffect((()=>i.listen(p)),[i]),c.createElement(a.F0,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:i})}const u=c.forwardRef((function(e,t){let{onClick:n,relative:i,reloadDocument:p,replace:u,state:d,target:m,to:g,preventScrollReset:h}=e,y=s(e,l),f=(0,a.oQ)(g,{relative:i}),k=function(e,t){let{target:n,replace:o,state:s,preventScrollReset:i,relative:l}=void 0===t?{}:t,p=(0,a.s0)(),u=(0,a.TH)(),d=(0,a.WU)(e,{relative:l});return c.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==o?o:(0,r.Ep)(u)===(0,r.Ep)(d);p(e,{replace:n,state:s,preventScrollReset:i,relative:l})}}),[u,p,d,o,s,n,e,i,l])}(g,{replace:u,state:d,target:m,preventScrollReset:h,relative:i});return c.createElement("a",o({},y,{href:f,onClick:p?n:function(e){n&&n(e),e.defaultPrevented||k(e)},ref:t,target:m}))}));var d,m;function g(e){let t=c.useRef(i(e)),n=(0,a.TH)(),r=c.useMemo((()=>function(e,t){let n=i(e);for(let e of t.keys())n.has(e)||t.getAll(e).forEach((t=>{n.append(e,t)}));return n}(n.search,t.current)),[n.search]),o=(0,a.s0)(),s=c.useCallback(((e,t)=>{const n=i("function"==typeof e?e(r):e);o("?"+n,t)}),[o,r]);return[r,s]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(d||(d={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(m||(m={}))},6417:(e,t,n)=>{"use strict";n.d(t,{AW:()=>A,F0:()=>L,TH:()=>b,WU:()=>_,Z5:()=>I,oQ:()=>v,s0:()=>j});var c=n(3170),a=n(9196);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.value=c,a.getSnapshot=t,u(a)&&r({inst:a})}),[e,c,t]),i((()=>{u(a)&&r({inst:a});return e((()=>{u(a)&&r({inst:a})}))}),[e]),p(c),c};"useSyncExternalStore"in a&&a.useSyncExternalStore;const m=a.createContext(null);const g=a.createContext(null);const h=a.createContext(null);const y=a.createContext(null);const f=a.createContext({outlet:null,matches:[]});const k=a.createContext(null);function v(e,t){let{relative:n}=void 0===t?{}:t;E()||(0,c.kG)(!1);let{basename:r,navigator:o}=a.useContext(h),{hash:s,pathname:i,search:l}=_(e,{relative:n}),p=i;return"/"!==r&&(p="/"===i?r:(0,c.RQ)([r,i])),o.createHref({pathname:p,search:l,hash:s})}function E(){return null!=a.useContext(y)}function b(){return E()||(0,c.kG)(!1),a.useContext(y).location}function j(){E()||(0,c.kG)(!1);let{basename:e,navigator:t}=a.useContext(h),{matches:n}=a.useContext(f),{pathname:r}=b(),o=JSON.stringify((0,c.Zq)(n).map((e=>e.pathnameBase))),s=a.useRef(!1);return a.useEffect((()=>{s.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof n)return void t.go(n);let i=(0,c.pC)(n,JSON.parse(o),r,"path"===a.relative);"/"!==e&&(i.pathname="/"===i.pathname?e:(0,c.RQ)([e,i.pathname])),(a.replace?t.replace:t.push)(i,a.state,a)}),[e,t,o,r])}function _(e,t){let{relative:n}=void 0===t?{}:t,{matches:r}=a.useContext(f),{pathname:o}=b(),s=JSON.stringify((0,c.Zq)(r).map((e=>e.pathnameBase)));return a.useMemo((()=>(0,c.pC)(e,JSON.parse(s),o,"path"===n)),[e,s,o,n])}function C(){let e=function(){var e;let t=a.useContext(k),n=P(R.UseRouteError),c=x(R.UseRouteError);if(t)return t;return null==(e=n.errors)?void 0:e[c]}(),t=(0,c.WK)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unhandled Thrown Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,a.createElement("p",null,"💿 Hey developer 👋"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:s},"errorElement")," props on ",a.createElement("code",{style:s},"")))}class w extends a.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?a.createElement(f.Provider,{value:this.props.routeContext},a.createElement(k.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Z(e){let{routeContext:t,match:n,children:c}=e,r=a.useContext(m);return r&&r.static&&r.staticContext&&n.route.errorElement&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),a.createElement(f.Provider,{value:t},c)}function N(e,t,n){if(void 0===t&&(t=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let r=e,o=null==n?void 0:n.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&(null==o?void 0:o[e.route.id])));e>=0||(0,c.kG)(!1),r=r.slice(0,Math.min(r.length,e+1))}return r.reduceRight(((e,c,s)=>{let i=c.route.id?null==o?void 0:o[c.route.id]:null,l=n?c.route.errorElement||a.createElement(C,null):null,p=t.concat(r.slice(0,s+1)),u=()=>a.createElement(Z,{match:c,routeContext:{outlet:e,matches:p}},i?l:void 0!==c.route.element?c.route.element:e);return n&&(c.route.errorElement||0===s)?a.createElement(w,{location:n.location,component:l,error:i,children:u(),routeContext:{outlet:null,matches:p}}):u()}),null)}var S,R;function P(e){let t=a.useContext(g);return t||(0,c.kG)(!1),t}function x(e){let t=function(e){let t=a.useContext(f);return t||(0,c.kG)(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||(0,c.kG)(!1),n.route.id}!function(e){e.UseRevalidator="useRevalidator"}(S||(S={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(R||(R={}));function A(e){(0,c.kG)(!1)}function L(e){let{basename:t="/",children:n=null,location:r,navigationType:o=c.aU.Pop,navigator:s,static:i=!1}=e;E()&&(0,c.kG)(!1);let l=t.replace(/^\/*/,"/"),p=a.useMemo((()=>({basename:l,navigator:s,static:i})),[l,s,i]);"string"==typeof r&&(r=(0,c.cP)(r));let{pathname:u="/",search:d="",hash:m="",state:g=null,key:f="default"}=r,k=a.useMemo((()=>{let e=(0,c.Zn)(u,l);return null==e?null:{pathname:e,search:d,hash:m,state:g,key:f}}),[l,u,d,m,g,f]);return null==k?null:a.createElement(h.Provider,{value:p},a.createElement(y.Provider,{children:n,value:{location:k,navigationType:o}}))}function I(e){let{children:t,location:n}=e,o=a.useContext(m);return function(e,t){E()||(0,c.kG)(!1);let{navigator:n}=a.useContext(h),o=a.useContext(g),{matches:s}=a.useContext(f),i=s[s.length-1],l=i?i.params:{},p=(i&&i.pathname,i?i.pathnameBase:"/");i&&i.route;let u,d=b();if(t){var m;let e="string"==typeof t?(0,c.cP)(t):t;"/"===p||(null==(m=e.pathname)?void 0:m.startsWith(p))||(0,c.kG)(!1),u=e}else u=d;let k=u.pathname||"/",v="/"===p?k:k.slice(p.length)||"/",j=(0,c.fp)(e,{pathname:v}),_=N(j&&j.map((e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:(0,c.RQ)([p,n.encodeLocation?n.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:(0,c.RQ)([p,n.encodeLocation?n.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,o||void 0);return t&&_?a.createElement(y.Provider,{value:{location:r({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:c.aU.Pop}},_):_}(o&&!t?o.router.routes:O(t),n)}var U;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(U||(U={}));new Promise((()=>{}));class T extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,c=null,a=U.pending;if(n instanceof Promise)if(this.state.error){U.error;let e=this.state.error;Promise.reject().catch((()=>{})),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_error",{get:()=>e})}else n._tracked?(n,void 0!==c._error?U.error:void 0!==c._data?U.success:U.pending):(U.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else U.success,Promise.resolve(),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_data",{get:()=>n});if(a===U.error&&c._error instanceof AbortedDeferredError)throw neverSettledPromise;if(a===U.error&&!t)throw c._error;if(a===U.error)return React.createElement(AwaitContext.Provider,{value:c,children:t});if(a===U.success)return React.createElement(AwaitContext.Provider,{value:c,children:e});throw c}}function O(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,r)=>{if(!a.isValidElement(e))return;if(e.type===a.Fragment)return void n.push.apply(n,O(e.props.children,t));e.type!==A&&(0,c.kG)(!1),e.props.index&&e.props.children&&(0,c.kG)(!1);let o=[...t,r],s={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(s.children=O(e.props.children,o)),n.push(s)})),n}},6975:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(951);const a=n.n(c)()("dops:analytics");let r,o;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const s={initialize:function(e,t,n){s.setUser(e,t),s.setSuperProps(n),s.identifyUser()},setGoogleAnalyticsEnabled:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){o={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);a("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),a('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);a("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),a('Built stat "%s" in group "%s"',t,e);return n}(e,t);s.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){s.tracks.recordPageView(e),s.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,c,a,r,o){s.ga.recordPurchase(e,t,n,c,a,r,o)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(a("- Super Props: %o",r),t=Object.assign(t,r)),a('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):a('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};s.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){s.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){a("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};s.ga.initialized||(o&&(e={userId:"u-"+o.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),s.ga.initialized=!0)},recordPageView:function(e,t){s.ga.initialize(),a("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,c){s.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(r+=" [Option Label: "+n+"]"),void 0!==c&&(r+=" [Option Value: "+c+"]"),a(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,c)},recordPurchase:function(e,t,n,c,a,r,o){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:c,currency:o}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:a,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){o&&window._tkq.push(["identifyUser",o.ID,o.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},i=s},4743:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>u});var c=n(1132),a=n(6483);function r(e){class t extends Error{constructor(){super(...arguments),this.name=e}}return t}const o=r("JsonParseError"),s=r("JsonParseAfterRedirectError"),i=r("Api404Error"),l=r("Api404AfterRedirectError"),p=r("FetchNetworkError");const u=new function(e,t){let n=e,r=e,o={"X-WP-Nonce":t},s={credentials:"same-origin",headers:o},i={method:"post",credentials:"same-origin",headers:Object.assign({},o,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",c=n.length?n.split("&"):[];return c.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+c.join("&")};const p={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){r=e},setApiNonce(e){o={"X-WP-Nonce":e},s={credentials:"same-origin",headers:o},i={method:"post",credentials:"same-origin",headers:Object.assign({},o,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t)=>{const a={registration_nonce:e,no_iframe:!0};return(0,c.jetpackConfigHas)("consumer_slug")&&(a.plugin_slug=(0,c.jetpackConfigGet)("consumer_slug")),null!==t&&(a.redirect_uri=t),g(`${n}jetpack/v4/connection/register`,i,{body:JSON.stringify(a)}).then(d).then(m)},fetchAuthorizationUrl:e=>u((0,a.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),s).then(d).then(m),fetchSiteConnectionData:()=>u(`${n}jetpack/v4/connection/data`,s).then(m),fetchSiteConnectionStatus:()=>u(`${n}jetpack/v4/connection`,s).then(m),fetchSiteConnectionTest:()=>u(`${n}jetpack/v4/connection/test`,s).then(d).then(m),fetchUserConnectionData:()=>u(`${n}jetpack/v4/connection/data`,s).then(m),fetchUserTrackingSettings:()=>u(`${n}jetpack/v4/tracking/settings`,s).then(d).then(m),updateUserTrackingSettings:e=>g(`${n}jetpack/v4/tracking/settings`,i,{body:JSON.stringify(e)}).then(d).then(m),disconnectSite:()=>g(`${n}jetpack/v4/connection`,i,{body:JSON.stringify({isActive:!1})}).then(d).then(m),fetchConnectUrl:()=>u(`${n}jetpack/v4/connection/url`,s).then(d).then(m),unlinkUser:()=>g(`${n}jetpack/v4/connection/user`,i,{body:JSON.stringify({linked:!1})}).then(d).then(m),reconnect:()=>g(`${n}jetpack/v4/connection/reconnect`,i).then(d).then(m),fetchConnectedPlugins:()=>u(`${n}jetpack/v4/connection/plugins`,s).then(d).then(m),setHasSeenWCConnectionModal:()=>g(`${n}jetpack/v4/seen-wc-connection-modal`,i).then(d).then(m),fetchModules:()=>u(`${n}jetpack/v4/module/all`,s).then(d).then(m),fetchModule:e=>u(`${n}jetpack/v4/module/${e}`,s).then(d).then(m),activateModule:e=>g(`${n}jetpack/v4/module/${e}/active`,i,{body:JSON.stringify({active:!0})}).then(d).then(m),deactivateModule:e=>g(`${n}jetpack/v4/module/${e}/active`,i,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>g(`${n}jetpack/v4/module/${e}`,i,{body:JSON.stringify(t)}).then(d).then(m),updateSettings:e=>g(`${n}jetpack/v4/settings`,i,{body:JSON.stringify(e)}).then(d).then(m),getProtectCount:()=>u(`${n}jetpack/v4/module/protect/data`,s).then(d).then(m),resetOptions:e=>g(`${n}jetpack/v4/options/${e}`,i,{body:JSON.stringify({reset:!0})}).then(d).then(m),activateVaultPress:()=>g(`${n}jetpack/v4/plugins`,i,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(d).then(m),getVaultPressData:()=>u(`${n}jetpack/v4/module/vaultpress/data`,s).then(d).then(m),installPlugin:(e,t)=>{const c={slug:e,status:"active"};return t&&(c.source=t),g(`${n}jetpack/v4/plugins`,i,{body:JSON.stringify(c)}).then(d).then(m)},activateAkismet:()=>g(`${n}jetpack/v4/plugins`,i,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(d).then(m),getAkismetData:()=>u(`${n}jetpack/v4/module/akismet/data`,s).then(d).then(m),checkAkismetKey:()=>u(`${n}jetpack/v4/module/akismet/key/check`,s).then(d).then(m),checkAkismetKeyTyped:e=>g(`${n}jetpack/v4/module/akismet/key/check`,i,{body:JSON.stringify({api_key:e})}).then(d).then(m),fetchStatsData:e=>u(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),s).then(d).then(m).then(y),getPluginUpdates:()=>u(`${n}jetpack/v4/updates/plugins`,s).then(d).then(m),getPlans:()=>u(`${n}jetpack/v4/plans`,s).then(d).then(m),fetchSettings:()=>u(`${n}jetpack/v4/settings`,s).then(d).then(m),updateSetting:e=>g(`${n}jetpack/v4/settings`,i,{body:JSON.stringify(e)}).then(d).then(m),fetchSiteData:()=>u(`${n}jetpack/v4/site`,s).then(d).then(m).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>u(`${n}jetpack/v4/site/features`,s).then(d).then(m).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>u(`${n}jetpack/v4/site/products`,s).then(d).then(m),fetchSitePurchases:()=>u(`${n}jetpack/v4/site/purchases`,s).then(d).then(m).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>u(`${n}jetpack/v4/site/benefits`,s).then(d).then(m).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>u(`${n}jetpack/v4/site/discount`,s).then(d).then(m).then((e=>e.data)),fetchSetupQuestionnaire:()=>u(`${n}jetpack/v4/setup/questionnaire`,s).then(d).then(m),fetchRecommendationsData:()=>u(`${n}jetpack/v4/recommendations/data`,s).then(d).then(m),fetchRecommendationsProductSuggestions:()=>u(`${n}jetpack/v4/recommendations/product-suggestions`,s).then(d).then(m),fetchRecommendationsUpsell:()=>u(`${n}jetpack/v4/recommendations/upsell`,s).then(d).then(m),fetchRecommendationsConditional:()=>u(`${n}jetpack/v4/recommendations/conditional`,s).then(d).then(m),saveRecommendationsData:e=>g(`${n}jetpack/v4/recommendations/data`,i,{body:JSON.stringify({data:e})}).then(d),fetchProducts:()=>u(`${n}jetpack/v4/products`,s).then(d).then(m),fetchRewindStatus:()=>u(`${n}jetpack/v4/rewind`,s).then(d).then(m).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>u(`${n}jetpack/v4/scan`,s).then(d).then(m).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>g(`${n}jetpack/v4/notice/${e}`,i,{body:JSON.stringify({dismissed:!0})}).then(d).then(m),fetchPluginsData:()=>u(`${n}jetpack/v4/plugins`,s).then(d).then(m),fetchIntroOffers:()=>u(`${n}jetpack/v4/intro-offers`,s).then(d).then(m),fetchVerifySiteGoogleStatus:e=>u(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,s).then(d).then(m),verifySiteGoogle:e=>g(`${n}jetpack/v4/verify-site/google`,i,{body:JSON.stringify({keyring_id:e})}).then(d).then(m),submitSurvey:e=>g(`${n}jetpack/v4/marketing/survey`,i,{body:JSON.stringify(e)}).then(d).then(m),saveSetupQuestionnaire:e=>g(`${n}jetpack/v4/setup/questionnaire`,i,{body:JSON.stringify(e)}).then(d).then(m),updateLicensingError:e=>g(`${n}jetpack/v4/licensing/error`,i,{body:JSON.stringify(e)}).then(d).then(m),updateLicenseKey:e=>g(`${n}jetpack/v4/licensing/set-license`,i,{body:JSON.stringify({license:e})}).then(d).then(m),getUserLicensesCounts:()=>u(`${n}jetpack/v4/licensing/user/counts`,s).then(d).then(m),getUserLicenses:()=>u(`${n}jetpack/v4/licensing/user/licenses`,s).then(d).then(m),updateLicensingActivationNoticeDismiss:e=>g(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,i,{body:JSON.stringify({last_detached_count:e})}).then(d).then(m),updateRecommendationsStep:e=>g(`${n}jetpack/v4/recommendations/step`,i,{body:JSON.stringify({step:e})}).then(d),confirmIDCSafeMode:()=>g(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,i).then(d),startIDCFresh:e=>g(`${n}jetpack/v4/identity-crisis/start-fresh`,i,{body:JSON.stringify({redirect_uri:e})}).then(d).then(m),migrateIDC:()=>g(`${n}jetpack/v4/identity-crisis/migrate`,i).then(d),attachLicenses:e=>g(`${n}jetpack/v4/licensing/attach-licenses`,i,{body:JSON.stringify({licenses:e})}).then(d).then(m),fetchSearchPlanInfo:()=>u(`${r}jetpack/v4/search/plan`,s).then(d).then(m),fetchSearchSettings:()=>u(`${r}jetpack/v4/search/settings`,s).then(d).then(m),updateSearchSettings:e=>g(`${r}jetpack/v4/search/settings`,i,{body:JSON.stringify(e)}).then(d).then(m),fetchSearchStats:()=>u(`${r}jetpack/v4/search/stats`,s).then(d).then(m),fetchWafSettings:()=>u(`${n}jetpack/v4/waf`,s).then(d).then(m),updateWafSettings:e=>g(`${n}jetpack/v4/waf`,i,{body:JSON.stringify(e)}).then(d).then(m),fetchWordAdsSettings:()=>u(`${n}jetpack/v4/wordads/settings`,s).then(d).then(m),updateWordAdsSettings:e=>g(`${n}jetpack/v4/wordads/settings`,i,{body:JSON.stringify(e)}),fetchSearchPricing:()=>u(`${r}jetpack/v4/search/pricing`,s).then(d).then(m),fetchMigrationStatus:()=>u(`${n}jetpack/v4/migration/status`,s).then(d).then(m)};function u(e,t){return fetch(l(e),t)}function g(e,t,n){return fetch(e,Object.assign({},t,n)).catch(h)}function y(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,p)};function d(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new i})):e.json().catch((e=>g(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function m(e){return e.json().catch((t=>g(t,e.redirected,e.url)))}function g(e,t,n){throw t?new s(n):new o}function h(){throw new p}},7121:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var c=n(5609),a=n(5736),r=n(5235),o=n.n(r),s=n(5162),i=n.n(s),l=n(9196),p=n.n(l),u=n(526),d=n(2289);const __=a.__,m=e=>{const{label:t,onClick:n,isLoading:a,displayError:r,errorMessage:s}=e;return p().createElement(p().Fragment,null,p().createElement(u.Z,{className:o()(d.Z.button,"jp-action-button--button"),label:t,onClick:n,variant:"primary",disabled:a},a?p().createElement(c.Spinner,null):t),r&&p().createElement("p",{className:o()(d.Z.error,"jp-action-button__error")},s))};m.propTypes={label:i().string.isRequired,onClick:i().func,isLoading:i().bool,displayError:i().bool,errorMessage:i().string},m.defaultProps={isLoading:!1,displayError:!1,errorMessage:__("An error occurred. Please try again.","jetpack-my-jetpack")};const g=m},9105:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(5736),a=n(5235),r=n.n(a),o=n(8237),s=n(8868),i=n(3846),l=n(3363),p=n(1494);const __=c.__,u=e=>{let{children:t,moduleName:n=__("Jetpack","jetpack-my-jetpack"),moduleNameHref:c,a8cLogoHref:a,showHeader:u=!0,showFooter:d=!0,showBackground:m=!0,header:g}=e;const h=r()(p.Z["admin-page"],{[p.Z.background]:m});return React.createElement("div",{className:h},u&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(i.Z,null,g||React.createElement(s.Z,null))),React.createElement(l.Z,{fluid:!0,horizontalSpacing:0},React.createElement(i.Z,null,t)),d&&React.createElement(l.Z,{horizontalSpacing:5},React.createElement(i.Z,null,React.createElement(o.Z,{moduleName:n,a8cLogoHref:a,moduleNameHref:c}))))}},6579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(9196),a=n.n(c),r=n(511);const o=e=>{let{children:t}=e;return a().createElement("div",{className:r.Z.section},t)}},216:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(9196),a=n.n(c),r=n(281);const o=e=>{let{children:t}=e;return a().createElement("div",{className:r.Z["section-hero"]},t)}},4972:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var c=n(797),a=n(496),r=n(9201),o=n(1074),s=n(5235),i=n.n(s),l=n(9196),p=n.n(l),u=n(9171);const d=e=>{switch(e){case"error":case"warning":default:return c.Z;case"info":return a.Z;case"success":return r.Z}},m=e=>{let{level:t,children:n,showIcon:c}=e;const a=i()(u.Z.container,u.Z[`is-${t}`]);return p().createElement("div",{className:a},c&&p().createElement("div",{className:u.Z["icon-wrapper"]},p().createElement(o.Z,{icon:d(t),className:u.Z.icon})),p().createElement("div",null,n))};m.defaultProps={level:"warning",showIcon:!0};const g=m},7525:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(2674),a=n.n(c),r=n(5736),o=n(5235),s=n.n(o),i=n(9196),l=n.n(i);const __=r.__,p=e=>{let{title:t=__("An Automattic Airline","jetpack-my-jetpack"),height:n=7,className:c,...r}=e;return l().createElement("svg",a()({role:"img",x:"0",y:"0",viewBox:"0 0 935 38.2",enableBackground:"new 0 0 935 38.2","aria-labelledby":"jp-automattic-byline-logo-title",height:n,className:s()("jp-automattic-byline-logo",c)},r),l().createElement("desc",{id:"jp-automattic-byline-logo-title"},t),l().createElement("path",{d:"M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"}),l().createElement("path",{d:"M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z"}),l().createElement("path",{d:"M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z"}))}},526:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(2674),a=n.n(c),r=n(5609),o=n(1074),s=n(5381),i=n(5235),l=n.n(i),p=n(9196),u=n.n(p),d=n(3466);const m=(0,p.forwardRef)(((e,t)=>{const{children:n,variant:c="primary",size:i="normal",weight:p="bold",icon:m,iconSize:g,disabled:h,isDestructive:y,isLoading:f,isExternalLink:k,className:v,text:E,fullWidth:b,...j}=e,_=l()(d.Z.button,v,{[d.Z.normal]:"normal"===i,[d.Z.small]:"small"===i,[d.Z.icon]:Boolean(m),[d.Z.loading]:f,[d.Z.regular]:"regular"===p,[d.Z["full-width"]]:b,[d.Z["is-icon-button"]]:Boolean(m)&&!n});j.ref=t;const C="normal"===i?20:16,w=k&&u().createElement(o.Z,{size:C,icon:s.Z,className:d.Z["external-icon"]}),Z=k?"_blank":void 0,N=n?.[0]&&null!==n[0]&&"components-tooltip"!==n?.[0]?.props?.className;return u().createElement(r.Button,a()({target:Z,variant:c,className:l()(_,{"has-text":!!m&&N}),icon:k?void 0:m,iconSize:g,disabled:h,"aria-disabled":h,isDestructive:y,text:E},j),f&&u().createElement(r.Spinner,null),u().createElement("span",null,n),w)}))},9026:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});n(2404);const c=e=>{let{format:t="horizontal",icon:n,imageUrl:c}=e;return React.createElement("div",{className:"jp-components__decorative-card "+(t?"jp-components__decorative-card--"+t:"")},React.createElement("div",{className:"jp-components__decorative-card__image",style:{backgroundImage:c?`url( ${c} )`:""}}),React.createElement("div",{className:"jp-components__decorative-card__content"},React.createElement("div",{className:"jp-components__decorative-card__lines"})),n?React.createElement("div",{className:"jp-components__decorative-card__icon-container"},React.createElement("span",{className:"jp-components__decorative-card__icon jp-components__decorative-card__icon--"+n})):null)}},3396:(e,t,n)=>{"use strict";n.d(t,{KM:()=>u,VS:()=>h,_1:()=>d,r7:()=>p});var c=n(2674),a=n.n(c),r=n(5609),o=n(5235),s=n.n(o),i=n(5612);const l=e=>{let{className:t,size:n=24,viewBox:c="0 0 24 24",opacity:o=1,color:l="#2C3338",children:p}=e;const u={className:s()(i.Z.iconWrapper,t),width:n,height:n,viewBox:c,opacity:o,fill:void 0};return l&&(u.fill=l),React.createElement(r.SVG,a()({},u,{fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg"}),React.createElement(r.G,{opacity:o},p))},p=e=>{let{size:t,className:n=i.Z["star-icon"],color:c}=e;return React.createElement(l,{className:n,size:t,color:c},React.createElement(r.Path,{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"}))},u=e=>{let{size:t,className:n=i.Z["checkmark-icon"],color:c}=e;return React.createElement(l,{className:n,size:t,color:c},React.createElement(r.Path,{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"}))},d=e=>{let{size:t,className:n=i.Z.jetpack,color:c}=e;return React.createElement(l,{className:n,size:t,color:c,viewBox:"0 0 32 32"},React.createElement(r.Path,{className:"jetpack-logo__icon-circle",d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),React.createElement(r.Polygon,{fill:"#fff",points:"15,19 7,19 15,3"}),React.createElement(r.Polygon,{fill:"#fff",points:"17,29 17,13 25,13"}))},m=e=>{let{className:t,fill:n="none",size:c,children:a}=e;return React.createElement(l,{className:s()(i.Z.socialIcon,t),size:c,color:n},a)},g={...{"anti-spam":e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1 s0,0.1-0.1,0.1c-0.1,0-0.1,0.1-0.1,0.1s-0.1,0-0.2,0h-5.1c-0.1,0-0.1,0-0.2,0c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1 c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1l0.1-0.1c0,0,0.1,0,0.2,0c0.5,0,1.1-0.2,1.1-0.8c0-0.3-0.1-0.5-0.2-0.8l-1.1-3.1 c-0.1-0.2-0.1-0.2-0.2-0.2h-4.3c-0.7,0-1.5,0-1.9,0.9l-1.1,2.4C7.1,17.6,7,17.8,7,18.1c0,0.8,1,0.9,1.6,0.9c0.1,0,0.1,0,0.2,0 L8.8,19l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1s-0.1,0.1-0.1,0.1l-0.1,0.1c-0.1,0-0.1,0-0.2,0H4.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.1-0.1-0.1-0.1l-0.1-0.1c0-0.1,0-0.1,0-0.1c0-0.1,0-0.1,0-0.2s0-0.1,0.1-0.1L4,19c0,0,0.1,0,0.1,0C5.2,19,5.5,18.5,6,17.5 l5.4-12.4c0.2-0.5,0.8-1,1.3-1C13,4.2,13.1,4.4,13.2,4.7z M9.1,13.1c0,0.1-0.1,0.1-0.1,0.2c0,0.1,0.1,0.1,0.1,0.1h4.4 c0.3,0,0.4-0.1,0.4-0.3c0-0.1,0-0.2-0.1-0.3l-1.2-3.5c-0.3-0.8-0.8-1.9-0.8-2.7c0-0.1,0-0.1-0.1-0.1c0,0-0.1,0-0.1,0.1 c-0.1,0.6-0.4,1.2-0.7,1.7L9.1,13.1z"}),React.createElement(r.Path,{d:"M21.6,12.5c0,0.6-0.3,1-0.9,1c-0.6,0-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1C21.3,11.7,21.6,12.1,21.6,12.5z"}),React.createElement(r.Path,{d:"M4.1,12.5c0,0.6-0.3,1-0.9,1s-0.8-0.3-0.8-0.8c0-0.6,0.4-1,0.9-1S4.1,12.1,4.1,12.5z"}))},backup:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1 l8.3,2.9c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.2,0.2,0.4,0.2,0.7c0,0.1,0,0.1,0,0.2v0.1c-0.1,0.5-0.2,0.9-0.3,1.4 c-0.2,0.4-0.3,1.2-0.7,2.2c-0.3,1-0.7,2.1-1.1,3.1c-0.5,1-1,2.1-1.6,3.3s-1.4,2.3-2.2,3.5c-0.9,1.1-1.8,2.2-2.8,3.1 c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4c-1.2-1.1-2.4-2.4-3.5-4c-1-1.6-1.9-3-2.5-4.3c-0.6-1.3-1.1-2.7-1.6-4 C2.8,8.7,2.5,7.6,2.3,7C2.3,6.5,2.1,6.1,2.1,5.8z M2.9,5.9c0,0.2,0.1,0.4,0.1,0.8C3.1,7,3.2,7.5,3.5,8.2C3.7,9,3.9,9.7,4.2,10.6 c0.3,0.7,0.7,1.7,1.1,2.7c0.4,1,1,2,1.5,2.9c0.5,1,1.2,1.9,1.9,2.9c0.8,1,1.6,1.9,2.4,2.6c0.2,0.2,0.4,0.2,0.5,0.2 c0.2,0,0.4-0.1,0.5-0.2c1.2-1,2.2-2.3,3.2-3.8c1-1.5,1.8-2.8,2.3-4c0.6-1.3,1.1-2.5,1.5-3.9c0.4-1.3,0.7-2.2,0.9-2.8 c0.1-0.5,0.2-1,0.3-1.3c0-0.1,0-0.1,0-0.1c0-0.2,0-0.3-0.1-0.4C20.3,5.2,20.2,5.1,20,5L12,2.1c0,0-0.1,0-0.2,0s-0.1,0-0.1,0h-0.2 l-8,2.8C3.2,5,3.1,5.2,3,5.3C2.9,5.5,2.9,5.6,2.9,5.8C2.9,5.8,2.9,5.8,2.9,5.9z M5.9,6.7h3l2.8,7l2.8-7h3c-0.1,0.1-0.2,0.5-0.3,0.8 C17,7.8,17,8.2,16.8,8.4c-0.1,0.3-0.2,0.5-0.4,0.8c0,0.1-0.1,0.1-0.1,0.1s-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.1,0 c-0.1,0-0.2,0.1-0.2,0.2c0,0-0.1,0.1-0.1,0.1s-0.1,0.1-0.1,0.1c0,0,0,0.1-0.1,0.2c0,0.1-0.1,0.1-0.1,0.1l-0.4,1.1 c-1.3,3.3-2.1,5.2-2.3,5.8h-2.2l-1-2.4c-0.1-0.3-0.3-0.8-0.5-1.3c-0.1-0.3-0.3-0.8-0.5-1.3L8,10.8c-0.1-0.1-0.1-0.2-0.1-0.4 C7.8,10.2,7.7,10,7.7,9.8C7.6,9.7,7.5,9.5,7.4,9.4C7.3,9.3,7.3,9.3,7.3,9.3c-0.1,0-0.2,0-0.2,0s-0.1,0-0.1,0 C6.6,8.5,6.3,7.6,5.9,6.7z"}))},boost:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19505 16.2545C4.47368 16.561 4.94802 16.5836 5.25451 16.3049L10.2595 11.7549L14.2842 15.2765L19 10.5607V13.75H20.5V9.5V8.75239V8.7476V8H19.7529H19.7471H19H14.75V9.5H17.9393L14.2158 13.2235L10.2405 9.74507L4.2455 15.195C3.93901 15.4737 3.91642 15.948 4.19505 16.2545Z"}))},crm:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"}))},extras:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z"}))},protect:e=>{let{opacity:t=1,size:n,className:c,color:a}=e;return React.createElement(l,{className:c,size:n,opacity:t,color:a},React.createElement(r.Path,{d:"M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z"}),React.createElement(r.Path,{d:"M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z"}))},scan:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z"}))},search:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z"}))},social:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{d:"M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z"}))},star:p,videopress:e=>{let{opacity:t=1,size:n,color:c}=e;return React.createElement(l,{size:n,opacity:t,color:c},React.createElement(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3,6.2c0.8,0,1.6,0.6,1.8,1.4l2.3,7.9c0,0,0,0,0,0l2.7-9.3h1.5h4.2c2.9,0,4.9,1.9,4.9,4.7c0,2.9-2,4.7-5,4.7 h-2h-2.5l-0.5,1.5c-0.4,1.4-1.7,2.3-3.2,2.3c-1.4,0-2.7-0.9-3.2-2.3L2.5,8.7C2.1,7.4,3,6.2,4.3,6.2z M13,12.8h2.9c1.3,0,2-0.7,2-1.9 c0-1.2-0.8-1.8-2-1.8h-1.7L13,12.8z"}))},jetpack:d},...{facebook:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.facebook,c)},React.createElement(r.Path,{d:"M12,2C6.5,2,2,6.5,2,12c0,5,3.7,9.1,8.4,9.9v-7H7.9V12h2.5V9.8c0-2.5,1.5-3.9,3.8-3.9c1.1,0,2.2,0.2,2.2,0.2v2.5h-1.3 c-1.2,0-1.6,0.8-1.6,1.6V12h2.8l-0.4,2.9h-2.3v7C18.3,21.1,22,17,22,12C22,6.5,17.5,2,12,2z"}))},twitter:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.twitter,c)},React.createElement(r.Path,{d:"M19,3H5C3.895,3,3,3.895,3,5v14c0,1.105,0.895,2,2,2h14c1.105,0,2-0.895,2-2V5C21,3.895,20.105,3,19,3z M16.466,9.71 c0.004,0.099,0.007,0.198,0.007,0.298c0,3.045-2.318,6.556-6.556,6.556c-1.301,0-2.512-0.381-3.532-1.035 c0.18,0.021,0.364,0.032,0.55,0.032c1.079,0,2.073-0.368,2.862-0.986c-1.008-0.019-1.859-0.685-2.152-1.6 c0.141,0.027,0.285,0.041,0.433,0.041c0.21,0,0.414-0.028,0.607-0.081c-1.054-0.212-1.848-1.143-1.848-2.259 c0-0.01,0-0.019,0-0.029c0.311,0.173,0.666,0.276,1.044,0.288c-0.618-0.413-1.025-1.118-1.025-1.918 c0-0.422,0.114-0.818,0.312-1.158c1.136,1.394,2.834,2.311,4.749,2.407c-0.039-0.169-0.06-0.344-0.06-0.525 c0-1.272,1.032-2.304,2.304-2.304c0.663,0,1.261,0.28,1.682,0.728c0.525-0.103,1.018-0.295,1.463-0.559 c-0.172,0.538-0.537,0.99-1.013,1.275c0.466-0.056,0.91-0.18,1.323-0.363C17.306,8.979,16.916,9.385,16.466,9.71z"}))},linkedin:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.linkedin,c)},React.createElement(r.Path,{d:"M19.7 3H4.3C3.582 3 3 3.582 3 4.3v15.4c0 .718.582 1.3 1.3 1.3h15.4c.718 0 1.3-.582 1.3-1.3V4.3c0-.718-.582-1.3-1.3-1.3zM8.34 18.338H5.666v-8.59H8.34v8.59zM7.003 8.574c-.857 0-1.55-.694-1.55-1.548 0-.855.692-1.548 1.55-1.548.854 0 1.547.694 1.547 1.548 0 .855-.692 1.548-1.546 1.548zm11.335 9.764h-2.67V14.16c0-.995-.017-2.277-1.387-2.277-1.39 0-1.6 1.086-1.6 2.206v4.248h-2.668v-8.59h2.56v1.174h.036c.357-.675 1.228-1.387 2.527-1.387 2.703 0 3.203 1.78 3.203 4.092v4.71z"}))},tumblr:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.tumblr,c)},React.createElement(r.Path,{d:"M19 3H5c-1.105 0-2 .895-2 2v14c0 1.105.895 2 2 2h14c1.105 0 2-.895 2-2V5c0-1.105-.895-2-2-2zm-5.57 14.265c-2.445.042-3.37-1.742-3.37-2.998V10.6H8.922V9.15c1.703-.615 2.113-2.15 2.21-3.026.006-.06.053-.084.08-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.13 1.08 1.107.3-.008.698-.094.907-.194l.54 1.6c-.205.297-1.12.642-1.946.657z"}))},google:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.google,c)},React.createElement(r.Path,{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05h-9.36z"}))},mastodon:e=>{let{fill:t,size:n,className:c}=e;return React.createElement(m,{fill:t,size:n,className:s()(i.Z.mastodon,c)},React.createElement(r.Path,{d:"M 19.997205,6.2868955 C 19.729197,4.3162778 17.992912,2.7633017 15.93468,2.4623753 15.587434,2.4115195 14.271759,2.2264681 11.224008,2.2264681 h -0.02277 c -3.0485688,0 -3.7026204,0.1850577 -4.0498676,0.2359072 C 5.1504449,2.7549655 3.3231548,4.1503966 2.879815,6.1443318 2.6665754,7.1263038 2.6438193,8.2149794 2.6834329,9.2136207 c 0.056471,1.4321143 0.067433,2.8617113 0.1989115,4.2879943 0.090908,0.947406 0.2494696,1.887266 0.4745239,2.812521 0.4214237,1.708868 2.1273496,3.130966 3.7987144,3.71116 1.7894479,0.605052 3.7138403,0.705478 5.5577463,0.290088 0.202828,-0.04667 0.403445,-0.100873 0.601781,-0.162549 0.447558,-0.140863 0.972662,-0.298434 1.358683,-0.575188 0.0052,-0.004 0.0097,-0.0089 0.01266,-0.01471 0.0031,-0.0056 0.0047,-0.01218 0.005,-0.01866 v -1.382076 c -9.4e-5,-0.006 -0.0016,-0.01202 -0.0043,-0.01754 -0.0027,-0.0054 -0.0067,-0.01028 -0.01155,-0.01392 -0.0049,-0.0038 -0.01044,-0.0063 -0.01648,-0.0078 -0.006,-0.0013 -0.01218,-0.0013 -0.01825,7.1e-5 -1.181368,0.279106 -2.391962,0.419012 -3.606552,0.416801 -2.0902554,0 -2.6524392,-0.981126 -2.8134375,-1.3896 -0.1293933,-0.353009 -0.2115739,-0.721231 -0.2444221,-1.095331 -3.29e-4,-0.0063 8.463e-4,-0.0125 0.00348,-0.01832 0.00253,-0.0056 0.00649,-0.01077 0.011389,-0.01471 0.0049,-0.004 0.010755,-0.0068 0.016957,-0.0081 0.00617,-0.0014 0.012655,-0.0012 0.018808,3.52e-4 1.1616831,0.277201 2.3525266,0.417106 3.5475526,0.416801 0.287408,0 0.573966,0 0.861395,-0.0074 1.201893,-0.03335 2.468685,-0.0942 3.6512,-0.322606 0.02952,-0.0058 0.059,-0.01091 0.0843,-0.01833 1.865209,-0.354279 3.640245,-1.466278 3.820617,-4.282163 0.0068,-0.110869 0.0236,-1.161191 0.0236,-1.276219 8.46e-4,-0.390958 0.127273,-2.7733487 -0.01856,-4.2371335 z m -2.87074,7.0263315 H 15.165179 V 8.5617567 c 0,-1.0003116 -0.421434,-1.5104614 -1.278618,-1.5104614 -0.942305,0 -1.414292,0.6035217 -1.414292,1.7955379 V 11.44764 H 10.522764 V 8.8468332 c 0,-1.1920162 -0.472832,-1.7955379 -1.4151372,-1.7955379 -0.8521293,0 -1.2777701,0.5101498 -1.2786179,1.5104614 V 13.313227 H 5.8693944 V 8.4175496 c 0,-1.0003133 0.2582014,-1.7949986 0.7745804,-2.3840846 0.5326766,-0.587672 1.2314038,-0.8894211 2.0986981,-0.8894211 1.003817,0 1.7623841,0.3817657 2.2680911,1.1445204 l 0.488023,0.8102521 0.488846,-0.8102521 c 0.505705,-0.7627547 1.264275,-1.1445204 2.26642,-1.1445204 0.866449,0 1.565152,0.3017491 2.099521,0.8894211 0.516404,0.5885211 0.774583,1.3832066 0.774583,2.3840846 z"}))}}};function h(e){return g[e]?g[e]:null}},8237:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var c=n(2674),a=n.n(c),r=n(5736),o=n(5235),s=n.n(o),i=n(9196),l=n.n(i),p=n(7525),u=(n(9054),n(8868));const __=r.__,d=e=>{let{a8cLogoHref:t="https://automattic.com",moduleName:n=__("Jetpack","jetpack-my-jetpack"),className:c,moduleNameHref:r="https://jetpack.com",...o}=e;return l().createElement("div",a()({className:s()("jp-dashboard-footer",c)},o),l().createElement("div",{className:"jp-dashboard-footer__footer-left"},l().createElement(u.Z,{logoColor:"#000",showText:!1,height:16,className:"jp-dashboard-footer__jetpack-symbol","aria-label":__("Jetpack logo","jetpack-my-jetpack")}),l().createElement("span",{className:"jp-dashboard-footer__module-name"},r?l().createElement("a",{href:r,"aria-label":n},n):n)),l().createElement("div",{className:"jp-dashboard-footer__footer-right"},l().createElement("a",{href:t,"aria-label":__("An Automattic Airline","jetpack-my-jetpack")},l().createElement(p.Z,null))))}},8868:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(2674),a=n.n(c),r=n(5736),o=n(5235),s=n.n(o),i=n(9196),l=n.n(i);const __=r.__,p=e=>{let{logoColor:t="#069e08",showText:n=!0,className:c,height:r=32,...o}=e;const i=n?"0 0 118 32":"0 0 32 32";return l().createElement("svg",a()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:i,className:s()("jetpack-logo",c),"aria-labelledby":"jetpack-logo-title",height:r},o),l().createElement("desc",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-my-jetpack")),l().createElement("path",{fill:t,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),n&&l().createElement(l().Fragment,null,l().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),l().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),l().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),l().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),l().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),l().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"}),l().createElement("path",{d:"M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z"})))}},3846:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5235),a=n.n(c),r=n(3080);const o=Number(r.Z.smCols),s=Number(r.Z.mdCols),i=Number(r.Z.lgCols),l=e=>{const{children:t,className:n}=e,c=Math.min(o,"number"==typeof e.sm?e.sm:o),l=Math.min(o,"object"==typeof e.sm?e.sm.start:0),p=Math.min(o,"object"==typeof e.sm?e.sm.end:0),u=Math.min(s,"number"==typeof e.md?e.md:s),d=Math.min(s,"object"==typeof e.md?e.md.start:0),m=Math.min(s,"object"==typeof e.md?e.md.end:0),g=Math.min(i,"number"==typeof e.lg?e.lg:i),h=Math.min(i,"object"==typeof e.lg?e.lg.start:0),y=Math.min(i,"object"==typeof e.lg?e.lg.end:0),f=a()(n,{[r.Z[`col-sm-${c}`]]:!(l&&p),[r.Z[`col-sm-${l}-start`]]:l>0,[r.Z[`col-sm-${p}-end`]]:p>0,[r.Z[`col-md-${u}`]]:!(d&&m),[r.Z[`col-md-${d}-start`]]:d>0,[r.Z[`col-md-${m}-end`]]:m>0,[r.Z[`col-lg-${g}`]]:!(h&&y),[r.Z[`col-lg-${h}-start`]]:h>0,[r.Z[`col-lg-${y}-end`]]:y>0});return React.createElement("div",{className:f},t)}},3363:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var c=n(5235),a=n.n(c),r=n(9196),o=n(8730);const s=e=>{let{children:t,fluid:n=!1,className:c,horizontalGap:s=1,horizontalSpacing:i=1}=e;const l=(0,r.useMemo)((()=>{const e=`calc( var(--horizontal-spacing) * ${i} )`;return{paddingTop:e,paddingBottom:e,rowGap:`calc( var(--horizontal-spacing) * ${s} )`}}),[s,i]),p=a()(c,o.Z.container,{[o.Z.fluid]:n});return React.createElement("div",{className:p,style:l},t)}},2054:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(4333),a=n(3247);const r=["sm","md","lg"],o=(e,t)=>{const n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t],[s,i,l]=r,p={sm:(0,c.useMediaQuery)(a.Z[s]),md:(0,c.useMediaQuery)(a.Z[i]),lg:(0,c.useMediaQuery)(a.Z[l])};return n.map(((e,t)=>{const n=o[t];return n?((e,t,n)=>{const c=r.indexOf(e),a=c+1,o=t.includes("=");let s=[];return t.startsWith("<")&&(s=r.slice(0,o?a:c)),t.startsWith(">")&&(s=r.slice(o?c:a)),s?.length?s.some((e=>n[e])):n[e]})(e,n,p):p[e]}))}},5033:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r);n(1683);const s=e=>{const t=e.className+" jp-components-spinner",n={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},c={borderTopColor:e.color,borderRightColor:e.color};return o().createElement("div",{className:t},o().createElement("div",{className:"jp-components-spinner__outer",style:n},o().createElement("div",{className:"jp-components-spinner__inner",style:c})))};s.propTypes={color:a().string,className:a().string,size:a().number},s.defaultProps={color:"#FFFFFF",className:"",size:20};const i=s},7325:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var c=n(9307),a=n(5736),r=n(5235),o=n.n(r),s=n(6895),i=n(5106);n(7920);const __=a.__,l=()=>(0,c.createInterpolateElement)(__("By clicking the buttons above, you agree to our Terms of Service and to share details with WordPress.com.","jetpack-my-jetpack"),{tosLink:React.createElement(u,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(u,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),p=e=>{let{agreeButtonLabel:t}=e;return(0,c.createInterpolateElement)((0,a.sprintf)(/* translators: %s is a button label */ +__("By clicking the %s button, you agree to our Terms of Service and to share details with WordPress.com.","jetpack-my-jetpack"),t),{strong:React.createElement("strong",null),tosLink:React.createElement(u,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(u,{slug:"jetpack-support-what-data-does-jetpack-sync"})})},u=e=>{let{slug:t,children:n}=e;return React.createElement("a",{className:"terms-of-service__link",href:(0,s.Z)(t),rel:"noopener noreferrer",target:"_blank"},n)},d=e=>{let{className:t,multipleButtons:n,agreeButtonLabel:c}=e;return React.createElement(i.ZP,{className:o()(t,"terms-of-service")},n?React.createElement(l,null):React.createElement(p,{agreeButtonLabel:c}))}},6017:(e,t,n)=>{"use strict";n.d(t,{h:()=>c,s:()=>a});const c={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},a=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},5106:(e,t,n)=>{"use strict";n.d(t,{Dx:()=>g,H3:()=>m,ZP:()=>d});var c=n(2674),a=n.n(c),r=n(5235),o=n.n(r),s=n(9196),i=n.n(s),l=n(6017),p=n(3280);const u=(0,s.forwardRef)(((e,t)=>{let{variant:n="body",children:c,component:r,className:u,...d}=e;const m=r||l.h[n]||"span",g=(0,s.useMemo)((()=>l.s.reduce(((e,t)=>(void 0!==d[t]&&(e+=p.Z[`${t}-${d[t]}`]+" ",delete d[t]),e)),"")),[d]);return d.ref=t,i().createElement(m,a()({className:o()(p.Z.reset,p.Z[n],u,g)},d),c)})),d=u,m=e=>{let{children:t,weight:n="bold",...c}=e;const r="headline-small"+("bold"===n?"":`-${n}`);return i().createElement(u,a()({variant:r,mb:3},c),t)},g=e=>{let{children:t,size:n="medium",...c}=e;return i().createElement(u,a()({variant:`title-${n}`,mb:1},c),t)}},8275:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>d});var c=n(9196),a=n.n(c),r=n(3591);const o={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},s={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},i={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},l={"--spacing-base":"8px"},p={},u=(e,t,n)=>{const c={...o,...s,...i,...l};for(const t in c)e.style.setProperty(t,c[t]);n&&e.classList.add(r.Z.global),t&&(p[t]={provided:!0,root:e})},d=e=>{let{children:t=null,targetDom:n,id:r,withGlobalStyles:o=!0}=e;const s=(0,c.useRef)(),i=p?.[r]?.provided;return(0,c.useLayoutEffect)((()=>{if(!i)return n?u(n,r,o):void(s?.current&&u(s.current,r,o))}),[n,s,i,r,o]),n?t:a().createElement("div",{ref:s},t)}},5905:(e,t,n)=>{"use strict";n.d(t,{O:()=>c});const c="d729d42c-b547-4750-a6f6-8b30534a5f12"},4164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var c=n(9196),a=n(8709),r=n(7328),o=n(4318);const s=()=>{const{isWithinAvailableChatTimes:e,isWithinAvailableChatDays:t}=r.Z;return(0,c.useMemo)((()=>{const n=new Date;return(0,a.X)().startsWith("en")&&t(n)&&e(n)}),[t,e])?React.createElement(o.Z,null):null}},7328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c={isWithinAvailableChatDays:e=>{const t=e.getUTCDay();return![0,6].includes(t)},isWithinAvailableChatTimes:e=>{const t=e.getUTCHours();return t>=9&&t<19}}},4318:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9196),a=n(5905);const r=()=>((0,c.useEffect)((()=>{const e=document.createElement("script"),t=document.getElementById("zendesk-chat-container");e.src="https://static.zdassets.com/ekr/snippet.js?key="+encodeURIComponent(a.O),e.type="text/javascript",e.id="ze-snippet",t&&t.appendChild(e)}),[]),React.createElement("div",{"data-testid":"zendesk-chat-container",id:"zendesk-chat-container"}))},8709:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var c=n(9771);const a=c.getSettings||c.__experimentalGetSettings,r=()=>{const{l10n:{locale:e}}=a();if(e)return(e=>{const t=e.match(/^([a-z]{2,3})(_[a-z]{2}|_[a-z][a-z0-9]{4,7})?(?:_.*)?$/i);return t?`${t[1]}${t[2]?t[2]:""}`.replace("_","-"):"en-US"})(e);return window?.window?.navigator?.language??"en-US"}},4153:(e,t,n)=>{"use strict";function c(e,t,n,c){const a=new URL("https://wordpress.com/checkout/"),r=new URL(`${a}${t}/${e}`);return r.searchParams.set("redirect_to",n),c||r.searchParams.set("unlinked","1"),r.searchParams.set("site",t),r.toString()}n.d(t,{Z:()=>c})},6895:(e,t,n)=>{"use strict";function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};let c;if("undefined"!=typeof window&&(c=window.Initial_State?.calypsoEnv),0===e.search("https://")){const t=new URL(e);e=`https://${t.host}${t.pathname}`,n.url=encodeURIComponent(e)}else n.source=encodeURIComponent(e);Object.keys(t).map((e=>{n[e]=encodeURIComponent(t[e])})),!Object.keys(n).includes("site")&&"undefined"!=typeof jetpack_redirects&&jetpack_redirects.hasOwnProperty("currentSiteRawUrl")&&(n.site=jetpack_redirects.currentSiteRawUrl),c&&(n.calypso_env=c);return"https://jetpack.com/redirect/?"+Object.keys(n).map((e=>e+"="+n[e])).join("&")}n.d(t,{Z:()=>c})},1132:(e,t,n)=>{let c={};try{c=n(4462)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),c={missingConfig:!0}}const a=e=>c.hasOwnProperty(e);e.exports={jetpackConfigHas:a,jetpackConfigGet:e=>{if(!a(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return c[e]}}},9312:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(5736),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o),i=n(1294),l=n(1624);const __=c.__,p=e=>{let{title:t,buttonLabel:n,apiRoot:c,apiNonce:a,registrationNonce:r,from:o,redirectUri:p,images:u,children:d,assetBaseUrl:m,footer:g,skipUserConnection:h}=e;const{handleRegisterSite:y,isRegistered:f,isUserConnected:k,siteIsRegistering:v,userIsConnecting:E,registrationError:b}=(0,i.Z)({registrationNonce:r,redirectUri:p,apiRoot:c,apiNonce:a,from:o,skipUserConnection:h}),j=!f||!k,_=Boolean(b),C=v||E;return s().createElement(l.Z,{title:t,images:u,assetBaseUrl:m,showConnectButton:j,buttonLabel:n,handleButtonClick:y,displayButtonError:_,buttonIsLoading:C,footer:g},d)};p.propTypes={title:r().string,buttonLabel:r().string,apiRoot:r().string.isRequired,apiNonce:r().string.isRequired,registrationNonce:r().string.isRequired,from:r().string,redirectUri:r().string.isRequired,images:r().arrayOf(r().string),assetBaseUrl:r().string,skipUserConnection:r().bool},p.defaultProps={title:__("Over 5 million WordPress sites are faster and more secure","jetpack-my-jetpack"),buttonLabel:__("Set up Jetpack","jetpack-my-jetpack"),images:[],redirectUri:null,skipUserConnection:!1};const u=p},1624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(7325),a=n(7121),r=n(5162),o=n.n(r),s=n(9196),i=n.n(s),l=n(8524);n(1510);const p=e=>{const{title:t,images:n,children:r,assetBaseUrl:o,isLoading:s,showConnectButton:p,buttonLabel:u,handleButtonClick:d,displayButtonError:m,buttonIsLoading:g,footer:h}=e;return i().createElement(l.Z,{title:t,assetBaseUrl:o,images:n,className:"jp-connection__connect-screen"+(s?" jp-connection__connect-screen__loading":"")},i().createElement("div",{className:"jp-connection__connect-screen__content"},r,p&&i().createElement(i().Fragment,null,i().createElement("div",{className:"jp-connection__connect-screen__tos"},i().createElement(c.Z,{agreeButtonLabel:u})),i().createElement(a.Z,{label:u,onClick:d,displayError:m,isLoading:g})),h&&i().createElement("div",{className:"jp-connection__connect-screen__footer"},h)))};p.propTypes={title:o().string,images:o().arrayOf(o().string),assetBaseUrl:o().string,isLoading:o().bool,showConnectButton:o().bool,buttonLabel:o().string.isRequired,handleButtonClick:o().func,displayButtonError:o().bool,buttonIsLoading:o().bool,footer:o().node},p.defaultProps={showConnectButton:!0,isLoading:!1,buttonIsLoading:!1,displayButtonError:!1,handleButtonClick:()=>{},footer:null};const u=p},2458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r);const s=e=>{const{images:t,assetBaseUrl:n}=e;if(!t.length)return null;const c=t.map(((e,t)=>o().createElement(o().Fragment,{key:t},o().createElement("img",{src:n+e,alt:""}))));return o().createElement("div",{className:"jp-connection__connect-screen__image-slider"},c)};s.propTypes={images:a().arrayOf(a().string).isRequired,assetBaseUrl:a().string},s.defaultProps={assetBaseUrl:""};const i=s},8524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(8868),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o),i=n(2458);n(9610);const l=e=>{const{title:t,children:n,className:a,assetBaseUrl:r,images:o,logo:l}=e,p=o?.length;return s().createElement("div",{className:"jp-connection__connect-screen-layout"+(p?" jp-connection__connect-screen-layout__two-columns":"")+(a?" "+a:"")},s().createElement("div",{className:"jp-connection__connect-screen-layout__left"},l||s().createElement(c.Z,null),s().createElement("h2",null,t),n),p?s().createElement("div",{className:"jp-connection__connect-screen-layout__right"},s().createElement(i.Z,{images:o,assetBaseUrl:r})):null)};l.propTypes={title:r().string,className:r().string,images:r().arrayOf(r().string),assetBaseUrl:r().string,logo:r().element};const p=l},7879:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(5736),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o),i=n(4322);const __=c.__,l=e=>{const{connectedPlugins:t,disconnectingPlugin:n}=e,c=(0,o.useMemo)((()=>{if(t){return Object.keys(t).map((e=>Object.assign({slug:e},t[e]))).filter((e=>n!==e.slug))}return[]}),[t,n]);return t&&c.length>0?s().createElement(s().Fragment,null,s().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy"},s().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Jetpack is powering other plugins on your site. If you disconnect, these plugins will no longer work.","jetpack-my-jetpack"))),s().createElement("div",{className:"jp-connection__disconnect-card__group"},c.map((e=>s().createElement(i.Z,{title:e.name,key:e.slug}))))):null};l.propTypes={connectedPlugins:r().array,disconnectingPlugin:r().string};const p=l},6186:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(2054),a=n(5033),r=n(5609),o=n(5736),s=n(5162),i=n.n(s),l=n(9196),p=n.n(l),u=n(9836);const __=o.__,d=e=>{const{message:t,isRestoringConnection:n,restoreConnectionCallback:s,restoreConnectionError:i}=e,[l]=(0,c.Z)(["md"],[">"]),d=u.Z.notice+(l?" "+u.Z["bigger-than-medium"]:""),m=p().createElement(r.Icon,{icon:p().createElement(r.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p().createElement(r.Path,{d:"M11.7815 4.93772C11.8767 4.76626 12.1233 4.76626 12.2185 4.93772L20.519 19.8786C20.6116 20.0452 20.4911 20.25 20.3005 20.25H3.69951C3.50889 20.25 3.3884 20.0452 3.48098 19.8786L11.7815 4.93772Z",stroke:"#D63638",strokeWidth:"1.5"}),p().createElement(r.Path,{d:"M13 10H11V15H13V10Z",fill:"#D63638"}),p().createElement(r.Path,{d:"M13 16H11V18H13V16Z",fill:"#D63638"}))});if(!t)return null;if(n)return p().createElement(r.Notice,{status:"error",isDismissible:!1,className:d},p().createElement("div",{className:u.Z.message},p().createElement(a.Z,{color:"#B32D2E",size:24}),__("Reconnecting Jetpack","jetpack-my-jetpack")));const g=i?p().createElement(r.Notice,{status:"error",isDismissible:!1,className:d+" "+u.Z.error},p().createElement("div",{className:u.Z.message},m,(0,o.sprintf)(/* translators: placeholder is the error. */ +__("There was an error reconnecting Jetpack. Error: %s","jetpack-my-jetpack"),i))):null;return p().createElement(p().Fragment,null,g,p().createElement(r.Notice,{status:"error",isDismissible:!1,className:d},p().createElement("div",{className:u.Z.message},m,t),s&&p().createElement("a",{onClick:s,onKeyDown:s,className:u.Z.button,href:"#"},__("Restore Connection","jetpack-my-jetpack"))))};d.propTypes={message:i().string.isRequired,restoreConnectionCallback:i().func,isRestoringConnection:i().bool,restoreConnectionError:i().string};const m=d},4322:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r);n(4220);const s=e=>{const{title:t,value:n,description:c}=e;return o().createElement("div",{className:"jp-connection__disconnect-card card"},o().createElement("div",{className:"jp-connection__disconnect-card__card-content"},o().createElement("p",{className:"jp-connection__disconnect-card__card-headline"},t),(n||c)&&o().createElement("div",{className:"jp-connection__disconnect-card__card-stat-block"},o().createElement("span",{className:"jp-connection__disconnect-card__card-stat"},n),o().createElement("div",{className:"jp-connection__disconnect-card__card-description"},c))))};s.propTypes={title:a().string,value:a().oneOfType([a().string,a().number]),description:a().string};const i=s},6168:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var c=n(6975),a=n(4743),r=n(1132),o=n(5609),s=n(5736),i=n(5162),l=n.n(i),p=n(9196),u=n.n(p),d=(n(287),n(9015)),m=n(5995),g=n(1702),h=n(1166);const __=s.__,y=e=>{const[t,n]=(0,p.useState)(!1),[s,i]=(0,p.useState)(!1),[l,y]=(0,p.useState)(!1),[f,k]=(0,p.useState)(!1),[v,E]=(0,p.useState)(!1),[b,j]=(0,p.useState)(!1),{apiRoot:_,apiNonce:C,connectedPlugins:w,title:Z,pluginScreenDisconnectCallback:N,onDisconnected:S,onError:R,disconnectStepComponent:P,context:x,connectedUser:A,connectedSiteId:L,isOpen:I,onClose:U}=e;let T="";(0,r.jetpackConfigHas)("consumer_slug")&&(T=(0,r.jetpackConfigGet)("consumer_slug"));const O=(0,p.useMemo)((()=>({context:x,plugin:T})),[x,T]);(0,p.useEffect)((()=>{a.ZP.setApiRoot(_),a.ZP.setApiNonce(C)}),[_,C]),(0,p.useEffect)((()=>{A&&A.ID&&A.login&&c.Z.initialize(A.ID,A.login)}),[A,A.ID,A.login]),(0,p.useEffect)((()=>{I&&c.Z.tracks.recordEvent("jetpack_disconnect_dialog_open",O)}),[I,O]),(0,p.useEffect)((()=>{I&&(s?!s||f||v?f&&!v?c.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"survey"},O)):v&&c.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"thank_you"},O)):c.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"disconnect_confirm"},O)):c.Z.tracks.recordEvent("jetpack_disconnect_dialog_step",Object.assign({},{step:"disconnect"},O)))}),[I,s,f,v,O]);const F=(0,p.useCallback)((()=>{a.ZP.disconnectSite().then((()=>{n(!1),i(!0)})).catch((e=>{n(!1),y(e),R&&R(e)}))}),[n,i,y,R]),D=(0,p.useCallback)(((e,t)=>{j(!0),fetch("https://public-api.wordpress.com/wpcom/v2/marketing/feedback-survey",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)}).then((e=>e.json())).then((e=>{if(!0!==e.success)throw new Error("Survey endpoint returned error code "+e.code);c.Z.tracks.recordEvent("jetpack_disconnect_survey_submit",t),E(!0),j(!1)})).catch((e=>{c.Z.tracks.recordEvent("jetpack_disconnect_survey_error",Object.assign({},{error:e.message},t)),E(!0),j(!1)}))}),[j,E]),z=(0,p.useCallback)((e=>{e&&e.preventDefault(),y(!1),n(!0),"plugins"!==x?F():N&&N(e)}),[y,n,N,x,F]),M=(0,p.useCallback)((e=>c.Z.tracks.recordEvent(e,O)),[O]),V=(0,p.useCallback)((()=>!(!A.ID||!L)),[A,L]),B=(0,p.useCallback)(((e,t,n)=>{if(n&&n.preventDefault(),!V())return void E(!0);const c={site_id:L,user_id:A.ID,survey_id:"jetpack-plugin-disconnect",survey_responses:{"why-cancel":{response:e,text:t||null}}},a=Object.assign({},O,{disconnect_reason:e});D(c,a)}),[D,E,V,L,A,O]),J=(0,p.useCallback)((e=>{e&&e.preventDefault(),S&&S(),U()}),[S,U]),H=(0,p.useCallback)((e=>{e&&e.preventDefault(),k(!0)}),[k]);return u().createElement(u().Fragment,null,I&&u().createElement(o.Modal,{title:"",contentLabel:Z,aria:{labelledby:"jp-connection__disconnect-dialog__heading"},onRequestClose:U,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"jp-connection__disconnect-dialog"+(s?" jp-connection__disconnect-dialog__success":"")},s?!s||f||v?f&&!v?u().createElement(g.Z,{isSubmittingFeedback:b,onFeedBackProvided:B,onExit:J}):v?u().createElement(h.Z,{onExit:J}):void 0:u().createElement(m.Z,{canProvideFeedback:V(),onProvideFeedback:H,onExit:J}):u().createElement(d.Z,{title:Z,connectedPlugins:w,disconnectStepComponent:P,isDisconnecting:t,closeModal:U,onDisconnect:z,disconnectError:l,context:x,disconnectingPlugin:T,trackModalClick:M})))};y.propTypes={apiRoot:l().string.isRequired,apiNonce:l().string.isRequired,title:l().string,onDisconnected:l().func,onError:l().func,context:l().string,connectedPlugins:l().oneOfType([l().array,l().object]),pluginScreenDisconnectCallback:l().func,disconnectStepComponent:l().element,connectedUser:l().object,connectedSiteId:l().number,isOpen:l().bool,onClose:l().func},y.defaultProps={title:__("Are you sure you want to disconnect?","jetpack-my-jetpack"),context:"jetpack-dashboard",connectedUser:{}};const f=y},5995:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(9026),a=n(5609),r=n(9307),o=n(5736),s=n(5162),i=n.n(s),l=n(9196),p=n.n(l),u=n(2042);const __=o.__,d=e=>{const{onExit:t,canProvideFeedback:n,onProvideFeedback:o}=e;return p().createElement("div",{className:"jp-connection__disconnect-dialog__content"},p().createElement(c.Z,{icon:"unlink",imageUrl:u}),p().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy jp-connection__disconnect-dialog__step-copy--narrow"},p().createElement("h1",null,(0,r.createInterpolateElement)(__("Jetpack has been
        successfully disconnected.","jetpack-my-jetpack"),{br:p().createElement("br",null)})),n&&p().createElement(p().Fragment,null,p().createElement("p",null,__("We’re sorry to see you go. Here at Jetpack, we’re always striving to provide the best experience for our customers. Please take our short survey (2 minutes, promise).","jetpack-my-jetpack")),p().createElement("p",null,p().createElement(a.Button,{variant:"primary",onClick:o,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Help us improve","jetpack-my-jetpack"))),p().createElement("a",{className:"jp-connection__disconnect-dialog__link jp-connection__disconnect-dialog__link--bold",href:"#",onClick:t},__("No thank you","jetpack-my-jetpack"))),!n&&p().createElement(p().Fragment,null,p().createElement("p",null,p().createElement(a.Button,{variant:"primary",onClick:t,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Back to my website","jetpack-my-jetpack"))))))};d.propTypes={onExit:i().func,onProvideFeedback:i().func,canProvideFeedback:i().bool};const m=d},9015:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(6895),a=n(5609),r=n(9307),o=n(5736),s=n(5162),i=n.n(s),l=n(9196),p=n.n(l),u=n(7879);const __=o.__,d=e=>{const{title:t,isDisconnecting:n,onDisconnect:o,disconnectError:s,disconnectStepComponent:i,connectedPlugins:d,disconnectingPlugin:m,closeModal:g,context:h,trackModalClick:y}=e,f=(0,l.useCallback)((()=>y("jetpack_disconnect_dialog_click_learn_about")),[y]),k=(0,l.useCallback)((()=>y("jetpack_disconnect_dialog_click_support")),[y]),v=(0,l.useCallback)((()=>{y("jetpack_disconnect_dialog_click_stay_connected"),g()}),[y,g]),E=(0,l.useCallback)((e=>{y("jetpack_disconnect_dialog_click_disconnect"),o(e)}),[y,o]),b=(0,l.useCallback)((e=>{"Escape"!==e.key||n||v()}),[v,n]);(0,l.useEffect)((()=>(document.addEventListener("keydown",b,!1),()=>{document.removeEventListener("keydown",b,!1)})),[]);return p().createElement(p().Fragment,null,p().createElement("div",{className:"jp-connection__disconnect-dialog__content"},p().createElement("h1",{id:"jp-connection__disconnect-dialog__heading"},t),p().createElement(u.Z,{connectedPlugins:d,disconnectingPlugin:m}),i,(()=>{if(!(d&&Object.keys(d).filter((e=>e!==m)).length)&&!i)return p().createElement("div",{className:"jp-connection__disconnect-dialog__step-copy"},p().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Jetpack is currently powering multiple products on your site.","jetpack-my-jetpack"),p().createElement("br",null),__("Once you disconnect Jetpack, these will no longer work.","jetpack-my-jetpack")))})()),p().createElement("div",{className:"jp-connection__disconnect-dialog__actions"},p().createElement("div",{className:"jp-row"},p().createElement("div",{className:"lg-col-span-8 md-col-span-9 sm-col-span-4"},p().createElement("p",null,(0,r.createInterpolateElement)(__("Need help? Learn more about the Jetpack connection or contact Jetpack support.","jetpack-my-jetpack"),{strong:p().createElement("strong",null),jpConnectionInfoLink:p().createElement(a.ExternalLink,{href:(0,c.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),className:"jp-connection__disconnect-dialog__link",onClick:f}),jpSupportLink:p().createElement(a.ExternalLink,{href:(0,c.Z)("jetpack-support"),className:"jp-connection__disconnect-dialog__link",onClick:k})}))),p().createElement("div",{className:"jp-connection__disconnect-dialog__button-wrap lg-col-span-4 md-col-span-7 sm-col-span-4"},p().createElement(a.Button,{variant:"primary",disabled:n,onClick:v,className:"jp-connection__disconnect-dialog__btn-dismiss"},"plugins"===h?__("Cancel","jetpack-my-jetpack"):__("Stay connected","jetpack-my-jetpack",0)),(()=>{let e=__("Disconnect","jetpack-my-jetpack");return n?e=__("Disconnecting…","jetpack-my-jetpack"):"plugins"===h&&(e=__("Deactivate","jetpack-my-jetpack")),p().createElement(a.Button,{variant:"primary",disabled:n,onClick:E,className:"jp-connection__disconnect-dialog__btn-disconnect"},e)})())),s&&p().createElement("p",{className:"jp-connection__disconnect-dialog__error"},s)))};d.propTypes={title:i().string,isDisconnecting:i().bool,onDisconnect:i().func,disconnectError:i().bool,disconnectStepComponent:i().element,connectedPlugins:i().array,disconnectingPlugin:i().string,closeModal:i().func,context:i().string,trackModalClick:i().func};const m=d},1702:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(5736),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o),i=(n(9823),n(6336));const __=c.__,l=e=>{const{onExit:t,onFeedBackProvided:n,isSubmittingFeedback:c}=e;return s().createElement("div",{className:"jp-connection__disconnect-dialog__content"},s().createElement("h1",null,__("Before you go, help us improve Jetpack","jetpack-my-jetpack")),s().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},__("Let us know what didn‘t work for you","jetpack-my-jetpack")),s().createElement(i.Z,{onSubmit:n,isSubmittingFeedback:c}),s().createElement("a",{className:"jp-connection__disconnect-dialog__link jp-connection__disconnect-dialog__link--bold",href:"#",onClick:t},__("Skip for now","jetpack-my-jetpack")))};l.PropTypes={onExit:r().func,onFeedBackProvided:r().func,isSubmittingFeedback:r().bool};const p=l},1166:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(9026),a=n(5609),r=n(9307),o=n(5736),s=n(5162),i=n.n(s),l=n(9196),p=n.n(l),u=n(724);const __=o.__,d=e=>{const{onExit:t}=e;return p().createElement("div",{className:"jp-connection__disconnect-dialog__content"},p().createElement(c.Z,{format:"vertical",imageUrl:u}),p().createElement("div",{className:"jp-connection__disconnect-dialog__copy"},p().createElement("h1",null,__("Thank you!","jetpack-my-jetpack")),p().createElement("p",{className:"jp-connection__disconnect-dialog__large-text"},(0,r.createInterpolateElement)(__("Your answer has been submitted.
        Thanks for your input on how we can improve Jetpack.","jetpack-my-jetpack"),{br:p().createElement("br",null)})),p().createElement(a.Button,{variant:"primary",onClick:t,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},__("Back to my website","jetpack-my-jetpack"))))};d.PropTypes={onExit:i().func,assetBaseUrl:i().string};const m=d},6336:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(5609),a=n(5736),r=n(5162),o=n.n(r),s=n(9196),i=n.n(s),l=n(4372);const __=a.__,p=e=>{const{onSubmit:t,isSubmittingFeedback:n}=e,[a,r]=(0,s.useState)(),[o,p]=(0,s.useState)(),u=[{id:"troubleshooting",answerText:__("Troubleshooting - I'll be reconnecting afterwards.","jetpack-my-jetpack")},{id:"not-working",answerText:__("I can't get it to work.","jetpack-my-jetpack")},{id:"slowed-down-site",answerText:__("It slowed down my site.","jetpack-my-jetpack")},{id:"buggy",answerText:__("It's buggy.","jetpack-my-jetpack")},{id:"what-does-it-do",answerText:__("I don't know what it does.","jetpack-my-jetpack")}],d="another-reason",m=(0,s.useCallback)((()=>{t(a,a===d?o:"")}),[t,d,o,a]),g=(0,s.useCallback)((e=>{const t=e.target.value;e.stopPropagation(),p(t)}),[p]),h=e=>e===a?"jp-connect__disconnect-survey-card--selected":"",y=(0,s.useCallback)(((e,t)=>{switch(t.key){case"Enter":case"Space":case"Spacebar":case" ":r(e)}}),[r]);return i().createElement(i().Fragment,null,i().createElement("div",{className:"jp-connection__disconnect-dialog__survey"},u.map((e=>i().createElement(l.Z,{id:e.id,onClick:r,onKeyDown:y,className:"card jp-connect__disconnect-survey-card "+h(e.id)},i().createElement("p",{className:"jp-connect__disconnect-survey-card__answer"},e.answerText)))),i().createElement(l.Z,{id:d,onClick:r,onKeyDown:y,className:"card jp-connect__disconnect-survey-card "+h(d)},i().createElement("p",{className:"jp-connect__disconnect-survey-card__answer"},__("Other:","jetpack-my-jetpack")," ",i().createElement("input",{placeholder:__("share your experience","jetpack-my-jetpack"),className:"jp-connect__disconnect-survey-card__input",type:"text",value:o,onChange:g,maxLength:1e3})))),i().createElement("p",null,i().createElement(c.Button,{disabled:!a||n,variant:"primary",onClick:m,className:"jp-connection__disconnect-dialog__btn-back-to-wp"},n?__("Submitting…","jetpack-my-jetpack"):__("Submit Feedback","jetpack-my-jetpack",0))))};p.PropTypes={onSubmit:o().func,isSubmittingFeedback:o().bool};const u=p},4372:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9196),a=n.n(c);n(9823);const r=e=>{const{id:t,onClick:n,onKeyDown:r,children:o,className:s}=e,i=(0,c.useCallback)((()=>{n(t)}),[t,n]),l=(0,c.useCallback)((e=>{r(t,e)}),[t,r]);return a().createElement("div",{tabIndex:"0",role:"button",onClick:i,onKeyDown:l,className:"card jp-connect__disconnect-survey-card "+s},o)}},8137:(e,t,n)=>{"use strict";n.d(t,{Z:()=>j});var c=n(5106),a=n(6895),r=n(526),o=n(5609),s=n(9307),i=n(5736),l=n(1074),p=n(6936),u=n(5381),d=n(5235),m=n.n(d),g=n(5162),h=n.n(g),y=n(9196),f=n.n(y),k=n(6168);n(7664);const __=i.__,v=e=>{const{title:t,apiRoot:n,apiNonce:r,connectedPlugins:s,onDisconnected:i,context:l,connectedUser:p,connectedSiteId:u,isOpen:d,onClose:m}=e,[g,h]=(0,y.useState)(!1),v=(0,y.useCallback)((e=>{e&&e.preventDefault(),h(!0)}),[h]),j=(0,y.useCallback)((e=>{e&&e.preventDefault(),h(!1)}),[h]);return f().createElement(f().Fragment,null,d&&f().createElement(f().Fragment,null,f().createElement(o.Modal,{title:"",contentLabel:t,aria:{labelledby:"jp-connection__manage-dialog__heading"},shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"jp-connection__manage-dialog"},f().createElement("div",{className:"jp-connection__manage-dialog__content"},f().createElement("h1",{id:"jp-connection__manage-dialog__heading"},t),f().createElement(c.ZP,{className:"jp-connection__manage-dialog__large-text"},__("At least one user must be connected for your Jetpack products to work properly.","jetpack-my-jetpack")),f().createElement(E,{title:__("Transfer ownership to another admin","jetpack-my-jetpack"),link:(0,a.Z)("calypso-settings-manage-connection",{site:window?.myJetpackInitialState?.siteSuffix}),key:"transfer",action:"transfer"}),f().createElement(E,{title:__("Disconnect Jetpack","jetpack-my-jetpack"),onClick:v,key:"disconnect",action:"disconnect"})),f().createElement(b,{onClose:m})),f().createElement(k.Z,{apiRoot:n,apiNonce:r,onDisconnected:i,connectedPlugins:s,connectedSiteId:u,connectedUser:p,isOpen:g,onClose:j,context:l})))},E=e=>{let{title:t,onClick:n=(()=>null),link:c="#",action:a}=e;return f().createElement("div",{className:"jp-connection__manage-dialog__action-card card"},f().createElement("div",{className:"jp-connection__manage-dialog__action-card__card-content"},f().createElement("a",{href:c,className:m()("jp-connection__manage-dialog__action-card__card-headline",a),onClick:n},t,f().createElement(l.Z,{icon:"disconnect"===a?p.Z:u.Z,className:"jp-connection__manage-dialog__action-card__icon"}))))},b=e=>{let{onClose:t}=e;return f().createElement("div",{className:"jp-row jp-connection__manage-dialog__actions"},f().createElement("div",{className:"jp-connection__manage-dialog__text-wrap lg-col-span-9 md-col-span-7 sm-col-span-3"},f().createElement(c.ZP,null,(0,s.createInterpolateElement)(__("Need help? Learn more about the Jetpack connection or contact Jetpack support","jetpack-my-jetpack"),{strong:f().createElement("strong",null),connectionInfoLink:f().createElement(o.ExternalLink,{href:(0,a.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),className:"jp-connection__manage-dialog__link"}),supportLink:f().createElement(o.ExternalLink,{href:(0,a.Z)("jetpack-support"),className:"jp-connection__manage-dialog__link"})}))),f().createElement("div",{className:"jp-connection__manage-dialog__button-wrap lg-col-span-3 md-col-span-1 sm-col-span-1"},f().createElement(r.Z,{weight:"regular",variant:"secondary",onClick:t,className:"jp-connection__manage-dialog__btn-dismiss"},__("Cancel","jetpack-my-jetpack"))))};v.propTypes={title:h().string,apiRoot:h().string.isRequired,apiNonce:h().string.isRequired,connectedPlugins:h().oneOfType([h().array,h().object]),onDisconnected:h().func,context:h().string,connectedUser:h().object,connectedSiteId:h().number,isOpen:h().bool,onClose:h().func},v.defaultProps={title:__("Manage your Jetpack connection","jetpack-my-jetpack"),isOpen:!1,context:"jetpack-dashboard",connectedUser:{}};const j=v},1294:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(4743),a=n(9818),r=n(9196),o=n(428);const s=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},i=function(){let{registrationNonce:e=s.registrationNonce,apiRoot:t=s.apiRoot,apiNonce:n=s.apiNonce,redirectUri:i,autoTrigger:l,from:p,skipUserConnection:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:d,connectUser:m,refreshConnectedPlugins:g}=(0,a.useDispatch)(o.t),h=(0,a.useSelect)((e=>e(o.t).getRegistrationError())),{siteIsRegistering:y,userIsConnecting:f,userConnectionData:k,connectedPlugins:v,connectionErrors:E,isRegistered:b,isUserConnected:j,hasConnectedOwner:_}=(0,a.useSelect)((e=>({siteIsRegistering:e(o.t).getSiteIsRegistering(),userIsConnecting:e(o.t).getUserIsConnecting(),userConnectionData:e(o.t).getUserConnectionData(),connectedPlugins:e(o.t).getConnectedPlugins(),connectionErrors:e(o.t).getConnectionErrors(),...e(o.t).getConnectionStatus()}))),C=()=>u?i?(window.location=i,Promise.resolve(i)):Promise.resolve():m({from:p,redirectUri:i}),w=t=>(t&&t.preventDefault(),b?C():d({registrationNonce:e,redirectUri:i}).then((()=>C())));return(0,r.useEffect)((()=>{c.ZP.setApiRoot(t),c.ZP.setApiNonce(n)}),[t,n]),(0,r.useEffect)((()=>{!l||y||f||w()}),[]),{handleRegisterSite:w,handleConnectUser:C,refreshConnectedPlugins:g,isRegistered:b,isUserConnected:j,siteIsRegistering:y,userIsConnecting:f,registrationError:h,userConnectionData:k,hasConnectedOwner:_,connectedPlugins:v,connectionErrors:E}}},3329:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o,h:()=>s});var c=n(6186),a=n(1294),r=n(1045);function o(){const{connectionErrors:e}=(0,a.Z)({}),t=Object.values(e).shift(),n=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(n),connectionErrorMessage:n}}const s=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=o(),{restoreConnection:n,isRestoringConnection:a,restoreConnectionError:s}=(0,r.Z)();return e?React.createElement(c.Z,{isRestoringConnection:a,restoreConnectionError:s,restoreConnectionCallback:n,message:t}):null}},8258:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var c=n(4743),a=n(4153),r=n(9818),o=n(951),s=n.n(o),i=n(9196),l=n(1294),p=n(428);const u=s()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:d,apiRoot:m,apiNonce:g,siteSuffix:h}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function y(){let{productSlug:e,redirectUrl:t,siteSuffix:n=h,siteProductAvailabilityHandler:o=null,from:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u("productSlug is %s",e),u("redirectUrl is %s",t),u("siteSuffix is %s",n),u("from is %s",s);const[y,f]=(0,i.useState)(!1),{registerSite:k}=(0,r.useDispatch)(p.t),{isUserConnected:v,isRegistered:E,handleConnectUser:b}=(0,l.Z)({redirectUri:t,from:s}),j=(0,a.Z)(e,n,t,v);u("checkoutProductUrl is %s",j),u("isUserConnected is %s",v);const _=()=>Promise.resolve(o&&o()).then((e=>{if(e)return u("handleAfterRegistration: Site has a product associated"),b();u("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",j),window.location.href=j}));return(0,i.useEffect)((()=>{c.ZP.setApiRoot(m),c.ZP.setApiNonce(g)}),[]),{run:e=>{if(e&&e.preventDefault(),f(!0),E)return _();k({registrationNonce:d,redirectUri:t}).then(_)},isRegistered:E,hasCheckoutStarted:y}}},1045:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(4743),a=n(9818),r=n(9196),o=n(428);const{apiRoot:s,apiNonce:i}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function l(){const[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{disconnectUserSuccess:p}=(0,a.useDispatch)(o.t),u="/wp-admin/admin.php?page=my-jetpack#/connection";return(0,r.useEffect)((()=>{c.ZP.setApiRoot(s),c.ZP.setApiNonce(i)}),[]),{restoreConnection:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t(!0),l(null),c.ZP.reconnect().then((t=>("in_progress"===t.status?(p(),e&&(window.location.href=u)):window.location.reload(),t))).catch((e=>{throw l(e),t(!1),e}))},isRestoringConnection:e,restoreConnectionError:n}}},7523:(e,t,n)=>{"use strict";n.d(t,{LI:()=>r,N4:()=>s,Qo:()=>m,T1:()=>l,TS:()=>u,ZP:()=>_,b5:()=>h,i6:()=>a,qV:()=>i,r7:()=>o,wQ:()=>g});var c=n(4743);const a="SET_CONNECTION_STATUS",r="SET_CONNECTION_STATUS_IS_FETCHING",o="SET_SITE_IS_REGISTERING",s="SET_USER_IS_CONNECTING",i="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",p="REGISTER_SITE",u="SET_AUTHORIZATION_URL",d="CONNECT_USER",m="DISCONNECT_USER_SUCCESS",g="SET_CONNECTED_PLUGINS",h="SET_CONNECTION_ERRORS",y=e=>({type:a,connectionStatus:e}),f=e=>({type:o,isRegistering:e}),k=e=>({type:s,isConnecting:e}),v=e=>({type:i,registrationError:e}),E=()=>({type:l}),b=e=>({type:u,authorizationUrl:e}),j=e=>({type:g,connectedPlugins:e});const _={setConnectionStatus:y,setConnectionStatusIsFetching:e=>({type:r,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:f,setUserIsConnecting:k,setRegistrationError:v,clearRegistrationError:E,setAuthorizationUrl:b,registerSite:function(e){let{registrationNonce:t,redirectUri:n}=e;return function*(){yield E(),yield f(!0);try{const e=yield{type:p,registrationNonce:t,redirectUri:n};return yield y({isRegistered:!0}),yield b(e.authorizeUrl),yield f(!1),Promise.resolve(e)}catch(e){return yield v(e),yield f(!1),Promise.reject(e)}}()},connectUser:function(){let{from:e,redirectFunc:t,redirectUri:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){yield k(!0),yield{type:d,from:e,redirectFunc:t,redirectUri:n}}()},disconnectUserSuccess:()=>({type:m}),setConnectedPlugins:j,refreshConnectedPlugins:()=>async e=>{let{dispatch:t}=e;return await new Promise((e=>c.ZP.fetchConnectedPlugins().then((n=>{t(j(n)),e(n)}))))},setConnectionErrors:e=>({type:h,connectionErrors:e})}},1432:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(4743),a=n(9818),r=n(7057);const o={FETCH_AUTHORIZATION_URL:e=>{let{redirectUri:t}=e;return c.ZP.fetchAuthorizationUrl(t)},REGISTER_SITE:e=>{let{registrationNonce:t,redirectUri:n}=e;return c.ZP.registerSite(t,n)},CONNECT_USER:(0,a.createRegistryControl)((e=>{let{resolveSelect:t}=e;return function(){let{from:e,redirectFunc:n,redirectUri:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((a,o)=>{t(r.Z).getAuthorizationUrl(c).then((t=>{const c=n||(e=>window.location.assign(e)),r=new URL(t);e&&r.searchParams.set("from",encodeURIComponent(e));const o=r.toString();c(o),a(o)})).catch((e=>{o(e)}))}))}}))}},1479:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9818),a=n(7523);const r=(0,c.combineReducers)({connectionStatus:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.i6:return{...e,...t.connectionStatus};case a.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.LI?t.isFetching:e},siteIsRegistering:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.r7?t.isRegistering:e},userIsConnecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===a.N4?t.isConnecting:e},registrationError:(e,t)=>{switch(t.type){case a.T1:return!1;case a.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===a.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===a.wQ?t.connectedPlugins:e},connectionErrors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===a.b5?t.connectionErrors:e}})},7728:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(9818),a=n(7523),r=n(7057);const o={...{getAuthorizationUrl:{isFulfilled:function(e){const t=Boolean(e.authorizationUrl);for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o{"use strict";n.d(t,{Z:()=>c});const c={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}}},3535:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var c=n(17),a=n.n(c),r=n(9818);class o{static mayBeInit(e,t){null===o.store&&(o.store=(0,r.createReduxStore)(e,t),(0,r.register)(o.store))}}a()(o,"store",null);const s=o},7057:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});const c="jetpack-connection"},428:(e,t,n)=>{"use strict";n.d(t,{t:()=>l.Z});var c=n(7523),a=n(1432),r=n(1479),o=n(7728),s=n(2725),i=n(3535),l=n(7057);const p=window.JP_CONNECTION_INITIAL_STATE;p||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),i.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:r.Z,actions:c.ZP,selectors:s.Z,resolvers:o.Z,controls:a.Z,initialState:p||{}})},8728:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var c=n(6975),a=n(8868),r=n(5033),o=n(5609),s=n(9307),i=n(5736),l=n(1074),p=n(797),u=n(5844),d=n.n(u),m=n(9196),g=n.n(m);const __=i.__,h=e=>{const{className:t,disabled:n,onChange:c,value:a}=e;return g().createElement(o.TextControl,{className:t,label:__("License key","jetpack-my-jetpack"),value:a,onChange:c,disabled:n})},y=e=>{const{className:t,availableLicenses:n,disabled:c,onChange:a,value:r}=e,[s,l]=(0,m.useState)(""),p=null===n,u=(0,m.useMemo)((()=>p?[{label:__("Fetching available licenses…","jetpack-my-jetpack"),value:""}]:[...n.map((e=>{let{product:t,license_key:n}=e;return{label:(0,i.sprintf)(/* translators: placeholder is the product name and license key */ +__("%1$s - %2$s","jetpack-my-jetpack"),t,n),value:n}})),{label:__("I want to add a license key manually","jetpack-my-jetpack"),value:""}]),[n,p]);(0,m.useEffect)((()=>{l(u?.length?u[0].value:"")}),[u]);const d=(0,m.useCallback)((e=>{l(e),a(e)}),[a]);return g().createElement(g().Fragment,null,g().createElement(o.SelectControl,{className:t,disabled:c,label:__("Select a license key","jetpack-my-jetpack"),value:s,options:u,onChange:d}),!p&&!s&&g().createElement(o.TextControl,{className:t,label:__("Input a license key","jetpack-my-jetpack"),value:r,onChange:a,disabled:c}))},f=e=>{const{activateLicense:t,availableLicenses:n,fetchingAvailableLicenses:i,isActivating:u,license:d,licenseError:f,onLicenseChange:k}=e,v=null!=f;(0,m.useEffect)((()=>{c.Z.tracks.recordEvent("jetpack_wpa_license_key_activation_view")}),[]);const E=v?"jp-license-activation-screen-controls--license-field-with-error":"jp-license-activation-screen-controls--license-field",b=n&&n.length;return g().createElement("div",{className:"jp-license-activation-screen-controls"},g().createElement("div",{className:"jp-license-activation-screen-controls--content"},g().createElement(a.Z,{showText:!1,height:48}),g().createElement("h1",null,__("Add a license key","jetpack-my-jetpack")),g().createElement("p",null,(0,s.createInterpolateElement)(__("Check your email for your license key. You should have received it after making your purchase.","jetpack-my-jetpack"),{strong:g().createElement("strong",null)})),i||b?g().createElement(y,{className:E,disabled:i||u,onChange:k,availableLicenses:i?null:n,value:d}):g().createElement(h,{className:E,disabled:u,onChange:k,value:d}),v&&g().createElement("div",{className:"jp-license-activation-screen-controls--license-field-error"},g().createElement(l.Z,{icon:p.Z}),g().createElement("span",null,f))),g().createElement("div",null,g().createElement(o.Button,{className:"jp-license-activation-screen-controls--button",onClick:t,disabled:!d},u?g().createElement(r.Z,null):__("Activate","jetpack-my-jetpack"))))};f.propTypes={activateLicense:d().func.isRequired,availableLicenses:d().array,fetchingAvailableLicenses:d().bool,isActivating:d().bool.isRequired,license:d().string.isRequired,licenseError:d().string,onLicenseChange:d().func.isRequired,siteUrl:d().string.isRequired};const k=f},8781:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(6895),a=n(9307),r=n(5736),o=n(5844),s=n.n(o),i=n(9196),l=n.n(i);const __=r.__,p=e=>{const{imageUrl:t,showSupportLink:n=!1}=e;return l().createElement("div",{className:"jp-license-activation-screen-illustration"},l().createElement("div",{className:"jp-license-activation-screen-illustration--wrapper"},l().createElement("img",{className:"jp-license-activation-screen-illustration--img",src:t,alt:""})),n&&l().createElement("p",{className:"jp-license-activation-screen-illustration--support-link"},(0,a.createInterpolateElement)(__("Do you need help? Contact us.","jetpack-my-jetpack"),{a:l().createElement("a",{href:(0,c.Z)("jetpack-support-license-activation")})})))};p.propTypes={imageUrl:s().string.isRequired,showSupportLink:s().bool};const u=p},7554:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var c=n(8868),a=n(5844),r=n.n(a),o=n(9196),s=n.n(o),i=n(3157),l=n(8288),p=n(4172);const u=e=>{const{productId:t,siteRawUrl:n,siteAdminUrl:a,currentRecommendationsStep:r}=e;return s().createElement("div",{className:"jp-license-activation-screen-success-info"},s().createElement("div",{className:"jp-license-activation-screen-success-info--content"},s().createElement(c.Z,{showText:!1,height:48})),s().createElement(l.Z,{siteRawUrl:n,productId:t}),s().createElement("div",{className:"jp-license-activation-screen-success-info--buttons"},s().createElement(i.c,{currentRecommendationsStep:r,siteAdminUrl:a,siteRawUrl:n}),s().createElement(p.o,{siteRawUrl:n,productId:t})))};u.propTypes={siteRawUrl:r().string,productId:r().number,siteAdminUrl:r().string,currentRecommendationsStep:r().string};const d=u},3157:(e,t,n)=>{"use strict";n.d(t,{c:()=>p});var c=n(6895),a=n(5609),r=n(5736),o=n(5844),s=n.n(o),i=n(9196),l=n.n(i);const __=r.__,p=e=>{const{currentRecommendationsStep:t,siteAdminUrl:n,siteRawUrl:r}=e;return"not-started"===t?l().createElement(a.Button,{className:"jp-license-activation-screen-success-info--button",href:n+"admin.php?page=jetpack#/recommendations"},__("Configure my site","jetpack-my-jetpack")):l().createElement(a.Button,{className:"jp-license-activation-screen-success-info--button",href:(0,c.Z)("license-activation-view-my-plans",{site:r})},__("View my plans","jetpack-my-jetpack"))};p.propTypes={siteAdminUrl:s().string.isRequired,currentRecommendationsStep:s().string,siteRawUrl:s().string.isRequired}},4172:(e,t,n)=>{"use strict";n.d(t,{o:()=>u});var c=n(6895),a=n(5609),r=n(5736),o=n(5844),s=n.n(o),i=n(9196),l=n.n(i),p=n(9430);const __=r.__,u=e=>{const{productId:t,siteRawUrl:n}=e,r={jetpack_backup:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},jetpack_complete:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},jetpack_scan:{text:__("View scan results","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-scan"},jetpack_search:{text:__("Configure search","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-search"},jetpack_security:{text:__("View latest backup","jetpack-my-jetpack"),redirectSource:"jetpack-license-activation-success-backup"},default:null}[(0,p.F)(t)];return l().createElement(l().Fragment,null,r&&l().createElement(a.ExternalLink,{className:"jp-license-activation-screen-success-info--external-link",href:(0,c.Z)(r.redirectSource,{site:n})},r.text))};u.propTypes={siteRawUrl:s().string,productId:s().number}},468:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var c=n(6975),a=n(4743),r=n(9307),o=n(5736),s=n(5844),i=n.n(s),l=n(9196),p=n.n(l),u=n(8728),d=n(8781),m=n(7554),g=n(9644),h=n(8702),y=n(1160);const __=o.__,f=e=>{const{availableLicenses:t=[],currentRecommendationsStep:n,fetchingAvailableLicenses:o=!1,onActivationSuccess:s=(()=>null),siteAdminUrl:i,siteRawUrl:f,startingLicense:k,displayName:v=""}=e,[E,b]=(0,l.useState)(k??""),[j,_]=(0,l.useState)(null),[C,w]=(0,l.useState)(!1),[Z,N]=(0,l.useState)(null);(0,l.useEffect)((()=>{t&&t[0]&&b(t[0].license_key)}),[t]);const S=(0,l.useCallback)((()=>C?Promise.resolve():E.length<1?(_(__("This is not a valid license key. Please try again.","jetpack-my-jetpack")),Promise.resolve()):(_(null),w(!0),c.Z.tracks.recordJetpackClick({target:"license_activation_button"}),a.ZP.attachLicenses([E]).then((e=>{const t=(e=>{let t=e;for(;Array.isArray(t)&&t.length>0;)t=t[0];if(t?.activatedProductId)return t.activatedProductId;if(t?.errors)for(const e in t.errors)if(t.errors[e].length>0)throw new Error(t.errors[e][0]);throw new Error(__("An unknown error occurred during license activation. Please try again.","jetpack-my-jetpack"))})(e);N(t),s(t),c.Z.tracks.recordEvent("jetpack_wpa_license_activation_success")})).catch((e=>{c.Z.tracks.recordEvent("jetpack_wpa_license_activation_error");"invalid_permission_manage_user_licenses"===e.response?.code?_((0,r.createInterpolateElement)(__("You either do not have permissions to perform this action or a user account needs to be connected. Click here to connect your user account or contact your administrator.","jetpack-my-jetpack"),{connectLink:p().createElement("a",{href:"admin.php?page=my-jetpack#/connection?returnTo=add-license"})})):_(e.message)})).finally((()=>{w(!1)})))),[C,E,s]);return null!==Z&&E.startsWith("jetpack-golden-token")?p().createElement(g.Z,{tokenRedeemed:!0,displayName:v}):null!==Z?p().createElement("div",{className:"jp-license-activation-screen"},p().createElement(m.Z,{siteRawUrl:f,productId:Z,siteAdminUrl:i,currentRecommendationsStep:n}),p().createElement(d.Z,{imageUrl:y,showSupportLink:!1})):p().createElement("div",{className:"jp-license-activation-screen"},p().createElement(u.Z,{availableLicenses:t,activateLicense:S,fetchingAvailableLicenses:o,isActivating:C,license:E,licenseError:j,onLicenseChange:b,siteUrl:f}),p().createElement(d.Z,{imageUrl:h,showSupportLink:!0}))};f.propTypes={availableLicenses:i().array,currentRecommendationsStep:i().string,fetchingAvailableLicenses:i().bool,onActivationSuccess:i().func,siteAdminUrl:i().string.isRequired,siteRawUrl:i().string.isRequired,startingLicense:i().string,displayName:i().string};const k=f},9644:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var c=n(3396),a=n(3363),r=n(3846),o=n(8868),s=n(526),i=n(5609),l=n(5736),p=n(5235),u=n.n(p),d=n(5844),m=n.n(d),g=n(9196),h=n.n(g),y=n(1008);const __=l.__,_x=l._x;function f(e){let{redeemClick:t,displayName:n,onModalClose:p,tokenRedeemed:d}=e;const[m,f]=(0,g.useState)(!1),k=(0,g.useRef)(null);(0,g.useEffect)((()=>{setTimeout((()=>{k?.current?.play()}),500)}),[k]);const v=(0,c.VS)("scan"),E=(0,c.VS)("backup"),b=(0,g.useCallback)((e=>{t?.(e),f(!0),k.current.play()}),[k,t]),j=(0,g.useCallback)((()=>{m&&k.current.play()}),[m]),_=u()(y.Z.modal,{[y.Z.animating]:m});return h().createElement("div",null,h().createElement(i.Modal,{className:_,onRequestClose:p,isDismissible:!1,__experimentalHideHeader:!0},h().createElement(a.Z,{horizontalSpacing:3,horizontalGap:3},h().createElement(r.Z,null,h().createElement(o.Z,{className:y.Z["jetpack-logo"]}),h().createElement("div",{className:y.Z["video-wrap"],onClick:j,role:"presentation"},h().createElement("video",{ref:k,src:"https://videos.files.wordpress.com/oSlNIBQO/jetpack-golden-token.mp4",muted:"muted"})),h().createElement("div",{className:y.Z["content-wrap"]},h().createElement("div",{className:y.Z["content-wrap-text"]},n.length>0&&h().createElement("p",{className:y.Z["hi-user"]},(0,l.sprintf)(/* Translators: %s is the user's display name. */ +__("Hey, %s","jetpack-my-jetpack"),n)),h().createElement("h2",{className:y.Z.headline},__("You have been gifted a Jetpack Gold Token.","jetpack-my-jetpack")),h().createElement("p",null,d&&__("This unlocked a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience is already active.","jetpack-my-jetpack"),!d&&__("This unlocks a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience awaits.","jetpack-my-jetpack"))),h().createElement(s.Z,{variant:"primary",weight:"regular",onClick:b,className:y.Z.button},d&&__("Awesome!","jetpack-my-jetpack"),!d&&__("Redeem your token","jetpack-my-jetpack"))),h().createElement("div",{className:`${y.Z["powers-wrap"]} ${y.Z["content-wrap"]}`},h().createElement("div",{className:y.Z["content-wrap-text"]},h().createElement("h2",{className:y.Z.headline},__("Super powers are ready!","jetpack-my-jetpack")),h().createElement("p",{className:y.Z.paragraph},__("Your Jetpack Gold Token provides a lifetime license for this website and includes the following products:","jetpack-my-jetpack"))),h().createElement("div",{className:y.Z["jetpack-products"]},h().createElement("div",null,h().createElement(E,null),h().createElement("h3",null,__("VaultPress Backup","jetpack-my-jetpack")),h().createElement("p",null,__("Save every change and get back online quickly with one‑click restores.","jetpack-my-jetpack"))),h().createElement("div",null,h().createElement(v,null),h().createElement("h3",null,_x("Scan","Plugin name (noun).","jetpack-my-jetpack")),h().createElement("p",null,__("Automated scanning and one‑click fixes to keep your site ahead of security threats.","jetpack-my-jetpack")))),h().createElement(s.Z,{variant:"primary",weight:"regular",onClick:b,href:window?.myJetpackInitialState?.myJetpackUrl,className:y.Z.button},__("Explore your new powers","jetpack-my-jetpack")))))))}f.defaultProps={tokenRedeemed:!1,onModalClose:e=>{document.referrer.includes(window.location.host)?(e.preventDefault(),history.back()):(e.preventDefault(),window.location.href=window?.myJetpackInitialState?.myJetpackUrl)}},f.propTypes={redeemClick:m().func,tokenRedeemed:m().bool,displayName:m().string,onModalClose:m().func};const k=f},3281:(e,t,n)=>{"use strict";n.d(t,{H:()=>a.Z,I:()=>c.Z});var c=n(468),a=n(9644)},1899:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var c=n(4743),a=n(9105),r=n(3363),o=n(3846),s=n(1294),i=n(3281),l=n(9196),p=n.n(l),u=n(2199),d=n(4106),m=n(5626);function g(){(0,l.useEffect)((()=>{const{apiRoot:e,apiNonce:t}=window?.myJetpackRest||{};c.ZP.setApiRoot(e),c.ZP.setApiNonce(t)}),[]);const{recordEvent:e}=(0,u.Z)(),{availableLicenses:t,fetchingAvailableLicenses:n}=(0,d.Z)(),{userConnectionData:g}=(0,s.Z)(),h=g?.currentUser?.wpcomUser?.display_name||g?.currentUser?.wpcomUser?.login||g?.currentUser?.username,y=(0,l.useCallback)((t=>{e("jetpack_myjetpack_license_activation_back_link_click"),document.referrer.includes(window.location.host)&&(t.preventDefault(),history.back())}),[e]);return p().createElement(a.Z,{showHeader:!1,showBackground:!1},p().createElement(r.Z,{horizontalSpacing:3,horizontalGap:3},p().createElement(o.Z,null,p().createElement(m.Z,{onClick:y})),p().createElement(o.Z,null,p().createElement(i.I,{currentRecommendationsStep:null,availableLicenses:t,fetchingAvailableLicenses:n,onActivationSuccess:void 0,siteAdminUrl:window?.myJetpackInitialState?.adminUrl,siteRawUrl:window?.myJetpackInitialState?.siteSuffix,displayName:h}))))}},3890:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(1074),a=n(9517),r=n(5235),o=n.n(r),s=n(9196),i=n.n(s),l=n(9997),p=n(6234);const u=e=>{let{className:t}=e;return i().createElement(l.rU,{to:"/",className:o()(p.Z.link,t)},i().createElement(c.Z,{icon:a.Z,className:p.Z.icon}))}},5745:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var c=n(3396),a=n(1294),r=n(5162),o=n.n(r),s=n(9196),i=n.n(s),l=n(3345),p=n(3703),u=n(2728);const d=e=>{let{admin:t,slug:n}=e;const{isRegistered:r,isUserConnected:o}=(0,a.Z)(),{detail:d,status:m,activate:g,deactivate:h,isFetching:y}=(0,p.i)(n),{name:f,description:k,manageUrl:v,requiresUserConnection:E}=d,b=(0,l.Z)("/connection"),j=(0,l.Z)(`add-${n}`),_=(0,s.useCallback)((()=>{window.location=v}),[v]),C=(0,s.useCallback)((()=>{r&&o||!E?g():b()}),[g,r,o,E,b]),w=(0,c.VS)(n);return i().createElement(u.Z,{name:f,description:k,status:m,icon:i().createElement(w,{opacity:.4}),admin:t,isFetching:y,onDeactivate:h,slug:n,onActivate:C,onAdd:j,onManage:_,onFixConnection:b})};d.propTypes={admin:o().bool.isRequired,slug:o().string.isRequired};const m=d},9841:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_});var c=n(9105),a=n(3363),r=n(3846),o=n(6895),s=n(9312),i=n(5736),l=n(1074),p=n(5381),u=n(9196),d=n.n(u),m=n(9997),g=n(1689),h=n(3890),y=n(5242),f=n(6790),k=n(184),v=n(8578),E=n(4403);const __=i.__,b=()=>d().createElement(d().Fragment,null,d().createElement("div",{className:v.Z["account-description"]},__("You can use your existing account on any of these services:","jetpack-my-jetpack")),d().createElement("span",{className:v.Z["account-images"]},d().createElement("img",{src:E,className:v.Z.wordpress,alt:__("Wordpress Logo","jetpack-my-jetpack")}),d().createElement("img",{src:k,className:v.Z.google,alt:__("Google Logo","jetpack-my-jetpack")}),d().createElement("img",{src:y,className:v.Z.apple,alt:__("Apple Logo","jetpack-my-jetpack")}))),j=()=>{const[e]=(0,m.lr)(),t=e.get("returnTo");return t?`admin.php?page=my-jetpack#/${t}`:"admin.php?page=my-jetpack"},_=()=>{const{apiRoot:e,apiNonce:t}=(0,g.Z)(),n=j();return d().createElement(c.Z,{showHeader:!1,showBackground:!1},d().createElement(a.Z,{horizontalSpacing:8,horizontalGap:0},d().createElement(r.Z,{className:v.Z["relative-col"]},d().createElement(h.Z,{className:v.Z["close-link"]})),d().createElement(r.Z,null,d().createElement(s.Z,{title:__("Unlock all the amazing features of Jetpack by connecting now","jetpack-my-jetpack"),buttonLabel:__("Connect your user account","jetpack-my-jetpack"),apiRoot:e,apiNonce:t,images:[f],footer:d().createElement(b,null),from:"my-jetpack",redirectUri:n},d().createElement("ul",null,d().createElement("li",null,__("Receive instant downtime alerts","jetpack-my-jetpack")),d().createElement("li",null,__("Automatically share your content on social media","jetpack-my-jetpack")),d().createElement("li",null,__("Let your subscribers know when you post","jetpack-my-jetpack")),d().createElement("li",null,__("Receive notifications about new likes and comments","jetpack-my-jetpack")),d().createElement("li",null,__("Let visitors share your content on social media","jetpack-my-jetpack")),d().createElement("li",null,__("And more!","jetpack-my-jetpack")," ",d().createElement("a",{href:(0,o.Z)("jetpack-features"),target:"_blank",className:v.Z["all-features"],rel:"noreferrer"},__("See all Jetpack features","jetpack-my-jetpack"),d().createElement(l.Z,{icon:p.Z}))))))))}},247:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Z});var c=n(5106),a=n(526),r=n(6895),o=n(1294),s=n(428),i=n(8137),l=n(9818),p=n(5736),u=n(1074),d=n(496),m=n(9201),g=n(5235),h=n.n(g),y=n(5162),f=n.n(y),k=n(9196),v=n.n(k),E=n(8489),b=n(3815),j=n(9182),_=n(6322);const __=p.__,C=e=>{let{text:t,actionText:n,onClick:r,status:o}=e;return v().createElement("div",{className:_.Z["list-item"]},v().createElement(c.ZP,{className:h()(_.Z["list-item-text"],{[_.Z.error]:"error"===o})},v().createElement(u.Z,{icon:"error"===o?d.Z:m.Z,className:h()({[_.Z.info]:"error"===o})}),t),n&&v().createElement(a.Z,{variant:"link",weight:"regular",onClick:r},n))},w=e=>{const{apiRoot:t,apiNonce:n,redirectUri:u,title:d,connectionInfoText:m,onDisconnected:g,connectedPlugins:y,connectedSiteId:f,context:w,onConnectUser:Z}=e,{isRegistered:N,isUserConnected:S,userConnectionData:R}=(0,o.Z)({apiRoot:t,apiNonce:n,redirectUri:u}),[P,x]=(0,k.useState)(!1),{setConnectionStatus:A,setUserIsConnecting:L}=(0,l.useDispatch)(s.t),I=Z||L,U=R.currentUser?.wpcomUser?.avatar,T=(0,k.useCallback)((e=>{e&&e.preventDefault(),x(!0)}),[x]),O=(0,k.useCallback)((e=>{e&&e.preventDefault(),x(!1)}),[x]),F=(0,k.useCallback)((e=>{e&&e.preventDefault(),A({isActive:!1,isRegistered:!1,isUserConnected:!1}),g?.()}),[g,A]);return v().createElement("div",{className:_.Z["connection-status-card"]},v().createElement(c.H3,null,d),v().createElement(c.ZP,{variant:"body",mb:3},`${m} `,v().createElement(a.Z,{href:(0,r.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),variant:"link",weight:"regular",isExternalLink:!0},__("Learn more about connections","jetpack-my-jetpack"))),v().createElement("div",{className:_.Z.status},v().createElement("img",{src:E,alt:"",className:_.Z.cloud}),v().createElement("div",{className:h()(_.Z.line,{[_.Z.disconnected]:!N||!S})}),v().createElement("div",{className:_.Z["avatar-wrapper"]},v().createElement("img",{src:j,alt:"",className:_.Z.jetpack}),v().createElement("img",{src:S&&U?U:b,alt:"",className:_.Z.avatar}))),v().createElement("div",null,N?v().createElement(v().Fragment,null,v().createElement(C,{onClick:T,text:__("Site connected.","jetpack-my-jetpack"),actionText:S&&R.currentUser?.isMaster?__("Manage","jetpack-my-jetpack"):null}),S&&v().createElement(C,{onClick:T,actionText:__("Manage","jetpack-my-jetpack"),text:(0,p.sprintf)(/* translators: first placeholder is user name, second is either the (Owner) string or an empty string */ +__("Connected as %1$s%2$s.","jetpack-my-jetpack"),R.currentUser?.wpcomUser?.display_name,R.currentUser?.isMaster?__(" (Owner)","jetpack-my-jetpack"):"")}),S&&!R.currentUser?.isMaster&&v().createElement(C,{text:(0,p.sprintf)(/* translators: placeholder is the username of the Jetpack connection owner */ +__("Also connected: %s (Owner).","jetpack-my-jetpack"),R.connectionOwner)}),!S&&v().createElement(C,{onClick:I,text:__("You’re not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})):v().createElement(C,{onClick:I,text:__("Jetpack is not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})),v().createElement(i.Z,{apiRoot:t,apiNonce:n,onDisconnected:F,connectedPlugins:y,connectedSiteId:f,connectedUser:R,isOpen:P,onClose:O,context:w}))};w.propTypes={apiRoot:f().string.isRequired,apiNonce:f().string.isRequired,redirectUri:f().string,connectedPlugins:f().array,connectedSiteId:f().number,title:f().string,connectionInfoText:f().string,onDisconnected:f().func,context:f().string,onConnectUser:f().func,requiresUserConnection:f().bool},w.defaultProps={title:__("Connection","jetpack-my-jetpack"),connectionInfoText:__("Jetpack connects your site and user account to the WordPress.com cloud to provide more powerful features.","jetpack-my-jetpack"),redirectUri:null,onConnectUser:null,requiresUserConnection:!0};const Z=w},5784:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(9818),a=n(9196),r=n.n(a),o=n(1689),s=n(3345),i=n(7493),l=n(247);function p(){const{apiRoot:e,apiNonce:t,topJetpackMenuItemUrl:n,connectedPlugins:a}=(0,o.Z)(),p=(0,s.Z)("/connection"),u=(0,c.useSelect)((e=>e(i.t).getProductsThatRequiresUserConnection()));return r().createElement(l.Z,{apiRoot:e,apiNonce:t,redirectUri:n,onConnectUser:p,connectedPlugins:a,requiresUserConnection:u.length>0,onDisconnected:()=>document?.location?.reload(!0)})}},5626:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(5736),a=n(1074),r=n(3259),o=n(9196),s=n.n(o),i=n(9997),l=n(197);const __=c.__;function p(e){let{onClick:t}=e;return s().createElement(i.rU,{to:"/",className:l.Z.link,onClick:t},s().createElement(a.Z,{icon:r.Z,className:l.Z.icon}),__("Go back","jetpack-my-jetpack"))}p.defaultProps={onClick:()=>{}};const u=p},8607:(e,t,n)=>{"use strict";n.d(t,{r:()=>d});var c=n(526),a=n(3396),r=n(5609),o=n(9771),s=n(5736),i=n(5235),l=n.n(i),p=n(9196),u=n(4416);n(1854);const __=s.__;function d(e){let{productName:t,giftedDate:n}=e;const[i,d]=(0,p.useState)(!1),m=(0,p.useCallback)((()=>d(!0)),[d]),g={position:"top center",placement:"top",animate:!0,noArrow:!1,resize:!1,flip:!1,offset:6,focusOnMount:"container",onClose:(0,p.useCallback)((()=>d(!1)),[d]),className:u.Z.container},h=l()(u.Z.wrapper,"golden-token-icon-tooltip");return React.createElement("div",{className:h},React.createElement(c.Z,{variant:"link",onClick:m},React.createElement(a._1,{className:u.Z.logo})),React.createElement("div",{className:u.Z.helper},i&&React.createElement(r.Popover,g,React.createElement("div",null,React.createElement("div",{className:u.Z.title},t),React.createElement("div",{className:u.Z.content},(0,s.sprintf)( +// translators: %1$s is a product name, %2$s is the date the product was gifted. +__("%1$s was gifted on %2$s. It gives you access to a lifetime subscription of Jetpack VaultPress Backup and Jetpack Scan.","jetpack-my-jetpack"),t,(0,o.dateI18n)("F j, Y",n)))))))}},8966:(e,t,n)=>{"use strict";n.d(t,{Z:()=>N});var c=n(2674),a=n.n(c),r=n(2054),o=n(9105),s=n(216),i=n(3363),l=n(3846),p=n(5106),u=n(6579),d=n(4164),m=n(3329),g=n(5609),h=n(5736),y=n(496),f=n(9196),k=n.n(f),v=n(2199),E=n(5371),b=n(5031),j=n(5784),_=n(6800),C=n(5943),w=n(1017);const __=h.__,Z=e=>{let{message:t,options:n,clean:c}=e;const[o]=(0,r.Z)(["md"],[">"]),s={error:k().createElement(g.SVG,{className:w.Z.nofill,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k().createElement(g.Path,{d:"M11.7815 4.93772C11.8767 4.76626 12.1233 4.76626 12.2185 4.93772L20.519 19.8786C20.6116 20.0452 20.4911 20.25 20.3005 20.25H3.69951C3.50889 20.25 3.3884 20.0452 3.48098 19.8786L11.7815 4.93772Z",stroke:"#D63638",strokeWidth:"1.5"}),k().createElement(g.Path,{d:"M13 10H11V15H13V10Z",fill:"#D63638"}),k().createElement(g.Path,{d:"M13 16H11V18H13V16Z",fill:"#D63638"})),info:y.Z};return k().createElement(g.Notice,a()({isDismissible:!1},n,{onRemove:c,className:w.Z.notice+(o?" "+w.Z["bigger-than-medium"]:"")}),k().createElement("div",{className:w.Z.message},s?.[n.status]&&k().createElement(g.Icon,{icon:s[n.status]}),t))};function N(){(0,E.Z)();const{message:e,options:t,clean:n}=(0,b.Z)(),{hasConnectionError:c}=(0,m.Z)(),{recordEvent:a}=(0,v.Z)();return(0,f.useEffect)((()=>{a("jetpack_myjetpack_page_view")}),[a]),k().createElement(o.Z,null,k().createElement(s.Z,null,k().createElement(i.Z,{horizontalSpacing:0},k().createElement(l.Z,null,k().createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),k().createElement(i.Z,{horizontalSpacing:5,horizontalGap:e?3:6},k().createElement(l.Z,{sm:4,md:7,lg:6},k().createElement(p.ZP,{variant:"headline-small"},__("Manage your Jetpack products","jetpack-my-jetpack"))),c&&k().createElement(l.Z,null,k().createElement(m.h,null)),e&&k().createElement(l.Z,null,k().createElement(Z,{message:e,options:t,clean:n})),k().createElement(l.Z,null,k().createElement(C.Z,null)))),k().createElement(u.Z,null,k().createElement(i.Z,{horizontalSpacing:8},k().createElement(l.Z,{sm:2,md:4,lg:6},k().createElement(_.Z,null)),k().createElement(l.Z,{sm:2,md:4,lg:6},k().createElement(j.Z,null)))),k().createElement(d.Z,null))}},6800:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var c=n(5106),a=n(526),r=n(5736),o=n(9196),s=n.n(o),i=n(2199),l=n(1689),p=n(3345),u=n(1750),d=n(8295),m=n(7258),g=n(6986),h=n(8607),y=n(6891);const __=r.__,_n=r._n;function f(e){let{purchase:t={}}=e;const{product_name:n}=t;return s().createElement(s().Fragment,null,s().createElement(c.Dx,null,n),s().createElement(k,t))}function k(e){const{expiry_message:t,product_name:n,subscribed_date:a}=e;return(0,g.h)(e)?s().createElement(c.ZP,{variant:"body",className:y.Z["expire-date"]},s().createElement("span",{className:y.Z["expire-date--with-icon"]},__("Never Expires","jetpack-my-jetpack")),s().createElement(h.r,{productName:n,giftedDate:a})):s().createElement(c.ZP,{variant:"body",className:y.Z["expire-date"]},t)}function v(e){let{purchases:t}=e;return s().createElement(s().Fragment,null,s().createElement(c.H3,null,t.length<=1?__("Your plan","jetpack-my-jetpack"):__("Your plans","jetpack-my-jetpack")),0===t.length&&s().createElement(c.ZP,{variant:"body"},__("Want to power up your Jetpack?","jetpack-my-jetpack")))}function E(e){let{purchases:t}=e;const{recordEvent:n}=(0,i.Z)(),{isUserConnected:c}=(0,l.Z)();let r=__("Purchase a plan","jetpack-my-jetpack");t.length>=1&&(r=_n("Manage your plan","Manage your plans",t.length,"jetpack-my-jetpack"));const u=(0,o.useCallback)((()=>{const e=t.length?"jetpack_myjetpack_plans_manage_click":"jetpack_myjetpack_plans_purchase_click";n(e)}),[t,n]),g=(0,p.Z)("/connection"),h=(0,o.useCallback)((()=>{n("jetpack_myjetpack_activate_license_click"),c||g()}),[g,c,n]);let f=__("Activate a license","jetpack-my-jetpack");return c||(f=__("Activate a license (requires a user connection)","jetpack-my-jetpack")),s().createElement("ul",null,s().createElement("li",{className:y.Z["actions-list-item"]},s().createElement(a.Z,{onClick:u,href:t.length?(0,d.Z)():(0,m.Z)(),weight:"regular",variant:"link",isExternalLink:!0},r)),window?.myJetpackInitialState?.loadAddLicenseScreen&&s().createElement("li",{className:y.Z["actions-list-item"]},s().createElement(a.Z,{onClick:h,href:c?`${window?.myJetpackInitialState?.adminUrl}admin.php?page=my-jetpack#/add-license`:void 0,variant:"link",weight:"regular"},f)))}function b(){const{purchases:e}=(0,u.Z)();return s().createElement("div",{className:y.Z.container},s().createElement(v,{purchases:e}),s().createElement("div",{className:y.Z.purchasesSection},e.map((e=>s().createElement(f,{key:`purchase-${e.product_name}`,purchase:e})))),s().createElement(E,{purchases:e}))}},2728:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,Z:()=>E});var c=n(2674),a=n.n(c),r=n(526),o=n(5106),s=n(5736),i=n(5235),l=n.n(i),p=n(5162),u=n.n(p),d=n(9196),m=n.n(d),g=n(2199),h=n(9720);const __=s.__,y={ACTIVE:"active",INACTIVE:"inactive",ERROR:"error",ABSENT:"plugin_absent",NEEDS_PURCHASE:"needs_purchase",NEEDS_PURCHASE_OR_FREE:"needs_purchase_or_free"},f={[y.ACTIVE]:__("Active","jetpack-my-jetpack"),[y.INACTIVE]:__("Inactive","jetpack-my-jetpack"),[y.NEEDS_PURCHASE]:__("Inactive","jetpack-my-jetpack"),[y.NEEDS_PURCHASE_OR_FREE]:__("Inactive","jetpack-my-jetpack"),[y.ERROR]:__("Error","jetpack-my-jetpack")},k=e=>{let{status:t,admin:n,name:c,onActivate:o,onManage:i,onFixConnection:l,isFetching:p,className:u,onAdd:d}=e;if(!n)return m().createElement(r.Z,a()({},g,{size:"small",variant:"link",weight:"regular"}),/* translators: placeholder is product name. */ +(0,s.sprintf)(__("Learn about %s","jetpack-my-jetpack"),c));const g={variant:p?void 0:"primary",disabled:p,className:u};switch(t){case y.ABSENT:return m().createElement(r.Z,a()({},g,{size:"small",variant:"link",weight:"regular"}),/* translators: placeholder is product name. */ +(0,s.sprintf)(__("Add %s","jetpack-my-jetpack"),c));case y.NEEDS_PURCHASE:return m().createElement(r.Z,a()({},g,{size:"small",weight:"regular",onClick:d}),__("Purchase","jetpack-my-jetpack"));case y.NEEDS_PURCHASE_OR_FREE:return m().createElement(r.Z,a()({},g,{size:"small",weight:"regular",onClick:d}),__("Start for free","jetpack-my-jetpack"));case y.ACTIVE:return m().createElement(r.Z,a()({},g,{size:"small",weight:"regular",variant:"secondary",onClick:i}),__("Manage","jetpack-my-jetpack"));case y.ERROR:return m().createElement(r.Z,a()({},g,{size:"small",weight:"regular",onClick:l}),__("Fix connection","jetpack-my-jetpack"));case y.INACTIVE:return m().createElement(r.Z,a()({},g,{size:"small",weight:"regular",variant:"secondary",onClick:o}),__("Activate","jetpack-my-jetpack"));default:return null}},v=e=>{const{name:t,description:n,icon:c,status:r,onActivate:s,onAdd:i,onFixConnection:p,onManage:u,isFetching:v,slug:E}=e,b=r===y.ACTIVE,j=r===y.ERROR,_=r===y.INACTIVE,C=r===y.ABSENT,w=r===y.NEEDS_PURCHASE||r===y.NEEDS_PURCHASE_OR_FREE,Z=f[r],N=l()(h.Z.container,{[h.Z.plugin_absent]:C,[h.Z["is-purchase-required"]]:w,[h.Z["is-link"]]:C,[h.Z["has-error"]]:j}),S=l()(h.Z.status,{[h.Z.active]:b,[h.Z.inactive]:_||w,[h.Z.error]:j,[h.Z["is-fetching"]]:v}),{recordEvent:R}=(0,g.Z)(),P=(0,d.useCallback)((()=>{R("jetpack_myjetpack_product_card_activate_click",{product:E}),s()}),[E,s,R]),x=(0,d.useCallback)((e=>{e?.preventDefault&&e.preventDefault(),R("jetpack_myjetpack_product_card_add_click",{product:E}),i()}),[E,i,R]),A=(0,d.useCallback)((()=>{R("jetpack_myjetpack_product_card_manage_click",{product:E}),u()}),[E,u,R]),L=(0,d.useCallback)((()=>{R("jetpack_myjetpack_product_card_fixconnection_click",{product:E}),p()}),[E,p,R]),I=C?e=>{let{children:t,...n}=e;return m().createElement("a",a()({},n,{href:"#",onClick:x}),t)}:e=>{let{children:t,...n}=e;return m().createElement("div",n,t)};return m().createElement(I,{className:N},m().createElement("div",{className:h.Z.name},m().createElement(o.ZP,{variant:"title-medium"},t),c),m().createElement(o.ZP,{variant:"body-small",className:h.Z.description},n),m().createElement("div",{className:h.Z.actions},m().createElement(k,a()({},e,{onActivate:P,onFixConnection:L,onManage:A,className:h.Z.button})),!C&&m().createElement(o.ZP,{variant:"label",className:S},Z)))};v.propTypes={name:u().string.isRequired,description:u().string.isRequired,icon:u().element,admin:u().bool.isRequired,isFetching:u().bool,onManage:u().func,onFixConnection:u().func,onActivate:u().func,onAdd:u().func,slug:u().string.isRequired,status:u().oneOf([y.ACTIVE,y.INACTIVE,y.ERROR,y.ABSENT,y.NEEDS_PURCHASE,y.NEEDS_PURCHASE_OR_FREE]).isRequired},v.defaultProps={icon:null,isFetching:!1,onManage:()=>{},onFixConnection:()=>{},onActivate:()=>{},onAdd:()=>{}};const E=v},1640:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"anti-spam"})};i.propTypes={admin:a().bool.isRequired};const l=i},401:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"backup"})};i.propTypes={admin:a().bool.isRequired};const l=i},4074:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"boost"})};i.propTypes={admin:a().bool.isRequired};const l=i},5996:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"crm"})};i.propTypes={admin:a().bool.isRequired};const l=i},717:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"extras"})};i.propTypes={admin:a().bool.isRequired};const l=i},5943:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var c=n(3363),a=n(3846),r=n(9196),o=n.n(r),s=n(1640),i=n(401),l=n(4074),p=n(5996),u=n(717),d=n(5440),m=n(687),g=n(419),h=n(9894);const y=()=>o().createElement(c.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(i.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(d.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(s.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(l.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(m.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(h.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(p.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(g.Z,{admin:!0})),o().createElement(a.Z,{sm:4,md:4,lg:4},o().createElement(u.Z,{admin:!0})))},5440:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var c=n(9818),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o),i=n(7493),l=n(5745);const p=e=>{let{admin:t}=e;const n=(0,c.useSelect)((e=>e(i.t).hasStandalonePluginInstalled()));return s().createElement(l.Z,{admin:t,slug:n?"protect":"scan"})};p.propTypes={admin:r().bool.isRequired};const u=p},687:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"search"})};i.propTypes={admin:a().bool.isRequired};const l=i},419:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"social"})};i.propTypes={admin:a().bool.isRequired};const l=i},9894:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5162),a=n.n(c),r=n(9196),o=n.n(r),s=n(5745);const i=e=>{let{admin:t}=e;return o().createElement(s.Z,{admin:t,slug:"videopress"})};i.propTypes={admin:a().bool.isRequired};const l=i},2667:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(5609),a=n(5162),r=n.n(a),o=n(9196),s=n.n(o);const i=e=>{let{children:t,className:n,href:a,isLoading:r,onClick:o,isPrimary:i,disabled:l}=e;return s().createElement(c.Button,{onClick:o,className:n,href:a,variant:i?"primary":"secondary",disabled:r||l},r?s().createElement(c.Spinner,null):t)};i.propTypes={className:r().string,isLoading:r().bool,isPrimary:r().bool,disabled:r().bool},i.defaultProps={isLoading:!1,isPrimary:!0,disabled:!1};const l=i},968:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_});var c=n(8899),a=n(5106),r=n(3396),o=n(4972),s=n(8258),i=n(5609),l=n(5736),p=n(1074),u=n(1908),d=n(9201),m=n(5235),g=n.n(m),h=n(9196),y=n.n(h),f=n(2199),k=n(3703),v=n(2667),E=n(8429);const __=l.__;function b(e){let{value:t,currency:n,isOld:r}=e;if(!t||!n)return null;const o=(0,c.LR)(t,n),s=g()(E.Z.price,{[E.Z["is-old"]]:r});return y().createElement(a.ZP,{className:s,variant:"headline-medium",component:"p"},y().createElement(a.ZP,{component:"sup",variant:"title-medium"},o.symbol),o.integer,y().createElement(a.ZP,{component:"sup",variant:"title-medium"},o.fraction))}const j=e=>{let{slug:t,onClick:n,trackButtonClick:c,className:m,supportingInfo:j}=e;const{fileSystemWriteAccess:_,siteSuffix:C,myJetpackUrl:w}=window?.myJetpackInitialState??{},{detail:Z,isFetching:N}=(0,k.i)(t),{title:S,longDescription:R,features:P,disclaimers:x,pricingForUi:A,isBundle:L,supportedProducts:I,hasRequiredPlan:U,status:T,pluginSlug:O}=Z,F="plugin_absent"===T&&"no"===_,{isFree:D,trialAvailable:z,fullPricePerMonth:M,currencyCode:V,discountPricePerMonth:B,wpcomProductSlug:J,wpcomFreeProductSlug:H,introductoryOffer:q}=A,{recordEvent:G}=(0,f.Z)(),W=!D&&!U,{run:$,hasCheckoutStarted:K}=(0,s.Z)({productSlug:J,redirectUrl:w,siteSuffix:C,from:"my-jetpack"}),{run:Q,hasCheckoutStarted:X}=(0,s.Z)({productSlug:H,redirectUrl:w,siteSuffix:C,from:"my-jetpack"}),Y=L?I.join("_plus_").split("_").map(((e,t)=>{if("plus"===e)return y().createElement(p.Z,{className:E.Z["plus-icon"],key:`icon-plugs${t}`,icon:u.Z,size:14});const n=(0,r.VS)(e);return y().createElement(n,{key:e,size:24})})):null,ee="month"===q?.intervalUnit&&1===q?.intervalCount?(0,l.sprintf)( +// translators: %s is the monthly price for a product +__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),M):__("/month, paid yearly","jetpack-my-jetpack",0),te=(0,h.useCallback)((()=>{c(),n?.($)}),[n,c,$]),ne=(0,h.useCallback)((()=>{c(H),n?.(Q)}),[n,c,Q,H]),ce=(0,h.useCallback)((e=>{G("jetpack_myjetpack_product_card_disclaimer_click",{id:e,product:t})}),[t,G]);function ae(e){let{slug:t}=e;const n=(0,r.VS)(t);return n?y().createElement("div",{className:E.Z["product-icon"]},y().createElement(n,null)):null}return y().createElement("div",{className:g()(E.Z.card,m,{[E.Z["is-bundle-card"]]:L})},L&&y().createElement("div",{className:E.Z["card-header"]},y().createElement(r.r7,{className:E.Z["product-bundle-icon"],size:16}),y().createElement(a.ZP,{variant:"label"},__("Popular upgrade","jetpack-my-jetpack"))),y().createElement("div",{className:E.Z.container},L&&y().createElement("div",{className:E.Z["product-bundle-icons"]},Y),y().createElement(ae,{slug:t}),y().createElement(a.H3,null,S),y().createElement(a.ZP,{mb:3},R),y().createElement("ul",{className:E.Z.features},P.map(((e,t)=>y().createElement(a.ZP,{component:"li",key:`feature-${t}`,variant:"body"},y().createElement(p.Z,{icon:d.Z,size:24}),e)))),W&&y().createElement(y().Fragment,null,y().createElement("div",{className:E.Z["price-container"]},B0&&y().createElement("div",{className:E.Z.disclaimers},x.map(((e,t)=>{const{text:n,link_text:c=null,url:r=null}=e;return y().createElement(a.ZP,{key:`disclaimer-${t}`,component:"p",variant:"body-small"},`${n} `,r&&c&&y().createElement(i.ExternalLink,{onClick:()=>ce(t),href:r,target:"_blank",rel:"noopener noreferrer"},c))}))),L&&U&&y().createElement("div",{className:E.Z["product-has-required-plan"]},y().createElement(r.KM,{size:36}),y().createElement(a.ZP,null,__("Active on your site","jetpack-my-jetpack"))),j&&y().createElement(a.ZP,{className:E.Z["supporting-info"],variant:"body-extra-small"},j)))};j.defaultProps={trackButtonClick:()=>{}};const _=j},8093:(e,t,n)=>{"use strict";n.d(t,{B$:()=>S,Jw:()=>I,Q5:()=>x,WJ:()=>N,Yi:()=>R,jO:()=>P,q:()=>w,qA:()=>Z,uw:()=>L,y$:()=>A});var c=n(9105),a=n(3363),r=n(3846),o=n(5106),s=n(9818),i=n(9307),l=n(5736),p=n(9196),u=n.n(p),d=n(2199),m=n(3345),g=n(3703),h=n(7493),y=n(5626),f=n(968),k=n(5610),v=n(4763),E=n(2605),b=n(720),j=n(1287),_=n(1439);const __=l.__;function C(e){let{bundle:t,installsPlugin:n=!1,slug:l,supportingInfo:k,children:v=null}=e;const{activate:E,detail:b}=(0,g.i)(l),{isUpgradableByBundle:_}=b,{recordEvent:C}=(0,d.Z)();(0,p.useEffect)((()=>{C("jetpack_myjetpack_product_interstitial_view",{product:l})}),[C,l]);const w=(0,p.useCallback)((function(){C("jetpack_myjetpack_product_interstitial_add_link_click",{product:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)??l})}),[C,l]),Z=(0,p.useCallback)((()=>{C("jetpack_myjetpack_product_interstitial_add_link_click",{product:t})}),[C,t]),N=(0,m.Z)("/"),S=(0,p.useCallback)((e=>{(t?Promise.resolve():E()).finally((()=>{const n=(0,s.select)(h.t).getProduct(l);if(t)return void e?.();const c=n?.postActivationUrl,a=n?.hasRequiredPlan,r=n?.pricingForUi?.isFree;if(!c)return!r&&!a?void e?.():N();window.location.href=c}))}),[N,E,t,l]),R=(0,p.useCallback)((e=>{l&&C("jetpack_myjetpack_product_interstitial_back_link_click",{product:l}),document.referrer.includes(window.location.host)&&(e.preventDefault(),history.back())}),[C,l]);return u().createElement(c.Z,{showHeader:!1,showBackground:!1},u().createElement(a.Z,{horizontalSpacing:3,horizontalGap:3},u().createElement(r.Z,{className:j.Z["product-interstitial__header"]},u().createElement(y.Z,{onClick:R}),u().createElement(o.ZP,{variant:"body-small"},(0,i.createInterpolateElement)(__("Already have an existing plan or license key? Click here to get started","jetpack-my-jetpack"),{a:u().createElement("a",{className:j.Z["product-interstitial__license-activation-link"],href:"admin.php?page=my-jetpack#/add-license"})}))),u().createElement(r.Z,null,u().createElement(a.Z,{className:_?null:j.Z.container,horizontalSpacing:0,horizontalGap:0,fluid:!0},u().createElement(r.Z,{sm:4,md:4,lg:7},u().createElement(f.Z,{slug:l,trackButtonClick:w,onClick:n?S:void 0,className:_?j.Z.container:null,supportingInfo:k})),u().createElement(r.Z,{sm:4,md:4,lg:5,className:j.Z.imageContainer},t?u().createElement(f.Z,{slug:t,trackButtonClick:Z,onClick:S,className:_?j.Z.container:null}):v)))))}function w(){return u().createElement(C,{slug:"anti-spam",installsPlugin:!0,bundle:"security"})}function Z(){return u().createElement(C,{slug:"backup",installsPlugin:!0,bundle:"security"})}function N(){return u().createElement(C,{slug:"boost",installsPlugin:!0},u().createElement("img",{src:k,alt:"Boost"}))}function S(){return u().createElement(C,{slug:"crm",installsPlugin:!0},u().createElement("img",{src:v,alt:"CRM"}))}function R(){return u().createElement(C,{slug:"extras",installsPlugin:!0},u().createElement("img",{src:E,alt:"Extras"}))}function P(){return u().createElement(C,{slug:"protect",installsPlugin:!0,bundle:"security"})}function x(){return u().createElement(C,{slug:"scan",installsPlugin:!0,bundle:"security"})}function A(){return u().createElement(C,{slug:"social",installsPlugin:!0})}function L(){const{detail:e}=(0,g.i)("search");return u().createElement(C,{slug:"search",installsPlugin:!0,supportingInfo:(e?.pricingForUi?.trialAvailable?__("Jetpack Search Free supports up to 5,000 records and 500 search requests per month for free. You will be asked to upgrade to a paid plan if you exceed these limits for three continuous months.","jetpack-my-jetpack"):"")+__("For the paid plan, pricing will automatically adjust based on the number of records in your search index. If you grow into a new pricing tier, we'll let you know before your next billing cycle.","jetpack-my-jetpack")},u().createElement("img",{src:b,alt:"Search"}))}function I(){return u().createElement(C,{slug:"videopress",installsPlugin:!0},u().createElement("img",{src:_,alt:"VideoPress"}))}},673:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var c=n(1294),a=n(3281),r=n(5736),o=n(9196),s=n.n(o),i=n(1750),l=n(6986);const __=r.__;function p(){const{userConnectionData:e}=(0,c.Z)(),t=e?.currentUser?.wpcomUser?.display_name||e?.currentUser?.wpcomUser?.login||e?.currentUser?.username,{isFetchingPurchases:n,purchases:r}=(0,i.Z)(),o=(0,l.o)(r);return n?s().createElement(s().Fragment,null,__("Checking gold status…","jetpack-my-jetpack")):s().createElement(s().Fragment,null,s().createElement(a.H,{tokenRedeemed:o,displayName:t}))}},8565:(e,t,n)=>{"use strict";n.d(t,{f6:()=>a,w6:()=>c});const c="my-jetpack-my-plans-manage",a="my-jetpack-my-plans-purchase"},2199:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var c=n(6975),a=n(9196),r=n(1689);const o=()=>{const{isUserConnected:e,connectedPlugins:t,userConnectionData:n={}}=(0,r.Z)(),{login:o,ID:s}=n.currentUser?.wpcomUser||{};(0,a.useEffect)((()=>{e&&s&&o&&c.Z.initialize(s,o)}),[s,e,o]);const i=Object.keys(t||{}).sort().join(",").replaceAll("jetpack-",""),{clearedIdentity:l,ga:p,mc:u,pageView:d,purchase:m,setGoogleAnalyticsEnabled:g,setMcAnalyticsEnabled:h,setProperties:y,tracks:f}=c.Z;return{clearedIdentity:l,ga:p,mc:u,pageView:d,purchase:m,recordEvent:(0,a.useCallback)(((e,t)=>{f.recordEvent(e,{...t,version:window?.myJetpackInitialState?.myJetpackVersion,referring_plugins:i})}),[]),setGoogleAnalyticsEnabled:g,setMcAnalyticsEnabled:h,setProperties:y,tracks:f}}},4106:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9818),a=n(7493);function r(){return{availableLicenses:(0,c.useSelect)((e=>e(a.t).getAvailableLicenses())),fetchingAvailableLicenses:(0,c.useSelect)((e=>e(a.t).isFetchingAvailableLicenses()))}}},5371:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(9818),a=n(5736),r=n(9196),o=n(7493),s=n(1689),i=n(3345);const __=a.__;function l(){const e=(0,i.Z)("/connection"),{setGlobalNotice:t}=(0,c.useDispatch)(o.t),n=(0,c.useSelect)((e=>e(o.t).getProductsThatRequiresUserConnection())),{isSiteConnected:l,hasConnectedOwner:p}=(0,s.Z)(),u=!p&&n.length>0,d=(0,a.sprintf)(/* translators: placeholder is product name. */ +__("Jetpack %s needs a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),n[0]),m=n.length>1?__("Some products need a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"):d,g=__("Some products need a connection to WordPress.com to be able to work.","jetpack-my-jetpack");(0,r.useEffect)((()=>{l?u&&t(m,{status:"error",actions:[{label:__("Connect your user account to fix this","jetpack-my-jetpack"),onClick:e,noDefaultClasses:!0}]}):t(g,{status:"warning",actions:[{label:__("Connect your site to fix this","jetpack-my-jetpack"),onClick:e,variant:"link",noDefaultClasses:!0}]})}),[l,g,m,u,e,t])}},1689:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var c=n(1294);function a(){const{apiRoot:e,apiNonce:t}=myJetpackRest,{topJetpackMenuItemUrl:n}=myJetpackInitialState,a=(0,c.Z)({apiRoot:e,apiNonce:t}),r=a.isRegistered;return{apiNonce:t,apiRoot:e,...a,isSiteConnected:r,topJetpackMenuItemUrl:n}}},3345:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9196),a=n(6417);function r(e){const t=(0,a.s0)();return(0,c.useCallback)((()=>t(e)),[t,e])}},5031:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9818),a=n(7493);function r(){const e=(0,c.useDispatch)(),{message:t,options:n}=(0,c.useSelect)((e=>e(a.t).getGlobalNotice()));return{message:t,options:n||{},clean:()=>e(a.t).cleanGlobalNotice()}}},3703:(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var c=n(9818),a=n(7493);function r(e){const{activateProduct:t,deactivateProduct:n}=(0,c.useDispatch)(a.t),r=(0,c.useSelect)((t=>t(a.t).getProduct(e)));return{activate:()=>t(e),deactivate:()=>n(e),productsList:(0,c.useSelect)((e=>e(a.t).getProducts())),detail:r,isActive:"active"===r.status,isFetching:(0,c.useSelect)((t=>t(a.t).isFetching(e))),status:r.status}}},1750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9818),a=n(7493);function r(){const{purchases:e,isFetchingPurchases:t}=(0,c.useSelect)((e=>{const{getPurchases:t,isRequestingPurchases:n}=e(a.t);return{purchases:t(),isFetchingPurchases:n()}}));return{purchases:e,isFetchingPurchases:t}}},9274:(e,t,n)=>{"use strict";n.d(t,{GH:()=>u,Np:()=>d,RT:()=>i,ZP:()=>C,d1:()=>f,dE:()=>h,dI:()=>g,dq:()=>y,fE:()=>k,ny:()=>l,vv:()=>m,z8:()=>p});var c=n(428),a=n(6989),r=n.n(a),o=n(5736),s=n(2086);const __=o.__,i="SET_PURCHASES_IS_FETCHING",l="FETCH_PURCHASES",p="SET_PURCHASES",u="SET_AVAILABLE_LICENSES_IS_FETCHING",d="SET_AVAILABLE_LICENSES",m="SET_IS_FETCHING_PRODUCT",g="SET_PRODUCT",h="SET_PRODUCT_REQUEST_ERROR",y="SET_PRODUCT_STATUS",f="SET_GLOBAL_NOTICE",k="CLEAN_GLOBAL_NOTICE",v=e=>({type:g,product:e}),E=(e,t)=>({type:h,productId:e,error:t}),b=(e,t)=>({type:"SET_GLOBAL_NOTICE",message:e,options:t});function j(e,t){return{type:m,productId:e,isFetching:t}}const _={setProduct:v,activateProduct:e=>async t=>await function(e,t,n){let{select:a,dispatch:i,registry:l}=n;return new Promise(((n,p)=>{if(!a.isValidProduct(e)){const t=__("Invalid product name","jetpack-my-jetpack"),n=new Error(t);return i(E(e,n)),i(b(t,{status:"error",isDismissible:!0})),void p(n)}const u=t.activate?"POST":"DELETE";return i(j(e,!0)),r()({path:`${s.Jk}/${e}`,method:u}).then((t=>{i(j(e,!1)),i(v(t)),l.dispatch(c.t).refreshConnectedPlugins(),n(t?.status)})).catch((t=>{const{name:n}=a.getProduct(e),c=(0,o.sprintf)( +// translators: %$1s: Jetpack Product name +__("Failed to activate %1$s. Please try again","jetpack-my-jetpack"),n);i(j(e,!1)),i(E(e,t)),i(b(c,{status:"error",isDismissible:!0})),p(t)}))}))}(e,{activate:!0},t),setIsFetchingProduct:j,setRequestProductError:E,setProductStatus:(e,t)=>({type:y,productId:e,status:t})},C={setPurchasesIsFetching:e=>({type:i,isFetching:e}),fetchPurchases:()=>({type:l}),setPurchases:e=>({type:p,purchases:e}),setAvailableLicensesIsFetching:e=>({type:u,isFetching:e}),fetchAvailableLicenses:()=>({type:"FETCH_AVAILABLE_LICENSES"}),setAvailableLicenses:e=>({type:d,availableLicenses:e}),...{setGlobalNotice:b,cleanGlobalNotice:()=>({type:"CLEAN_GLOBAL_NOTICE"})},..._}},2086:(e,t,n)=>{"use strict";n.d(t,{Jk:()=>r,LQ:()=>a,iB:()=>o});const c="my-jetpack/v1",a=`${c}/site/purchases`,r=`${c}/site/products`,o=["scan"]},9462:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var c=n(6989),a=n.n(c),r=n(9274),o=n(2086);const s={[r.ny]:function(){return new Promise(((e,t)=>{a()({path:o.LQ}).then(e).catch(t)}))}}},925:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(9818),a=n(9274);const r=(0,c.combineReducers)({products:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.vv:{const{productId:n,isFetching:c}=t;return{...e,isFetching:{...e.isFetching,[n]:c},errors:{...e.errors,[n]:c?void 0:e.errors[n]}}}case a.dq:{const{productId:n,status:c}=t;return{...e,items:{...e.items,[n]:{...e.items[n],status:c}}}}case a.dI:{const{product:n}=t,{slug:c}=n;return{...e,items:{...e.items,[c]:n}}}case a.dE:{const{productId:n,error:c}=t;return{...e,errors:{...e.errors,[n]:c}}}default:return e}},purchases:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.RT:return{...e,isFetching:t.isFetching};case a.z8:return{...e,items:t?.purchases||[]};default:return e}},availableLicenses:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.GH:return{...e,isFetching:t.isFetching};case a.Np:return{...e,items:t?.availableLicenses||[]};default:return e}},notices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{global:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.d1:{const{message:n,options:c}=t;return{...e,global:{message:n,options:c}}}case a.fE:return{...e,global:{}};default:return e}},plugins:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}})},9844:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var c=n(4743),a=n(6989),r=n.n(a),o=n(5736),s=n(2086);const __=o.__,i={...{getProduct:{isFulfilled:(e,t)=>(e?.products?.items||{}).hasOwnProperty(t)&&!s.iB.includes(t),fulfill:e=>async t=>{let{dispatch:n}=t;try{n.setIsFetchingProduct(e,!0);const t=await r()({path:`${s.Jk}/${e}`});return n.setProduct(t),n.setIsFetchingProduct(e,!1),Promise.resolve()}catch(t){if(n.setIsFetchingProduct(e,!1),t?.code&&t?.message)return n.setRequestProductError(e,t),Promise.reject(t);throw new Error(t)}}},getPurchases:()=>async e=>{let{dispatch:t}=e;t.setPurchasesIsFetching(!0);try{t.setPurchases(await r()({path:s.LQ})),t.setPurchasesIsFetching(!1)}catch(e){t.setPurchasesIsFetching(!1),"not_connected"!==e.code&&t.setGlobalNotice(__("There was an error fetching your purchases information. Check your site connectivity and try again.","jetpack-my-jetpack"),{status:"error"})}},getAvailableLicenses:()=>async e=>{let{dispatch:t}=e;t.setAvailableLicensesIsFetching(!0);try{const{apiRoot:e,apiNonce:n}=window?.myJetpackRest||{};c.ZP.setApiRoot(e),c.ZP.setApiNonce(n);const a=await c.ZP.getUserLicenses();a&&a.items?t.setAvailableLicenses(a.items.filter((e=>{let{attached_at:t}=e;return null===t}))):t.setAvailableLicenses([])}catch(e){t.setAvailableLicenses([])}finally{t.setAvailableLicensesIsFetching(!1)}}}}},6896:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>s});var c=n(2728),a=n(6782);const r=e=>e.products?.items||{},o=e=>Object.keys(r(e)),s={...{getProducts:r,getProductNames:o,getProduct:(e,t)=>{const n=r(e)?.[t]||{},c=(0,a.N)(n,!0);return c.pricingForUi=(0,a.N)(c.pricingForUi||{},!0),c.pricingForUi.introductoryOffer=c.pricingForUi.isIntroductoryOffer?(0,a.N)(c.pricingForUi.introductoryOffer,!0):null,c.features=c.features||[],c.supportedProducts=c.supportedProducts||[],c.pricingForUi.fullPricePerMonth=Math.ceil(c.pricingForUi.fullPrice/12*100)/100,c.pricingForUi.discountPricePerMonth=Math.ceil(c.pricingForUi.discountPrice/12*100)/100,c},isValidProduct:(e,t)=>o(e).includes(t),isFetching:(e,t)=>e.products?.isFetching?.[t]||!1,getProductsThatRequiresUserConnection:e=>{const t=r(e);return Object.keys(t).reduce(((e,n)=>{const a=t[n];return a?.requires_user_connection&&(a?.status===c.N.ACTIVE||a?.status===c.N.ERROR)&&e.push(a?.name),e}),[])}},getPurchases:e=>e.purchases?.items||[],isRequestingPurchases:e=>e.purchases?.isFetching||!1,getAvailableLicenses:e=>e.availableLicenses?.items||[],isFetchingAvailableLicenses:e=>e.availableLicenses?.isFetching||!1,getGlobalNotice:e=>e.notices?.global,...{hasStandalonePluginInstalled:e=>Object.values(e.plugins).filter((e=>["jetpack-backup","jetpack-boost","jetpack-protect","jetpack-search","jetpack-social","jetpack-videopress"].indexOf(e.TextDomain)>=0)).length>0}}},1214:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var c=n(17),a=n.n(c),r=n(9818);class o{static mayBeInit(e,t){null===o.store&&(o.store=(0,r.createReduxStore)(e,t),(0,r.register)(o.store))}}a()(o,"store",null);const s=o},7493:(e,t,n)=>{"use strict";n.d(t,{N:()=>p,t:()=>l});var c=n(9274),a=n(9462),r=n(925),o=n(9844),s=n(6896),i=n(1214);const l="my-jetpack";function p(){i.Z.mayBeInit(l,{__experimentalUseThunks:!0,reducer:r.Z,actions:c.ZP,selectors:s.ZP,resolvers:o.Z,controls:a.Z,initialState:window.myJetpackInitialState||{}})}},8295:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(6895),a=n(8565);function r(){const e=window?.myJetpackInitialState?.siteSuffix;return(0,c.Z)(a.w6,{site:e})}},7258:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var c=n(6895),a=n(8565);function r(){const e=window?.myJetpackInitialState?.siteSuffix;return(0,c.Z)(a.f6,{site:e})}},6986:(e,t,n)=>{"use strict";function c(e){let{partner_slug:t}=e;return!!t&&"goldenticket"===t}function a(e){return!!Array.isArray(e)&&e.filter((e=>c(e))).length>0}n.d(t,{h:()=>c,o:()=>a})},6782:(e,t,n)=>{"use strict";function c(e){return e.replace(/([-_][a-z])/gi,(e=>e.toUpperCase().replace("_","")))}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Object.assign({},e);for(const e in n)n.hasOwnProperty(e)&&-1!==e.indexOf("_")&&(n[c(e)]=n[e],t&&delete n[e]);return n}n.d(t,{N:()=>a})},2042:(e,t,n)=>{"use strict";e.exports=n.p+"images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg"},724:(e,t,n)=>{"use strict";e.exports=n.p+"images/disconnect-thanks-5873bfac56a9bd7322cd.jpg"},8702:(e,t,n)=>{"use strict";e.exports=n.p+"images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png"},1160:(e,t,n)=>{"use strict";e.exports=n.p+"images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png"},5242:(e,t,n)=>{"use strict";e.exports=n.p+"images/apple-92dacafad84e79708a74.svg"},6790:(e,t,n)=>{"use strict";e.exports=n.p+"images/connect-f27775ac15cf885713c2.png"},184:(e,t,n)=>{"use strict";e.exports=n.p+"images/google-dec2a429bf1d8e83f9ad.svg"},4403:(e,t,n)=>{"use strict";e.exports=n.p+"images/wordpress-1fc3e0ba6c52e9707900.svg"},8489:(e,t,n)=>{"use strict";e.exports=n.p+"images/cloud-81ac85ba680343200f54.svg"},3815:(e,t,n)=>{"use strict";e.exports=n.p+"images/empty-avatar-fea23feddfa99b07c2e8.svg"},9182:(e,t,n)=>{"use strict";e.exports=n.p+"images/jetpack-9de1caef5eb5c22da5d6.svg"},5610:(e,t,n)=>{"use strict";e.exports=n.p+"images/boost-a54137485af36fdffe9c.png"},4763:(e,t,n)=>{"use strict";e.exports=n.p+"images/crm-7e7684ae2c40327d8fed.png"},2605:(e,t,n)=>{"use strict";e.exports=n.p+"images/extras-26daf36507504c96d066.png"},720:(e,t,n)=>{"use strict";e.exports=n.p+"images/search-f9756bd9c926d905fe70.png"},1439:(e,t,n)=>{"use strict";e.exports=n.p+"images/videopress-9591093a9a238cc48a35.png"},4462:e=>{"use strict";if(void 0==={consumer_slug:"my_jetpack"}){var t=new Error('Cannot find module \'{"consumer_slug":"my_jetpack"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"my_jetpack"}},9196:e=>{"use strict";e.exports=window.React},6989:e=>{"use strict";e.exports=window.wp.apiFetch},5609:e=>{"use strict";e.exports=window.wp.components},4333:e=>{"use strict";e.exports=window.wp.compose},9818:e=>{"use strict";e.exports=window.wp.data},9771:e=>{"use strict";e.exports=window.wp.date},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},444:e=>{"use strict";e.exports=window.wp.primitives},6483:e=>{"use strict";e.exports=window.wp.url},17:(e,t,n)=>{var c=n(6930);e.exports=function(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},2674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var c=n(3522).default;e.exports=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!==c(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6930:(e,t,n)=>{var c=n(3522).default,a=n(5061);e.exports=function(e){var t=a(e,"string");return"symbol"===c(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},3522:e=>{function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},8288:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var c=n(9307),a=n(5736),r=n(5844),o=n(9196),s=n(9430);const __=a.__,i=e=>{const{productId:t,siteRawUrl:n}=e,a=`https://cloud.jetpack.com/landing/${n}`,r=(0,s.F)(t),i={jetpack_anti_spam:{title:__("Jetpack Anti-spam is active!","jetpack-my-jetpack"),text:__("We'll take care of everything from here. Now you can enjoy a spam-free site!","jetpack-my-jetpack")},jetpack_backup:{title:__("Jetpack Backup is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:o.createElement("a",{href:a})})},jetpack_complete:{title:__("Jetpack Complete is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups, security scans, and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:o.createElement("a",{href:a})})},jetpack_scan:{title:__("Jetpack Scan is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your security scans on cloud.jetpack.com.","jetpack-my-jetpack"),{a:o.createElement("a",{href:a})})},jetpack_search:{title:__("Jetpack Search is active!","jetpack-my-jetpack"),text:__("Next, we'll help you customize the Search experience for your visitors.","jetpack-my-jetpack")},jetpack_security:{title:__("Jetpack Security is active!","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You can see your backups, security scans, and restore your site on cloud.jetpack.com. If you ever lose access to your site, you can restore it there.","jetpack-my-jetpack"),{a:o.createElement("a",{href:a})})},jetpack_videopress:{title:__("Jetpack VideoPress is active!","jetpack-my-jetpack"),text:__("Experience high-quality, ad-free video built specifically for WordPress.","jetpack-my-jetpack")},default:{title:__("Your product is active!","jetpack-my-jetpack"),text:__("You're all set!","jetpack-my-jetpack")}};return o.createElement("div",{className:"jp-license-activation-screen-success-info--product-details"},o.createElement("h1",null,i[r].title," ",String.fromCodePoint(127881)),o.createElement("p",null,i[r].text))};i.propTypes={dashboardUrl:r.string,productId:r.number};const l=i},9430:(e,t,n)=>{"use strict";n.d(t,{F:()=>a});const c={jetpack_anti_spam:[2110,2111],jetpack_backup:[2100,2101,2102,2103,2112,2113,2114,2115],jetpack_complete:[2014,2015],jetpack_scan:[2106,2107,2108,2109],jetpack_search:[2104,2105],jetpack_security:[2010,2011,2012,2013,2016,2017,2019,2020],jetpack_videopress:[2116,2117]};function a(e){return Object.keys(c).find((t=>c[t].includes(e)))||"default"}}},t={};function n(c){var a=t[c];if(void 0!==a)return a.exports;var r=t[c]={exports:{}};return e[c](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var c in t)n.o(t,c)&&!n.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:t[c]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var c=t.getElementsByTagName("script");c.length&&(e=c[c.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";var e=n(8275),t=n(9307),c=n(9196),a=n.n(c),r=n(6417),o=n(9997),s=n(1899),i=n(9841),l=n(8966),p=n(8093),u=n(673),d=n(7493);n(5878);function m(){const e=(0,r.TH)();return(0,c.useEffect)((()=>window.scrollTo(0,0)),[e]),null}(0,d.N)();const g=()=>a().createElement(e.ZP,null,a().createElement(o.UT,null,a().createElement(m,null),a().createElement(r.Z5,null,a().createElement(r.AW,{path:"/",element:a().createElement(l.Z,null)}),a().createElement(r.AW,{path:"/connection",element:a().createElement(i.Z,null)}),a().createElement(r.AW,{path:"/add-anti-spam",element:a().createElement(p.q,null)}),a().createElement(r.AW,{path:"/add-backup",element:a().createElement(p.qA,null)}),a().createElement(r.AW,{path:"/add-boost",element:a().createElement(p.WJ,null)}),a().createElement(r.AW,{path:"/add-crm",element:a().createElement(p.B$,null)}),a().createElement(r.AW,{path:"/add-extras",element:a().createElement(p.Yi,null)}),a().createElement(r.AW,{path:"/add-protect",element:a().createElement(p.jO,null)}),a().createElement(r.AW,{path:"/add-scan",element:a().createElement(p.Q5,null)}),a().createElement(r.AW,{path:"/add-social",element:a().createElement(p.y$,null)}),a().createElement(r.AW,{path:"/add-search",element:a().createElement(p.uw,null)}),a().createElement(r.AW,{path:"/add-videopress",element:a().createElement(p.Jw,null)}),window?.myJetpackInitialState?.loadAddLicenseScreen&&a().createElement(r.AW,{path:"/add-license",element:a().createElement(s.Z,null)}),a().createElement(r.AW,{path:"/redeem-token",element:a().createElement(u.Z,null)}))));!function(){const e=document.getElementById("my-jetpack-container");null!==e&&(t.createRoot?t.createRoot(e).render(a().createElement(g,null)):t.render(a().createElement(g,null),e))}()})()})(); \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt new file mode 100644 index 00000000..b954283e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js.LICENSE.txt @@ -0,0 +1,46 @@ +/* + * Exposes number format capability + * + * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors). + * @license See CREDITS.md + * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js + */ + +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ + +/** + * @remix-run/router v1.2.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router DOM v6.6.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ + +/** + * React Router v6.6.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css new file mode 100644 index 00000000..082a7994 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.rtl.css @@ -0,0 +1 @@ +#my-jetpack-container{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);height:100%}#my-jetpack-container .jetpack-logo{height:40px}#my-jetpack-container .jp-dashboard-footer__jetpack-symbol{height:16px}#wpbody-content>.notice{display:none}#wpwrap{background-color:var(--jp-white-off)}.pIsYsXFAJ9KX2VrS5rmY{--actions-size:28px;--status-size:8px;background:var(--jp-white);border-radius:var(--jp-border-radius);box-shadow:0 0 40px rgba(0,0,0,.08);box-shadow:0 0 0 1px var(--jp-gray-10) inset;display:flex;flex-direction:column;height:100%;padding:calc(var(--spacing-base)*3)}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9{background:none;background-color:var(--jp-white-off);color:var(--jp-black-80);text-decoration:none}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9:hover{background-color:var(--jp-white)}.pIsYsXFAJ9KX2VrS5rmY.YXHdD0VsFjiTsVRLrrx9:focus{background-color:var(--jp-white);box-shadow:0 0 0 1.5px var(--jp-black);outline:3px solid transparent}.pIsYsXFAJ9KX2VrS5rmY.Pp9cMIaESLYelLOX3tkI{box-shadow:0 0 0 1.5px var(--jp-red-60)}.w56ueQLYexqzTybA7015{align-items:center;display:flex;justify-content:space-between;margin-bottom:var(--spacing-base);width:100%}.gmPKCDKZcfQt9WieTyKS{flex-grow:1}.fDBaV7I4yUO6w5AWVEtr{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:calc(var(--spacing-base)*2);min-height:var(--actions-size);width:100%}.f5VJYwuJmjxH8PVxEbbv{align-items:center;display:flex;height:var(--actions-size);margin-right:var(--spacing-base);white-space:nowrap}.f5VJYwuJmjxH8PVxEbbv:before{border-radius:50%;content:"";display:inline-block;height:var(--status-size);margin-left:var(--spacing-base);width:var(--status-size)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3{color:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.ry3pxoGtmQ0ZeSwp7F_3:before{background:var(--jp-green-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr{color:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.LZzE3EG7m3CDR46wwwEr:before{background:var(--jp-gray-50)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02{color:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.Vx_jpT02r8W6NfsRSB02:before{background:var(--jp-red-60)}.f5VJYwuJmjxH8PVxEbbv.PdsJCfyyjSgrNDheF2qi:before{animation:dWP7ypkVXudMbAa38W5Z .5s linear infinite}@keyframes dWP7ypkVXudMbAa38W5Z{0%{opacity:0}50%{opacity:.5}to{opacity:0}}.zI5tJ_qhWE6Oe6Lk75GY{--wp-admin-theme-color:var(--jp-black);--wp-admin-theme-color-darker-10:var(--jp-black-80);--wp-admin-theme-color-darker-20:var(--jp-black-80);--wp-admin-border-width-focus:1.5px;border-radius:var(--jp-border-radius);font-weight:600;justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo{height:calc(var(--spacing-base)*5);padding:var(--spacing-base);width:calc(var(--spacing-base)*5)}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo>svg:first-child{margin:0;padding:0}.zI5tJ_qhWE6Oe6Lk75GY.tuBt2DLqimiImoqVzPqo.Na39I683LAaSA99REg14{height:calc(var(--spacing-base)*4);min-width:calc(var(--spacing-base)*4);padding:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*4)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body);height:auto;line-height:24px;padding:var(--spacing-base) calc(var(--spacing-base)*3)}.zI5tJ_qhWE6Oe6Lk75GY.ipS7tKy9GntCS4R3vekF:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK{padding:var(--spacing-base) calc(var(--spacing-base)*2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo){font-size:var(--font-body-extra-small);height:auto;line-height:20px;padding:calc(var(--spacing-base)/2) var(--spacing-base)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo).paGLQwtPEaJmtArCcmyK>svg:first-child{margin-left:calc(var(--spacing-base)/2)}.zI5tJ_qhWE6Oe6Lk75GY.Na39I683LAaSA99REg14:not(.tuBt2DLqimiImoqVzPqo)>.components-spinner{height:20px}.zI5tJ_qhWE6Oe6Lk75GY.lZAo6_oGfclXOO9CC6Rd{font-weight:400}.zI5tJ_qhWE6Oe6Lk75GY.xJDOiJxTt0R_wSl8Ipz_{min-width:100%}.zI5tJ_qhWE6Oe6Lk75GY.is-primary:disabled,.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:disabled{background:var(--jp-gray);color:var(--jp-gray-20)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary{background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-black)}.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:active:not(:disabled),.zI5tJ_qhWE6Oe6Lk75GY.is-secondary:hover:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-link.Na39I683LAaSA99REg14,.zI5tJ_qhWE6Oe6Lk75GY.is-link.ipS7tKy9GntCS4R3vekF{padding:0}.zI5tJ_qhWE6Oe6Lk75GY.is-link:hover:not(:disabled){text-decoration-thickness:3px}.zI5tJ_qhWE6Oe6Lk75GY.is-link:focus:not(:disabled){text-decoration-line:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:not(:disabled){background:var(--jp-red-50);box-shadow:inset 0 0 0 1px var(--jp-red-50);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:hover:not(:disabled){background:var(--jp-red-60);box-shadow:inset 0 0 0 1px var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:focus:not(:disabled){background:var(--jp-red-70);box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-white)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-primary:active:not(:disabled){background:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary{box-shadow:none}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:not(:disabled){background:var(--jp-white);box-shadow:inset 0 0 0 1.5px var(--jp-red-50);color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:hover:not(:disabled){background:var(--jp-red-0);box-shadow:inset 0 0 0 1.5px var(--jp-red-60);color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-secondary:active:not(:disabled){background:var(--jp-gray-0)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:not(:disabled){color:var(--jp-red-50)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:hover:not(:disabled){box-shadow:none;color:var(--jp-red-60)}.zI5tJ_qhWE6Oe6Lk75GY.is-destructive.is-link:focus:not(:disabled){box-shadow:inset 0 0 0 1px var(--jp-white),0 0 0 var(--wp-admin-border-width-focus) var(--jp-red-70);color:var(--jp-red-70)}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6{position:relative}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6.has-icon{justify-content:center}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>:not(.components-spinner){visibility:hidden}.zI5tJ_qhWE6Oe6Lk75GY.q_tVWqMjl39RcY6WtQA6>.components-spinner{margin:0;position:absolute}.CDuBjJp_8jxzx5j6Nept{margin-right:calc(var(--spacing-base)/2)}.WQVtrU6q0L1Igcj7wCrQ{margin:0;padding:0}.UujoBFTnQNY2cWU2SIsH{font-size:var(--font-headline-medium);font-weight:700;line-height:52px}.TeGO5V_thHw5lDAm1_2M{font-weight:700}.TeGO5V_thHw5lDAm1_2M,.WolQzb2MsSgiNmLtc7_j{font-size:var(--font-headline-small);line-height:40px}.WolQzb2MsSgiNmLtc7_j{font-weight:400}.hUB0JT8p1T2Hw28N6qC8{font-weight:500}.gKZWDv5chz3_O3Syp74H,.hUB0JT8p1T2Hw28N6qC8{font-size:var(--font-title-medium);line-height:32px}.gKZWDv5chz3_O3Syp74H{font-weight:600}.zY2No8Ga4b8shbOQGhnv{font-size:var(--font-title-small);font-weight:500;line-height:30px}.tIj0D1t8Cc892ikmgFPZ{font-size:var(--font-body);font-weight:400;line-height:24px}.KdcN0BnOaVeVhyLRKqhS{font-size:var(--font-body-small);font-weight:400;line-height:24px}.dso3Rh3tl3Xv1GumBktz{font-weight:400}.dso3Rh3tl3Xv1GumBktz,.mQ1UlbN9u4Mg9byO8m7v{font-size:var(--font-body-extra-small);line-height:20px}.mQ1UlbN9u4Mg9byO8m7v{font-weight:700}.PItlW5vRExLnTj4a8eLE{font-size:var(--font-body-extra-small);font-weight:600;line-height:16px}.TwRpPlktzxhmFVeua7P5{margin:calc(var( --spacing-base )*0)}.zVfqx7gyb3o9mxfGynn1{margin-left:calc(var( --spacing-base )*0);margin-right:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy{margin-bottom:calc(var( --spacing-base )*0)}.iSHVzNiB9iVleGljaQxy,.xqDIp6cNVr_E6RXaiPyD{margin-top:calc(var( --spacing-base )*0)}.S8EwaXk1kyPizt6x4WH2{margin-left:calc(var( --spacing-base )*0)}.ODX5Vr1TARoLFkDDFooD{margin-bottom:calc(var( --spacing-base )*0)}.cphJ8dCpfimnky7P2FHg{margin-right:calc(var( --spacing-base )*0)}.PFgIhNxIyiSuNvQjAIYj{margin:calc(var( --spacing-base )*1)}.M2jKmUzDxvJjjVEPU3zn{margin-left:calc(var( --spacing-base )*1);margin-right:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk{margin-bottom:calc(var( --spacing-base )*1)}.io15gAh8tMTNbSEfwJKk,.rcTN5uw9xIEeMEGL3Xi_{margin-top:calc(var( --spacing-base )*1)}.CQSkybjq2TcRM1Xo9COV{margin-left:calc(var( --spacing-base )*1)}.hfqOWgq6_MEGdFE82eOY{margin-bottom:calc(var( --spacing-base )*1)}.I8MxZQYTbuu595yfesWA{margin-right:calc(var( --spacing-base )*1)}.kQkc6rmdpvLKPkyoJtVQ{margin:calc(var( --spacing-base )*2)}.j6vFPxWuu4Jan2ldoxpp{margin-left:calc(var( --spacing-base )*2);margin-right:calc(var( --spacing-base )*2)}.hqr39dC4H_AbactPAkCG{margin-bottom:calc(var( --spacing-base )*2)}.c3dQnMi16C6J6Ecy4283,.hqr39dC4H_AbactPAkCG{margin-top:calc(var( --spacing-base )*2)}.YNZmHOuRo6hU7zzKfPdP{margin-left:calc(var( --spacing-base )*2)}.Db8lbak1_wunpPk8NwKU{margin-bottom:calc(var( --spacing-base )*2)}.ftsYE5J9hLzquQ0tA5dY{margin-right:calc(var( --spacing-base )*2)}.Det4MHzLUW7EeDnafPzq{margin:calc(var( --spacing-base )*3)}.h_8EEAztC29Vve1datb5{margin-left:calc(var( --spacing-base )*3);margin-right:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM{margin-bottom:calc(var( --spacing-base )*3)}.YXIXJ0h1k47u6hzK8KcM,.soADBBkcIKCBXzCTuV9_{margin-top:calc(var( --spacing-base )*3)}.zSX59ziEaEWGjnpZa4uV{margin-left:calc(var( --spacing-base )*3)}.yrVTnq_WBMbejg89c2ZQ{margin-bottom:calc(var( --spacing-base )*3)}.UKtHPJnI2cXBWtPDm5hM{margin-right:calc(var( --spacing-base )*3)}.guexok_Tqd5Tf52hRlbT{margin:calc(var( --spacing-base )*4)}.oS1E2KfTBZkJ3F0tN7T6{margin-left:calc(var( --spacing-base )*4);margin-right:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd{margin-bottom:calc(var( --spacing-base )*4)}.DN1OhhXi6AoBgEdDSbGd,.ot2kkMcYHv53hLZ4LSn0{margin-top:calc(var( --spacing-base )*4)}.A1krOZZhlQ6Sp8Cy4bly{margin-left:calc(var( --spacing-base )*4)}.pkDbXXXL32237M0hokEh{margin-bottom:calc(var( --spacing-base )*4)}.XXv4kDTGvEnQeuGKOPU3{margin-right:calc(var( --spacing-base )*4)}.yGqHk1a57gaISwkXwXe6{margin:calc(var( --spacing-base )*5)}.X8cghM358X3DkXLc9aNK{margin-left:calc(var( --spacing-base )*5);margin-right:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f{margin-bottom:calc(var( --spacing-base )*5)}.GdfSmGwHlFnN2S6xBn1f,.yqeuzwyGQ7zG0avrGqi_{margin-top:calc(var( --spacing-base )*5)}.g9emeCkuHvYhveiJbfXO{margin-left:calc(var( --spacing-base )*5)}.Lvk3dqcyHbZ07QCRlrUQ{margin-bottom:calc(var( --spacing-base )*5)}.r3yQECDQ9qX0XZzXlVAg{margin-right:calc(var( --spacing-base )*5)}.aQhlPwht2Cz1X_63Miw0{margin:calc(var( --spacing-base )*6)}.JyHb0vK3wJgpblL9s5j8{margin-left:calc(var( --spacing-base )*6);margin-right:calc(var( --spacing-base )*6)}.cY2gULL1lAv6WPNIRuf3{margin-bottom:calc(var( --spacing-base )*6)}.NBWQ9Lwhh_fnry3lg_p7,.cY2gULL1lAv6WPNIRuf3{margin-top:calc(var( --spacing-base )*6)}.yIOniNe5E40C8fWvBm5V{margin-left:calc(var( --spacing-base )*6)}.t30usboNSyqfQWIwHvT3{margin-bottom:calc(var( --spacing-base )*6)}.Nm_TyFkYCMhOoghoToKJ{margin-right:calc(var( --spacing-base )*6)}.C4qJKoBXpgKtpmrqtEKB{margin:calc(var( --spacing-base )*7)}.S93Srbu6NQ_PBr7DmTiD{margin-left:calc(var( --spacing-base )*7);margin-right:calc(var( --spacing-base )*7)}.fJj8k6gGJDks3crUZxOS{margin-bottom:calc(var( --spacing-base )*7)}.cW6D6djs7Ppm7fD7TeoV,.fJj8k6gGJDks3crUZxOS{margin-top:calc(var( --spacing-base )*7)}.DuCnqNfcxcP3Z__Yo5Ro{margin-left:calc(var( --spacing-base )*7)}.im8407m2fw5vOg7O2zsw{margin-bottom:calc(var( --spacing-base )*7)}.G0fbeBgvz2sh3uTP9gNl{margin-right:calc(var( --spacing-base )*7)}.kvW3sBCxRxUqz1jrVMJl{margin:calc(var( --spacing-base )*8)}.tOjEqjLONQdkiYx_XRnw{margin-left:calc(var( --spacing-base )*8);margin-right:calc(var( --spacing-base )*8)}.op5hFSx318zgxsoZZNLN{margin-bottom:calc(var( --spacing-base )*8)}.c9WfNHP6TFKWIfLxv52J,.op5hFSx318zgxsoZZNLN{margin-top:calc(var( --spacing-base )*8)}.sBA75QqcqRwwYSHJh2wc{margin-left:calc(var( --spacing-base )*8)}.GpL6idrXmSOM6jB8Ohsf{margin-bottom:calc(var( --spacing-base )*8)}.HbtWJoQwpgGycz8dGzeT{margin-right:calc(var( --spacing-base )*8)}.uxX3khU88VQ_Ah49Ejsa{padding:calc(var( --spacing-base )*0)}.KX0FhpBKwKzs9fOUdbNz{padding-left:calc(var( --spacing-base )*0);padding-right:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz{padding-bottom:calc(var( --spacing-base )*0)}.PfK8vKDyN32dnimlzYjz,.emxLHRjQuJsImnPbQIzE{padding-top:calc(var( --spacing-base )*0)}.kJ8WzlpTVgdViXt8ukP9{padding-left:calc(var( --spacing-base )*0)}.tg_UIUI11VBzrTAn2AzJ{padding-bottom:calc(var( --spacing-base )*0)}.uczvl8kaz84oPQJ2DB2R{padding-right:calc(var( --spacing-base )*0)}.o7UHPcdVK3lt7q3lqV4o{padding:calc(var( --spacing-base )*1)}.IDqEOxvDoYrFYxELPmtX{padding-left:calc(var( --spacing-base )*1);padding-right:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2{padding-bottom:calc(var( --spacing-base )*1)}.DdywPW2qSYlu2pt8tpO2,.npy3hw4A5QSkDicb2CJJ{padding-top:calc(var( --spacing-base )*1)}.LgbptTApNY5NwLQvEFAt{padding-left:calc(var( --spacing-base )*1)}.WZQy2SZuZso59bUsXXyl{padding-bottom:calc(var( --spacing-base )*1)}.o331apInxNunbYB3SfPE{padding-right:calc(var( --spacing-base )*1)}.fMPIyD9Vqki1Lrc_yJnG{padding:calc(var( --spacing-base )*2)}.i2pMcTcdrr10IQoiSm_L{padding-left:calc(var( --spacing-base )*2);padding-right:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH{padding-bottom:calc(var( --spacing-base )*2)}.eA702gn32kwptiI1obXH,.o9bGieUKcYc8o0Ij9oZX{padding-top:calc(var( --spacing-base )*2)}.SwZcFez1RDqWsOFjB5iG{padding-left:calc(var( --spacing-base )*2)}.eHpLc_idmuEqeqCTvqkN{padding-bottom:calc(var( --spacing-base )*2)}.vU39i2B4P1fUTMB2l6Vo{padding-right:calc(var( --spacing-base )*2)}.JHWNzBnE29awhdu5BEh1{padding:calc(var( --spacing-base )*3)}.X72lGbb56L3KFzC2xQ9N{padding-left:calc(var( --spacing-base )*3);padding-right:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e{padding-bottom:calc(var( --spacing-base )*3)}.BzfNhRG8wXdCEB5ocQ6e,.srV0KSDC83a2fiimSMMQ{padding-top:calc(var( --spacing-base )*3)}.lUWfkmbQjCskhcNwkyCm{padding-left:calc(var( --spacing-base )*3)}.Ts0dIlc3aTSL7V4cIHis{padding-bottom:calc(var( --spacing-base )*3)}.CzlqQXXhX6MvorArFZ8B{padding-right:calc(var( --spacing-base )*3)}.TqMPkQtR_DdZuKb5vBoV{padding:calc(var( --spacing-base )*4)}.a7UrjhI69Vetlcj9ZVzz{padding-left:calc(var( --spacing-base )*4);padding-right:calc(var( --spacing-base )*4)}.StEhBzGs2Gi5dDEkjhAv{padding-bottom:calc(var( --spacing-base )*4)}.FGneZfZyvYrt1dG0zcnm,.StEhBzGs2Gi5dDEkjhAv{padding-top:calc(var( --spacing-base )*4)}.APEH216rpdlJWgD2fHc8{padding-left:calc(var( --spacing-base )*4)}.oGwXC3ohCic9XnAj6x69{padding-bottom:calc(var( --spacing-base )*4)}.U6gnT9y42ViPNOcNzBwb{padding-right:calc(var( --spacing-base )*4)}.IpdRLBwnHqbqFrixgbYC{padding:calc(var( --spacing-base )*5)}.HgNeXvkBa9o3bQ5fvFZm{padding-left:calc(var( --spacing-base )*5);padding-right:calc(var( --spacing-base )*5)}.tJtFZM3XfPG9v9TSDfN1{padding-bottom:calc(var( --spacing-base )*5)}.PdifHW45QeXYfK568uD8,.tJtFZM3XfPG9v9TSDfN1{padding-top:calc(var( --spacing-base )*5)}.mbLkWTTZ0Za_BBbFZ5b2{padding-left:calc(var( --spacing-base )*5)}.vVWpZpLlWrkTt0hMk8XU{padding-bottom:calc(var( --spacing-base )*5)}.RxfaJj5a1Nt6IavEo5Zl{padding-right:calc(var( --spacing-base )*5)}.SppJULDGdnOGcjZNCYBy{padding:calc(var( --spacing-base )*6)}.palY2nLwdoyooPUm9Hhk{padding-left:calc(var( --spacing-base )*6);padding-right:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_{padding-bottom:calc(var( --spacing-base )*6)}.WYw1JvZC0ppLdvSAPhr_,.YEEJ9b90ueQaPfiU8aeN{padding-top:calc(var( --spacing-base )*6)}.QE0ssnsKvWJMqlhPbY5u{padding-left:calc(var( --spacing-base )*6)}.n8yA3jHlMRyLd5UIfoND{padding-bottom:calc(var( --spacing-base )*6)}.tXHmxYnHzbwtfxEaG51n{padding-right:calc(var( --spacing-base )*6)}.kBTsPKkO_3g_tLkj77Um{padding:calc(var( --spacing-base )*7)}.RyhrFx6Y1FGDrGAAyaxm{padding-left:calc(var( --spacing-base )*7);padding-right:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO{padding-bottom:calc(var( --spacing-base )*7)}.CBwRpB0bDN3iEdQPPMJO,.vQVSq6SvWKbOMu6r4H6b{padding-top:calc(var( --spacing-base )*7)}.oBy5__aEADMsH46mrgFX{padding-left:calc(var( --spacing-base )*7)}.KVEXoJqf1s92j0JMdNmN{padding-bottom:calc(var( --spacing-base )*7)}.ZMXGNrNaKW3k_3TLz0Fq{padding-right:calc(var( --spacing-base )*7)}.tuiR9PhkHXhGyEgzRZRI{padding:calc(var( --spacing-base )*8)}.U7454qyWkQNa2iaSJziu{padding-left:calc(var( --spacing-base )*8);padding-right:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8{padding-bottom:calc(var( --spacing-base )*8)}.VLYIv2GVocjuN93e8HC8,.X1rm9DQ1zLGLfogja5Gn{padding-top:calc(var( --spacing-base )*8)}.JS7G6kAuqJo5GIuF8S5t{padding-left:calc(var( --spacing-base )*8)}.Y8F9ga1TDCMbM1lj4gUz{padding-bottom:calc(var( --spacing-base )*8)}.AJuyNGrI63BOWql719H8{padding-right:calc(var( --spacing-base )*8)}._fUXxnSp5pagKBp9gSN7 *{box-sizing:border-box}.jErCC9oKHSM15BxzFyQK{margin-bottom:0}.oVoYbwbFB6U2o90Njusk{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);border-right:6px solid var(--jp-red-50);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.oVoYbwbFB6U2o90Njusk.is-error{background-color:var(--jp-white)}.oVoYbwbFB6U2o90Njusk .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.oVoYbwbFB6U2o90Njusk .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.oVoYbwbFB6U2o90Njusk .components-notice__dismiss{align-self:center}.oVoYbwbFB6U2o90Njusk .components-notice__action{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;height:auto;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-right:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.oVoYbwbFB6U2o90Njusk.Snc8NEmDelsbhlH4285s .components-notice__action{margin-right:0;margin-top:0;white-space:nowrap}.oVoYbwbFB6U2o90Njusk.Snc8NEmDelsbhlH4285s .components-notice__content{align-items:center;flex-direction:row}.wBVXH4OTNwLHPRpN4nsq{display:flex;flex-grow:1;margin-left:var(--spacing-base)}.wBVXH4OTNwLHPRpN4nsq>svg{fill:var(--jp-red-60);align-self:flex-start;flex-shrink:0;margin-left:calc(var(--spacing-base)*2)}.wBVXH4OTNwLHPRpN4nsq>svg.F1qvEnFfHs5nz3zFZUOV{fill:none}.urouayitSUT8zW0V3p_0{margin-bottom:0}.iXXJlk08gFDeCvsTTlNQ{border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);border-right:6px solid var(--jp-red-50);box-shadow:0 4px 8px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.06);box-sizing:border-box;color:var(--jp-gray-80);font-size:16px;line-height:22px;margin:0;padding:calc(var(--spacing-base)*2) calc(var(--spacing-base)*3) calc(var(--spacing-base)*2) calc(var(--spacing-base)*3)}.iXXJlk08gFDeCvsTTlNQ.is-error{background-color:var(--jp-white)}.iXXJlk08gFDeCvsTTlNQ .components-notice__content{align-items:flex-start;display:flex;flex-direction:column;margin:0;padding:12px 4px}.iXXJlk08gFDeCvsTTlNQ .is-link{color:var(--jp-black);font-size:16px;font-weight:600}.iXXJlk08gFDeCvsTTlNQ .components-notice__dismiss{align-self:center}.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ .MWqRqr7q6fgvLxitcWYk:visited{align-items:center;background:#000;border-radius:var(--jp-border-radius);color:var(--jp-white);cursor:pointer;font-size:16px;font-weight:600;justify-content:center;letter-spacing:-.01em;line-height:24px;margin-right:calc(var(--spacing-base)*2 + 24px);margin-top:24px;padding:8px 24px;text-decoration:none}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:active,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:hover,.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .MWqRqr7q6fgvLxitcWYk:visited{margin-right:0;margin-top:0;white-space:nowrap}.iXXJlk08gFDeCvsTTlNQ.YLcXAoc82nypTPaKSAcd .components-notice__content{align-items:center;flex-direction:row}.e6hHy8BZ7ZKPSXbIC0UG{margin-bottom:25px}.jXz8LnXNzMDdtHqkG0sZ{display:flex;flex-grow:1;margin-left:var(--spacing-base)}.jXz8LnXNzMDdtHqkG0sZ>svg{align-self:flex-start;flex-shrink:0}.jXz8LnXNzMDdtHqkG0sZ .jp-components-spinner,.jXz8LnXNzMDdtHqkG0sZ>svg{margin-left:calc(var(--spacing-base)*2)}@keyframes rotate-spinner{to{transform:rotate(-1turn)}}.jp-components-spinner{align-items:center;display:flex}.jp-components-spinner__inner,.jp-components-spinner__outer{animation:3s linear infinite;animation-name:rotate-spinner;border:.1em solid transparent;border-radius:50%;box-sizing:border-box;margin:auto}.jp-components-spinner__outer{border-top-color:#fff}.jp-components-spinner__inner{border-left-color:#fff;border-top-color:#fff;height:100%;opacity:.4;width:100%}.sexr0jUxC1jVixdKiDnC{margin-right:-20px}@media(max-width:782px){.sexr0jUxC1jVixdKiDnC{margin-right:-10px}}.sexr0jUxC1jVixdKiDnC.vKQ11sLeAM45M04P1ccj{background-color:var(--jp-white)}.SqdhUZkXCRuIpErj1B3z{--max-container-width:1128px;--vertical-gutter:24px;--horizontal-spacing:8px;column-gap:var(--vertical-gutter);display:grid;margin:0 auto;max-width:var(--max-container-width);width:100%}@media(max-width:599px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 16px}}@media(min-width:600px)and (max-width:959px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(8,minmax(0,1fr));padding:0 18px}}@media(min-width:960px){.SqdhUZkXCRuIpErj1B3z{grid-template-columns:repeat(12,minmax(0,1fr));padding:0 24px}}.SqdhUZkXCRuIpErj1B3z.OZC_9a1LhpWF9dv15Gdh{max-width:none;padding:unset}@media(max-width:599px){.RuVLl3q4lxTQa3wbhBJB{grid-column-end:span 1}.f9LZTRG4MMK42rS89afW{grid-column-start:1}.bHe_zKxjjpUwHw_MdYE1{grid-column-end:2}.QZbNrOqE2aNSn50xVhpU{grid-column-end:span 2}.ev7W3z7zVYPeHAlYqZjf{grid-column-start:2}.NJWd1m_e7lOiPYru2ZMP{grid-column-end:3}.Xc6nt1Qc1DI0Z2A3gt1r{grid-column-end:span 3}.UIcN_GXiPRoIsin8Kohg{grid-column-start:3}.GRKCyqb5LufCSCgykKFc{grid-column-end:4}.i_qTq8gqhhC3vIUepVRB{grid-column-end:span 4}.G3qaZ3Jpbvam_1XvGxgc{grid-column-start:4}.VRCNYKZtO9zukEwmgP1y{grid-column-end:5}}@media(min-width:600px)and (max-width:959px){.tRm008K_WJL79WoNZTNL{grid-column-end:span 1}.l5T2P_bgKts4tdaRkS1d{grid-column-start:1}.zOCxfLZpF6BlgC7a_Yq1{grid-column-end:2}.F80DdgVn0m5OpvtSQWka{grid-column-end:span 2}.oI1c7JYfiJtMQHbhngtU{grid-column-start:2}.pMQtA_4jh1_1lVknqEP5{grid-column-end:3}.VenqMpdgyKQVUNNQcfqd{grid-column-end:span 3}.seNYL99uoczf9V4MxBxT{grid-column-start:3}.YKfF1HFhI9KygA5l3b2J{grid-column-end:4}.yAi0Cv1xDWkoqsaUhvhR{grid-column-end:span 4}.ubhnyZOnkgxNhh6XtVWv{grid-column-start:4}.RGOPGQbWMJ9Ei5oFxS7X{grid-column-end:5}.Sz1E2aWbX483ijdi6yge{grid-column-end:span 5}.tku6_bRYrX9tMbgYGmIl{grid-column-start:5}.b5JHttOhSEcI1WBlqAjk{grid-column-end:6}.FboSx5MoKTAWbxXyYlCw{grid-column-end:span 6}.Jhs8yEEmodG30edbJvag{grid-column-start:6}.IpzbbKVqEqPcfIGkXkwt{grid-column-end:7}.mhCPwfAZ4Kmm_empzJAq{grid-column-end:span 7}.x034ilrJF7rO9UJB2rI1{grid-column-start:7}.Wt8t2e16viRrOJ1lLA5v{grid-column-end:8}.S6pIrEy9AMLKx9bgh_Ae{grid-column-end:span 8}.kEfI4tGyuWfHTlRnvIab{grid-column-start:8}.PUzX4RRsKq1dnsz3gebS{grid-column-end:9}}@media(min-width:960px){.X_pdcLJikd8LS_YAdJlB{grid-column-end:span 1}.tl936d14Huby4khYp05X{grid-column-start:1}.hnge0LnR69d3NXEtEE1t{grid-column-end:2}.fj0NUMuyZQcPNgKcjp5Z{grid-column-end:span 2}.R2ncBX7a2NigdYCcV1OX{grid-column-start:2}.t8vMSDVYno9k9itRwnXb{grid-column-end:3}.wsDuEN2GqHx6qzo8dUdk{grid-column-end:span 3}.cIEVPUweWtLBy3xaXnMx{grid-column-start:3}.fajUWBwu1m2B479j3jmz{grid-column-end:4}.YR0c7fQTgMkDdWzwSyLp{grid-column-end:span 4}.xlwp8BmplxkKNMI7gamo{grid-column-start:4}._C4O1w9DUqx1m3gPf8aA{grid-column-end:5}.Z54F1hAErckAIrKlxnXW{grid-column-end:span 5}.ezSDWkRHmKSxDJXxuiOH{grid-column-start:5}.T0ChoeAjGJjkkNrYhD4g{grid-column-end:6}.qtMoMPF6yHvGJnWHSsde{grid-column-end:span 6}.gdoywN5VPiWERfIBqkph{grid-column-start:6}.wUev_VH5uf_pwFFlbnAU{grid-column-end:7}.egIPDFJsOpownTClq9XP{grid-column-end:span 7}.yGhp9yoAW7k0kQik9AB7{grid-column-start:7}.SJ43U9mR5wUg5V2qBeQA{grid-column-end:8}.cTuyHfMwSUJxN_HdIEgd{grid-column-end:span 8}.smCr8DaIagcumdvdldiK{grid-column-start:8}.T03NHzQJvzwL6wAfIiTL{grid-column-end:9}.pMvxM3RJGjqyNdf9qg1Y{grid-column-end:span 9}.iIVpNRwEnQ_JI5gpp9EN{grid-column-start:9}.ZbQ4u4vGSX5rJOje4uGL{grid-column-end:10}.gKb5wuIDAlKGbrjK2vxy{grid-column-end:span 10}.Z7pINdImE2WJiYnZBTqm{grid-column-start:10}.ZTxp6qpvwurMdOnLLSz1{grid-column-end:11}.NnQTlbfnxPDR6cQ7rygg{grid-column-end:span 11}.O137wZd6Yl0olSA9PsXR{grid-column-start:11}.zf2OJtQ2MPz6SDoh6CB0{grid-column-end:12}.U3H6UHW6HqRt9hdzVg3O{grid-column-end:span 12}.zynnNeS_ZBTxABcVpUQH{grid-column-start:12}.vI8tltFZtFUNAy9Iag9s{grid-column-end:13}}.jp-dashboard-footer{align-items:center;color:#000;display:flex;flex-flow:row wrap;justify-content:space-between;max-width:1128px;width:100%}.jp-dashboard-footer a,.jp-dashboard-footer a:hover,.jp-dashboard-footer a:visited{color:#000;text-decoration:none}.jp-dashboard-footer__jetpack-symbol,.jp-dashboard-footer__module-name{display:inline-block;vertical-align:middle}.jp-dashboard-footer__module-name{font-size:12px;font-weight:600;margin-right:5px}.vMa4i_Dza2t5Zi_Bw9Nf{background:var(--jp-white-off)}.cuoSlhSNrqf1dozY22Xb{fill:#000}.JLquNpQVlysAamuh5lJO,.lAIiifeLMmZAPlQ9n9ZR{fill:var(--jp-green-primary)}.cbOwD8Y4tFjwimmtchQI{fill:#757575}.cbOwD8Y4tFjwimmtchQI.aHOlEBGD5EA8NKRw3xTw{fill:var(--color-facebook);border-radius:50%!important}.cbOwD8Y4tFjwimmtchQI.af4Y_zItXvLAOEoSDPSv{fill:var(--color-twitter)}.cbOwD8Y4tFjwimmtchQI.f68aqF3XSD1OBvXR1get{fill:var(--color-linkedin)}.cbOwD8Y4tFjwimmtchQI.xFI0dt3UiXRlRQdqPWkx{fill:var(--color-tumblr)}.cbOwD8Y4tFjwimmtchQI.q7JEoyymveP6kF747M43{fill:var(--color-gplus)}.cbOwD8Y4tFjwimmtchQI.DKOBOTVmTLbh26gUH_73{fill:var(--color-mastodon)}.cAbGtJDGgLubucBnz7vM{background-color:var(--jp-white)}.wiobThfXJCuhGNrbFIT6 a,.wiobThfXJCuhGNrbFIT6 a:active,.wiobThfXJCuhGNrbFIT6 a:hover{color:var(--jp-black)}.VgAxgahF9bC2M__FiIgV{display:flex;margin-bottom:calc(var(--spacing-base)*3)}.dbRwkMLqcMF67njPoAF7{margin-left:8px}.Doju0RxvvN9JS12mf489{line-height:calc(var(--spacing-base)*3);margin:0 0 var(--spacing-base) 0}.yWUvvF4WJLNDSpMgBMfm{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ka1fVHj2HOkHjhdoEFOZ{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ka1fVHj2HOkHjhdoEFOZ{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.JMOO4Y_9yhTO9lwLnRUx{grid-column-end:span 1}.PFDPAqk51qox_ChLqJwm{grid-column-end:span 2}.ault0jHVfWpShqOGooIP{grid-column-end:span 3}.GqpvdRzmzPJELtSm4FEN{grid-column-end:span 4}@media(min-width:600px){.Ym4_YneEGD_iZD6W1C2o{grid-column-end:span 1}.NbvHnnDtWw8n9BEUQ0Oy{grid-column-end:span 2}.ElMT7rhxe5ZJKO41MnhW{grid-column-end:span 3}.yKjnqjibn_wW_1tWWt5Q{grid-column-end:span 4}.Pb30lOcQFpzUX57GwflS{grid-column-end:span 5}.pC1wxc_R8y4pNILHsiiY{grid-column-end:span 6}.pChscSCnudQoWGjMFKI_{grid-column-end:span 7}.qw1H2gAgF3lDCI2Tbkmb{grid-column-end:span 8}}@media(min-width:960px){.VzcA_rrxBK3g4ozA0oD9{grid-column-end:span 1}.pNAa7O2adRZD8Slgk9iR{grid-column-end:span 2}.tlIMLlipexblj8CeOx4B{grid-column-end:span 3}.Dvt0u5l2Rr1BhBmvYAzl{grid-column-end:span 4}.BiUsgNTc0tyc7tC5jnzE{grid-column-end:span 5}.ulJXAsj7G2ROJ1g3_s28{grid-column-end:span 6}.HsoVlyVLsXYClx9Atox0{grid-column-end:span 7}.oXxjRQNNj2cfIpFBqC1W{grid-column-end:span 8}.qXgUn4Adg9xE_JnbuDio{grid-column-end:span 9}.xMpqTLiLfYFEJiRPQQQq{grid-column-end:span 10}.IiGo3Sz2FDZN7_eGElwA{grid-column-end:span 11}.Om8BNCjfgqQ_wmPQjfOY{grid-column-end:span 12}}@media(max-width:960px){.t10ZWzP7ADjJnR4tqxRS{display:none}}@media(max-width:600px){.eOUlZG8Pelh_Xj0aSoHG{display:none}}.l546LrwBEePz434NFK5Q{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.l546LrwBEePz434NFK5Q span{display:block}.l546LrwBEePz434NFK5Q span:last-of-type{font-weight:600}.l546LrwBEePz434NFK5Q:focus span:last-of-type,.l546LrwBEePz434NFK5Q:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.l546LrwBEePz434NFK5Q:focus:after,.l546LrwBEePz434NFK5Q:hover:after{transform:translateY(-50%) translateX(-8px)}.l546LrwBEePz434NFK5Q:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.Q7w4fcEcemZ2nlwaYNog{fill:var(--jp-yellow-30)!important;display:inline-block!important;width:1.1em!important}.AoNQsOaTt6gSf0H6Yasz{display:inline-block;position:relative}.v13ZwGzUnecPA7Y3URAl{height:18px;pointer-events:none;position:absolute;right:-53px;top:0;width:124px}.EeDbu9pXFWTsCzfTpv2v{pointer-events:all}.BmSvoIi3rErkcrRiOi2W{color:var(--jp-black);font-size:16px;font-weight:600;line-height:19px}.BmSvoIi3rErkcrRiOi2W:not(:last-child){margin-bottom:8px}.mojRoVuWdDJo0E6LEjJw{font-size:14px;font-weight:400;line-height:24px}.components-popover:not(.is-without-arrow):before{border-color:var(--jp-gray)}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=left] .components-popover__content{margin-left:-62px}.golden-token-icon-tooltip .components-popover:not([data-y-axis=middle])[data-x-axis=right] .components-popover__content{margin-right:-62px}.golden-token-icon-tooltip .components-popover[data-y-axis=bottom] .components-popover__content{top:2px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-6px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-4px!important}.golden-token-icon-tooltip .components-popover[data-y-axis=top] .components-popover__content{bottom:10px!important}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:3px}.golden-token-icon-tooltip .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:4px}.golden-token-icon-tooltip .components-popover__content{border:1px solid var(--jp-gray);border-radius:4px;outline:none;padding:24px;white-space:normal;width:304px}.golden-token-icon-tooltip .components-button.is-link:focus:not(:disabled){box-shadow:none}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe{align-items:center;display:flex;gap:var(--spacing-base);margin-bottom:calc(var(--spacing-base)*3)}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .VmtuLc2xRqmsO6cK8qjF{position:relative}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .MdTRfQ3eo5qZKChZlzNj{width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .PbEpL02SEH9VNAlbKCfV{width:30px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .TD4AUM9gcTVAB6JHB5ZR{border-radius:50%;margin-right:-10px;position:absolute;width:32px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .yjl73qv0VWoPP8IhGreh{border-top-style:solid;border-top:2px dashed var(--jp-black);height:0;width:67px}.kezuOHNvu9vdvlJ86Fwg .qJizORs2q_CVCj9L6XLe .rq8YRaj9OyUUXJUHiUgI{border-color:var(--jp-red)}.kezuOHNvu9vdvlJ86Fwg .YZ7FNKEm9qpvQ4ZkbAz5{transform:rotate(-180deg)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz{margin-bottom:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .oH9tzGE80LnB6Og69RFz,.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp{align-items:center;display:flex;gap:var(--spacing-base)}.kezuOHNvu9vdvlJ86Fwg .xXVEWvQllVsFGmJY8WEp.J0GIu2rNR7rXocQTyd8p{fill:var(--jp-red);color:var(--jp-red)}.jp-connection__manage-dialog{--spacing-base:8px;border-radius:3px;margin:auto;width:1200px}.jp-connection__manage-dialog__content{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:center;padding:80px;text-align:center}.jp-connection__manage-dialog__content h1{font-size:var(--font-title-large);font-weight:700;line-height:1.2;margin:0}.jp-connection__manage-dialog__large-text{font-size:1.25rem;font-weight:600;margin-bottom:calc(var(--spacing-base)*4);margin-top:calc(var(--spacing-base)*3);max-width:60%}.jp-connection__manage-dialog__actions{align-items:center;background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;box-sizing:border-box;margin:0!important;max-width:1200px!important;padding:calc(var(--spacing-base)*4) calc(var(--spacing-base)*5);position:sticky}.jp-connection__manage-dialog__link{color:var(--jp-black)}.jp-connection__manage-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__manage-dialog__link:focus{color:var(--jp-black)}.jp-connection__manage-dialog__button-wrap button{float:left}.jp-connection__manage-dialog__action-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:var(--spacing-base) auto;max-width:100%;padding:1rem 2rem;text-align:right;width:750px}.jp-connection__manage-dialog__action-card__card-headline{font-size:var(--font-body);font-weight:600;line-height:calc(var(--spacing-base)*3);text-decoration:none}.jp-connection__manage-dialog__action-card__icon{float:left}.jp-connection__manage-dialog__action-card .transfer{fill:var(--jp-black);color:var(--jp-black)}.jp-connection__manage-dialog__action-card .disconnect{fill:var(--jp-red);color:var(--jp-red)}.jp-connection__manage-dialog .components-modal__header{display:none}.jp-connection__manage-dialog .components-modal__content{margin:0;padding:0}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-small);font-weight:600;line-height:1.2;margin-top:0}.jp-connection__disconnect-dialog h2{font-size:var(--font-title-small);font-weight:400;line-height:1.2;margin:0}.jp-connection__disconnect-dialog p{font-size:var(--font-body);margin-top:0}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.25rem}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link,.jp-connection__disconnect-dialog__link{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:hover,.jp-connection__disconnect-dialog__link:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link:focus,.jp-connection__disconnect-dialog__link:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__disconnect-dialog .jp-connection__disconnect-dialog__link--bold,.jp-connection__disconnect-dialog__link--bold{font-weight:700}.jp-connection__disconnect-dialog .components-button{border-radius:4px;font-size:var(--font-body-small);height:40px}.jp-connection__disconnect-dialog .components-modal__content{display:flex;flex-direction:column;flex-grow:1;margin:0;padding:0}.jp-connection__disconnect-dialog .components-modal__content:before,.jp-connection__disconnect-dialog .components-modal__header{display:none}.jp-connection__disconnect-dialog .jp-row{align-items:center;width:calc(100% - 48px)}.jp-connection__disconnect-dialog__content{align-items:center;background:var(--jp-white-off);border-radius:4px;display:flex;flex-direction:column;flex-grow:1;justify-content:center;margin:0;padding:2rem 1rem;text-align:center}.jp-connection__disconnect-dialog__actions{background:var(--jp-white);border-top:1px solid var(--jp-gray);bottom:0;padding:2rem 0;position:sticky}.jp-connection__disconnect-dialog__actions p{margin-bottom:0}.jp-connection__disconnect-dialog__actions:before{background:linear-gradient(to bottom,transparent,var(--jp-white-off));bottom:calc(100% + 1px);content:"";display:block;height:80px;position:absolute;right:0;width:100%}.jp-connection__disconnect-dialog__btn-dismiss,.jp-connection__disconnect-dialog__btn-dismiss.components-button{background:var(--jp-black)!important;margin-left:10px}.jp-connection__disconnect-dialog__btn-disconnect{background:var(--jp-red)!important}.jp-connection__disconnect-dialog__btn-back-to-wp{background:var(--jp-black)!important}.jp-connection__disconnect-dialog__button-wrap{text-align:right}@media(min-width:960px){.jp-connection__disconnect-dialog__button-wrap{text-align:center}}.jp-connection__disconnect-dialog__error{color:var(--jp-red)}.jp-connection__disconnect-dialog__survey{margin-bottom:1.5rem;max-width:100%}.jp-connection__disconnect-dialog__step-copy{margin:0 auto;max-width:800px}.jp-connection__disconnect-dialog__step-copy--narrow{max-width:600px}@media(max-height:900px){.jp-connection__disconnect-dialog__content .jp-components__decorative-card{display:none}}@media(min-width:600px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{max-width:calc(100% - 32px);width:100%}.jp-connection__disconnect-dialog__actions,.jp-connection__disconnect-dialog__content{padding:2rem}}@media(min-width:960px){.jp-connection__disconnect-dialog,.jp-connection__disconnect-dialog.components-modal__frame{display:flex;flex-direction:column;height:900px;width:1200px}.jp-connection__disconnect-dialog h1{font-size:var(--font-title-large)}.jp-connection__disconnect-dialog p.jp-connection__disconnect-dialog__large-text,.jp-connection__disconnect-dialog__large-text{font-size:1.5rem}.jp-connection__disconnect-dialog__content{padding:80px}.jp-connection__disconnect-dialog__actions{padding:2rem 3rem}.jp-row{margin-right:0}}.jp-connection__disconnect-card{background-color:var(--jp-white);border:none;border-radius:3px;box-shadow:0 0 15px var(--jp-gray-off);margin:0 auto 1rem;max-width:100%;padding:1rem 2rem;text-align:right;width:800px}.jp-connection__disconnect-card__group{margin-bottom:1rem;max-width:100%}.jp-connection__disconnect-card__card-content{display:block;font-size:.875rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-content{align-items:center;display:flex;justify-content:space-between}}.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{flex-shrink:0;font-size:1.25rem;font-weight:600;margin-bottom:0;margin-top:0}@media only screen and (min-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline,.jp-connection__disconnect-card__card-headline{font-size:1.5rem;margin-left:1.5rem}}@media only screen and (max-width:782px){.jp-connection__disconnect-card .jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block,.jp-connection__disconnect-card__card-headline+.jp-disconnect-card__card-stat-block{margin-top:.5rem}}.jp-connection__disconnect-card__card-stat-block{align-items:baseline;display:flex;flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat-block{flex-direction:row-reverse}}.jp-connection__disconnect-card__card-description{flex-grow:1}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-description{text-align:left}}.jp-connection__disconnect-card__card-stat{font-size:1rem;font-weight:600;margin-left:.5rem}@media only screen and (min-width:782px){.jp-connection__disconnect-card__card-stat{font-size:1.5rem;margin-left:0;margin-right:1rem}}.jp-components__decorative-card{border-radius:8px;box-shadow:0 0 15px var(--jp-gray);display:flex;height:280px;margin:0 auto 3rem;max-width:100%;overflow:hidden;position:relative;width:360px}.jp-components__decorative-card__content,.jp-components__decorative-card__image{width:50%}.jp-components__decorative-card__image{background:var(--jp-gray);background-size:cover;position:relative}.jp-components__decorative-card__image:before{background-image:url('data:image/svg+xml;uf8,');content:"";display:block;height:8px;position:absolute;right:24px;top:24px;width:38px}.jp-components__decorative-card__content{background:#fff;padding:2rem}.jp-components__decorative-card__icon-container{background:var(--jp-red);border-radius:50px;height:80px;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);width:80px}.jp-components__decorative-card__icon{background-position:50%,50%;background-repeat:no-repeat;height:40px;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);width:40px}.jp-components__decorative-card__icon--unlink{background-image:url('data:image/svg+xml;uf8, ')}.jp-components__decorative-card__lines,.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{background:#e9eff5;border-radius:6px;display:block;height:12px;position:relative;width:100%}.jp-components__decorative-card__lines:after,.jp-components__decorative-card__lines:before{content:"";top:calc(100% + 16px)}.jp-components__decorative-card__lines:after{top:calc(100% + 32px);width:75%}.jp-components__decorative-card--vertical{flex-direction:column}.jp-components__decorative-card--vertical .jp-components__decorative-card__content,.jp-components__decorative-card--vertical .jp-components__decorative-card__image{height:50%;width:100%}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines{margin-left:auto;margin-right:auto;max-width:135px}.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:after,.jp-components__decorative-card--vertical .jp-components__decorative-card__lines:before{margin-left:auto;margin-right:auto}.jp-connect__disconnect-survey-card{border:2px solid transparent;border-radius:4px;box-shadow:0 0 15px var(--jp-gray-off);margin-left:auto;margin-right:auto;max-width:100%;padding:1rem;position:relative;text-align:right;width:800px}.jp-connect__disconnect-survey-card--selected{background:var(--jp-gray-off);border-color:var(--jp-black)}.jp-connect__disconnect-survey-card:after{border-left:2px solid var(--jp-black);border-top:2px solid var(--jp-black);content:"";display:block;height:5px;left:1.5rem;position:absolute;top:50%;transform:translateY(-50%) rotate(-45deg);width:5px}.jp-connect__disconnect-survey-card:hover{cursor:pointer}.jp-connect__disconnect-survey-card:focus:not(.jp-disconnect-survey-card--selected),.jp-connect__disconnect-survey-card:hover:not(.jp-disconnect-survey-card--selected){border-color:var(--jp-black-80)}.jp-connect__disconnect-survey-card__answer{align-items:center;display:flex;font-weight:700;margin:0}input.jp-connect__disconnect-survey-card__input{-webkit-appearance:none;background-color:transparent;border:none;color:var(--jp-black-80);flex-grow:1;max-width:calc(100% - 40px);padding-left:40px}.zvd4dCB_bBDiXJKKDqXm{position:relative}.ly4o9lSswAGHFXqGUEIO{left:32px;position:absolute;top:32px;z-index:1}.u64Go3kwEZ7MD9eji0H1{color:var(--jp-gray-50);font-size:13px;margin-bottom:16px;width:60%}._RT41NE3LU4R0ubcij2y{align-items:center;display:flex}.cFGWJeRiGHjAr8D7CWJW{margin-left:8px;max-width:110px}.Iz3l7a05TP6HK9S92TIL{width:16px}.lmQ0wFmnk4kKkGVjokPA{height:18px;margin-right:8px}.AoIs8wD92wKR8RpQj6Uc{align-items:center;display:inline-flex}.rV_5QyvhDnsVjCX4pb0h{--gray-90:#1e1e1e;fill:var(--gray-90);width:24px}.MO1jDNY8VPqeNS9xL8jE{align-items:center;display:flex;text-decoration:none}.jp-connection__connect-screen{--spacing-base:8px}.jp-connection__connect-screen__loading{display:none}.jp-connection__connect-screen .terms-of-service{margin-bottom:calc(var(--spacing-base)*3);margin-top:calc(var(--spacing-base)*4);max-width:360px}.jp-connection__connect-screen .terms-of-service a{text-decoration:underline}.jp-connection__connect-screen .jp-action-button{margin-top:40px}.jp-connection__connect-screen .jp-action-button--button{border-radius:4px;font-weight:600}.jp-connection__connect-screen .jp-action-button button{max-width:100%}.jp-connection__connect-screen .jp-action-button button:disabled{color:hsla(0,0%,100%,.4)}@media(max-width:782px){.jp-connection__connect-screen .jp-action-button button{max-width:none;width:100%}}.jp-connection__connect-screen__footer{margin-top:32px}.jp-connection__connect-screen-layout{background:var(--jp-white);border-radius:4px;box-shadow:0 0 40px rgba(0,0,0,.08)}.jp-connection__connect-screen-layout__loading{display:none}.jp-connection__connect-screen-layout__left,.jp-connection__connect-screen-layout__right{box-sizing:border-box}.jp-connection__connect-screen-layout__left{padding:calc(var(--spacing-base)*3)}@media(min-width:600px){.jp-connection__connect-screen-layout__left{padding:64px 96px}}.jp-connection__connect-screen-layout__left .jetpack-logo{margin-bottom:24px}.jp-connection__connect-screen-layout__left h2{color:var(--jp-black);font-size:36px;font-style:normal;font-weight:700;line-height:40px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left h3{color:var(--jp-black);font-size:24px;font-style:normal;font-weight:500;line-height:32px;margin-bottom:0;margin-top:32px}.jp-connection__connect-screen-layout__left li,.jp-connection__connect-screen-layout__left p{font-size:16px;font-style:normal;font-weight:400;line-height:24px}.jp-connection__connect-screen-layout__left p{color:#101517;margin:16px 0}.jp-connection__connect-screen-layout__left a{color:var(--jp-black);font-size:var(--font-body);font:inherit;height:auto;padding:0;text-decoration:underline}.jp-connection__connect-screen-layout__left a:hover{color:var(--jp-black);text-decoration-thickness:var(--jp-underline-thickness)}.jp-connection__connect-screen-layout__left a:focus{box-shadow:none!important;color:var(--jp-black)}.jp-connection__connect-screen-layout__left ul{list-style-type:none;padding:0}.jp-connection__connect-screen-layout__left ul li{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwFnwUInggGnggGnggHnAcAnwUFnQcAnwcGnwkFnQgGnQgFnwcGnQYFnQcFnAcGnQkDnwdhiL0pAAAAEnRSTlMAMF//f2Aw7yBQ3+9gcIBgcED+HDbkAAAAZklEQVR4Ae3LNwICARDDQC0+cv7/Y8mwV9odSfWIcf/+VegnGkIvDaGXKvTTn/Gz+Uf5xTL0K1XotS7fs5H6GHvvaO8d7c3j7rdgHne/A/PYt/cO+R42oYdN6OEQetiFHo4A//6dAXqtBEkmtWutAAAAAElFTkSuQmCC) no-repeat;background-size:24px;color:var(--jp-black);margin-bottom:9px;padding-right:30px}.jp-connection__connect-screen-layout__right{padding:64px 0}.jp-connection__connect-screen-layout__right img{max-width:100%}.jp-connection__connect-screen-layout__two-columns{display:flex;flex-wrap:wrap}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:100%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__left{flex-basis:52%}}.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{background:#f9f9f6;display:none;flex-basis:47%;flex-grow:1}@media(min-width:1080px){.jp-connection__connect-screen-layout__two-columns .jp-connection__connect-screen-layout__right{display:block}}.terms-of-service{color:var(--jp-black);font-size:var(--font-body)}.terms-of-service .terms-of-service__link{color:var(--jp-green-50)}.TcCZnGE6mad8Dvz9pCZi{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDIwYTggOCAwIDEgMCAwLTE2IDggOCAwIDAgMCAwIDE2WiIgc3Ryb2tlPSIjRDYzNjM5IiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Ik0xMyA3aC0ydjZoMlY3Wk0xMyAxNWgtMnYyaDJ2LTJaIiBmaWxsPSIjRDYzNjM5Ii8+PC9zdmc+) no-repeat 100% 0;color:var(--jp-red);line-height:25px;padding-right:25px}._mn6o2Dtm5pfFWc8_A1K{--spacing-base:8px;min-width:264px}.SWwV4Pw6OZ5vU3PqPXmr{--product-card-shadow:rgb(0 0 0/3%);background-color:var(--jp-white);border:1px solid var(--jp-gray);border-radius:var(--jp-border-radius);box-shadow:0 2px 6px var(--product-card-shadow),0 1px 2px var(--product-card-shadow)}.r7tUofa9Z3A5ziKVR1H7{align-items:center;display:flex}.r7tUofa9Z3A5ziKVR1H7 img{object-fit:cover;width:100%}.YcYvLvdvWrb1EUZoVsE8{display:flex;flex-wrap:wrap;gap:calc(var(--horizontal-spacing)*2);justify-content:space-between}.uGTTsKoIOoZdYhk6uPnl{white-space:nowrap}.hdasSNj9k3Sc5PwXK4uE{margin-left:4px;width:16px}.eWN8Hj0SBRDq1F48n_Fg{--gray-70:#3c434a;align-items:center;color:var(--gray-70);display:flex;font-size:14px;text-decoration:none}.q0T8YyQxRawhpDtvJjxI{background-color:var(--jp-white);height:100%;padding:calc(var(--spacing-base)*8);position:relative}.B7JDqI_vtKxSy5GjvqA1{display:flex;flex-direction:column;height:100%}.zj7xadmhIWeuf7ZwvVTS{align-items:center;background:var(--jp-black);border-radius:var(--jp-border-radius) var(--jp-border-radius) 0 0;color:var(--jp-white);display:flex;height:calc(var(--spacing-base)*4);padding:0 var(--spacing-base);position:absolute;right:0;top:0;width:100%}.GsioW6IsC8EMYE3U6788{fill:var(--jp-white);margin-left:var(--spacing-base)}.cfEO8udWbRGPFJzW8Jg5,.dbz07JqxOlivjKO4vBEF{align-items:center;display:flex;height:calc(var(--spacing-base)*4);margin-bottom:calc(var(--spacing-base)*4)}.zlh3zbjUe4Z8cBs7uVVe{fill:#8c8f94;height:24px;line-height:24px}.qoZuzG5EcDa231hC6t0P{align-items:center;display:flex;justify-content:center}.qoZuzG5EcDa231hC6t0P svg{margin-left:var(--spacing-base)}.Q6uUUQCPWS6_6nLxIn68{display:inline-block;min-height:42px;padding:.5em 2em;text-align:center;width:100%}.Q6uUUQCPWS6_6nLxIn68 .YU4iBCRze09ZP3iCsdcb{margin:0}.Q6uUUQCPWS6_6nLxIn68.components-button.is-primary{height:auto;white-space:normal}.Q6uUUQCPWS6_6nLxIn68.is-secondary:hover:not(:disabled){background-color:var(--jp-black);color:var(--jp-white)}.OrQG7DjDd9Ha2Xj1Mx3L{margin-top:calc(var(--spacing-base)*2)}.Q1jaYDpa2AVfJpA29wT0{flex-grow:1;margin:0;margin-bottom:calc(var(--spacing-base)*2);padding:0}.Q1jaYDpa2AVfJpA29wT0 li{align-items:flex-start;display:flex;list-style:none;margin-bottom:var(--spacing-base)}.Q1jaYDpa2AVfJpA29wT0 svg{fill:var(--jp-green-primary);flex-shrink:0;margin-left:var(--spacing-base)}.sEcLfpWjo0GF7QrxD3Lt{margin-top:calc(var(--spacing-base)*2)}.xgv3jRkeF39aEQELCwru{align-items:flex-end;color:var(--jp-text-color);display:flex;flex-wrap:wrap}.twlleZ5Ehq4bB7CvKVSW{position:relative}.twlleZ5Ehq4bB7CvKVSW:first-child{margin-left:calc(var(--spacing-base)*2)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8{color:var(--jp-gray-20)}.twlleZ5Ehq4bB7CvKVSW.Qg4rPEvXsqmod1s_31d8:after{background:var(--jp-red);border-radius:var(--jp-border-radius);content:" ";display:block;height:3px;margin-top:-2px;pointer-events:none;position:absolute;top:50%;width:100%}.ApsgxIornVy_3KnciVeJ{color:var(--jp-gray-40);margin-bottom:calc(var(--spacing-base)*3)}.NMxcZL17aEP7v81uG3zD{margin-top:calc(var(--spacing-base)*5)}.demNsMJjhi7BLY7xhjU5{align-items:center;display:flex;font-size:var(--font-body);line-height:calc(var(--spacing-base)*3);margin:calc(var(--spacing-base)*2) 0;min-height:calc(var(--spacing-base)*3)}.QiUjdjJSkqh6nH7YMG5A{align-self:flex-start;height:calc(var(--spacing-base)*3);margin-left:calc(var(--spacing-base)/2);width:calc(var(--spacing-base)*3)}.Q080AHcq29J2fc68Hhk5{color:var(--jp-red)}.Q080AHcq29J2fc68Hhk5 .hYWbIwhppukXmGnsiT9H{fill:var(--jp-red)}.JjHuxWly0HI9C60gorbq{color:var(--jp-yellow-40)}.JjHuxWly0HI9C60gorbq .hYWbIwhppukXmGnsiT9H{fill:var(--jp-yellow-40)}.Cm8ZFHi3mngl4cj9Gatx{color:var(--jp-blue-40)}.Cm8ZFHi3mngl4cj9Gatx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-blue-40)}.ytGBsU015p3LGwOPwFDx{color:var(--jp-green)}.ytGBsU015p3LGwOPwFDx .hYWbIwhppukXmGnsiT9H{fill:var(--jp-green)}.jp-license-activation-screen-controls{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-controls h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-controls p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-controls label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-controls{padding:64px}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error{max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field .components-input-control__label.components-input-control__label.components-input-control__label,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error .components-input-control__label.components-input-control__label.components-input-control__label{font-size:var(--font-body);font-weight:600}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field select.components-select-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border-radius:var(--jp-border-radius);font-size:18px;line-height:24px;margin:0;min-height:48px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field input.components-text-control__input{border:1px solid var(--jp-gray-40)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error input.components-text-control__input,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-with-error select.components-select-control__input{border:1px solid var(--jp-red)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error{align-items:flex-start;color:var(--jp-red);display:flex;flex-direction:row;max-width:500px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error svg{fill:var(--jp-red);margin-left:4px;min-width:24px}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--license-field-error span{font-size:var(--font-body)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);display:flex;font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin-top:24px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active{width:auto}}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:hover,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:focus,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active[disabled],.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:disabled,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button .jp-components-spinner,.jp-license-activation-screen-controls .jp-license-activation-screen-controls--button:active .jp-components-spinner{width:100%}.jp-license-activation-screen-illustration{align-items:center;background:var(--jp-white-off);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-illustration--wrapper{display:flex;flex:1}.jp-license-activation-screen-illustration--wrapper img{align-self:center;height:auto;max-width:100%}.jp-license-activation-screen-illustration--support-link{flex:0}.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{background-color:var(--jp-black);border-radius:4px;color:var(--jp-white);font-size:16px;font-size:var(--font-body);font-style:normal;font-weight:600;justify-content:center;line-height:24px;margin:0 0 20px 40px;min-height:48px;min-width:158px;padding:13.5px 45px;width:100%}@media screen and (min-width:480px){.components-button.jp-license-activation-screen-success-info--button,.components-button.jp-license-activation-screen-success-info--button:active,.components-button.jp-license-activation-screen-success-info--button:visited{width:auto}}.components-button.jp-license-activation-screen-success-info--button:active:hover,.components-button.jp-license-activation-screen-success-info--button:hover,.components-button.jp-license-activation-screen-success-info--button:visited:hover{background-color:var(--jp-black-80);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:focus,.components-button.jp-license-activation-screen-success-info--button:focus,.components-button.jp-license-activation-screen-success-info--button:visited:focus{background-color:var(--jp-black-80);border:1px solid var(--jp-white);color:var(--jp-white)}.components-button.jp-license-activation-screen-success-info--button:active:disabled,.components-button.jp-license-activation-screen-success-info--button:active[disabled],.components-button.jp-license-activation-screen-success-info--button:disabled,.components-button.jp-license-activation-screen-success-info--button:visited:disabled,.components-button.jp-license-activation-screen-success-info--button:visited[disabled],.components-button.jp-license-activation-screen-success-info--button[disabled]{background-color:var(--jp-gray);color:var(--jp-gray-20)}.components-button.jp-license-activation-screen-success-info--button .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:active .jp-components-spinner,.components-button.jp-license-activation-screen-success-info--button:visited .jp-components-spinner{width:100%}.jp-license-activation-screen-success-info--product-details h1{line-height:52px}.jp-license-activation-screen-success-info--product-details a{color:var(--jp-black);text-decoration:underline!important}.jp-license-activation-screen-success-info--external-link{color:var(--jp-black);font-size:16px;font-style:normal;font-weight:600;text-decoration:underline!important;white-space:nowrap}.jp-wrap{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.jp-row{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.jp-row{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.jp-row{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.sm-col-span-1{grid-column-end:span 1}.sm-col-span-2{grid-column-end:span 2}.sm-col-span-3{grid-column-end:span 3}.sm-col-span-4{grid-column-end:span 4}@media(min-width:600px){.md-col-span-1{grid-column-end:span 1}.md-col-span-2{grid-column-end:span 2}.md-col-span-3{grid-column-end:span 3}.md-col-span-4{grid-column-end:span 4}.md-col-span-5{grid-column-end:span 5}.md-col-span-6{grid-column-end:span 6}.md-col-span-7{grid-column-end:span 7}.md-col-span-8{grid-column-end:span 8}}@media(min-width:960px){.lg-col-span-1{grid-column-end:span 1}.lg-col-span-2{grid-column-end:span 2}.lg-col-span-3{grid-column-end:span 3}.lg-col-span-4{grid-column-end:span 4}.lg-col-span-5{grid-column-end:span 5}.lg-col-span-6{grid-column-end:span 6}.lg-col-span-7{grid-column-end:span 7}.lg-col-span-8{grid-column-end:span 8}.lg-col-span-9{grid-column-end:span 9}.lg-col-span-10{grid-column-end:span 10}.lg-col-span-11{grid-column-end:span 11}.lg-col-span-12{grid-column-end:span 12}}@media(max-width:960px){.md-col-span-0{display:none}}@media(max-width:600px){.sm-col-span-0{display:none}}.jp-cut{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.jp-cut,.jp-cut span{display:block}.jp-cut span:last-of-type{font-weight:600}.jp-cut:focus span:last-of-type,.jp-cut:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.jp-cut:focus:after,.jp-cut:hover:after{transform:translateY(-50%) translateX(-8px)}.jp-cut:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.jp-license-activation-screen-success-info{background:var(--jp-white);display:flex;flex-direction:column;justify-content:space-between;padding:32px}.jp-license-activation-screen-success-info h1{font-size:44px;font-weight:700;line-height:1.4;margin:.67em 0}.jp-license-activation-screen-success-info p{font-size:var(--font-body);margin:1em 0}.jp-license-activation-screen-success-info label{font-size:var(--font-body);font-weight:600}@media screen and (min-width:780px){.jp-license-activation-screen-success-info{padding:64px}}@media screen and (max-width:480px){.jp-license-activation-screen-success-info .jp-license-activation-screen-success-info--buttons{text-align:center}}:root{--font-title-large:36px;--font-title-small:24px;--font-body:16px;--font-label:12px;--jp-black:#000;--jp-black-80:#2c3338;--jp-white:#fff;--jp-white-off:#f9f9f6;--jp-gray:#dcdcde;--jp-gray-0:#f6f7f7;--jp-gray-5:#dcdcde;--jp-gray-10:#c3c4c7;--jp-gray-20:#a7aaad;--jp-gray-30:#8c8f94;--jp-gray-40:#787c82;--jp-gray-50:#646970;--jp-gray-60:#50575e;--jp-gray-70:#3c434a;--jp-gray-80:#2c3338;--jp-gray-90:#1d2327;--jp-gray-100:#101517;--jp-gray-off:#e2e2df;--jp-yellow-10:#f2cf75;--jp-red-0:#f7ebec;--jp-red-50:#d63638;--jp-red-60:#b32d2e;--jp-red-80:#8a2424;--jp-red:#d63639;--jp-pink:#c9356e;--jp-green-0:#f0f2eb;--jp-green-5:#d0e6b8;--jp-green-10:#9dd977;--jp-green-20:#64ca43;--jp-green-30:#2fb41f;--jp-green-40:#069e08;--jp-green-50:#008710;--jp-green-60:#007117;--jp-green-70:#005b18;--jp-green-80:#004515;--jp-green-90:#003010;--jp-green-100:#001c09;--jp-green:#069e08;--jp-green-primary:var(--jp-green-40);--jp-green-secondary:var(--jp-green-30);--jp-border-radius:4px;--jp-menu-border-height:1px;--jp-underline-thickness:2px;--jp-modal-padding-large:32px;--jp-modal-padding:24px;--jp-modal-padding-small:16px;--jp-modal-radius:8px;--jp-button-padding:8px;--jp-button-radius:4px;--jp-gap:16px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;min-height:100%;padding:0}.EiaNctK1_P9pPqOeiaSI{align-items:center;display:flex;flex-wrap:wrap;margin:0 auto;max-width:1128px}.ogHZg_sJCljylz3VJfsf{grid-gap:24px;display:grid;grid-template-columns:repeat(4,1fr);margin:0 16px;width:100%}@media(min-width:600px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(8,1fr);margin:0 18px}}@media(min-width:960px){.ogHZg_sJCljylz3VJfsf{grid-template-columns:repeat(12,1fr);margin:0 24px;max-width:1128px}}.zv7eGvijKRkbPVakubHw{grid-column-end:span 1}.VoJNoiya_1ck3_kXS6_C{grid-column-end:span 2}.ecv0NO526NoTNbpALA1A{grid-column-end:span 3}.OfBdkceMzeHvRbzhqDlP{grid-column-end:span 4}@media(min-width:600px){.JLb3NpEKN8pOaWd7K1bu{grid-column-end:span 1}.fsMPGqPKE4mjMIPFwl77{grid-column-end:span 2}.DIK_zdaGAQ09eKspBJ4E{grid-column-end:span 3}.shXYpxPu3WCJsR8aOHtz{grid-column-end:span 4}.s7ElrOqG_yGd5SIfwqOR{grid-column-end:span 5}.Cxml9uzGvArAL8_RDs_p{grid-column-end:span 6}.aANxBKDGx72eDqU0iUPj{grid-column-end:span 7}.XxyzuTY3mnQcl9EGZadm{grid-column-end:span 8}}@media(min-width:960px){.Sfo4WaSNIWInJ93Abd3w{grid-column-end:span 1}.tQS7SKUGrU4THhWMysbo{grid-column-end:span 2}.I94U7mpY4h16pcOksZNF{grid-column-end:span 3}.uWMb9k77kQxBdS5MTt0s{grid-column-end:span 4}.rKwEEZQxK9s_POMg5Jss{grid-column-end:span 5}.UcPXX_s06IPCkF7ZjH3D{grid-column-end:span 6}.CrQdtiCFkRbzY6K2dFvt{grid-column-end:span 7}.rEUALOmOdUBXO0Us871z{grid-column-end:span 8}.NqXa9TlcTEviVsB53hBV{grid-column-end:span 9}.OnWVeiQiwgQ9lzdGPW66{grid-column-end:span 10}.D2PkTcy7b8u2K9QXY6VQ{grid-column-end:span 11}.EcqBhzAyxo5RDc2Y6m7K{grid-column-end:span 12}}@media(max-width:960px){.gB1mWzHOM38d80lrhBRX{display:none}}@media(max-width:600px){.KNQXLP78ejczOkour3zg{display:none}}.rBVbaVWBnBRtTMrUKZxm{border:2px solid var(--jp-green-primary);border-radius:var(--jp-border-radius);display:block;margin:32px 0;padding:16px 24px 16px 64px;position:relative;text-decoration:none}.rBVbaVWBnBRtTMrUKZxm span{display:block}.rBVbaVWBnBRtTMrUKZxm span:last-of-type{font-weight:600}.rBVbaVWBnBRtTMrUKZxm:focus span:last-of-type,.rBVbaVWBnBRtTMrUKZxm:hover span:last-of-type{text-decoration:underline;text-decoration-thickness:var(--jp-underline-thickness)}.rBVbaVWBnBRtTMrUKZxm:focus:after,.rBVbaVWBnBRtTMrUKZxm:hover:after{transform:translateY(-50%) translateX(-8px)}.rBVbaVWBnBRtTMrUKZxm:after{color:var(--jp-green-primary);content:"→";font-size:24px;font-weight:600;left:24px;position:absolute;top:50%;transform:translateY(-50%);transition:transform .15s ease-out}.gfM_DIJrVbRhmKdAphIm{background:var(--jp-white);border-radius:var(--jp-modal-radius);box-shadow:0 12px 16px -.5px rgba(0,0,0,.15);height:max-content;margin:3rem auto;max-width:414px;overflow:hidden;position:relative;transition:height .25s cubic-bezier(.59,.37,.18,1.19) 0;width:90%;will-change:height}.gfM_DIJrVbRhmKdAphIm>div:first-child{padding:0}.gfM_DIJrVbRhmKdAphIm *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.gfM_DIJrVbRhmKdAphIm p{color:var(--jp-black)}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:none}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:614px;transition-delay:2.15s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh h2{margin-top:0}._j4GWTmW5psCHFYh6R0x{align-self:flex-start;margin-top:var(--jp-gap)!important;padding:8px var(--jp-modal-padding-small)!important;width:100%}.saSAjv8yulVXQDoqDJEI{font-weight:500;line-height:110%;margin-bottom:8px}.O_hcdbeMivIhBn7ApDnS{line-height:140%}@media(min-width:760px){.gfM_DIJrVbRhmKdAphIm{height:740px;max-width:1360px;position:relative;width:95%}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN{display:block;position:absolute;right:64px;top:64px;z-index:99}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path{fill:#000}.gfM_DIJrVbRhmKdAphIm .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#fff}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh{height:740px;transition-delay:0}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN clipPath,.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path{fill:#fff;transition:fill 2s ease .5s}.gfM_DIJrVbRhmKdAphIm.pnwbCuWbV0PNQr1LFpRh .zfJfONxRAw0fHjXUS7LN path.FCnyb_xCK7DhJ63p6TEd{fill:#000;transition:fill 2s ease .5s}}@keyframes OmAVpCQ270MqI4IsT9Ky{20%{transform:translateY(0) scale(1)}65%{transform:translateY(16%) scale(1.4)}to{transform:translateY(0) scale(1)}}.Qn5xayjI_jH2m1d6BEoq{border-radius:var(--jp-button-radius);display:flex;height:50%;justify-content:center;min-height:400px;overflow:hidden;position:relative;transition:height .55s cubic-bezier(.59,.37,.18,1) 0s;will-change:height}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{height:100%;transition-delay:.65s}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq video{animation:OmAVpCQ270MqI4IsT9Ky 1.5s ease-in-out forwards}.Qn5xayjI_jH2m1d6BEoq video{height:100%;object-fit:cover;position:absolute;right:0;top:0;transform:scale(1);transition:all .85s cubic-bezier(1,0,.39,1) 0s;width:100%;will-change:transform}@media(min-width:760px){@keyframes Axe8f2LgqEBZHVcsRgY5{0%{animation-timing-function:cubic-bezier(.86,0,.07,1);right:60%;top:32px}50%{animation-timing-function:cubic-bezier(.17,.84,.44,1);bottom:32px;right:32px;top:32px;width:100%}to{right:32px;width:40%}}.Qn5xayjI_jH2m1d6BEoq{border-radius:12px;bottom:32px;display:block;height:auto;left:32px;overflow:hidden;position:absolute;right:60%;top:32px;transition-delay:0;transition:width .55s ease 0s;z-index:3}.Qn5xayjI_jH2m1d6BEoq video{height:100%;object-fit:cover;position:absolute;right:0;top:0;width:100%}.pnwbCuWbV0PNQr1LFpRh .Qn5xayjI_jH2m1d6BEoq{animation-delay:.25s;animation-duration:2s;animation-fill-mode:forwards;animation-name:Axe8f2LgqEBZHVcsRgY5;height:auto}}.iBMDoShSmqpt72YfJb36{padding:var(--jp-modal-padding)}.iBMDoShSmqpt72YfJb36 h2{font-size:clamp(1.5rem,-.7353rem + 4.7059vw,3.5rem)}.iBMDoShSmqpt72YfJb36 p{font-size:clamp(1rem,.6974rem + 1.1696vw,1.75rem)}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:none;font-size:clamp(1.25rem,1.1491rem + .3899vw,1.5rem)}@media(min-width:760px){.iBMDoShSmqpt72YfJb36{bottom:15%;display:flex;flex-direction:column;gap:64px;padding:0 0 0 var(--jp-modal-padding);position:absolute;right:64px;width:55%}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC{align-items:flex-start;display:flex;flex-direction:column;gap:16px;padding:0 0 0 32px}.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC h2,.iBMDoShSmqpt72YfJb36 .l35bIyiqYJiZ6tVYvJtC p{margin:0}.iBMDoShSmqpt72YfJb36 p.eQG1KKK8jjKtQyzfv573{display:block}.iBMDoShSmqpt72YfJb36 ._j4GWTmW5psCHFYh6R0x{align-self:flex-start;padding:16px var(--jp-modal-padding-large)!important;width:auto}.pnwbCuWbV0PNQr1LFpRh .iBMDoShSmqpt72YfJb36{opacity:0;right:-20px;transition:all .55s cubic-bezier(.59,.37,.18,1) .3s}}.HQVDZ6J3x6SJNYFX5khS{background:var(--jp-white);opacity:0;position:absolute;right:0;top:100%;transition:transform .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;width:100%;will-change:transform,opacity;z-index:2}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{opacity:1;transform:translateY(-100%);transition-delay:2s}@media(min-width:760px){.HQVDZ6J3x6SJNYFX5khS{container-type:inline-size;align-items:flex-end;bottom:5%;display:flex;flex-direction:column;gap:40px;left:32px;padding:0;right:45%;transform:translateY(0);transition-delay:0;transition:none;width:auto}.HQVDZ6J3x6SJNYFX5khS h2{width:100%}.HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{margin-left:var(--jp-modal-padding-large)}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS{bottom:12%;left:32px;opacity:1;right:45%;top:unset;transform:translateY(0);transition:all .45s cubic-bezier(.59,.37,.18,1) 2s,opacity .45s linear;transition-delay:2s;width:auto}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS .l35bIyiqYJiZ6tVYvJtC{padding-right:32px}.pnwbCuWbV0PNQr1LFpRh .HQVDZ6J3x6SJNYFX5khS ._j4GWTmW5psCHFYh6R0x{align-self:flex-end}}.KdvmPIjelQIFiPQGuIYf{background:var(--jp-gray-0);display:flex;flex-direction:column;gap:var(--jp-gap)}.KdvmPIjelQIFiPQGuIYf div{background-color:var(--jp-white);border:1px solid var(--jp-gray-10);border-radius:var(--jp-button-radius);box-shadow:0 0 40px 0 rgba(0,0,0,.08);flex:1;padding:var(--jp-modal-padding)}.KdvmPIjelQIFiPQGuIYf h3{font-size:24px;line-height:normal;margin:0}.KdvmPIjelQIFiPQGuIYf p{font-size:14px}@media(min-width:760px){.KdvmPIjelQIFiPQGuIYf{flex-direction:row;padding:var(--jp-modal-padding-large)}.KdvmPIjelQIFiPQGuIYf div{border:none;box-shadow:0 2px 16px rgba(0,0,0,.08),0 2px 2px rgba(0,0,0,.1)}.KdvmPIjelQIFiPQGuIYf div p{margin:8px 0}.KdvmPIjelQIFiPQGuIYf svg{margin-bottom:var(--jp-modal-padding-small)}}@container (max-width: 600px){.KdvmPIjelQIFiPQGuIYf div{padding:var(--jp-modal-padding-small)}}.jp-license-activation-screen{border-radius:4px;box-shadow:0 4px 24px 0 #00000026;display:flex;flex-direction:column;min-height:540px;overflow:hidden}@media screen and (min-width:780px){.jp-license-activation-screen{flex-direction:row}} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json new file mode 100644 index 00000000..059c98bb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/composer.json @@ -0,0 +1,76 @@ +{ + "name": "automattic/jetpack-my-jetpack", + "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-admin-ui": "^0.2.17", + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-connection": "^1.51.4", + "automattic/jetpack-jitm": "^2.3.4", + "automattic/jetpack-licensing": "^1.8.1", + "automattic/jetpack-plugins-installer": "^0.2.3", + "automattic/jetpack-redirect": "^1.7.24", + "automattic/jetpack-constants": "^1.6.21" + }, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "automattic/jetpack-videopress": "^0.13.4-alpha" + }, + "autoload": { + "classmap": [ + "src/", + "src/products" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "test-js": [ + "pnpm run test" + ], + "test-js-watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run test --watch" + ], + "build-development": [ + "pnpm run build" + ], + "build-production": [ + "NODE_ENV=production pnpm run build" + ], + "watch": [ + "Composer\\Config::disableProcessTimeout", + "pnpm run watch" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-my-jetpack", + "textdomain": "jetpack-my-jetpack", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "2.9.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-initializer.php" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php new file mode 100644 index 00000000..2e10cc31 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php @@ -0,0 +1,314 @@ +initialize(); + } + + // Add custom WP REST API endoints. + add_action( 'rest_api_init', array( __CLASS__, 'register_rest_endpoints' ) ); + + $page_suffix = Admin_Menu::add_menu( + __( 'My Jetpack', 'jetpack-my-jetpack' ), + __( 'My Jetpack', 'jetpack-my-jetpack' ), + 'manage_options', + 'my-jetpack', + array( __CLASS__, 'admin_page' ), + 999 + ); + + add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) ); + + // Sets up JITMS. + JITM::configure(); + + /** + * Fires after the My Jetpack package is initialized + * + * @since 0.1.0 + */ + do_action( 'my_jetpack_init' ); + } + + /** + * Acts as a feature flag, returning a boolean for whether we should show the licensing UI. + * + * @since 1.2.0 + * + * @return boolean + */ + public static function is_licensing_ui_enabled() { + // Default changed to true in 1.5.0. + $is_enabled = true; + + /* + * Bail if My Jetpack is not enabled, + * and thus the licensing UI shouldn't be enabled either. + */ + if ( ! self::should_initialize() ) { + $is_enabled = false; + } + + /** + * Acts as a feature flag, returning a boolean for whether we should show the licensing UI. + * + * @param bool $is_enabled Defaults to true. + * + * @since 1.2.0 + * @since 1.5.0 Update default value to true. + */ + return apply_filters( + 'jetpack_my_jetpack_should_enable_add_license_screen', + $is_enabled + ); + } + + /** + * Callback for the load my jetpack page hook. + * + * @return void + */ + public static function admin_init() { + add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); + // Product statuses are constantly changing, so we never want to cache the page. + header( 'Cache-Control: no-cache, no-store, must-revalidate' ); + header( 'Pragma: no-cache' ); + header( 'Expires: 0' ); + } + + /** + * Returns whether we are in condition to track to use + * Analytics functionality like Tracks, MC, or GA. + */ + public static function can_use_analytics() { + $status = new Status(); + $connection = new Connection_Manager(); + $tracking = new Tracking( 'jetpack', $connection ); + + return $tracking->should_enable_tracking( new Terms_Of_Service(), $status ); + } + /** + * Enqueue admin page assets. + * + * @return void + */ + public static function enqueue_scripts() { + Assets::register_script( + 'my_jetpack_main_app', + '../build/index.js', + __FILE__, + array( + 'enqueue' => true, + 'in_footer' => true, + 'textdomain' => 'jetpack-my-jetpack', + ) + ); + wp_localize_script( + 'my_jetpack_main_app', + 'myJetpackInitialState', + array( + 'products' => array( + 'items' => Products::get_products(), + ), + 'purchases' => array( + 'items' => array(), + ), + 'plugins' => Plugins_Installer::get_plugins(), + 'myJetpackUrl' => admin_url( 'admin.php?page=my-jetpack' ), + 'topJetpackMenuItemUrl' => Admin_Menu::get_top_level_menu_item_url(), + 'siteSuffix' => ( new Status() )->get_site_suffix(), + 'myJetpackVersion' => self::PACKAGE_VERSION, + 'fileSystemWriteAccess' => self::has_file_system_write_access(), + 'loadAddLicenseScreen' => self::is_licensing_ui_enabled(), + 'adminUrl' => esc_url( admin_url() ), + ) + ); + + wp_localize_script( + 'my_jetpack_main_app', + 'myJetpackRest', + array( + 'apiRoot' => esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + ) + ); + + // Connection Initial State. + wp_add_inline_script( 'my_jetpack_main_app', Connection_Initial_State::render(), 'before' ); + + // Required for Analytics. + if ( self::can_use_analytics() ) { + Tracking::register_tracks_functions_scripts( true ); + } + } + + /** + * Echoes the admin page content. + * + * @return void + */ + public static function admin_page() { + echo '
        '; + } + + /** + * Register the REST API routes. + * + * @return void + */ + public static function register_rest_endpoints() { + new REST_Products(); + new REST_Purchases(); + + register_rest_route( + 'my-jetpack/v1', + 'site', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_site', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + return current_user_can( 'manage_options' ); + } + + /** + * Return true if we should initialize the My Jetpack admin page. + */ + public static function should_initialize() { + $should = true; + + if ( is_multisite() ) { + $should = false; + } + + /** + * Allows filtering whether My Jetpack should be initialized. + * + * @since 0.5.0-alpha + * + * @param bool $shoud_initialize Should we initialize My Jetpack? + */ + return apply_filters( 'jetpack_my_jetpack_should_initialize', $should ); + } + + /** + * Site full-data endpoint. + * + * @return object Site data. + */ + public static function get_site() { + $site_id = \Jetpack_Options::get_option( 'id' ); + $wpcom_endpoint = sprintf( '/sites/%d?force=wpcom', $site_id ); + $wpcom_api_version = '1.1'; + $response = Client::wpcom_json_api_request_as_blog( $wpcom_endpoint, $wpcom_api_version ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) ) { + return new \WP_Error( 'site_data_fetch_failed', 'Site data fetch failed', array( 'status' => $response_code ) ); + } + + return rest_ensure_response( $body, 200 ); + } + + /** + * Returns true if the site has file write access to the plugins folder, false otherwise. + * + * @return bool + **/ + public static function has_file_system_write_access() { + + $cache = get_transient( 'my_jetpack_write_access' ); + + if ( false !== $cache ) { + return $cache; + } + + if ( ! function_exists( 'get_filesystem_method' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + require_once ABSPATH . 'wp-admin/includes/template.php'; + + $write_access = 'no'; + + $filesystem_method = get_filesystem_method( array(), WP_PLUGIN_DIR ); + if ( 'direct' === $filesystem_method ) { + $write_access = 'yes'; + } + + if ( ! $write_access ) { + ob_start(); + $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); + ob_end_clean(); + + if ( $filesystem_credentials_are_stored ) { + $write_access = 'yes'; + } + } + + set_transient( 'my_jetpack_write_access', $write_access, 30 * MINUTE_IN_SECONDS ); + + return $write_access; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php new file mode 100644 index 00000000..96c074f5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php @@ -0,0 +1,182 @@ + Products\Anti_Spam::class, + 'backup' => Products\Backup::class, + 'boost' => Products\Boost::class, + 'crm' => Products\Crm::class, + 'extras' => Products\Extras::class, + 'scan' => Products\Scan::class, + 'search' => Products\Search::class, + 'social' => Products\Social::class, + 'security' => Products\Security::class, + 'protect' => Products\Protect::class, + 'videopress' => Products\Videopress::class, + ); + + /** + * This filter allows plugin to override the Product class of a given product. The new class must be a child class of the default one declared in My Jetpack + * + * For example, a stand-alone plugin could overwrite its product class to control specific behavior of the product in the My Jetpack page after it is active without having to commit changes to the My Jetpack package: + * + * add_filter( 'my_jetpack_products_classes', function( $classes ) { + * $classes['my_plugin'] = 'My_Plugin'; // a class that extends the original one declared in the My Jetpack package. + * return $classes + * } ); + * + * @param array $classes An array where the keys are the product slugs and the values are the class names. + */ + $final_classes = apply_filters( 'my_jetpack_products_classes', $classes ); + + // Check that the classes are still child of the same original classes. + foreach ( (array) $final_classes as $slug => $final_class ) { + if ( $final_class === $classes[ $slug ] ) { + continue; + } + if ( ! class_exists( $final_class ) || ! is_subclass_of( $final_class, $classes[ $slug ] ) ) { + throw new \Exception( 'You can only overwrite a Product class with a child of the original class.' ); + } + } + + return $final_classes; + } + + /** + * Product data + * + * @return array Jetpack products on the site and their availability. + */ + public static function get_products() { + $products = array(); + foreach ( self::get_products_classes() as $class ) { + $product_slug = $class::$slug; + $products[ $product_slug ] = $class::get_info(); + } + return $products; + } + + /** + * Get one product data by its slug + * + * @param string $product_slug The product slug. + * + * @return ?array + */ + public static function get_product( $product_slug ) { + $classes = self::get_products_classes(); + if ( isset( $classes[ $product_slug ] ) ) { + return $classes[ $product_slug ]::get_info(); + } + } + + /** + * Get one product Class name + * + * @param string $product_slug The product slug. + * + * @return ?string + */ + public static function get_product_class( $product_slug ) { + $classes = self::get_products_classes(); + if ( isset( $classes[ $product_slug ] ) ) { + return $classes[ $product_slug ]; + } + } + + /** + * Return product slugs list. + * + * @return array Product slugs array. + */ + public static function get_products_slugs() { + return array_keys( self::get_products_classes() ); + } + + /** + * Gets the json schema for the product data + * + * @return array + */ + public static function get_product_data_schema() { + return array( + 'title' => 'The requested product data', + 'type' => 'object', + 'properties' => array( + 'product' => array( + 'description' => __( 'Product slug', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => __CLASS__ . '::get_product_slugs', + 'required' => false, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ), + 'action' => array( + 'description' => __( 'Production action to execute', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => array( 'activate', 'deactivate' ), + 'required' => false, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ), + 'slug' => array( + 'title' => 'The product slug', + 'type' => 'string', + ), + 'name' => array( + 'title' => 'The product name', + 'type' => 'string', + ), + 'description' => array( + 'title' => 'The product description', + 'type' => 'string', + ), + 'status' => array( + 'title' => 'The product status', + 'type' => 'string', + 'enum' => array( 'active', 'inactive', 'plugin_absent', 'needs_purchase', 'needs_purchase_or_free', 'error' ), + ), + 'class' => array( + 'title' => 'The product class handler', + 'type' => 'string', + ), + ), + ); + } + + /** + * Extend actions links for plugins + * tied to the Products. + */ + public static function extend_plugins_action_links() { + $products = array( + 'backup', + 'boost', + 'crm', + 'videopress', // we use videopress here to add the plugin action to the Jetpack plugin itself + ); + foreach ( $products as $product ) { + $class_name = self::get_product_class( $product ); + $class_name::extend_plugin_action_links(); + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php new file mode 100644 index 00000000..a0300a84 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php @@ -0,0 +1,208 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_products', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ), + 'schema' => array( $this, 'get_products_schema' ), + ) + ); + + $product_arg = array( + 'description' => __( 'Product slug', 'jetpack-my-jetpack' ), + 'type' => 'string', + 'enum' => Products::get_products_slugs(), + 'required' => true, + 'validate_callback' => __CLASS__ . '::check_product_argument', + ); + + register_rest_route( + 'my-jetpack/v1', + 'site/products/(?P[a-z\-]+)', + array( + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_product', + 'permission_callback' => __CLASS__ . '::permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::activate_product', + 'permission_callback' => __CLASS__ . '::edit_permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + array( + 'methods' => \WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::deactivate_product', + 'permission_callback' => __CLASS__ . '::edit_permissions_callback', + 'args' => array( + 'product' => $product_arg, + ), + ), + ) + ); + } + + /** + * Get the schema for the products endpoint + * + * @return array + */ + public function get_products_schema() { + return array( + '$schema' => 'http://json-schema.org/draft-04/schema#', + 'title' => 'products', + 'type' => 'object', + 'properties' => Products::get_product_data_schema(), + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + return current_user_can( 'manage_options' ); + } + + /** + * Check Product arguments. + * + * @access public + * @static + * + * @param mixed $value - Value of the 'product' argument. + * @return true|WP_Error True if the value is valid, WP_Error otherwise. + */ + public static function check_product_argument( $value ) { + if ( ! is_string( $value ) ) { + return new WP_Error( + 'rest_invalid_param', + esc_html__( 'The product argument must be a string.', 'jetpack-my-jetpack' ), + array( 'status' => 400 ) + ); + } + + return true; + } + + /** + * Site products endpoint. + * + * @return array of site products list. + */ + public static function get_products() { + $response = Products::get_products(); + return rest_ensure_response( $response, 200 ); + } + + /** + * Site single product endpoint. + * + * @param \WP_REST_Request $request The request object. + * @return array of site products list. + */ + public static function get_product( $request ) { + $product_slug = $request->get_param( 'product' ); + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + + /** + * Check permission to edit product + * + * @return bool + */ + public static function edit_permissions_callback() { + if ( ! current_user_can( 'activate_plugins' ) ) { + return false; + } + if ( is_multisite() && ! current_user_can( 'manage_network' ) ) { + return false; + } + return true; + } + + /** + * Callback for activating a product + * + * @param \WP_REST_Request $request The request object. + * @return \WP_REST_Response + */ + public static function activate_product( $request ) { + $product_slug = $request->get_param( 'product' ); + $product = Products::get_product( $product_slug ); + if ( ! isset( $product['class'] ) ) { + return new \WP_Error( + 'not_implemented', + esc_html__( 'The product class handler is not implemented', 'jetpack-my-jetpack' ), + array( 'status' => 501 ) + ); + } + + $activate_product_result = call_user_func( array( $product['class'], 'activate' ) ); + if ( is_wp_error( $activate_product_result ) ) { + $activate_product_result->add_data( array( 'status' => 400 ) ); + return $activate_product_result; + } + + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + + /** + * Callback for deactivating a product + * + * @param \WP_REST_Request $request The request object. + * @return \WP_REST_Response + */ + public static function deactivate_product( $request ) { + $product_slug = $request->get_param( 'product' ); + $product = Products::get_product( $product_slug ); + if ( ! isset( $product['class'] ) ) { + return new \WP_Error( + 'not_implemented', + esc_html__( 'The product class handler is not implemented', 'jetpack-my-jetpack' ), + array( 'status' => 501 ) + ); + } + + $deactivate_product_result = call_user_func( array( $product['class'], 'deactivate' ) ); + if ( is_wp_error( $deactivate_product_result ) ) { + $deactivate_product_result->add_data( array( 'status' => 400 ) ); + return $deactivate_product_result; + } + + return rest_ensure_response( Products::get_product( $product_slug ), 200 ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php new file mode 100644 index 00000000..fde97b75 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php @@ -0,0 +1,76 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_site_current_purchases', + 'permission_callback' => __CLASS__ . '::permissions_callback', + ) + ); + } + + /** + * Check user capability to access the endpoint. + * + * @access public + * @static + * + * @return true|WP_Error + */ + public static function permissions_callback() { + $connection = new Connection_Manager(); + $is_site_connected = $connection->is_connected(); + + if ( ! $is_site_connected ) { + return new \WP_Error( + 'not_connected', + __( 'Your site is not connected to Jetpack.', 'jetpack-my-jetpack' ), + array( + 'status' => 400, + ) + ); + } + + return current_user_can( 'manage_options' ); + } + + /** + * Site purchases endpoint. + * + * @return array of site purchases. + */ + public static function get_site_current_purchases() { + $site_id = \Jetpack_Options::get_option( 'id' ); + $wpcom_endpoint = sprintf( '/sites/%1$d/purchases?locale=%2$s', $site_id, get_user_locale() ); + $wpcom_api_version = '1.1'; + $response = Client::wpcom_json_api_request_as_blog( $wpcom_endpoint, $wpcom_api_version ); + $response_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $response ) || empty( $response['body'] ) || 200 !== $response_code ) { + return new \WP_Error( 'site_data_fetch_failed', 'Site data fetch failed', array( 'status' => $response_code ? $response_code : 400 ) ); + } + + return rest_ensure_response( $body, 200 ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php new file mode 100644 index 00000000..26bc422c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php @@ -0,0 +1,229 @@ +get_ip( true ); + $headers = array( + 'X-Forwarded-For' => $ip, + ); + + // If has a blog id, use connected endpoint. + + if ( $blog_id ) { + $endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() ); + + $wpcom_request = Client::wpcom_json_api_request_as_blog( + $endpoint, + '1.1', + array( + 'method' => 'GET', + 'headers' => $headers, + ) + ); + } else { + $endpoint = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack'; + + $wpcom_request = wp_remote_get( + esc_url_raw( $endpoint ), + array( + 'headers' => $headers, + ) + ); + } + + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + + if ( 200 === $response_code ) { + return json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + } else { + return new WP_Error( + 'failed_to_fetch_wpcom_products', + esc_html__( 'Unable to fetch the products list from WordPress.com', 'jetpack-my-jetpack' ), + array( 'status' => $response_code ) + ); + } + } + + /** + * Update the cache with new information retrieved from WPCOM + * + * We store one cache for each user, as the information is internationalized based on user preferences + * Also, the currency is based on the user IP address + * + * @param Object $products_list The products list as received from WPCOM. + * @return bool + */ + private static function update_cache( $products_list ) { + update_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, time() ); + return update_user_meta( get_current_user_id(), self::CACHE_META_NAME, $products_list ); + } + + /** + * Checks if the cache is old, meaning we need to fetch new data from WPCOM + */ + private static function is_cache_old() { + if ( empty( self::get_products_from_cache() ) ) { + return true; + } + $cache_date = get_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, true ); + return time() - (int) $cache_date > ( 7 * DAY_IN_SECONDS ); + } + + /** + * Gets the product list from the user cache + */ + private static function get_products_from_cache() { + return get_user_meta( get_current_user_id(), self::CACHE_META_NAME, true ); + } + + /** + * Gets the product list + * + * Attempts to retrieve the products list from the user cache if cache is not too old. + * If cache is old, it will attempt to fetch information from WPCOM. If it fails, we return what we have in cache, if anything, otherwise we return an error. + * + * @param bool $skip_cache If true it will ignore the cache and attempt to fetch fresh information from WPCOM. + * + * @return Object|WP_Error + */ + public static function get_products( $skip_cache = false ) { + // This is only available for logged in users. + if ( ! get_current_user_id() ) { + return null; + } + if ( ! self::is_cache_old() && ! $skip_cache ) { + return self::get_products_from_cache(); + } + + $products = self::get_products_from_wpcom(); + if ( is_wp_error( $products ) ) { + // Let's see if we have it cached. + $cached = self::get_products_from_cache(); + if ( ! empty( $cached ) ) { + return $cached; + } else { + return $products; + } + } + + self::update_cache( $products ); + return $products; + } + + /** + * Get one product + * + * @param string $product_slug The product slug. + * + * @return ?Object The product details if found + */ + public static function get_product( $product_slug ) { + $products = self::get_products(); + if ( ! empty( $products->$product_slug ) ) { + return $products->$product_slug; + } + } + + /** + * Get only the product currency code and price in an array + * + * @param string $product_slug The product slug. + * + * @return array An array with currency_code and full_price. Empty array if product not found. + */ + public static function get_product_pricing( $product_slug ) { + $product = self::get_product( $product_slug ); + if ( empty( $product ) ) { + return array(); + } + + $cost = $product->cost; + $discount_price = $cost; + $is_introductory_offer = false; + $introductory_offer = null; + + // Get/compute the discounted price. + if ( isset( $product->introductory_offer->cost_per_interval ) ) { + $discount_price = $product->introductory_offer->cost_per_interval; + $is_introductory_offer = true; + $introductory_offer = $product->introductory_offer; + } + + $pricing = array( + 'currency_code' => $product->currency_code, + 'full_price' => $cost, + 'discount_price' => $discount_price, + 'is_introductory_offer' => $is_introductory_offer, + 'introductory_offer' => $introductory_offer, + ); + + return self::populate_with_discount( $product, $pricing, $discount_price ); + } + + /** + * Populate the pricing array with the discount information. + * + * @param {object} $product - The product object. + * @param {object} $pricing - The pricing array. + * @param {float} $price - The price to be discounted. + * @return {object} The pricing array with the discount information. + */ + public static function populate_with_discount( $product, $pricing, $price ) { + // Check whether the product has a coupon. + if ( ! isset( $product->sale_coupon ) ) { + return $pricing; + } + + // Check whether it is still valid. + $coupon = $product->sale_coupon; + $coupon_start_date = strtotime( $coupon->start_date ); + $coupon_expires = strtotime( $coupon->expires ); + if ( $coupon_start_date > time() || $coupon_expires < time() ) { + return $pricing; + } + + $coupon_discount = intval( $coupon->discount ); + + // Populate response with coupon discount. + $pricing['coupon_discount'] = $coupon_discount; + + // Apply coupon discount to the price. + $pricing['discount_price'] = $price * ( 100 - $coupon_discount ) / 100; + + return $pricing; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php new file mode 100644 index 00000000..583f52e4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php @@ -0,0 +1,138 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_anti_spam'; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=akismet-key-config' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php new file mode 100644 index 00000000..6dfd6116 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php @@ -0,0 +1,214 @@ + _x( '* Subject to your usage and storage limit.', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ), + 'link_text' => _x( 'Learn more', 'Backup Product Disclaimer', 'jetpack-my-jetpack' ), + 'url' => Redirect::get_url( 'jetpack-faq-backup-disclaimer' ), + ), + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_backup_t1_yearly'; + } + + /** + * Get the product princing details + * + * @return array Pricing details + */ + public static function get_pricing_for_ui() { + return array_merge( + array( + 'available' => true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Hits the wpcom api to check rewind status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d/rewind', $site_id ) . '?force=wpcom', '2', array( 'timeout' => 2 ), null, 'wpcom' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'rewind_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $rewind_data = static::get_state_from_wpcom(); + if ( is_wp_error( $rewind_data ) ) { + return false; + } + return is_object( $rewind_data ) && isset( $rewind_data->state ) && 'unavailable' !== $rewind_data->state; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page or continue the purchase flow if needed. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + if ( static::is_plugin_active() ) { + return admin_url( 'admin.php?page=jetpack-backup' ); + } + } + + /** + * Checks whether the Product is active + * + * @return boolean + */ + public static function is_active() { + return parent::is_active() && static::has_required_plan(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php new file mode 100644 index 00000000..7c159eb4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php @@ -0,0 +1,117 @@ + true, + 'is_free' => true, + ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-boost' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php new file mode 100644 index 00000000..9fce5f92 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php @@ -0,0 +1,124 @@ + true, + 'is_free' => true, + ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return admin_url( 'admin.php?page=zerobscrm-plugin' ); // Welcome page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=zerobscrm-dash' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php new file mode 100644 index 00000000..ec35be1d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php @@ -0,0 +1,140 @@ + true, + 'is_free' => true, + ); + } + + /** + * Checks whether the Product is active. + * If Jetpack plugin is active, then Extras will be inactive. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active(); + } + + /** + * Checks whether the plugin is installed + * If Jetpack plugin is installed, then Extras will be inactive. + * + * @return boolean + */ + public static function is_plugin_installed() { + return static::is_jetpack_plugin_installed(); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack' ); + } + + /** + * Activates the Jetpack plugin + * + * @return null|WP_Error Null on success, WP_Error on invalid file. + */ + public static function activate_plugin() { + return activate_plugin( static::get_installed_plugin_filename( 'jetpack' ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php new file mode 100644 index 00000000..3b5d2758 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php @@ -0,0 +1,132 @@ +is_active( static::$module_name ); + } + return true; + } + + /** + * Checks whether the Product is active + * + * @return boolean + */ + public static function is_active() { + return parent::is_active() && static::is_module_active(); + } + + /** + * Activates the plugin + * + * @return null|WP_Error Null on success, WP_Error on invalid file. + */ + public static function activate_plugin() { + /* + * Activate self-installed plugin if it's installed. + */ + if ( parent::is_plugin_installed() ) { + return activate_plugin( static::get_installed_plugin_filename() ); + } + + /* + * Otherwise, activate Jetpack plugin. + */ + if ( static::is_jetpack_plugin_installed() ) { + return activate_plugin( static::get_installed_plugin_filename( 'jetpack' ) ); + } + + return new WP_Error( 'plugin_not_found', __( 'Activation failed. Plugin is not installed', 'jetpack-my-jetpack' ) ); + } + + /** + * Activates the product. If the Hybrid product has declared a jetpack module name, let's try to activate it if Jetpack plugin is active + * + * @param bool|WP_Error $product_activation Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|WP_Error + */ + public static function do_product_specific_activation( $product_activation ) { + + if ( is_wp_error( $product_activation ) ) { + // If we failed to install the stand-alone plugin because the package was not found, let's try and install Jetpack plugin instead. + // This might happen, for example, while the stand-alone plugin was not released to the WP.org repository yet. + if ( 'no_package' === $product_activation->get_error_code() ) { + $product_activation = Plugins_Installer::install_plugin( self::JETPACK_PLUGIN_SLUG ); + if ( ! is_wp_error( $product_activation ) ) { + $product_activation = static::activate_plugin(); + } + } + if ( is_wp_error( $product_activation ) ) { + return $product_activation; + } + } + + if ( ! empty( static::$module_name ) ) { + if ( ! static::has_required_plan() ) { + // translators: %s is the product name. e.g. Jetpack Search. + return new WP_Error( 'not_supported', sprintf( __( 'Your plan does not support %s.', 'jetpack-my-jetpack' ), static::get_title() ) ); + } + $module_activation = ( new Modules() )->activate( static::$module_name, false, false ); + if ( ! $module_activation ) { + return new WP_Error( 'module_activation_failed', __( 'Error activating Jetpack module', 'jetpack-my-jetpack' ) ); + } + + return $module_activation; + } + + return true; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php new file mode 100644 index 00000000..444f26b8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php @@ -0,0 +1,134 @@ + static::$slug, + 'plugin_slug' => static::$plugin_slug, + 'name' => static::get_name(), + 'title' => static::get_title(), + 'description' => static::get_description(), + 'long_description' => static::get_long_description(), + 'features' => static::get_features(), + 'disclaimers' => static::get_disclaimers(), + 'status' => static::get_status(), + 'pricing_for_ui' => static::get_pricing_for_ui(), + 'is_bundle' => static::is_bundle_product(), + 'is_upgradable_by_bundle' => static::is_upgradable_by_bundle(), + 'supported_products' => static::get_supported_products(), + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'requires_user_connection' => static::$requires_user_connection, + 'has_required_plan' => static::has_required_plan(), + 'manage_url' => static::get_manage_url(), + 'post_activation_url' => static::get_post_activation_url(), + 'class' => get_called_class(), + ); + } + + /** + * Get the internationalized product name + * + * @return string + */ + abstract public static function get_name(); + + /** + * Get the internationalized product title + * + * @return string + */ + abstract public static function get_title(); + + /** + * Get the internationalized product description + * + * @return string + */ + abstract public static function get_description(); + + /** + * Get the internationalized product long description + * + * @return string + */ + abstract public static function get_long_description(); + + /** + * Get the internationalized features list + * + * @return array + */ + abstract public static function get_features(); + + /** + * Get the product pricing + * + * @return array + */ + abstract public static function get_pricing_for_ui(); + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + abstract public static function get_manage_url(); + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return static::get_manage_url(); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return null; + } + + /** + * Get the disclaimers corresponding to a feature + * + * @return ?array + */ + public static function get_disclaimers() { + return array(); + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * Returns true if it supports. Return false if a purchase is still required. + * + * Free products will always return true. + * + * @return boolean + */ + public static function has_required_plan() { + return true; + } + + /** + * Checks whether the product supports trial or not + * + * Returns true if it supports. Return false otherwise. + * + * Free products will always return false. + * + * @return boolean + */ + public static function has_trial_support() { + return false; + } + + /** + * Checks whether product is a bundle. + * + * @return boolean True if product is a bundle. Otherwise, False. + */ + public static function is_bundle_product() { + return false; + } + + /** + * Check whether the product is upgradable + * by a product bundle. + * + * @return boolean|array Bundles list or False if not upgradable by a bundle. + */ + public static function is_upgradable_by_bundle() { + return false; + } + + /** + * In case it's a bundle product, + * return all the products it contains. + * Empty array by default. + * + * @return Array Product slugs + */ + public static function get_supported_products() { + return array(); + } + + /** + * Undocumented function + * + * @return string + */ + public static function get_status() { + + if ( ! static::is_plugin_installed() ) { + $status = 'plugin_absent'; + } elseif ( static::is_active() ) { + $status = 'active'; + // We only consider missing user connection an error when the Product is active. + if ( static::$requires_user_connection && ! ( new Connection_Manager() )->has_connected_owner() ) { + $status = 'error'; + } elseif ( ! static::has_required_plan() ) { // We need needs_purchase here as well because some products we consider active without the required plan. + if ( static::has_trial_support() ) { + $status = 'needs_purchase_or_free'; + } else { + $status = 'needs_purchase'; + } + } + } elseif ( ! static::has_required_plan() ) { + if ( static::has_trial_support() ) { + $status = 'needs_purchase_or_free'; + } else { + $status = 'needs_purchase'; + } + } else { + $status = 'inactive'; + } + return $status; + } + + /** + * Checks whether the Product is active + * + * @return boolean + */ + public static function is_active() { + return static::is_plugin_active() && static::has_required_plan(); + } + + /** + * Checks whether the plugin is installed + * + * @return boolean + */ + public static function is_plugin_installed() { + return (bool) static::get_installed_plugin_filename(); + } + + /** + * Checks whether the plugin is active + * + * @return boolean + */ + public static function is_plugin_active() { + return Plugins_Installer::is_plugin_active( static::get_installed_plugin_filename() ); + } + + /** + * Checks whether the Jetpack plugin is installed + * + * @return boolean + */ + public static function is_jetpack_plugin_installed() { + return (bool) static::get_installed_plugin_filename( 'jetpack' ); + } + + /** + * Checks whether the Jetpack plugin is active + * + * @return boolean + */ + public static function is_jetpack_plugin_active() { + return Plugins_Installer::is_plugin_active( static::get_installed_plugin_filename( 'jetpack' ) ); + } + + /** + * Activates the plugin + * + * @return null|WP_Error Null on success, WP_Error on invalid file. + */ + public static function activate_plugin() { + return activate_plugin( static::get_installed_plugin_filename() ); + } + + /** + * Perform the top level activation routines, which is installing and activating the required plugin + * + * @return bool|WP_Error + */ + private static function do_activation() { + if ( static::is_active() ) { + return true; + } + + if ( ! static::is_plugin_installed() ) { + $installed = Plugins_Installer::install_plugin( static::get_plugin_slug() ); + if ( is_wp_error( $installed ) ) { + return $installed; + } + } + + if ( ! current_user_can( 'activate_plugins' ) ) { + return new WP_Error( 'not_allowed', __( 'You are not allowed to activate plugins on this site.', 'jetpack-my-jetpack' ) ); + } + + $result = static::activate_plugin(); + if ( is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Activates the product by installing and activating its plugin + * + * @return boolean|WP_Error + */ + final public static function activate() { + + $result = self::do_activation(); + + $result = static::do_product_specific_activation( $result ); + + $product_slug = static::$slug; + + /** + * Fires after My Jetpack activates a product and filters the result + * Use this filter to run additional routines for a product activation on stand-alone plugins + * + * @param bool|WP_Error $result The result of the previous steps of activation. + */ + $result = apply_filters( "my_jetpack_{$product_slug}_activation", $result ); + + return $result; + } + + /** + * Override this method to perform product specific activation routines. + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + return $current_result; + } + + /** + * Deactivate the product + * + * @return boolean + */ + public static function deactivate() { + deactivate_plugins( static::get_installed_plugin_filename() ); + return true; + } + + /** + * Returns filtered Jetpack plugin actions links. + * + * @param array $actions - Jetpack plugin action links. + * @return array Filtered Jetpack plugin actions links. + */ + public static function get_plugin_actions_links( $actions ) { + // My Jetpack action link. + $my_jetpack_home_link = array( + 'jetpack-home' => sprintf( + '%2$s', + admin_url( 'admin.php?page=my-jetpack' ), + __( 'My Jetpack', 'jetpack-my-jetpack' ), + __( 'My Jetpack dashboard', 'jetpack-my-jetpack' ) + ), + ); + + // Otherwise, add it to the beginning of the array. + return array_merge( $my_jetpack_home_link, $actions ); + } + + /** + * Extend the plugin action links. + */ + public static function extend_plugin_action_links() { + + $filenames = static::get_plugin_filename(); + if ( ! is_array( $filenames ) ) { + $filenames = array( $filenames ); + } + + foreach ( $filenames as $filename ) { + $hook = 'plugin_action_links_' . $filename; + $callback = array( static::class, 'get_plugin_actions_links' ); + if ( ! has_filter( $hook, $callback ) ) { + add_filter( $hook, $callback, 20, 2 ); + } + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php new file mode 100644 index 00000000..a4cca50a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php @@ -0,0 +1,119 @@ + true, + 'is_free' => true, + ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-protect' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php new file mode 100644 index 00000000..0ab5eae6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php @@ -0,0 +1,217 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_scan'; + } + + /** + * Hits the wpcom api to check scan status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d/scan', $site_id ) . '?force=wpcom', '2', array( 'timeout' => 2 ), null, 'wpcom' ); + + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'scan_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $scan_data = static::get_state_from_wpcom(); + if ( is_wp_error( $scan_data ) ) { + return false; + } + return is_object( $scan_data ) && isset( $scan_data->state ) && 'unavailable' !== $scan_data->state; + } + + /** + * Checks whether the Product is active + * + * Scan is not actually a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // Scan is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + return $product_activation; + } + + /** + * Checks whether the Jetpack module is active + * + * Scan is not a module. Nothing needs to be active. Let's always consider it active. + * + * @return bool + */ + public static function is_module_active() { + return true; + } + + /** + * Return product bundles list + * that supports the product. + * + * @return boolean|array Products bundle list. + */ + public static function is_upgradable_by_bundle() { + return array( 'security' ); + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return Redirect::get_url( 'my-jetpack-manage-scan' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php new file mode 100644 index 00000000..8d363a3b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php @@ -0,0 +1,150 @@ + true, + 'exclude_from_search' => false, + ) + ); + $indexable_status_array = get_post_stati( + array( + 'public' => true, + 'exclude_from_search' => false, + ) + ); + $raw_posts_counts = static::get_raw_post_type_breakdown(); + if ( ! $raw_posts_counts || is_wp_error( $raw_posts_counts ) ) { + return array(); + } + $posts_counts = static::get_post_type_breakdown_with( $raw_posts_counts, $indexable_post_types, $indexable_status_array ); + + return $posts_counts; + } + + /** + * Calculate breakdown of post types with passed in indexable post types and statuses. + * The function is going to be used from WPCOM as well for consistency. + * + * @param array $raw_posts_counts Array of post types with counts as value. + * @param array $indexable_post_types Array of indexable post types. + * @param array $indexable_status_array Array of indexable post statuses. + */ + public static function get_post_type_breakdown_with( $raw_posts_counts, $indexable_post_types, $indexable_status_array ) { + $posts_counts = array(); + foreach ( $raw_posts_counts as $row ) { + // ignore if status is not public. + if ( ! in_array( $row['post_status'], $indexable_status_array, true ) ) { + continue; + } + // ignore if post type is in excluded post types. + if ( in_array( $row['post_type'], self::EXCLUDED_POST_TYPES, true ) ) { + continue; + } + // ignore if post type is not public and is not explicitly included. + if ( ! in_array( $row['post_type'], $indexable_post_types, true ) && + ! in_array( $row['post_type'], self::DO_NOT_EXCLUDE_POST_TYPES, true ) + ) { + continue; + } + // add up post type counts of potentially multiple post_status. + if ( ! isset( $posts_counts[ $row['post_type'] ] ) ) { + $posts_counts[ $row['post_type'] ] = 0; + } + $posts_counts[ $row['post_type'] ] += intval( $row['num_posts'] ); + } + + arsort( $posts_counts, SORT_NUMERIC ); + return $posts_counts; + } + + /** + * Get raw post type breakdown from the database. + */ + protected static function get_raw_post_type_breakdown() { + global $wpdb; + + $results = wp_cache_get( self::POST_TYPE_BREAKDOWN_CACHE_KEY, self::CACHE_GROUP ); + if ( false !== $results ) { + return $results; + } + + $query = "SELECT post_type, post_status, COUNT( * ) AS num_posts + FROM {$wpdb->posts} + WHERE post_password = '' + GROUP BY post_type, post_status"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery + $results = $wpdb->get_results( $query, ARRAY_A ); + wp_cache_set( self::POST_TYPE_BREAKDOWN_CACHE_KEY, $results, self::CACHE_GROUP, self::CACHE_EXPIRY ); + return $results; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php new file mode 100644 index 00000000..0bc1319b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php @@ -0,0 +1,324 @@ + true, + 'trial_available' => static::has_trial_support(), + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + 'wpcom_free_product_slug' => static::get_wpcom_free_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + + $record_count = intval( Search_Stats::estimate_count() ); + $search_pricing = static::get_pricing_from_wpcom( $record_count ); + + if ( is_wp_error( $search_pricing ) ) { + return $pricing; + } + + $pricing['estimated_record_count'] = $record_count; + + return array_merge( $pricing, $search_pricing ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_search'; + } + + /** + * Get the WPCOM free product slug + * + * @return ?string + */ + public static function get_wpcom_free_product_slug() { + return 'jetpack_search_free'; + } + + /** + * Returns true if the new_pricing_202208 is set to not empty in URL for testing purpose, or it's active. + */ + public static function is_new_pricing_202208() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash + if ( isset( $_GET['new_pricing_202208'] ) && $_GET['new_pricing_202208'] ) { + return true; + } + + $record_count = intval( Search_Stats::estimate_count() ); + $search_pricing = static::get_pricing_from_wpcom( $record_count ); + if ( is_wp_error( $search_pricing ) ) { + return false; + } + + return '202208' === $search_pricing['pricing_version']; + } + + /** + * Override status to `needs_purchase_or_free` when status is `needs_purchase`. + */ + public static function get_status() { + $status = parent::get_status(); + return $status; + } + + /** + * Use centralized Search pricing API. + * + * The function is also used by the search package, as a result it could be called before site connection - i.e. blog token might not be available. + * + * @param int $record_count Record count to estimate pricing. + * + * @return array|WP_Error + */ + public static function get_pricing_from_wpcom( $record_count ) { + static $pricings = array(); + + if ( isset( $pricings[ $record_count ] ) ) { + return $pricings[ $record_count ]; + } + + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + // For simple sites fetch the response directly. + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ), + '2', + array( 'timeout' => 5 ), + null, + 'wpcom' + ); + } else { + // For non-simple sites we have to use the wp_remote_get, as connection might not be available. + $response = wp_remote_get( + sprintf( Constants::get_constant( 'JETPACK__WPCOM_JSON_API_BASE' ) . '/wpcom/v2/jetpack-search/pricing?record_count=%1$d&locale=%2$s', $record_count, get_user_locale() ), + array( 'timeout' => 5 ) + ); + } + + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'search_pricing_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $pricings[ $record_count ] = json_decode( $body, true ); + return $pricings[ $record_count ]; + } + + /** + * Hits the wpcom api to check Search status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $blog_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( + '/sites/' . $blog_id . '/jetpack-search/plan', + '2', + array( 'timeout' => 5 ), + null, + 'wpcom' + ); + + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'search_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the product supports trial or not + * + * Returns true if it supports. Return false otherwise. + * + * Free products will always return false. + * + * @return boolean + */ + public static function has_trial_support() { + return static::is_new_pricing_202208(); + } + + /** + * Checks whether the current plan of the site already supports the product + * + * Returns true if it supports. Return false if a purchase is still required. + * + * Free products will always return true. + * + * @return boolean + */ + public static function has_required_plan() { + $search_state = static::get_state_from_wpcom(); + return ! empty( $search_state->supports_search ) || ! empty( $search_state->supports_instant_search ); + } + + /** + * Activates the product. Try to enable instant search after the Search module was enabled. + * + * @param bool|WP_Error $product_activation Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return bool|WP_Error + */ + public static function do_product_specific_activation( $product_activation ) { + $product_activation = parent::do_product_specific_activation( $product_activation ); + if ( is_wp_error( $product_activation ) ) { + return $product_activation; + } + + if ( class_exists( 'Automattic\Jetpack\Search\Module_Control' ) ) { + ( new Search_Module_Control() )->enable_instant_search(); + } + + // we don't want to change the success of the activation if we fail to activate instant search. That's not mandatory. + return $product_activation; + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page or continue the purchase flow if needed. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return admin_url( 'admin.php?page=jetpack-search' ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php new file mode 100644 index 00000000..9f8ef881 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php @@ -0,0 +1,246 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_security_t1_yearly'; + } + + /** + * Checks whether the Jetpack module is active + * + * This is a bundle and not a product. We should not use this information for anything + * + * @return bool + */ + public static function is_module_active() { + return false; + } + + /** + * Activates the product by installing and activating its plugin + * + * @param bool|WP_Error $current_result Is the result of the top level activation actions. You probably won't do anything if it is an WP_Error. + * @return boolean|\WP_Error + */ + public static function do_product_specific_activation( $current_result ) { + + $product_activation = parent::do_product_specific_activation( $current_result ); + + if ( is_wp_error( $product_activation ) && 'module_activation_failed' === $product_activation->get_error_code() ) { + // A bundle is not a module. There's nothing in the plugin to be activated, so it's ok to fail to activate the module. + $product_activation = true; + } + + // At this point, Jetpack plugin is installed. Let's activate each individual product. + $activation = Anti_Spam::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Backup::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + $activation = Scan::activate(); + if ( is_wp_error( $activation ) ) { + return $activation; + } + + return $activation; + } + + /** + * Checks whether the Product is active + * + * Security is a bundle and not a module. Activation takes place on WPCOM. So lets consider it active if jetpack is active and has the plan. + * + * @return boolean + */ + public static function is_active() { + return static::is_jetpack_plugin_active() && static::has_required_plan(); + } + + /** + * Hits the wpcom api to check scan status. + * + * @todo Maybe add caching. + * + * @return Object|WP_Error + */ + private static function get_state_from_wpcom() { + static $status = null; + + if ( $status !== null ) { + return $status; + } + + $site_id = Jetpack_Options::get_option( 'id' ); + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%d/purchases', $site_id ), + '1.1', + array( + 'method' => 'GET', + ) + ); + if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + return new WP_Error( 'purchases_state_fetch_failed' ); + } + + $body = wp_remote_retrieve_body( $response ); + $status = json_decode( $body ); + return $status; + } + + /** + * Checks whether the current plan (or purchases) of the site already supports the product + * + * @return boolean + */ + public static function has_required_plan() { + $purchases_data = static::get_state_from_wpcom(); + if ( is_wp_error( $purchases_data ) ) { + return false; + } + if ( is_array( $purchases_data ) && ! empty( $purchases_data ) ) { + foreach ( $purchases_data as $purchase ) { + if ( + 0 === strpos( $purchase->product_slug, 'jetpack_security' ) || + 0 === strpos( $purchase->product_slug, 'jetpack_complete' ) + ) { + return true; + } + } + } + return false; + } + + /** + * Checks whether product is a bundle. + * + * @return boolean True + */ + public static function is_bundle_product() { + return true; + } + + /** + * Return all the products it contains. + * + * @return Array Product slugs + */ + public static function get_supported_products() { + return array( 'backup', 'scan', 'anti-spam' ); + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + return ''; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php new file mode 100644 index 00000000..c8add202 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php @@ -0,0 +1,133 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_social'; + } + + /** + * Get the URL where the user manages the product + * + * @return string + */ + public static function get_manage_url() { + if ( static::is_plugin_active() ) { + return admin_url( 'admin.php?page=jetpack-social' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php new file mode 100644 index 00000000..3fe08372 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php @@ -0,0 +1,151 @@ + true, + 'wpcom_product_slug' => static::get_wpcom_product_slug(), + ), + Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ) + ); + } + + /** + * Get the WPCOM product slug used to make the purchase + * + * @return ?string + */ + public static function get_wpcom_product_slug() { + return 'jetpack_videopress'; + } + + /** + * Get the URL the user is taken after activating the product + * + * @return ?string + */ + public static function get_post_activation_url() { + return ''; // stay in My Jetpack page. + } + + /** + * Get the URL where the user manages the product + * + * @return ?string + */ + public static function get_manage_url() { + if ( method_exists( 'Automattic\Jetpack\VideoPress\Initializer', 'should_initialize_admin_ui' ) && \Automattic\Jetpack\VideoPress\Initializer::should_initialize_admin_ui() ) { + return \Automattic\Jetpack\VideoPress\Admin_UI::get_admin_page_url(); + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/CHANGELOG.md new file mode 100644 index 00000000..9e69497a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/CHANGELOG.md @@ -0,0 +1,264 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.7.23] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.7.22] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.7.21] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.7.20] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.7.19] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [1.7.18] - 2022-10-25 +### Changed +- Updated package dependencies. [#26705] + +## [1.7.17] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [1.7.16] - 2022-09-08 +### Changed +- Updated package dependencies. + +## [1.7.15] - 2022-08-29 +### Changed +- Updated package dependencies. + +## [1.7.14] - 2022-08-23 +### Changed +- Updated package dependencies. [#25628] + +## [1.7.13] - 2022-08-03 +### Changed +- Updated package dependencies. [#25300, #25315] + +## [1.7.12] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.7.11] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [1.7.10] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.7.9] - 2022-05-18 +### Fixed +- Fix new PHPCS sniffs. [#24366] + +## [1.7.8] - 2022-05-04 +### Changed +- Updated package dependencies. [#24095] + +### Deprecated +- Moved the options class into Connection. [#24095] + +## [1.7.7] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.7.6] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [1.7.5] - 2022-04-12 +### Changed +- Updated package dependencies. + +## [1.7.4] - 2022-04-06 +### Changed +- Updated package dependencies. + +## [1.7.3] - 2022-03-29 +### Changed +- Microperformance: Use === null instead of is_null + +## [1.7.2] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.7.1] - 2022-02-22 +### Changed +- Updated package dependencies. + +## [1.7.0] - 2022-02-16 +### Added +- Added the ability to specify a partner logo for each supported partner +- Remotely check if partner coupon looks valid + +## [1.6.4] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.6.3] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [1.6.2] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.6.1] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.6.0] - 2021-11-30 +### Added +- Addde partner coupon logic + +## [1.5.7] - 2021-11-23 +### Changed +- Updated package dependencies + +## [1.5.6] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.5.5] - 2021-10-19 +### Changed +- Updated package dependencies. + +## [1.5.4] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.5.3] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.5.2] - 2021-08-31 +### Changed +- Run composer update on test-php command instead of phpunit. +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions. + +## [1.5.1] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.5.0] - 2021-04-27 +### Added +- Adds segmentation "from" parameter to the registration flow + +## [1.4.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.4.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.4.1] - 2021-01-20 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.4.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.3.1] - 2020-10-29 + +- Update dependency brain/monkey to v2.5.0 +- Updated PHPCS: Packages and Debugger + +## [1.3.0] - 2020-08-25 + +- Update Authorize URL iframe to include affiliate code +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.2.0] - 2020-07-01 + +- Package Unit tests: update test file names to make sure they runs in Travis + +## [1.1.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- PHPCS Updates after WPCS 2.3 +- Update README.md on partner package + +## [1.0.1] - 2020-01-27 + +- Pin dependency brain/monkey to 2.4.0 + +## 1.0.0 - 2019-12-16 + +- Add partner subsidiary id to upgrade URLs. + +[1.7.23]: https://github.com/Automattic/jetpack-partner/compare/v1.7.22...v1.7.23 +[1.7.22]: https://github.com/Automattic/jetpack-partner/compare/v1.7.21...v1.7.22 +[1.7.21]: https://github.com/Automattic/jetpack-partner/compare/v1.7.20...v1.7.21 +[1.7.20]: https://github.com/Automattic/jetpack-partner/compare/v1.7.19...v1.7.20 +[1.7.19]: https://github.com/Automattic/jetpack-partner/compare/v1.7.18...v1.7.19 +[1.7.18]: https://github.com/Automattic/jetpack-partner/compare/v1.7.17...v1.7.18 +[1.7.17]: https://github.com/Automattic/jetpack-partner/compare/v1.7.16...v1.7.17 +[1.7.16]: https://github.com/Automattic/jetpack-partner/compare/v1.7.15...v1.7.16 +[1.7.15]: https://github.com/Automattic/jetpack-partner/compare/v1.7.14...v1.7.15 +[1.7.14]: https://github.com/Automattic/jetpack-partner/compare/v1.7.13...v1.7.14 +[1.7.13]: https://github.com/Automattic/jetpack-partner/compare/v1.7.12...v1.7.13 +[1.7.12]: https://github.com/Automattic/jetpack-partner/compare/v1.7.11...v1.7.12 +[1.7.11]: https://github.com/Automattic/jetpack-partner/compare/v1.7.10...v1.7.11 +[1.7.10]: https://github.com/Automattic/jetpack-partner/compare/v1.7.9...v1.7.10 +[1.7.9]: https://github.com/Automattic/jetpack-partner/compare/v1.7.8...v1.7.9 +[1.7.8]: https://github.com/Automattic/jetpack-partner/compare/v1.7.7...v1.7.8 +[1.7.7]: https://github.com/Automattic/jetpack-partner/compare/v1.7.6...v1.7.7 +[1.7.6]: https://github.com/Automattic/jetpack-partner/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-partner/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-partner/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-partner/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-partner/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-partner/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-partner/compare/v1.6.4...v1.7.0 +[1.6.4]: https://github.com/Automattic/jetpack-partner/compare/v1.6.3...v1.6.4 +[1.6.3]: https://github.com/Automattic/jetpack-partner/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-partner/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-partner/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-partner/compare/v1.5.7...v1.6.0 +[1.5.7]: https://github.com/Automattic/jetpack-partner/compare/v1.5.6...v1.5.7 +[1.5.6]: https://github.com/Automattic/jetpack-partner/compare/v1.5.5...v1.5.6 +[1.5.5]: https://github.com/Automattic/jetpack-partner/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/Automattic/jetpack-partner/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-partner/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-partner/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-partner/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-partner/compare/v1.4.3...v1.5.0 +[1.4.3]: https://github.com/Automattic/jetpack-partner/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-partner/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-partner/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-partner/compare/v1.3.1...v1.4.0 +[1.3.1]: https://github.com/Automattic/jetpack-partner/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-partner/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-partner/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-partner/compare/v1.0.1...v1.1.0 +[1.0.1]: https://github.com/Automattic/jetpack-partner/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/composer.json new file mode 100644 index 00000000..5caacc08 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/composer.json @@ -0,0 +1,51 @@ +{ + "name": "automattic/jetpack-partner", + "description": "Support functions for Jetpack hosting partners.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-connection": "^1.51.7", + "automattic/jetpack-status": "^1.16.4" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-partner", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-partner/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.7.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php new file mode 100644 index 00000000..c664e9e8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php @@ -0,0 +1,464 @@ + array( + 'name' => 'IONOS', + 'logo' => array( + 'src' => '/images/ionos-logo.jpg', + 'width' => 119, + 'height' => 32, + ), + ), + ); + + /** + * A list of supported presets. + * + * @var array + */ + private static $supported_presets = array( + 'IONA' => 'jetpack_backup_daily', + ); + + /** + * Get singleton instance of class. + * + * @return Partner_Coupon + */ + public static function get_instance() { + if ( self::$instance === null ) { + self::$instance = new Partner_Coupon( array( Connection_Client::class, 'wpcom_json_api_request_as_blog' ) ); + } + + return self::$instance; + } + + /** + * Constructor. + * + * @param callable $request_as_blog Callable that executes a blog-authenticated request. + */ + public function __construct( $request_as_blog ) { + $this->request_as_blog = $request_as_blog; + } + + /** + * Register hooks to catch and purge coupon. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + * @param string $redirect_location The location we should redirect to after catching the coupon. + */ + public static function register_coupon_admin_hooks( $plugin_slug, $redirect_location ) { + $instance = self::get_instance(); + + // We have to use an anonymous function, so we can pass along relevant information + // and not have to hardcode values for a single plugin. + // This open up the opportunity for e.g. the "all-in-one" and backup plugins + // to both implement partner coupon logic. + add_action( + 'admin_init', + function () use ( $plugin_slug, $redirect_location, $instance ) { + $instance->catch_coupon( $plugin_slug, $redirect_location ); + $instance->maybe_purge_coupon( $plugin_slug ); + } + ); + } + + /** + * Catch partner coupon and redirect to claim component. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + * @param string $redirect_location The location we should redirect to after catching the coupon. + */ + public function catch_coupon( $plugin_slug, $redirect_location ) { + // Accept and store a partner coupon if present, and redirect to Jetpack connection screen. + $partner_coupon = isset( $_GET['jetpack-partner-coupon'] ) ? sanitize_text_field( wp_unslash( $_GET['jetpack-partner-coupon'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( $partner_coupon ) { + Jetpack_Options::update_options( + array( + self::$coupon_option => $partner_coupon, + self::$added_option => time(), + ) + ); + + $connection = new Connection_Manager( $plugin_slug ); + if ( $connection->is_connected() ) { + $redirect_location = add_query_arg( array( 'showCouponRedemption' => 1 ), $redirect_location ); + wp_safe_redirect( $redirect_location ); + } else { + wp_safe_redirect( $redirect_location ); + } + } + } + + /** + * Purge partner coupon. + * + * We try to remotely check if a coupon looks valid. We also automatically purge + * partner coupons after a certain amount of time to prevent unnecessary look-ups + * and/or promoting a product for months or years in the future due to unknown + * errors. + * + * @param string $plugin_slug The plugin slug to differentiate between Jetpack connections. + */ + public function maybe_purge_coupon( $plugin_slug ) { + // Only run coupon checks on Jetpack admin pages. + // The "admin-ui" package is responsible for registering the Jetpack admin + // page for all Jetpack plugins and has hardcoded the settings page to be + // "jetpack", so we shouldn't need to allow for dynamic/custom values. + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET['page'] ) || 'jetpack' !== $_GET['page'] ) { + return; + } + + if ( ( new Status() )->is_offline_mode() ) { + return; + } + + $connection = new Connection_Manager( $plugin_slug ); + if ( ! $connection->is_connected() ) { + return; + } + + if ( $this->maybe_purge_coupon_by_added_date() ) { + return; + } + + // Limit checks to happen once a minute at most. + if ( get_transient( self::$last_check_transient ) ) { + return; + } + + set_transient( self::$last_check_transient, true, MINUTE_IN_SECONDS ); + + $this->maybe_purge_coupon_by_availability_check(); + } + + /** + * Purge coupon based on local added date. + * + * We automatically remove the coupon after a month to "self-heal" if + * something in the claim process has broken with the site. + * + * @return bool Return whether we should skip further purge checks. + */ + protected function maybe_purge_coupon_by_added_date() { + $date = Jetpack_Options::get_option( self::$added_option, '' ); + + if ( empty( $date ) ) { + return true; + } + + $expire_date = strtotime( '+30 days', $date ); + $today = time(); + + if ( $today >= $expire_date ) { + $this->delete_coupon_data(); + + return true; + } + + return false; + } + + /** + * Purge coupon based on availability check. + * + * @return bool Return whether we deleted coupon data. + */ + protected function maybe_purge_coupon_by_availability_check() { + $blog_id = Jetpack_Options::get_option( 'id', false ); + + if ( ! $blog_id ) { + return false; + } + + $coupon = self::get_coupon(); + + if ( ! $coupon ) { + return false; + } + + $response = call_user_func_array( + $this->request_as_blog, + array( + add_query_arg( + array( 'coupon_code' => $coupon['coupon_code'] ), + sprintf( + '/sites/%d/jetpack-partner/coupon/v1/site/coupon', + $blog_id + ) + ), + 2, + array( 'method' => 'GET' ), + null, + 'wpcom', + ) + ); + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + if ( + 200 === wp_remote_retrieve_response_code( $response ) && + is_array( $body ) && + isset( $body['available'] ) && + false === $body['available'] + ) { + $this->delete_coupon_data(); + + return true; + } + + return false; + } + + /** + * Delete all coupon data. + */ + protected function delete_coupon_data() { + Jetpack_Options::delete_option( + array( + self::$coupon_option, + self::$added_option, + ) + ); + } + + /** + * Get partner coupon data. + * + * @return array|bool + */ + public static function get_coupon() { + $coupon_code = Jetpack_Options::get_option( self::$coupon_option, '' ); + + if ( ! is_string( $coupon_code ) || empty( $coupon_code ) ) { + return false; + } + + $instance = self::get_instance(); + $partner = $instance->get_coupon_partner( $coupon_code ); + + if ( ! $partner ) { + return false; + } + + $preset = $instance->get_coupon_preset( $coupon_code ); + + if ( ! $preset ) { + return false; + } + + $product = $instance->get_coupon_product( $preset ); + + if ( ! $product ) { + return false; + } + + return array( + 'coupon_code' => $coupon_code, + 'partner' => $partner, + 'preset' => $preset, + 'product' => $product, + ); + } + + /** + * Get coupon partner. + * + * @param string $coupon_code Coupon code to go through. + * @return array|bool + */ + private function get_coupon_partner( $coupon_code ) { + if ( ! is_string( $coupon_code ) || false === strpos( $coupon_code, '_' ) ) { + return false; + } + + $prefix = strtok( $coupon_code, '_' ); + $supported_partners = $this->get_supported_partners(); + + if ( ! isset( $supported_partners[ $prefix ] ) ) { + return false; + } + + return array( + 'name' => $supported_partners[ $prefix ]['name'], + 'prefix' => $prefix, + 'logo' => isset( $supported_partners[ $prefix ]['logo'] ) ? $supported_partners[ $prefix ]['logo'] : null, + ); + } + + /** + * Get coupon product. + * + * @param string $coupon_preset The preset we wish to find a product for. + * @return array|bool + */ + private function get_coupon_product( $coupon_preset ) { + if ( ! is_string( $coupon_preset ) ) { + return false; + } + + /** + * Allow for plugins to register supported products. + * + * @since 1.6.0 + * + * @param array A list of product details. + * @return array + */ + $product_details = apply_filters( 'jetpack_partner_coupon_products', array() ); + $product_slug = $this->get_supported_presets()[ $coupon_preset ]; + + foreach ( $product_details as $product ) { + if ( ! $this->array_keys_exist( array( 'title', 'slug', 'description', 'features' ), $product ) ) { + continue; + } + + if ( $product_slug === $product['slug'] ) { + return $product; + } + } + + return false; + } + + /** + * Checks if multiple keys are present in an array. + * + * @param array $needles The keys we wish to check for. + * @param array $haystack The array we want to compare keys against. + * + * @return bool + */ + private function array_keys_exist( $needles, $haystack ) { + foreach ( $needles as $needle ) { + if ( ! isset( $haystack[ $needle ] ) ) { + return false; + } + } + + return true; + } + + /** + * Get coupon preset. + * + * @param string $coupon_code Coupon code to go through. + * @return string|bool + */ + private function get_coupon_preset( $coupon_code ) { + if ( ! is_string( $coupon_code ) ) { + return false; + } + + $regex = '/^.*?_(?P.*?)_.+$/'; + $matches = array(); + + if ( ! preg_match( $regex, $coupon_code, $matches ) ) { + return false; + } + + return isset( $this->get_supported_presets()[ $matches['slug'] ] ) ? $matches['slug'] : false; + } + + /** + * Get supported partners. + * + * @return array + */ + private function get_supported_partners() { + /** + * Allow external code to add additional supported partners. + * + * @since 1.6.0 + * + * @param array $supported_partners A list of supported partners. + * @return array + */ + return apply_filters( 'jetpack_partner_coupon_supported_partners', self::$supported_partners ); + } + + /** + * Get supported presets. + * + * @return array + */ + private function get_supported_presets() { + /** + * Allow external code to add additional supported presets. + * + * @since 1.6.0 + * + * @param array $supported_presets A list of supported presets. + * @return array + */ + return apply_filters( 'jetpack_partner_coupon_supported_presets', self::$supported_presets ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php new file mode 100644 index 00000000..2d70c521 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php @@ -0,0 +1,199 @@ +add_code_as_query_arg( self::SUBSIDIARY_CODE, $url ); + } + + /** + * Adds the affiliate code to the passed URL. + * + * @param string $url The URL. + * + * @return string + */ + public function add_affiliate_code_as_query_arg( $url ) { + return $this->add_code_as_query_arg( self::AFFILIATE_CODE, $url ); + } + + /** + * Adds the partner subsidiary code to the passed array. + * + * @param array $params The parameters array. + * + * @return array + * @since 1.5.0 + */ + public function add_subsidiary_id_to_params_array( $params ) { + if ( ! is_array( $params ) ) { + return $params; + } + return array_merge( $params, $this->get_code_as_array( self::SUBSIDIARY_CODE ) ); + } + + /** + * Adds the affiliate code to the passed array. + * + * @param array $params The parameters array. + * + * @return array + * @since 1.5.0 + */ + public function add_affiliate_code_to_params_array( $params ) { + if ( ! is_array( $params ) ) { + return $params; + } + return array_merge( $params, $this->get_code_as_array( self::AFFILIATE_CODE ) ); + } + + /** + * Returns the passed URL with the partner code added as a URL query arg. + * + * @param string $type The partner code. + * @param string $url The URL where the partner subsidiary id will be added. + * + * @return string The passed URL with the partner code added. + * @since 1.0.0 + */ + public function add_code_as_query_arg( $type, $url ) { + return add_query_arg( $this->get_code_as_array( $type ), $url ); + } + + /** + * Gets the partner code in an associative array format + * + * @param string $type The partner code. + * @return array + * @since 1.5.0 + */ + private function get_code_as_array( $type ) { + switch ( $type ) { + case self::AFFILIATE_CODE: + $query_arg_name = 'aff'; + break; + case self::SUBSIDIARY_CODE: + $query_arg_name = 'subsidiaryId'; + break; + default: + return array(); + } + + $code = $this->get_partner_code( $type ); + + if ( '' === $code ) { + return array(); + } + + return array( $query_arg_name => $code ); + } + + /** + * Returns a partner code. + * + * @param string $type This can be either 'affiliate' or 'subsidiary'. Returns empty string when code is unknown. + * + * @return string The partner code. + * @since 1.0.0 + */ + public function get_partner_code( $type ) { + switch ( $type ) { + case self::AFFILIATE_CODE: + /** + * Allow to filter the affiliate code. + * + * @param string $affiliate_code The affiliate code, blank by default. + * + * @since 1.0.0 + * @since-jetpack 6.9.0 + */ + return apply_filters( 'jetpack_affiliate_code', get_option( 'jetpack_affiliate_code', '' ) ); + case self::SUBSIDIARY_CODE: + /** + * Allow to filter the partner subsidiary id. + * + * @param string $subsidiary_id The partner subsidiary id, blank by default. + * + * @since 1.0.0 + */ + return apply_filters( + 'jetpack_partner_subsidiary_id', + get_option( 'jetpack_partner_subsidiary_id', '' ) + ); + default: + return ''; + } + } + + /** + * Resets the singleton for testing purposes. + */ + public static function reset() { + self::$instance = null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md new file mode 100644 index 00000000..fd9fd790 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/CHANGELOG.md @@ -0,0 +1,128 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.13] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.2.12] - 2023-03-20 +### Changed +- Updated package dependencies. [#29480] + +## [0.2.11] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.10] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [0.2.9] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.8] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.7] - 2022-09-20 +### Changed +- Updated package dependencies. + +## [0.2.6] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.2.5] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [0.2.4] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [0.2.3] - 2022-03-29 +### Changed +- Microperformance: Use === null instead of is_null + +## [0.2.2] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [0.2.1] - 2022-01-18 +### Changed +- Updated package dependencies. + +## [0.2.0] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies +- Updated package textdomain from `jetpack` to `jetpack-password-checker`. + +## [0.1.8] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [0.1.7] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [0.1.6] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [0.1.5] - 2021-10-12 +### Changed +- Updated package dependencies + +## [0.1.4] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [0.1.3] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [0.1.2] - 2021-05-25 +### Fixed +- Avoid checking in vendor directory. + +## [0.1.1] - 2021-04-27 +### Changed +- Updated package dependencies. + +## 0.1.0 - 2021-03-30 +### Added +- Initial release. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +[0.2.13]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.12...v0.2.13 +[0.2.12]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.11...v0.2.12 +[0.2.11]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.10...v0.2.11 +[0.2.10]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.9...v0.2.10 +[0.2.9]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.8...v0.2.9 +[0.2.8]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.7...v0.2.8 +[0.2.7]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.6...v0.2.7 +[0.2.6]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.5...v0.2.6 +[0.2.5]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.4...v0.2.5 +[0.2.4]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.3...v0.2.4 +[0.2.3]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-password-checker/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.8...v0.2.0 +[0.1.8]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.7...v0.1.8 +[0.1.7]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.6...v0.1.7 +[0.1.6]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-password-checker/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json new file mode 100644 index 00000000..305f4f12 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/composer.json @@ -0,0 +1,48 @@ +{ + "name": "automattic/jetpack-password-checker", + "description": "Password Checker.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-password-checker", + "textdomain": "jetpack-password-checker", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-password-checker/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php new file mode 100644 index 00000000..79c369c2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php @@ -0,0 +1,1313 @@ +user_id = get_current_user_id(); + } elseif ( is_object( $user ) && isset( $user->ID ) ) { + // Existing user, using their ID. + $this->user_id = $user->ID; + } elseif ( is_object( $user ) ) { + // Newly created user, using existing data. + $this->user = $user; + $this->user_id = 'new_user'; + } else { + $this->user_id = $user; + } + + /** + * Filters the password strength enforcement settings. + * + * You can supply your own passwords that should not be used for authenticating in addition to weak and easy + * to guess strings for each user. For example, you can add passwords from known password databases to avoid + * compromised password usage. + * + * @param array $common_passwords strings that are forbidden for use as passwords. + */ + $this->common_passwords = apply_filters( 'password_checker_common_passwords', $this->common_passwords ); + + /** + * Filters the password strength enforcement settings. + * + * You can modify the minimum password length using this filter. + * + * @param int $minimum_password_length minimum password length. + */ + $this->minimum_password_length = apply_filters( 'password_checker_minimum_password_length', $this->minimum_password_length ); + + /** + * Filters the password strength enforcement settings. + * + * You can modify the minimum entropy bits requirement using this filter. + * + * @param int $minimum_entropy_bits minimum entropy bits requirement. + */ + $this->minimum_entropy_bits = apply_filters( 'password_checker_minimum_entropy_bits', $this->minimum_entropy_bits ); + } + + /** + * Run tests against a password. + * + * @param string $password the password. + * @param bool $required_only only test against required conditions, defaults to false. + * + * @return array an array containing failed and passed test results. + */ + public function test( $password, $required_only = false ) { + // Run the tests. + $results = $this->run_tests( $password, $this->get_tests(), $required_only ); + + // If we've failed on the required tests, return now. + if ( ! empty( $results['failed'] ) ) { + return array( + 'passed' => false, + 'test_results' => $results, + ); + } + + $entropy_bits = $this->calculate_entropy_bits( $password ); + + // If we have failed the entropy bits test, run the regex tests so we can suggest improvements. + if ( $entropy_bits < $this->minimum_entropy_bits ) { + $results['failed']['entropy_bits'] = $entropy_bits; + // Run the tests. + $results = array_merge( $results, $this->run_tests( $password, $this->get_tests( 'preg_match' ) ) ); + } + + return ( array( + 'passed' => empty( $results['failed'] ), + 'test_results' => $results, + ) ); + } + + /** + * Run the tests using the currently set up object values. + * + * @param string $password the password. + * @param array $tests tests to run. + * @param bool $required_only whether to run only required tests. + * + * @return array test results. + */ + public function run_tests( $password, $tests, $required_only = false ) { + $results = array( + 'passed' => array(), + 'failed' => array(), + ); + + foreach ( $tests as $test_type => $section_tests ) { + foreach ( $section_tests as $test_name => $test_data ) { + // Skip non-required tests if required_only param is set. + if ( $required_only && ! $test_data['required'] ) { + continue; + } + + $result = call_user_func_array( array( $this, 'test_' . $test_type ), array( $password, $test_data ) ); + if ( $result ) { + $results['passed'][] = array( 'test_name' => $test_name ); + } else { + $results['failed'][] = array( + 'test_name' => $test_name, + 'explanation' => $test_data['error'], + ); + + if ( isset( $test_data['fail_immediately'] ) ) { + return $results; + } + } + } + } + + return $results; + } + + /** + * Returns an array of tests that need to be run on password strings. + * + * @param array $sections only return specific sections with the passed keys, defaults to all. + * + * @return array test descriptions. + */ + public function get_tests( $sections = false ) { + // Note: these should be in order of priority. + $tests = array( + 'preg_match' => array( + 'no_backslashes' => array( + 'pattern' => '/^[^\\\\]*$/u', + 'error' => __( 'Passwords may not contain the character "\".', 'jetpack-password-checker' ), + 'required' => true, + 'fail_immediately' => true, + ), + 'minimum_length' => array( + 'pattern' => '/^.{' . $this->minimum_password_length . ',}/u', + /* translators: %d is a number of characters in the password. */ + 'error' => sprintf( __( 'Password must be at least %d characters.', 'jetpack-password-checker' ), $this->minimum_password_length ), + 'required' => true, + 'fail_immediately' => true, + ), + 'has_mixed_case' => array( + 'pattern' => '/([a-z].*?[A-Z]|[A-Z].*?[a-z])/u', + 'error' => __( 'This password is too easy to guess: you can improve it by adding additional uppercase letters, lowercase letters, or numbers.', 'jetpack-password-checker' ), + 'required' => false, + ), + 'has_digit' => array( + 'pattern' => '/\d/u', + 'error' => __( 'This password is too easy to guess: you can improve it by mixing both letters and numbers.', 'jetpack-password-checker' ), + 'required' => false, + ), + 'has_special_char' => array( + 'pattern' => '/[^a-zA-Z\d]/u', + 'error' => __( 'This password is too easy to guess: you can improve it by including special characters such as !#=?*&.', 'jetpack-password-checker' ), + 'required' => false, + ), + ), + 'compare_to_list' => array( + 'not_a_common_password' => array( + 'list_callback' => 'get_common_passwords', + 'compare_callback' => 'negative_in_array', + 'error' => __( 'This is a very common password. Choose something that will be harder for others to guess.', 'jetpack-password-checker' ), + 'required' => true, + ), + 'not_same_as_other_user_data' => array( + 'list_callback' => 'get_other_user_data', + 'compare_callback' => 'test_not_same_as_other_user_data', + 'error' => __( 'Your password is too weak: Looks like you are including easy to guess information about yourself. Try something a little more unique.', 'jetpack-password-checker' ), + 'required' => true, + ), + ), + ); + + /** + * Filters the password strength enforcement settings. + * + * You can determine the tests run and their order based on whatever criteria you wish to specify. + * + * @param array $tests tests to run. + */ + $tests = apply_filters( 'password_checker_tests', $tests ); + + if ( ! $sections ) { + return $tests; + } + + $sections = (array) $sections; + + return array_intersect_key( $tests, array_flip( $sections ) ); + } + + /** + * Provides the regular expression tester functionality. + * + * @param string $password the password. + * @param array $test_data the current test data. + * + * @return bool does the test pass? + */ + protected function test_preg_match( $password, $test_data ) { + return preg_match( $test_data['pattern'], $password ); + } + + /** + * Provides the comparison tester functionality. + * + * @param string $password the password. + * @param array $test_data the current test data. + * + * @return bool does the test pass? + */ + protected function test_compare_to_list( $password, $test_data ) { + if ( + ! is_callable( array( $this, $test_data['list_callback'] ) ) + || ! is_callable( array( $this, $test_data['compare_callback'] ) ) + ) { + return false; + } + + return call_user_func( + array( + $this, + $test_data['compare_callback'], + ), + $password, + call_user_func( array( $this, $test_data['list_callback'] ) ) + ); + } + + /** + * Getter for the common password list. + * + * @return array common passwords. + */ + protected function get_common_passwords() { + return $this->common_passwords; + } + + /** + * Returns the widely known user data that can not be used in the password to avoid + * predictable strings. + * + * @return array user data. + */ + protected function get_other_user_data() { + if ( empty( $this->user_id ) ) { + return array(); + } + + $user_data = get_userdata( $this->user_id ); + if ( ! $user_data ) { + return array(); + } + + if ( isset( $user_data->ID ) ) { + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'first_name', true ) ); + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'last_name', true ) ); + $this->add_user_strings_to_test( get_user_meta( $user_data->ID, 'nickname', true ) ); + } + + if ( isset( $user_data->user_nicename ) ) { + $this->add_user_strings_to_test( $user_data->user_nicename ); + } + + if ( isset( $user_data->display_name ) ) { + $this->add_user_strings_to_test( $user_data->display_name ); + } + + if ( isset( $user_data->first_name ) ) { + $this->add_user_strings_to_test( $user_data->first_name ); + } + + if ( isset( $user_data->last_name ) ) { + $this->add_user_strings_to_test( $user_data->last_name ); + } + + if ( isset( $user_data->user_email ) ) { + $email_username = substr( $user_data->user_email, 0, strpos( $user_data->user_email, '@' ) ); + $this->add_user_strings_to_test( $email_username, '.' ); + $this->add_user_strings_to_test( $user_data->user_email ); + } + + return $this->get_user_strings_to_test(); + } + + /** + * Compare the password for matches with known user data. + * + * @param string $password the password. + * @param array $strings_to_test known user data. + * + * @return bool does the test pass? + */ + protected function test_not_same_as_other_user_data( $password, $strings_to_test ) { + if ( empty( $strings_to_test ) ) { + return false; + } + + $password_lowercase = strtolower( $password ); + + foreach ( $strings_to_test as $string ) { + $string = strtolower( $string ); + $string_reversed = strrev( $string ); + + if ( $password_lowercase === $string || $password_lowercase === $string_reversed ) { + return false; + } + + // Also check for the string or reversed string with any numbers just stuck to the end to catch things like bob123 as passwords. + if ( + preg_match( '/^' . preg_quote( $string, '/' ) . '\d+$/', $password_lowercase ) + || preg_match( '/^' . preg_quote( $string_reversed, '/' ) . '\d+$/', $password_lowercase ) + ) { + return false; + } + } + + return true; + } + + /** + * A shorthand for the not in array construct. + * + * @param mixed $needle the needle. + * @param array $haystack the haystack. + * + * @return bool is the needle not in the haystack? + */ + protected function negative_in_array( $needle, $haystack ) { + return ! in_array( $needle, $haystack, true ); + } + + /** + * A helper function used to break a single string into its constituents so + * that both the full string and its constituents and any variants thereof + * can be tested against the password. + * + * @param string $string the string to be broken down. + * @param string $explode_delimiter delimiter. + * + * @return bool + */ + protected function add_user_strings_to_test( $string, $explode_delimiter = ' ' ) { + // Don't check against empty strings. + if ( empty( $string ) ) { + return false; + } + + $strings = explode( $explode_delimiter, $string ); + + // Remove any non alpha numeric characters from the strings to check against. + foreach ( $strings as $key => $_string ) { + $_string = trim( preg_replace( '/[^a-zA-Z0-9]/', '', $_string ) ); + if ( empty( $_string ) ) { + continue; + } + + $strings[ $key ] = $_string; + } + + // Check the original too. + $strings[] = trim( $string ); + + // Check the original minus non alpha numeric characters. + $strings[] = trim( preg_replace( '/[^a-zA-Z0-9]/', '', $string ) ); + + // Remove any empty strings. + // Note: This will also filter out '0'. + $strings = array_filter( $strings ); + if ( empty( $strings ) ) { + return false; + } + + $this->user_strings_to_test = array_unique( array_merge( $this->user_strings_to_test, $strings ) ); + + return true; + } + + /** + * Getter for the user strings array. + * + * @return array user strings. + */ + protected function get_user_strings_to_test() { + return $this->user_strings_to_test; + } + + /** + * Return a character set size that is used in the string. + * + * @param string $password the password. + * + * @return int number of different character sets in use. + */ + protected function get_charset_size( $password ) { + $size = 0; + + // Lowercase a-z. + if ( preg_match( '/[a-z]/', $password ) ) { + $size += 26; + } + + // Uppercase A-Z. + if ( preg_match( '/[A-Z]/', substr( $password, 1, - 1 ) ) ) { + $size += 26; + } + + // Digits. + if ( preg_match( '/\d/', substr( $password, 1, - 1 ) ) ) { + $size += 10; + } + + // Over digits symbols. + if ( preg_match( '/[!|@|#|$|%|^|&|*|(|)]/', $password ) ) { + $size += 10; + } + + // Other symbols. + if ( preg_match( '#[`|~|-|_|=|+|\[|{|\]|}|\\|\|;:\'",<\.>/\?]#', $password ) ) { + $size += 20; + } + + // Spaces. + if ( strpos( $password, ' ' ) ) { + ++$size; + } + + return $size; + } + + /** + * Shorthand for getting a character index. + * + * @param string $char character. + * + * @return int the character code. + */ + protected function get_char_index( $char ) { + $char = strtolower( $char[0] ); + if ( $char < 'a' || $char > 'z' ) { + return 0; + } else { + return ord( $char[0] ) - ord( 'a' ) + 1; + } + } + + /** + * This is the password strength calculation algorithm, based on the formula H = L(logN/log2). + * + * H = Entropy + * L = String length (the for iterator) + * N = Our charset size, via get_charset_size() + * + * @see https://en.wikipedia.org/wiki/Password_strength#Random_passwords + * + * On top of the base formula, we're also multiplying the bits of entropy for every char + * by 1 - (the probabily of it following the previous char) + * i.e.: the probablity of U following Q is ~0.84. If our password contains this pair of characters, + * the u char will only add ( 0.16^2 * charset_score ) to our total of entropy bits. + * + * @param string $password the password. + * + * @return float|int + */ + protected function calculate_entropy_bits( $password ) { + $bits = 0; + // Calculate the score. + $charset_score = log( $this->get_charset_size( $password ) ) / log( 2 ); + + $aidx = $this->get_char_index( $password[0] ); + $length = strlen( $password ); + + for ( $b = 1; $b < $length; $b++ ) { + $bidx = $this->get_char_index( $password[ $b ] ); + + // 27 = number of chars in the index (a-z,' '). + $c = 1.0 - $this->frequency_table[ $aidx * 27 + $bidx ]; + + // Increment the bits. + $bits += $charset_score * $c * $c; + + // Move on to next pair. + $aidx = $bidx; + } + + return $bits; + } + + /** + * A frequency table of character pairs, starting with ' ' then ' a', ' b' [...] , 'a ', 'aa' etc. + * + * @see http://rumkin.com/tools/password/passchk.php + * + * @var array + */ + public $frequency_table = array( + 0.23653710453418866, + 0.04577693541332556, + 0.03449832337075375, + 0.042918209651552706, + 0.037390873305146524, + 0.028509112115468728, + 0.02350896632162123, + 0.022188657238664526, + 0.028429800262428927, + 0.04357019973757107, + 0.00913602565971716, + 0.03223093745443942, + 0.02235311269864412, + 0.04438081352966905, + 0.04512377897652719, + 0.020055401662049863, + 0.055903192885260244, + 0.0024388394809739026, + 0.035207464644991984, + 0.07355941099285611, + 0.036905671380667734, + 0.026134421927394666, + 0.023787724158040528, + 0.011352092141711621, + 0.0032354570637119114, + 0.005986878553725033, + 0.008861933226417843, + 0.11511532293337222, + 0.027556203528211108, + 0.024331243621519172, + 0.039266365359381834, + 0.031599941682461, + 0.014403265782183991, + 0.015480973902901297, + 0.027770812071730572, + 0.00942761335471643, + 0.039872867764980315, + 0.0078122175244204695, + 0.02808456043154979, + 0.08429100451960927, + 0.04688963405744277, + 0.13831170724595424, + 0.002540311998833649, + 0.025211838460416972, + 0.001543082081936142, + 0.09519638431258201, + 0.061845750109345385, + 0.08907071001603732, + 0.02137571074500656, + 0.027093162268552268, + 0.005521504592506197, + 0.003023181221752442, + 0.007086747339262283, + 0.010262720513194342, + 0.08785070710016038, + 0.14617757690625455, + 0.03417291150313457, + 0.0059635515381250915, + 0.006146668610584633, + 0.195202799241872, + 0.002774748505613063, + 0.004715556203528212, + 0.0044776206444088066, + 0.11205481848665985, + 0.005654468581425864, + 0.0028820527773727946, + 0.07383000437381543, + 0.005516839189386207, + 0.006496573844583759, + 0.09843067502551392, + 0.0027140982650532145, + 0.0006893133109782768, + 0.08425368129464937, + 0.021325557661466685, + 0.006493074792243767, + 0.07023414491908442, + 0.002077270739174807, + 0.0024633328473538415, + 0.0007744569179180639, + 0.015413325557661468, + 0.0011990086018370024, + 0.13162851727657093, + 0.10115993585070711, + 0.0026989357049132527, + 0.03319317684793702, + 0.002946202070272634, + 0.0783216212275842, + 0.0018358361277154103, + 0.00258813238081353, + 0.2141688292754046, + 0.09853681294649366, + 0.0032482869222918796, + 0.04359352675317102, + 0.01993526753171016, + 0.0036880011663507797, + 0.008011663507799971, + 0.12014696019827964, + 0.0029846916460125384, + 0.0017553579238956116, + 0.029470185158186325, + 0.010413179763813967, + 0.030699518880303252, + 0.03508499781309229, + 0.002021285901734947, + 0.0010613792097973467, + 0.0005295232541186761, + 0.009677212421635807, + 0.010585799679253535, + 0.17101734946785244, + 0.07968625164018078, + 0.007839043592360402, + 0.005438693687126403, + 0.0183606939787141, + 0.2732701559994168, + 0.004953491762647616, + 0.007259367254701851, + 0.008104971570199739, + 0.13274588132380813, + 0.004210526315789474, + 0.004997813092287506, + 0.017006560723137484, + 0.007442484327161393, + 0.016789619478058026, + 0.08477737279486806, + 0.005106283714827234, + 0.0005026971861787433, + 0.04040355736987899, + 0.037535500801866156, + 0.00885960052485785, + 0.0336410555474559, + 0.007066919376002332, + 0.005344219273946639, + 0.0006333284735384167, + 0.010684939495553289, + 0.0063064586674442345, + 0.15386849394955532, + 0.015049424114302375, + 0.012162705933809595, + 0.020425134859308938, + 0.037366379938766583, + 0.02157165767604607, + 0.009373961218836564, + 0.0173214754337367, + 0.009616562181075958, + 0.029522670943286193, + 0.010154249890654615, + 0.018600962239393497, + 0.06362210234728094, + 0.03157078291296107, + 0.151603440734801, + 0.0062329785683044175, + 0.014775331681003062, + 0.0020854351946347867, + 0.1826342032366234, + 0.0878017203674005, + 0.054190989940224525, + 0.010329202507654177, + 0.012763376585508092, + 0.0064872430383437815, + 0.006381105117364048, + 0.005388540603586529, + 0.0090800408222773, + 0.09611196967487973, + 0.09940691062837148, + 0.01033969966467415, + 0.004034407348009914, + 0.008826942703017933, + 0.11474675608689314, + 0.07132584924916169, + 0.012388977985129028, + 0.005435194634786413, + 0.1417174515235457, + 0.0037066627788307337, + 0.0045802595130485495, + 0.060800699810468, + 0.005341886572386646, + 0.005683627350925791, + 0.12434932205860913, + 0.004596588423968508, + 0.0007534626038781163, + 0.07107041842834232, + 0.022361277154104096, + 0.04784720804782038, + 0.06277533168100306, + 0.003441901151771395, + 0.005828254847645429, + 0.0009669047966175828, + 0.009470768333576322, + 0.002077270739174807, + 0.12797667298440007, + 0.08797783933518005, + 0.005388540603586529, + 0.0024913252660737715, + 0.007550954949701123, + 0.2786866890217233, + 0.002509986878553725, + 0.029002478495407494, + 0.0303204548768042, + 0.07576614666861058, + 0.00246799825047383, + 0.00592389561160519, + 0.039574281965301064, + 0.00706808572678233, + 0.03304505029887739, + 0.05474150750838315, + 0.0028633911648928414, + 0.0005073625892987316, + 0.07293541332555767, + 0.053528502697186175, + 0.022566554891383584, + 0.038151334013704616, + 0.002716430966613209, + 0.005049132526607377, + 0.0009902318122175246, + 0.008997229916897508, + 0.0011861787432570347, + 0.1666377022889634, + 0.14414462749671964, + 0.003374252806531564, + 0.005169266656947077, + 0.008468873013558828, + 0.16337541915731155, + 0.002873888321912815, + 0.004305000728969237, + 0.0031141565825922144, + 0.1241172182533897, + 0.0052800699810468, + 0.008969237498177577, + 0.024094474413179766, + 0.017029887738737422, + 0.01722700102055693, + 0.10618457501093455, + 0.006147834961364631, + 0.0008269427030179326, + 0.03303571949263741, + 0.024188948826359528, + 0.05213937891820965, + 0.04505846333284735, + 0.0035270447587111824, + 0.006799825047383001, + 0.0008199445983379502, + 0.02206735675754483, + 0.001010059775477475, + 0.11971191135734072, + 0.04656538854060359, + 0.011243621519171892, + 0.06513019390581717, + 0.032375564951159064, + 0.06347047674588133, + 0.013678961947805804, + 0.03309870243475726, + 0.006982942119842543, + 0.009726199154395685, + 0.010121592068814697, + 0.032514360693978714, + 0.04986032949409535, + 0.039734072022160664, + 0.15690683773144773, + 0.03949963551538125, + 0.014790494241143023, + 0.002722262720513194, + 0.02614375273363464, + 0.10753637556495116, + 0.06764834523983088, + 0.006221315060504448, + 0.021317393206006705, + 0.0030826651115322934, + 0.002399183554454002, + 0.0019069835252952323, + 0.015595276279341012, + 0.0925126111678087, + 0.18437906400349907, + 0.006538562472663654, + 0.008719638431258201, + 0.02116693395538708, + 0.18241376293920394, + 0.007290858725761773, + 0.005976381396705059, + 0.005629975215045925, + 0.09721300481119698, + 0.004810030616707975, + 0.024303251202799244, + 0.012954658113427612, + 0.011057005394372358, + 0.02733459688001166, + 0.10135121737862662, + 0.012016912086309959, + 0.001055547455897361, + 0.009027555037177431, + 0.07162326869806095, + 0.01007143898527482, + 0.07297623560285756, + 0.006741507508383147, + 0.0036891675171307776, + 0.0008409389123778977, + 0.011272780288671819, + 0.007020265344802449, + 0.1030389269572824, + 0.15350809155853623, + 0.004232686980609419, + 0.004353987461729115, + 0.0023385333138941536, + 0.14450386353695874, + 0.002546143752733635, + 0.0024470039364338824, + 0.01200758128006998, + 0.0981227584195947, + 0.003161976964572095, + 0.040695145064878264, + 0.03460446129173349, + 0.003908441463770229, + 0.01598483743986004, + 0.13107216795451232, + 0.003129319142732177, + 0.00032307916605919226, + 0.04050386353695874, + 0.05452689896486368, + 0.03589677795597026, + 0.07087097244496282, + 0.006143169558244642, + 0.008684647907858289, + 0.0004607085580988482, + 0.022010205569324977, + 0.0009097536083977258, + 0.07328765126111678, + 0.14751421490013122, + 0.008015162560139961, + 0.006601545414783497, + 0.025279486805656802, + 0.1682449336637994, + 0.008313748359819215, + 0.007010934538562473, + 0.005886572386645284, + 0.16889575739903775, + 0.004123050007289692, + 0.011925936725470185, + 0.10007289692374982, + 0.013380376148126549, + 0.009021723283277445, + 0.08650823735238372, + 0.007756232686980609, + 0.0007243038343781893, + 0.0026791077416533026, + 0.02797492345823006, + 0.032384895757399036, + 0.04187432570345531, + 0.00882461000145794, + 0.0032401224668318998, + 0.00033357632307916605, + 0.027878116343490307, + 0.0022277299897944304, + 0.14333518005540166, + 0.1725534334451086, + 0.02781629975215046, + 0.006909462020702727, + 0.005264907420906838, + 0.16661437527336345, + 0.004325995043009185, + 0.003334596880011664, + 0.005312727802886718, + 0.14024668318996938, + 0.0013261408368566844, + 0.003504884093891238, + 0.006375273363464061, + 0.04964922000291588, + 0.008290421344219274, + 0.09536783787724158, + 0.05394372357486515, + 0.005505175681586237, + 0.005339553870826651, + 0.01782067356757545, + 0.006710016037323225, + 0.05105933809593235, + 0.002983525295232541, + 0.002940370316372649, + 0.0004548768041988629, + 0.01208456043154979, + 0.000915585362297711, + 0.20146260387811635, + 0.067196967487972, + 0.006158332118384605, + 0.025438110511736407, + 0.07753783350342616, + 0.1273876658405015, + 0.009337804344656656, + 0.07683452398308792, + 0.0070412596588423975, + 0.08747164309666132, + 0.0038827817466102928, + 0.018116926665694706, + 0.005017641055547455, + 0.004567429654468581, + 0.028277008310249308, + 0.05271555620352821, + 0.004394809739029013, + 0.0013343052923166642, + 0.00411605190260971, + 0.059621519171890944, + 0.09073859163143316, + 0.01446858142586383, + 0.006770666277883074, + 0.003425572240851436, + 0.0004455459979588861, + 0.010401516256013998, + 0.005825922146085436, + 0.10833882490158916, + 0.007584779122321038, + 0.016903921854497742, + 0.02719580113719201, + 0.0304814112844438, + 0.02206385770520484, + 0.013064295086747339, + 0.02696369733197259, + 0.009581571657676046, + 0.026761918647033093, + 0.006510570053943724, + 0.021941390873305145, + 0.07042659279778393, + 0.05437410701268406, + 0.1425175681586237, + 0.027802303542790494, + 0.037690625455605774, + 0.0019606356611750987, + 0.1095623268698061, + 0.06157748942994606, + 0.044618749088788455, + 0.04955124653739612, + 0.03608689313310978, + 0.018381688292754043, + 0.003404577926811489, + 0.015036594255722409, + 0.009600233270156, + 0.10794693103951014, + 0.12447528794284882, + 0.0031981338387520046, + 0.0074716430966613205, + 0.003202799241871993, + 0.13437643971424407, + 0.006655197550663361, + 0.0036693395538708266, + 0.049338970695436656, + 0.09486863974340283, + 0.0015990669193760023, + 0.0026604461291733486, + 0.051775477474850555, + 0.0041347135150896636, + 0.005450357194926374, + 0.12030325120279925, + 0.04581309228750547, + 0.0004537104534188657, + 0.12425601399620935, + 0.025981629975215047, + 0.023926519900860182, + 0.04423385333138941, + 0.0017950138504155123, + 0.002661612479953346, + 0.0006333284735384167, + 0.008449045050298877, + 0.000653156436798367, + 0.04816678816153958, + 0.008625164018078437, + 0.0039037760606502403, + 0.005228750546726928, + 0.004531272780288672, + 0.0056672984400058316, + 0.00359585945473101, + 0.0032179618020119548, + 0.0038093016474704767, + 0.011452398308791368, + 0.002519317684793702, + 0.00280390727511299, + 0.005572824026826068, + 0.004554599795888614, + 0.004531272780288672, + 0.0035841959469310393, + 0.004400641492928998, + 0.0036670068523108326, + 0.004839189386207902, + 0.006258638285464354, + 0.004897506925207757, + 0.840776789619478, + 0.004968654322787578, + 0.002886718180492783, + 0.0019757982213150604, + 0.0018568304417553576, + 0.001691208630995772, + 0.09009243329931477, + 0.14030150167662925, + 0.013242746756086894, + 0.013746610293045632, + 0.027342761335471644, + 0.16938912377897652, + 0.006607377168683481, + 0.01661933226417845, + 0.008173786266219566, + 0.13297448607668758, + 0.0034675608689313307, + 0.016641492928998396, + 0.011722991689750693, + 0.021493512173786266, + 0.03430820819361423, + 0.10099548039072752, + 0.00873596734217816, + 0.0018323370753754193, + 0.020103222044029742, + 0.047197550663362, + 0.040833940807697915, + 0.03361189677795597, + 0.010844729552412887, + 0.005544831608106138, + 0.0007522962530981193, + 0.01525120279924187, + 0.00815512465373961, + 0.2109648636827526, + 0.058258055110074355, + 0.007181221752442048, + 0.043560868931331105, + 0.004058900714389853, + 0.10618107595859454, + 0.0062399766729844, + 0.004835690333867911, + 0.02679224376731302, + 0.08414637702288964, + 0.0030698352529523252, + 0.03637498177576906, + 0.01592885260242018, + 0.017413617145356466, + 0.008430383437818923, + 0.037231083248286924, + 0.03290275550371775, + 0.007538125091121154, + 0.004500947660008748, + 0.05932409972299169, + 0.16006764834523984, + 0.03309636973319726, + 0.007766729844000583, + 0.005225251494386936, + 0.0006321621227584196, + 0.012989648636827526, + 0.005274238227146815, + 0.1254503571949264, + 0.12852719055255868, + 0.0035433736696311416, + 0.005203090829566993, + 0.0019314768916751715, + 0.20520775623268697, + 0.002509986878553725, + 0.00343606939787141, + 0.027138649948972155, + 0.13926578218399185, + 0.004565096952908587, + 0.005614812654905963, + 0.00874413179763814, + 0.004109053797929727, + 0.008300918501239247, + 0.08270943286193323, + 0.002912377897652719, + 0.0037066627788307337, + 0.06909578655780726, + 0.03242805073625893, + 0.05237614812654906, + 0.04723487388832191, + 0.0038991106575302524, + 0.006299460562764251, + 0.00043388249015891526, + 0.020029741944889927, + 0.005311561452106721, + 0.09334072022160665, + 0.022940953491762648, + 0.024658988190698353, + 0.02901297565242747, + 0.03531593526753171, + 0.0758023035427905, + 0.013711619769645722, + 0.021597317393206007, + 0.009670214316955824, + 0.044728386062108175, + 0.010596296836273509, + 0.03264382563055839, + 0.0604822860475288, + 0.05489546581134276, + 0.11501851581863246, + 0.01837585653885406, + 0.026237060796034405, + 0.0011255285026971862, + 0.08704125965884241, + 0.10156349322058608, + 0.06660562764251349, + 0.023434319871701415, + 0.010777081207173057, + 0.005409534917626476, + 0.003123487388832191, + 0.0028762210234728096, + 0.0089995626184575, + 0.07518297127861205, + 0.2314868056568013, + 0.002226563639014434, + 0.003285610147251786, + 0.0027455897361131363, + 0.2724537104534189, + 0.0016655489138358362, + 0.0019209797346551977, + 0.0022137337804344656, + 0.17690392185449774, + 0.0014532730718763668, + 0.0024994897215337513, + 0.015302522233561744, + 0.003441901151771395, + 0.015303688584341741, + 0.09314593964134713, + 0.0017833503426155418, + 0.0005108616416387229, + 0.017828838023035427, + 0.010385187345094037, + 0.003168975069252078, + 0.01902901297565243, + 0.005525003644846187, + 0.0010088934246974776, + 0.0009272488700976819, + 0.036282840064149294, + 0.0022977110365942554, + 0.0766805656801283, + 0.22270418428342326, + 0.005283569033386791, + 0.007155562035282111, + 0.01173582154833066, + 0.1715620352821111, + 0.003925936725470185, + 0.004425134859308937, + 0.020040239101909902, + 0.14243242455168392, + 0.0016737133692958156, + 0.0066808572678232975, + 0.011980755212130047, + 0.012638577052048404, + 0.07206065024055984, + 0.08115701997375711, + 0.00710424260096224, + 0.0007278028867181805, + 0.02347630849978131, + 0.04595538708266512, + 0.01481965301064295, + 0.013925061962385188, + 0.0018125091121154687, + 0.00529173348884677, + 0.0016340574427759146, + 0.03072401224668319, + 0.0023746901880740633, + 0.25174165330223064, + 0.06673392622831317, + 0.00878378772415804, + 0.03956261845750109, + 0.010077270739174807, + 0.0844787869951888, + 0.00985216503863537, + 0.004973319725907567, + 0.01893220586091267, + 0.11200583175389998, + 0.0028715556203528212, + 0.004095057588569762, + 0.01202391019098994, + 0.01756757544831608, + 0.014825484764542934, + 0.05312961073042717, + 0.06746872721971132, + 0.003845458521650386, + 0.0210806239976673, + 0.019443067502551394, + 0.08017028721387957, + 0.01825572240851436, + 0.005365213587986587, + 0.01959702580551101, + 0.026184575010934536, + 0.02474879720075813, + 0.002171745152354571, + 0.25827321767021433, + 0.048050153083539875, + 0.01043184137629392, + 0.03930485493512174, + 0.027640180784370902, + 0.03294007872867765, + 0.006474413179763814, + 0.018314039947514214, + 0.015119405161102202, + 0.014706516984983233, + 0.005494678524566263, + 0.03309870243475726, + 0.043864120134130345, + 0.058996355153812505, + 0.06265986295378335, + 0.04633328473538417, + 0.03790756670068523, + 0.0004642076104388394, + 0.037849249161685375, + 0.08369966467415076, + 0.04999679253535501, + 0.02392768625164018, + 0.010998687855372504, + 0.009881323808135296, + 0.003867619186470331, + 0.012434465665548913, + 0.007253535500801866, + 0.11106225397288234, + 0.17624726636535937, + 0.008209943140399476, + 0.008390727511299025, + 0.012682898381688294, + 0.1825653885406036, + 0.001538416678816154, + 0.004590756670068524, + 0.008710307625018223, + 0.1299513048549351, + 0.002677941390873305, + 0.012309666132089225, + 0.014087184720804781, + 0.01199941682461, + 0.031246537396121883, + 0.07206648199445984, + 0.008254264470039366, + 0.0007033095203382417, + 0.007034261554162415, + 0.006599212713223502, + 0.013906400349905234, + 0.050098265053214755, + 0.007133401370462167, + 0.017750692520775622, + 0.0008257763522379356, + 0.03918821985712203, + 0.06015454147834961, + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md new file mode 100644 index 00000000..2cd55356 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/CHANGELOG.md @@ -0,0 +1,58 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.3] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.2.2] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [0.2.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [0.2.0] - 2022-08-23 +### Added +- Add method to check plugin activation context. [#25422] + +## [0.1.4] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.1.3] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [0.1.2] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [0.1.1] - 2022-03-29 +### Added +- Set composer package type to "jetpack-library" so i18n will work. + +## 0.1.0 - 2022-02-02 +### Added +- First version +- New functions to safely check plugin statuses + +### Changed +- Build: add missing mirror repo details, so package can be deployed. + +### Fixed +- Fix method logic + +[0.2.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.2...v0.2.3 +[0.2.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.4...v0.2.0 +[0.1.4]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-plugins-installer/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json new file mode 100644 index 00000000..2c4f7476 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/composer.json @@ -0,0 +1,39 @@ +{ + "name": "automattic/jetpack-plugins-installer", + "description": "Handle installation of plugins from WP.org", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-a8c-mc-stats": "^1.4.19" + }, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "mirror-repo": "Automattic/jetpack-plugins-installer", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plugins-installer/compare/v${old}...v${new}" + }, + "autotagger": true, + "textdomain": "jetpack-plugins-installer" + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php new file mode 100644 index 00000000..ae129c59 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php @@ -0,0 +1,155 @@ +fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $result ) { + // set the string here since they are not available just yet. + $upgrader->generic_strings(); + $this->feedback( 'fs_unavailable' ); + } + } + + /** + * Overwrites the error function + * + * @param \WP_Error|mixed $error The error object. + */ + public function error( $error ) { + if ( is_wp_error( $error ) ) { + $this->feedback( $error ); + } + } + + /** + * Set the main error code. + * + * Don't set the process_failed as code since it is not that helpful unless we don't have one already set + * + * @param string $code The error code. + * @return void + */ + private function set_main_error_code( $code ) { + $this->main_error_code = ( 'process_failed' === $code && $this->main_error_code ? $this->main_error_code : $code ); + } + + /** + * Set the main error message. + * + * Don't set the process_failed as message since it is not that helpful unless we don't have one already set + * + * @param string $message The error message. + * @param string $code The error code. + * @return void + */ + private function set_main_error_message( $message, $code ) { + $this->main_error_message = ( 'process_failed' === $code && $this->main_error_message ? $this->main_error_message : $message ); + } + + /** + * Get the main error code + * + * @return string + */ + public function get_main_error_code() { + return $this->main_error_code; + } + + /** + * Get the main error message + * + * @return string + */ + public function get_main_error_message() { + return $this->main_error_message; + } + + /** + * Overwrites the feedback function + * + * @param string|array|WP_Error $data Data. + * @param mixed ...$args Optional text replacements. + */ + public function feedback( $data, ...$args ) { + + $current_error = null; + if ( is_wp_error( $data ) ) { + $this->set_main_error_code( $data->get_error_code() ); + $string = $data->get_error_message(); + } elseif ( is_array( $data ) ) { + return; + } else { + $string = $data; + } + + if ( ! empty( $this->upgrader->strings[ $string ] ) ) { + $this->set_main_error_code( $string ); + + $current_error = $string; + $string = $this->upgrader->strings[ $string ]; + } + + if ( strpos( $string, '%' ) !== false ) { + if ( ! empty( $args ) ) { + $string = vsprintf( $string, $args ); + } + } + + $string = trim( $string ); + $string = wp_kses( + $string, + array( + 'a' => array( + 'href' => true, + ), + 'br' => true, + 'em' => true, + 'strong' => true, + ) + ); + + $this->set_main_error_message( $string, $current_error ); + $this->messages[] = $string; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php new file mode 100644 index 00000000..4ebf4a83 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php @@ -0,0 +1,291 @@ +install( $zip_url ); + + if ( is_wp_error( $result ) ) { + $mc_stats->add( 'install-plugin', "fail-$slug" ); + return $result; + } + + $plugin = self::get_plugin_id_by_slug( $slug ); + $error_code = 'install_error'; + if ( ! $plugin ) { + $error = __( 'There was an error installing your plugin', 'jetpack-plugins-installer' ); + } + + if ( ! $result ) { + $error_code = $upgrader->skin->get_main_error_code(); + $message = $upgrader->skin->get_main_error_message(); + $error = $message ? $message : __( 'An unknown error occurred during installation', 'jetpack-plugins-installer' ); + } + + if ( ! empty( $error ) ) { + if ( 'download_failed' === $error_code ) { + // For backwards compatibility: versions prior to 3.9 would return no_package instead of download_failed. + $error_code = 'no_package'; + } + + $mc_stats->add( 'install-plugin', "fail-$slug" ); + return new WP_Error( $error_code, $error, 400 ); + } + + $mc_stats->add( 'install-plugin', "success-$slug" ); + return (array) $upgrader->skin->get_upgrade_messages(); + } + + /** + * Get WordPress.org zip download link from a plugin slug + * + * @param string $plugin_slug Plugin slug. + */ + protected static function generate_wordpress_org_plugin_download_link( $plugin_slug ) { + return "https://downloads.wordpress.org/plugin/$plugin_slug.latest-stable.zip"; + } + + /** + * Get the plugin ID (composed of the plugin slug and the name of the main plugin file) from a plugin slug. + * + * @param string $slug Plugin slug. + */ + public static function get_plugin_id_by_slug( $slug ) { + // Check if get_plugins() function exists. This is required on the front end of the + // site, since it is in a file that is normally only loaded in the admin. + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + $plugins = apply_filters( 'all_plugins', get_plugins() ); + if ( ! is_array( $plugins ) ) { + return false; + } + + foreach ( $plugins as $plugin_file => $plugin_data ) { + if ( self::get_slug_from_file_path( $plugin_file ) === $slug ) { + return $plugin_file; + } + } + + return false; + } + + /** + * Get the plugin slug from the plugin ID (composed of the plugin slug and the name of the main plugin file) + * + * @param string $plugin_file Plugin file (ID -- e.g. hello-dolly/hello.php). + */ + protected static function get_slug_from_file_path( $plugin_file ) { + // Similar to get_plugin_slug() method. + $slug = dirname( $plugin_file ); + if ( '.' === $slug ) { + $slug = preg_replace( '/(.+)\.php$/', '$1', $plugin_file ); + } + + return $slug; + } + + /** + * Get the activation status for a plugin. + * + * @since-jetpack 8.9.0 + * + * @param string $plugin_file The plugin file to check. + * @return string Either 'network-active', 'active' or 'inactive'. + */ + public static function get_plugin_status( $plugin_file ) { + if ( self::is_plugin_active_for_network( $plugin_file ) ) { + return 'network-active'; + } + + if ( self::is_plugin_active( $plugin_file ) ) { + return 'active'; + } + + return 'inactive'; + } + + /** + * Safely checks if the plugin is active + * + * @since $next-version$ + * + * @param string $plugin_file The plugin file to check. + * @return bool + */ + public static function is_plugin_active( $plugin_file ) { + self::ensure_plugin_functions_are_loaded(); + return is_plugin_active( $plugin_file ); + } + + /** + * Safely checks if the plugin is active for network + * + * @since $next-version$ + * + * @param string $plugin_file The plugin file to check. + * @return bool + */ + public static function is_plugin_active_for_network( $plugin_file ) { + self::ensure_plugin_functions_are_loaded(); + return is_plugin_active_for_network( $plugin_file ); + } + + /** + * Returns a list of all plugins in the site. + * + * @since-jetpack 8.9.0 + * @uses get_plugins() + * + * @return array + */ + public static function get_plugins() { + self::ensure_plugin_functions_are_loaded(); + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + $plugins = apply_filters( 'all_plugins', get_plugins() ); + + if ( is_array( $plugins ) && ! empty( $plugins ) ) { + foreach ( $plugins as $plugin_slug => $plugin_data ) { + $plugins[ $plugin_slug ]['active'] = in_array( + self::get_plugin_status( $plugin_slug ), + array( 'active', 'network-active' ), + true + ); + } + return $plugins; + } + + return array(); + } + + /** + * Determine if the current request is activating a plugin from the plugins page. + * + * @param string $plugin Plugin file path to check. + * @return bool + */ + public static function is_current_request_activating_plugin_from_plugins_screen( $plugin ) { + // Filter out common async request contexts + if ( + wp_doing_ajax() || + ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || + ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ) || + ( defined( 'WP_CLI' ) && WP_CLI ) + ) { + return false; + } + + if ( isset( $_SERVER['SCRIPT_NAME'] ) ) { + $request_file = esc_url_raw( wp_unslash( $_SERVER['SCRIPT_NAME'] ) ); + } elseif ( isset( $_SERVER['REQUEST_URI'] ) ) { + list( $request_file ) = explode( '?', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); + } else { + return false; + } + + // Not the plugins page + if ( strpos( $request_file, 'wp-admin/plugins.php' ) === false ) { + return false; + } + + // Same method to get the action as used by plugins.php + $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); + $action = $wp_list_table->current_action(); + + // Not a singular activation + // This also means that if the plugin is activated as part of a group ( bulk activation ), this function will return false here. + if ( 'activate' !== $action ) { + return false; + } + + // Check the nonce associated with the plugin activation + // We are not changing any data here, so this is not super necessary, it's just a best practice before using the form data from $_REQUEST. + check_admin_referer( 'activate-plugin_' . $plugin ); + + // Not the right plugin + $requested_plugin = isset( $_REQUEST['plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plugin'] ) ) : null; + if ( $requested_plugin !== $plugin ) { + return false; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md new file mode 100644 index 00000000..74167861 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/CHANGELOG.md @@ -0,0 +1,221 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.7.25] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.7.24] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.7.23] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.7.22] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.7.21] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.7.20] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.7.19] - 2022-11-07 +### Changed +- Updated package dependencies. [#27278] + +## [1.7.18] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.7.17] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.7.16] - 2022-06-14 +### Changed +- Updated package dependencies. [#24529] + +## [1.7.15] - 2022-05-10 + +## [1.7.14] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.7.13] - 2022-04-05 +### Changed +- Updated package dependencies. + +## [1.7.12] - 2022-03-02 +### Changed +- Updated package dependencies. + +## [1.7.11] - 2022-02-22 +### Changed +- Updated package dependencies. + +## [1.7.10] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.7.9] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.7.8] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.7.7] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.7.6] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.7.5] - 2021-10-26 +### Changed +- Updated package dependencies. + +## [1.7.4] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.7.3] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.7.2] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.7.1] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [1.7.0] - 2021-06-29 +### Changed +- Allow any argument to be passed. +- Improve documentation. + +## [1.6.1] - 2021-06-15 +### Changed +- Updated package dependencies. + +## [1.6.0] - 2021-05-25 +### Removed +- Removed filter from the final Redirect URL + +## [1.5.5] - 2021-04-27 +### Changed +- Updated package dependencies. + +## [1.5.4] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. +- Userless Connection: Redirect "userless" users to the "Plans" page + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.5.3] - 2021-02-23 + +- CI: Make tests more generic + +## [1.5.2] - 2021-01-26 + +- Update dependencies to latest stable + +## [1.5.1] - 2021-01-26 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.5.0] - 2021-01-05 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing +- Pin dependency brain/monkey to 2.5.0 + +## [1.4.1] - 2020-11-24 + +- Status: Introduce get_site_suffix method + +## [1.4.0] - 2020-10-27 + +- Masterbar: Add Admin Menu endpoint + +## [1.3.0] - 2020-08-14 + +- Packages: Update filenames after #16810 +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.2.0] - 2020-06-16 + +- Add a trailing / to jetpack.com/redirect URLs. + +## [1.1.0] - 2020-05-22 + +- add filter to Redirect::get_url + +## 1.0.0 - 2020-04-24 + +- Create Jetpack Redirect package + +[1.7.25]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.24...v1.7.25 +[1.7.24]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.23...v1.7.24 +[1.7.23]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.22...v1.7.23 +[1.7.22]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.21...v1.7.22 +[1.7.21]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.20...v1.7.21 +[1.7.20]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.19...v1.7.20 +[1.7.19]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.18...v1.7.19 +[1.7.18]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.17...v1.7.18 +[1.7.17]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.16...v1.7.17 +[1.7.16]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.15...v1.7.16 +[1.7.15]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.14...v1.7.15 +[1.7.14]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.13...v1.7.14 +[1.7.13]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.12...v1.7.13 +[1.7.12]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.11...v1.7.12 +[1.7.11]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.10...v1.7.11 +[1.7.10]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.9...v1.7.10 +[1.7.9]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.8...v1.7.9 +[1.7.8]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.7...v1.7.8 +[1.7.7]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.6...v1.7.7 +[1.7.6]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.6.1...v1.7.0 +[1.6.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.5...v1.6.0 +[1.5.5]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.4.1...v1.5.0 +[1.4.1]: https://github.com/Automattic/jetpack-redirect/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-redirect/compare/v1.0.0...v1.1.0 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json new file mode 100644 index 00000000..65b22bab --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/composer.json @@ -0,0 +1,42 @@ +{ + "name": "automattic/jetpack-redirect", + "description": "Utilities to build URLs to the jetpack.com/redirect/ service", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-status": "^1.16.4" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-redirect", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-redirect/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.7.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php new file mode 100644 index 00000000..da5979b3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php @@ -0,0 +1,79 @@ +get_site_suffix(); + $args = wp_parse_args( $args, array( 'site' => $site_suffix ) ); + + $source_key = 'source'; + + if ( 0 === strpos( $source, 'https://' ) ) { + $source_key = 'url'; + $source_url = \wp_parse_url( $source ); + + // discard any query and fragments. + $source = 'https://' . $source_url['host'] . ( isset( $source_url['path'] ) ? $source_url['path'] : '' ); + } + + $to_be_added = array( + $source_key => rawurlencode( $source ), + ); + + foreach ( $args as $arg_name => $arg_value ) { + + if ( empty( $arg_value ) ) { + continue; + } + + $to_be_added[ $arg_name ] = rawurlencode( $arg_value ); + + } + + if ( ! empty( $to_be_added ) ) { + $url = add_query_arg( $to_be_added, $url ); + } + + return $url; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md new file mode 100644 index 00000000..0c3c1335 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/CHANGELOG.md @@ -0,0 +1,180 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.23] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.4.22] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.4.21] - 2023-01-11 +### Changed +- Updated package dependencies. + +## [1.4.20] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.4.19] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.4.18] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.4.17] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.4.16] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.4.15] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.4.14] - 2022-01-25 +### Changed +- Updated package dependencies. + +## [1.4.13] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.4.12] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.4.11] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.4.10] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.4.9] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.4.8] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.4.7] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.4.6] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +## [1.4.5] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.4.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.4.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.4.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.4.1] - 2021-01-20 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.4.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.3.1] - 2020-10-28 + +- Updated PHPCS: Packages and Debugger + +## [1.3.0] - 2020-08-13 + +- CI: Try collect js coverage +- Docker: Add package testing shortcut + +## [1.2.0] - 2020-07-01 + +- Package Unit tests: update test file names to make sure they runs in Travis + +## [1.1.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- PHPCS Updates after WPCS 2.3 + +## [1.0.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.2] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.0.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## 1.0.0 - 2019-09-14 + +- Jetpack DNA: Introduce a Roles package + +[1.4.23]: https://github.com/Automattic/jetpack-roles/compare/v1.4.22...v1.4.23 +[1.4.22]: https://github.com/Automattic/jetpack-roles/compare/v1.4.21...v1.4.22 +[1.4.21]: https://github.com/Automattic/jetpack-roles/compare/v1.4.20...v1.4.21 +[1.4.20]: https://github.com/Automattic/jetpack-roles/compare/v1.4.19...v1.4.20 +[1.4.19]: https://github.com/Automattic/jetpack-roles/compare/v1.4.18...v1.4.19 +[1.4.18]: https://github.com/Automattic/jetpack-roles/compare/v1.4.17...v1.4.18 +[1.4.17]: https://github.com/Automattic/jetpack-roles/compare/v1.4.16...v1.4.17 +[1.4.16]: https://github.com/Automattic/jetpack-roles/compare/v1.4.15...v1.4.16 +[1.4.15]: https://github.com/Automattic/jetpack-roles/compare/v1.4.14...v1.4.15 +[1.4.14]: https://github.com/Automattic/jetpack-roles/compare/v1.4.13...v1.4.14 +[1.4.13]: https://github.com/Automattic/jetpack-roles/compare/v1.4.12...v1.4.13 +[1.4.12]: https://github.com/Automattic/jetpack-roles/compare/v1.4.11...v1.4.12 +[1.4.11]: https://github.com/Automattic/jetpack-roles/compare/v1.4.10...v1.4.11 +[1.4.10]: https://github.com/Automattic/jetpack-roles/compare/v1.4.9...v1.4.10 +[1.4.9]: https://github.com/Automattic/jetpack-roles/compare/v1.4.8...v1.4.9 +[1.4.8]: https://github.com/Automattic/jetpack-roles/compare/v1.4.7...v1.4.8 +[1.4.7]: https://github.com/Automattic/jetpack-roles/compare/v1.4.6...v1.4.7 +[1.4.6]: https://github.com/Automattic/jetpack-roles/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/Automattic/jetpack-roles/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/Automattic/jetpack-roles/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/Automattic/jetpack-roles/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/Automattic/jetpack-roles/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/Automattic/jetpack-roles/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/Automattic/jetpack-roles/compare/v1.3.1...v1.4.0 +[1.3.1]: https://github.com/Automattic/jetpack-roles/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-roles/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-roles/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/Automattic/jetpack-roles/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/Automattic/jetpack-roles/compare/v1.0.2...v1.0.4 +[1.0.2]: https://github.com/Automattic/jetpack-roles/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-roles/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json new file mode 100644 index 00000000..a8a6864e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/composer.json @@ -0,0 +1,40 @@ +{ + "name": "automattic/jetpack-roles", + "description": "Utilities, related with user roles and capabilities.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-roles", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-roles/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php new file mode 100644 index 00000000..7bce3462 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php @@ -0,0 +1,81 @@ + 'manage_options', + 'editor' => 'edit_others_posts', + 'author' => 'publish_posts', + 'contributor' => 'edit_posts', + 'subscriber' => 'read', + ); + + /** + * Get the role of the current user. + * + * @access public + * + * @return string|boolean Current user's role, false if not enough capabilities for any of the roles. + */ + public function translate_current_user_to_role() { + foreach ( $this->capability_translations as $role => $cap ) { + if ( current_user_can( $role ) || current_user_can( $cap ) ) { + return $role; + } + } + + return false; + } + + /** + * Get the role of a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return string|boolean User's role, false if not enough capabilities for any of the roles. + */ + public function translate_user_to_role( $user ) { + foreach ( $this->capability_translations as $role => $cap ) { + if ( user_can( $user, $role ) || user_can( $user, $cap ) ) { + return $role; + } + } + + return false; + } + + /** + * Get the minimum capability for a role. + * + * @access public + * + * @param string $role Role name. + * @return string|boolean Capability, false if role isn't mapped to any capabilities. + */ + public function translate_role_to_cap( $role ) { + if ( ! isset( $this->capability_translations[ $role ] ) ) { + return false; + } + + return $this->capability_translations[ $role ]; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md new file mode 100644 index 00000000..c29f6e06 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/CHANGELOG.md @@ -0,0 +1,310 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.17.0] - 2023-04-17 +### Changed +- When Jetpack is available, `Modules::get()` no longer translates `module_tags`. Use Jetpack's `jetpack_get_module_i18n_tag()` function if you need translations. [#30067] + +## [1.16.4] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [1.16.3] - 2023-03-28 +### Changed +- Move brute force protection into WAF package. [#28401] + +## [1.16.2] - 2023-02-20 +### Changed +- Minor internal updates. + +## [1.16.1] - 2023-01-23 +### Added +- Add new filters for the latest status methods [#28328] + +## [1.16.0] - 2023-01-16 +### Added +- Add 2 new methods to detect whether a site is private or not. [#28322] + +## [1.15.4] - 2023-01-11 +### Changed +- Modules: Allow for deactivating multiple plugins when activating a module. [#28181] + +## [1.15.3] - 2022-12-19 +### Changed +- Updated package dependencies. + +## [1.15.2] - 2022-12-02 +### Changed +- Updated package dependencies. [#27688] + +## [1.15.1] - 2022-11-22 +### Changed +- Updated package dependencies. [#27043] + +## [1.15.0] - 2022-11-07 +### Added +- WordPress.com: add checks for Simple or either Simple/WoA. [#27278] + +## [1.14.3] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [1.14.2] - 2022-07-19 +### Changed +- Update logic in `is_woa_site` function for host changes [#25067] + +## [1.14.1] - 2022-06-21 +### Changed +- Renaming master to trunk. + +## [1.14.0] - 2022-06-14 +### Fixed +- Moved the connection_url_redirect action handling to the connection package. [#24529] + +## [1.13.6] - 2022-05-24 +### Added +- Allow plugins to filter the list of available modules. Only activate and consider active modules that are available [#24454] + +## [1.13.5] - 2022-05-20 +### Changed +- Modules: Make activate() method Jetpack plugin agnostic. Allowing standalone plugins to use it without Jetpack. + +## [1.13.4] - 2022-05-19 +### Added +- PHPCS updates. [#24418] + +## [1.13.3] - 2022-05-10 + +## [1.13.2] - 2022-04-26 +### Changed +- Updated package dependencies. + +## [1.13.1] - 2022-04-19 +### Changed +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` + +## [1.13.0] - 2022-04-05 +### Added +- Created Modules and File modules for managing those resources + +## [1.12.0] - 2022-03-02 +### Added +- Cache return values (per blog) from various status methods. + +## [1.11.2] - 2022-02-28 +### Fixed +- Re-doing 1.11.1 to fixup a bad release. + +## [1.11.1] - 2022-02-28 +### Fixed +- Remove trailing semicolor form site suffix. + +## [1.11.0] - 2022-02-22 +### Added +- Add methods to distinguish Newspack and VIP sites. + +## [1.10.0] - 2022-01-25 +### Added +- Added Visitor class for status regarding the site visitor. + +## [1.9.5] - 2022-01-04 +### Changed +- Switch to pcov for code coverage. +- Updated package dependencies + +## [1.9.4] - 2021-12-14 +### Changed +- Updated package dependencies. + +## [1.9.3] - 2021-11-22 +### Changed +- Updated package dependencies + +## [1.9.2] - 2021-11-16 +### Changed +- Add a function_exists check before calling wp_get_environment_type + +## [1.9.1] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.9.0] - 2021-10-26 +### Added +- Added Host class for reporting known hosting environment information. + +## [1.8.4] - 2021-10-13 +### Changed +- Updated package dependencies. + +## [1.8.3] - 2021-10-12 +### Changed +- Updated package dependencies + +## [1.8.2] - 2021-09-28 +### Changed +- Updated package dependencies. + +## [1.8.1] - 2021-08-30 +### Changed +- Run composer update on test-php command instead of phpunit +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). +- update annotations versions + +## [1.8.0] - 2021-06-15 +### Changed +- Update callback to Jetpack to new Identity_Crisis class. + +## [1.7.6] - 2021-05-25 +### Changed +- Updated package dependencies. + +## [1.7.5] - 2021-04-27 +### Deprecated +- Deprecates is_no_user_testing_mode + +## [1.7.4] - 2021-04-08 +### Changed +- Packaging and build changes, no change to the package itself. + +## [1.7.3] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies + +### Changed +- Update package dependencies. + +### Fixed +- Use `composer update` rather than `install` in scripts, as composer.lock isn't checked in. + +## [1.7.2] - 2021-02-05 + +- CI: Make tests more generic + +## [1.7.1] - 2021-01-20 + +- Add mirror-repo information to all current composer packages +- Monorepo: Reorganize all projects + +## [1.7.0] - 2020-12-14 + +- Update dependency brain/monkey to v2.6.0 +- Pin dependencies +- Packages: Update for PHP 8 testing + +## [1.6.0] - 2020-11-23 + +- Status: Introduce get_site_suffix method +- Status: Fix test failure +- Status: Improve the staging site detection +- General: update minimum required version to WordPress 5.5 +- Add the no_user_testing mode +- Status: Add a couple of test cases for staging site detection +- Update dependency brain/monkey to v2.5.0 +- Updated PHPCS: Packages and Debugger + +## [1.5.0] - 2020-10-13 + +- Also use Core `wp_get_environment_type` for local + +## [1.4.0] - 2020-08-13 + +- CI: Try collect js coverage + +## [1.3.0] - 2020-07-28 + +- Core Compat: Site Environment + +## [1.2.0] - 2020-06-22 + +- PHPCS: Clean up the packages +- Staging Sites: add newspack staging to the list of known providers + +## [1.1.1] - 2020-01-27 + +- Pin dependency brain/monkey to 2.4.0 + +## [1.1.0] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.0.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.0.3] - 2019-10-28 + +- Packages: Add gitattributes files to all packages that need th… + +## [1.0.2] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.0.1] - 2019-09-20 + +- Docs: Unify usage of @package phpdoc tags + +## 1.0.0 - 2019-09-14 + +- Packages: Introduce a status package + +[1.17.0]: https://github.com/Automattic/jetpack-status/compare/v1.16.4...v1.17.0 +[1.16.4]: https://github.com/Automattic/jetpack-status/compare/v1.16.3...v1.16.4 +[1.16.3]: https://github.com/Automattic/jetpack-status/compare/v1.16.2...v1.16.3 +[1.16.2]: https://github.com/Automattic/jetpack-status/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-status/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-status/compare/v1.15.4...v1.16.0 +[1.15.4]: https://github.com/Automattic/jetpack-status/compare/v1.15.3...v1.15.4 +[1.15.3]: https://github.com/Automattic/jetpack-status/compare/v1.15.2...v1.15.3 +[1.15.2]: https://github.com/Automattic/jetpack-status/compare/v1.15.1...v1.15.2 +[1.15.1]: https://github.com/Automattic/jetpack-status/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-status/compare/v1.14.3...v1.15.0 +[1.14.3]: https://github.com/Automattic/jetpack-status/compare/v1.14.2...v1.14.3 +[1.14.2]: https://github.com/Automattic/jetpack-status/compare/v1.14.1...v1.14.2 +[1.14.1]: https://github.com/Automattic/jetpack-status/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-status/compare/v1.13.6...v1.14.0 +[1.13.6]: https://github.com/Automattic/jetpack-status/compare/v1.13.5...v1.13.6 +[1.13.5]: https://github.com/Automattic/jetpack-status/compare/v1.13.4...v1.13.5 +[1.13.4]: https://github.com/Automattic/jetpack-status/compare/v1.13.3...v1.13.4 +[1.13.3]: https://github.com/Automattic/jetpack-status/compare/v1.13.2...v1.13.3 +[1.13.2]: https://github.com/Automattic/jetpack-status/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-status/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-status/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/Automattic/jetpack-status/compare/v1.11.2...v1.12.0 +[1.11.2]: https://github.com/Automattic/jetpack-status/compare/v1.11.1...v1.11.2 +[1.11.1]: https://github.com/Automattic/jetpack-status/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/Automattic/jetpack-status/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-status/compare/v1.9.5...v1.10.0 +[1.9.5]: https://github.com/Automattic/jetpack-status/compare/v1.9.4...v1.9.5 +[1.9.4]: https://github.com/Automattic/jetpack-status/compare/v1.9.3...v1.9.4 +[1.9.3]: https://github.com/Automattic/jetpack-status/compare/v1.9.2...v1.9.3 +[1.9.2]: https://github.com/Automattic/jetpack-status/compare/v1.9.1...v1.9.2 +[1.9.1]: https://github.com/Automattic/jetpack-status/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/Automattic/jetpack-status/compare/v1.8.4...v1.9.0 +[1.8.4]: https://github.com/Automattic/jetpack-status/compare/v1.8.3...v1.8.4 +[1.8.3]: https://github.com/Automattic/jetpack-status/compare/v1.8.2...v1.8.3 +[1.8.2]: https://github.com/Automattic/jetpack-status/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/Automattic/jetpack-status/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/Automattic/jetpack-status/compare/v1.7.6...v1.8.0 +[1.7.6]: https://github.com/Automattic/jetpack-status/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-status/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/Automattic/jetpack-status/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-status/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-status/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-status/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-status/compare/v1.6.0...v1.7.0 +[1.6.0]: https://github.com/Automattic/jetpack-status/compare/v1.5.0...v1.6.0 +[1.5.0]: https://github.com/Automattic/jetpack-status/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-status/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/Automattic/jetpack-status/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/Automattic/jetpack-status/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-status/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-status/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/Automattic/jetpack-status/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/Automattic/jetpack-status/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/Automattic/jetpack-status/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-status/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json new file mode 100644 index 00000000..a8b1733f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/composer.json @@ -0,0 +1,43 @@ +{ + "name": "automattic/jetpack-status", + "description": "Used to retrieve information about the current status of Jetpack and the site overall.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-constants": "^1.6.22" + }, + "require-dev": { + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-ip": "^0.1.2" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-status", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.17.x-dev" + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php new file mode 100644 index 00000000..9ca54593 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-cache.php @@ -0,0 +1,55 @@ +admin_url(); + $bits = wp_parse_url( $admin_url ); + + if ( is_array( $bits ) ) { + $path = ( isset( $bits['path'] ) ) ? dirname( $bits['path'] ) : null; + $domain = ( isset( $bits['host'] ) ) ? $bits['host'] : null; + } else { + $path = null; + $domain = null; + } + } + + // Extract state from cookies and delete cookies. + if ( isset( $_COOKIE['jetpackState'] ) && is_array( $_COOKIE['jetpackState'] ) ) { + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- User should sanitize if necessary. + $yum = wp_unslash( $_COOKIE['jetpackState'] ); + unset( $_COOKIE['jetpackState'] ); + foreach ( $yum as $k => $v ) { + if ( strlen( $v ) ) { + $state[ $k ] = $v; + } + setcookie( "jetpackState[$k]", false, 0, $path, $domain, is_ssl(), true ); + } + } + + if ( $restate ) { + foreach ( $state as $k => $v ) { + setcookie( "jetpackState[$k]", $v, 0, $path, $domain, is_ssl(), true ); + } + return; + } + + // Get a state variable. + if ( isset( $key ) && ! isset( $value ) ) { + if ( array_key_exists( $key, $state ) ) { + return $state[ $key ]; + } + return null; + } + + // Set a state variable. + if ( isset( $key ) && isset( $value ) ) { + if ( is_array( $value ) && isset( $value[0] ) ) { + $value = $value[0]; + } + $state[ $key ] = $value; + if ( ! headers_sent() ) { + if ( $this->should_set_cookie( $key ) ) { + setcookie( "jetpackState[$key]", $value, 0, $path, $domain, is_ssl(), true ); + } + } + } + } + + /** + * Determines whether the jetpackState[$key] value should be added to the + * cookie. + * + * @param string $key The state key. + * + * @return boolean Whether the value should be added to the cookie. + */ + public function should_set_cookie( $key ) { + global $current_screen; + $page = isset( $current_screen->base ) ? $current_screen->base : null; + + if ( 'toplevel_page_jetpack' === $page && 'display_update_modal' === $key ) { + return false; + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php new file mode 100644 index 00000000..342f1759 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-errors.php @@ -0,0 +1,43 @@ +is_atomic_platform() && Constants::is_true( 'WPCOMSH__PLUGIN_FILE' ); + Cache::set( 'is_woa_site', $ret ); + } + return $ret; + } + + /** + * Determine if the site is hosted on the Atomic hosting platform. + * + * @since 1.9.0 + * + * @return bool; + */ + public function is_atomic_platform() { + return Constants::is_true( 'ATOMIC_SITE_ID' ) && Constants::is_true( 'ATOMIC_CLIENT_ID' ); + } + + /** + * Determine if this is a Newspack site. + * + * @return bool + */ + public function is_newspack_site() { + return Constants::is_defined( 'NEWSPACK_PLUGIN_FILE' ); + } + + /** + * Determine if this is a VIP-hosted site. + * + * @return bool + */ + public function is_vip_site() { + return Constants::is_defined( 'WPCOM_IS_VIP_ENV' ) && true === Constants::get_constant( 'WPCOM_IS_VIP_ENV' ); + } + + /** + * Determine if this is a Simple platform site. + * + * @return bool + */ + public function is_wpcom_simple() { + return Constants::is_defined( 'IS_WPCOM' ) && true === Constants::get_constant( 'IS_WPCOM' ); + } + + /** + * Determine if this is a WordPress.com site. + * + * Includes both Simple and WoA platforms. + * + * @return bool + */ + public function is_wpcom_platform() { + return $this->is_wpcom_simple() || $this->is_woa_site(); + } + + /** + * Add all wordpress.com environments to the safe redirect allowed list. + * + * To be used with a filter of allowed domains for a redirect. + * + * @param array $domains Allowed WP.com Environments. + */ + public static function allow_wpcom_environments( $domains ) { + $domains[] = 'wordpress.com'; + $domains[] = 'jetpack.wordpress.com'; + $domains[] = 'wpcalypso.wordpress.com'; + $domains[] = 'horizon.wordpress.com'; + $domains[] = 'calypso.localhost'; + return $domains; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php new file mode 100644 index 00000000..955697f9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-modules.php @@ -0,0 +1,596 @@ +get_path( $this->get_slug( $module ) ); + + if ( isset( $modules_details[ $module ] ) ) { + $mod = $modules_details[ $module ]; + } else { + $mod = jetpack_get_module_info( $module ); + + if ( null === $mod ) { + // Try to get the module info from the file as a fallback. + $mod = $this->get_file_data( $file, jetpack_get_all_module_header_names() ); + + if ( empty( $mod['name'] ) ) { + // No info for this module. + return false; + } + } + + $mod['sort'] = empty( $mod['sort'] ) ? 10 : (int) $mod['sort']; + $mod['recommendation_order'] = empty( $mod['recommendation_order'] ) ? 20 : (int) $mod['recommendation_order']; + $mod['deactivate'] = empty( $mod['deactivate'] ); + $mod['free'] = empty( $mod['free'] ); + $mod['requires_connection'] = ( ! empty( $mod['requires_connection'] ) && 'No' === $mod['requires_connection'] ) ? false : true; + $mod['requires_user_connection'] = ( empty( $mod['requires_user_connection'] ) || 'No' === $mod['requires_user_connection'] ) ? false : true; + + if ( empty( $mod['auto_activate'] ) || ! in_array( strtolower( $mod['auto_activate'] ), array( 'yes', 'no', 'public' ), true ) ) { + $mod['auto_activate'] = 'No'; + } else { + $mod['auto_activate'] = (string) $mod['auto_activate']; + } + + if ( $mod['module_tags'] ) { + $mod['module_tags'] = explode( ',', $mod['module_tags'] ); + $mod['module_tags'] = array_map( 'trim', $mod['module_tags'] ); + } else { + $mod['module_tags'] = array( 'Other' ); + } + + if ( $mod['plan_classes'] ) { + $mod['plan_classes'] = explode( ',', $mod['plan_classes'] ); + $mod['plan_classes'] = array_map( 'strtolower', array_map( 'trim', $mod['plan_classes'] ) ); + } else { + $mod['plan_classes'] = array( 'free' ); + } + + if ( $mod['feature'] ) { + $mod['feature'] = explode( ',', $mod['feature'] ); + $mod['feature'] = array_map( 'trim', $mod['feature'] ); + } else { + $mod['feature'] = array( 'Other' ); + } + + $modules_details[ $module ] = $mod; + + } + + /** + * Filters the feature array on a module. + * + * This filter allows you to control where each module is filtered: Recommended, + * and the default "Other" listing. + * + * @since-jetpack 3.5.0 + * + * @param array $mod['feature'] The areas to feature this module: + * 'Recommended' shows on the main Jetpack admin screen. + * 'Other' should be the default if no other value is in the array. + * @param string $module The slug of the module, e.g. sharedaddy. + * @param array $mod All the currently assembled module data. + */ + $mod['feature'] = apply_filters( 'jetpack_module_feature', $mod['feature'], $module, $mod ); + + /** + * Filter the returned data about a module. + * + * This filter allows overriding any info about Jetpack modules. It is dangerous, + * so please be careful. + * + * @since-jetpack 3.6.0 + * + * @param array $mod The details of the requested module. + * @param string $module The slug of the module, e.g. sharedaddy + * @param string $file The path to the module source file. + */ + return apply_filters( 'jetpack_get_module', $mod, $module, $file ); + } + + /** + * Like core's get_file_data implementation, but caches the result. + * + * @param string $file Absolute path to the file. + * @param array $headers List of headers, in the format array( 'HeaderKey' => 'Header Name' ). + */ + public function get_file_data( $file, $headers ) { + // Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated. + $file_name = basename( $file ); + + if ( ! Constants::is_defined( 'JETPACK__VERSION' ) ) { + return get_file_data( $file, $headers ); + } + + $cache_key = 'jetpack_file_data_' . JETPACK__VERSION; + + $file_data_option = get_transient( $cache_key ); + + if ( ! is_array( $file_data_option ) ) { + delete_transient( $cache_key ); + $file_data_option = false; + } + + if ( false === $file_data_option ) { + $file_data_option = array(); + } + + $key = md5( $file_name . maybe_serialize( $headers ) ); + $refresh_cache = is_admin() && isset( $_GET['page'] ) && 'jetpack' === substr( $_GET['page'], 0, 7 ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput + + // If we don't need to refresh the cache, and already have the value, short-circuit! + if ( ! $refresh_cache && isset( $file_data_option[ $key ] ) ) { + return $file_data_option[ $key ]; + } + + $data = get_file_data( $file, $headers ); + + $file_data_option[ $key ] = $data; + + set_transient( $cache_key, $file_data_option, 29 * DAY_IN_SECONDS ); + + return $data; + } + + /** + * Get a list of activated modules as an array of module slugs. + */ + public function get_active() { + $active = \Jetpack_Options::get_option( 'active_modules' ); + + if ( ! is_array( $active ) ) { + $active = array(); + } + + if ( class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' ) ) { + $active[] = 'vaultpress'; + } else { + $active = array_diff( $active, array( 'vaultpress' ) ); + } + + // If protect is active on the main site of a multisite, it should be active on all sites. + if ( ! in_array( 'protect', $active, true ) && is_multisite() && get_site_option( 'jetpack_protect_active' ) ) { + $active[] = 'protect'; + } + + // If it's not available, it shouldn't be active. + // We don't delete it from the options though, as it will be active again when a plugin gets reactivated. + $active = array_intersect( $active, $this->get_available() ); + + /** + * Allow filtering of the active modules. + * + * Gives theme and plugin developers the power to alter the modules that + * are activated on the fly. + * + * @since-jetpack 5.8.0 + * + * @param array $active Array of active module slugs. + */ + $active = apply_filters( 'jetpack_active_modules', $active ); + + return array_unique( $active ); + } + + /** + * Extract a module's slug from its full path. + * + * @param string $file Full path to a file. + * + * @return string Module slug. + */ + public function get_slug( $file ) { + return str_replace( '.php', '', basename( $file ) ); + } + + /** + * List available Jetpack modules. Simply lists .php files in /modules/. + * Make sure to tuck away module "library" files in a sub-directory. + * + * @param bool|string $min_version Only return modules introduced in this version or later. Default is false, do not filter. + * @param bool|string $max_version Only return modules introduced before this version. Default is false, do not filter. + * @param bool|null $requires_connection Pass a boolean value to only return modules that require (or do not require) a connection. + * @param bool|null $requires_user_connection Pass a boolean value to only return modules that require (or do not require) a user connection. + * + * @return array $modules Array of module slugs + */ + public function get_available( $min_version = false, $max_version = false, $requires_connection = null, $requires_user_connection = null ) { + static $modules = null; + + if ( ! class_exists( 'Jetpack' ) || ! Constants::is_defined( 'JETPACK__VERSION' ) || ! Constants::is_defined( 'JETPACK__PLUGIN_DIR' ) ) { + return array_unique( + /** + * Stand alone plugins need to use this filter to register the modules they interact with. + * This will allow them to activate and deactivate these modules even when Jetpack is not present. + * Note: Standalone plugins can only interact with modules that also exist in the Jetpack plugin, otherwise they'll lose the ability to control it if Jetpack is activated. + * + * @since 1.13.6 + * + * @param array $modules The list of available modules as an array of slugs. + * @param bool $requires_connection Whether to list only modules that require a connection to work. + * @param bool $requires_user_connection Whether to list only modules that require a user connection to work. + */ + apply_filters( 'jetpack_get_available_standalone_modules', array(), $requires_connection, $requires_user_connection ) + ); + } + + if ( ! isset( $modules ) ) { + $available_modules_option = \Jetpack_Options::get_option( 'available_modules', array() ); + // Use the cache if we're on the front-end and it's available... + if ( ! is_admin() && ! empty( $available_modules_option[ JETPACK__VERSION ] ) ) { + $modules = $available_modules_option[ JETPACK__VERSION ]; + } else { + $files = ( new Files() )->glob_php( JETPACK__PLUGIN_DIR . 'modules' ); + + $modules = array(); + + foreach ( $files as $file ) { + $slug = $this->get_slug( $file ); + $headers = $this->get( $slug ); + + if ( ! $headers ) { + continue; + } + + $modules[ $slug ] = $headers['introduced']; + } + + \Jetpack_Options::update_option( + 'available_modules', + array( + JETPACK__VERSION => $modules, + ) + ); + } + } + + /** + * Filters the array of modules available to be activated. + * + * @since 2.4.0 + * + * @param array $modules Array of available modules. + * @param string $min_version Minimum version number required to use modules. + * @param string $max_version Maximum version number required to use modules. + * @param bool|null $requires_connection Value of the Requires Connection filter. + * @param bool|null $requires_user_connection Value of the Requires User Connection filter. + */ + $mods = apply_filters( 'jetpack_get_available_modules', $modules, $min_version, $max_version, $requires_connection, $requires_user_connection ); + + if ( ! $min_version && ! $max_version && $requires_connection === null && $requires_user_connection === null ) { + return array_keys( $mods ); + } + + $r = array(); + foreach ( $mods as $slug => $introduced ) { + if ( $min_version && version_compare( $min_version, $introduced, '>=' ) ) { + continue; + } + + if ( $max_version && version_compare( $max_version, $introduced, '<' ) ) { + continue; + } + + $mod_details = $this->get( $slug ); + + if ( null !== $requires_connection && (bool) $requires_connection !== $mod_details['requires_connection'] ) { + continue; + } + + if ( null !== $requires_user_connection && (bool) $requires_user_connection !== $mod_details['requires_user_connection'] ) { + continue; + } + + $r[] = $slug; + } + + return $r; + } + + /** + * Is slug a valid module. + * + * @param string $module Module slug. + * + * @return bool + */ + public function is_module( $module ) { + return ! empty( $module ) && ! validate_file( $module, $this->get_available() ); + } + + /** + * Update module status. + * + * @param string $module - module slug. + * @param boolean $active - true to activate, false to deactivate. + * @param bool $exit Should exit be called after deactivation. + * @param bool $redirect Should there be a redirection after activation. + */ + public function update_status( $module, $active, $exit = true, $redirect = true ) { + return $active ? $this->activate( $module, $exit, $redirect ) : $this->deactivate( $module ); + } + + /** + * Activate a module. + * + * @param string $module Module slug. + * @param bool $exit Should exit be called after deactivation. + * @param bool $redirect Should there be a redirection after activation. + * + * @return bool|void + */ + public function activate( $module, $exit = true, $redirect = true ) { + /** + * Fires before a module is activated. + * + * @since 2.6.0 + * + * @param string $module Module slug. + * @param bool $exit Should we exit after the module has been activated. Default to true. + * @param bool $redirect Should the user be redirected after module activation? Default to true. + */ + do_action( 'jetpack_pre_activate_module', $module, $exit, $redirect ); + + if ( ! strlen( $module ) ) { + return false; + } + + // If it's already active, then don't do it again. + $active = $this->get_active(); + foreach ( $active as $act ) { + if ( $act === $module ) { + return true; + } + } + + if ( ! $this->is_module( $module ) ) { + return false; + } + + // Jetpack plugin only + if ( class_exists( 'Jetpack' ) ) { + + $module_data = $this->get( $module ); + + $status = new Status(); + $state = new CookieState(); + + if ( ! \Jetpack::is_connection_ready() ) { + if ( ! $status->is_offline_mode() && ! $status->is_onboarding() ) { + return false; + } + + // If we're not connected but in offline mode, make sure the module doesn't require a connection. + if ( $status->is_offline_mode() && $module_data['requires_connection'] ) { + return false; + } + } + + if ( class_exists( 'Jetpack_Client_Server' ) ) { + $jetpack = \Jetpack::init(); + + // Check and see if the old plugin is active. + if ( isset( $jetpack->plugins_to_deactivate[ $module ] ) ) { + // Deactivate the old plugins. + $deactivated = array(); + foreach ( $jetpack->plugins_to_deactivate[ $module ] as $idx => $deactivate_me ) { + if ( \Jetpack_Client_Server::deactivate_plugin( $deactivate_me[0], $deactivate_me[1] ) ) { + // If we deactivated the old plugin, remembere that with ::state() and redirect back to this page to activate the module + // We can't activate the module on this page load since the newly deactivated old plugin is still loaded on this page load. + $deactivated[] = "$module:$idx"; + } + } + if ( $deactivated ) { + $state->state( 'deactivated_plugins', join( ',', $deactivated ) ); + wp_safe_redirect( add_query_arg( 'jetpack_restate', 1 ) ); + exit; + } + } + } + + // Protect won't work with mis-configured IPs. + if ( 'protect' === $module ) { + if ( ! IP_Utils::get_ip() ) { + $state->state( 'message', 'protect_misconfigured_ip' ); + return false; + } + } + + if ( class_exists( 'Jetpack_Plan' ) && ! \Jetpack_Plan::supports( $module ) ) { + return false; + } + + // Check the file for fatal errors, a la wp-admin/plugins.php::activate. + $errors = new Errors(); + $state->state( 'module', $module ); + $state->state( 'error', 'module_activation_failed' ); // we'll override this later if the plugin can be included without fatal error. + $errors->catch_errors( true ); + + ob_start(); + $module_path = $this->get_path( $module ); + if ( file_exists( $module_path ) ) { + require $this->get_path( $module ); // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.NotAbsolutePath + } + + $active[] = $module; + $this->update_active( $active ); + + $state->state( 'error', false ); // the override. + ob_end_clean(); + $errors->catch_errors( false ); + } else { // Not a Jetpack plugin. + $active[] = $module; + $this->update_active( $active ); + } + + if ( $redirect ) { + wp_safe_redirect( ( new Paths() )->admin_url( 'page=jetpack' ) ); + } + if ( $exit ) { + exit; + } + return true; + } + + /** + * Deactivate module. + * + * @param string $module Module slug. + * + * @return bool + */ + public function deactivate( $module ) { + /** + * Fires when a module is deactivated. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( 'jetpack_pre_deactivate_module', $module ); + + $active = $this->get_active(); + $new = array_filter( array_diff( $active, (array) $module ) ); + + return $this->update_active( $new ); + } + + /** + * Generate a module's path from its slug. + * + * @param string $slug Module slug. + */ + public function get_path( $slug ) { + if ( ! Constants::is_defined( 'JETPACK__PLUGIN_DIR' ) ) { + return ''; + } + /** + * Filters the path of a modules. + * + * @since 7.4.0 + * + * @param array $return The absolute path to a module's root php file + * @param string $slug The module slug + */ + return apply_filters( 'jetpack_get_module_path', JETPACK__PLUGIN_DIR . "modules/$slug.php", $slug ); + } + + /** + * Saves all the currently active modules to options. + * Also fires Action hooks for each newly activated and deactivated module. + * + * @param array $modules Array of active modules to be saved in options. + * + * @return $success bool true for success, false for failure. + */ + public function update_active( $modules ) { + $current_modules = \Jetpack_Options::get_option( 'active_modules', array() ); + $active_modules = $this->get_active(); + $new_active_modules = array_diff( $modules, $current_modules ); + $new_inactive_modules = array_diff( $active_modules, $modules ); + $new_current_modules = array_diff( array_merge( $current_modules, $new_active_modules ), $new_inactive_modules ); + $reindexed_modules = array_values( $new_current_modules ); + $success = \Jetpack_Options::update_option( 'active_modules', array_unique( $reindexed_modules ) ); + // Let's take `pre_update_option_jetpack_active_modules` filter into account + // and actually decide for which modules we need to fire hooks by comparing + // the 'active_modules' option before and after the update. + $current_modules_post_update = \Jetpack_Options::get_option( 'active_modules', array() ); + + $new_inactive_modules = array_diff( $current_modules, $current_modules_post_update ); + $new_inactive_modules = array_unique( $new_inactive_modules ); + $new_inactive_modules = array_values( $new_inactive_modules ); + + $new_active_modules = array_diff( $current_modules_post_update, $current_modules ); + $new_active_modules = array_unique( $new_active_modules ); + $new_active_modules = array_values( $new_active_modules ); + + foreach ( $new_active_modules as $module ) { + /** + * Fires when a specific module is activated. + * + * @since 1.9.0 + * + * @param string $module Module slug. + * @param boolean $success whether the module was activated. @since 4.2 + */ + do_action( 'jetpack_activate_module', $module, $success ); + /** + * Fires when a module is activated. + * The dynamic part of the filter, $module, is the module slug. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( "jetpack_activate_module_$module", $module ); + } + + foreach ( $new_inactive_modules as $module ) { + /** + * Fired after a module has been deactivated. + * + * @since 4.2.0 + * + * @param string $module Module slug. + * @param boolean $success whether the module was deactivated. + */ + do_action( 'jetpack_deactivate_module', $module, $success ); + /** + * Fires when a module is deactivated. + * The dynamic part of the filter, $module, is the module slug. + * + * @since 1.9.0 + * + * @param string $module Module slug. + */ + do_action( "jetpack_deactivate_module_$module", $module ); + } + + return $success; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php new file mode 100644 index 00000000..a3313c66 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-paths.php @@ -0,0 +1,28 @@ + 'jetpack' ) ); + $url = add_query_arg( $args, admin_url( 'admin.php' ) ); + return $url; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php new file mode 100644 index 00000000..96a5a11b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-status.php @@ -0,0 +1,412 @@ +is_offline_mode(). + * + * @return bool Whether Jetpack's offline mode is active. + */ + public function is_development_mode() { + _deprecated_function( __FUNCTION__, '1.3.0', 'Automattic\Jetpack\Status->is_offline_mode' ); + return $this->is_offline_mode(); + } + + /** + * Is Jetpack in offline mode? + * + * This was formerly called "Development Mode", but sites "in development" aren't always offline/localhost. + * + * @since 1.3.0 + * + * @return bool Whether Jetpack's offline mode is active. + */ + public function is_offline_mode() { + $cached = Cache::get( 'is_offline_mode' ); + if ( null !== $cached ) { + return $cached; + } + + $offline_mode = false; + + if ( defined( '\\JETPACK_DEV_DEBUG' ) ) { + $offline_mode = constant( '\\JETPACK_DEV_DEBUG' ); + } elseif ( defined( '\\WP_LOCAL_DEV' ) ) { + $offline_mode = constant( '\\WP_LOCAL_DEV' ); + } elseif ( $this->is_local_site() ) { + $offline_mode = true; + } + + /** + * Filters Jetpack's offline mode. + * + * @see https://jetpack.com/support/development-mode/ + * @todo Update documentation ^^. + * + * @since 1.1.1 + * @since-jetpack 2.2.1 + * @deprecated 1.3.0 + * + * @param bool $offline_mode Is Jetpack's offline mode active. + */ + $offline_mode = (bool) apply_filters_deprecated( 'jetpack_development_mode', array( $offline_mode ), '1.3.0', 'jetpack_offline_mode' ); + + /** + * Filters Jetpack's offline mode. + * + * @see https://jetpack.com/support/development-mode/ + * @todo Update documentation ^^. + * + * @since 1.3.0 + * + * @param bool $offline_mode Is Jetpack's offline mode active. + */ + $offline_mode = (bool) apply_filters( 'jetpack_offline_mode', $offline_mode ); + + Cache::set( 'is_offline_mode', $offline_mode ); + return $offline_mode; + } + + /** + * Is Jetpack in "No User test mode"? + * + * This will make Jetpack act as if there were no connected users, but only a site connection (aka blog token) + * + * @since 1.6.0 + * @deprecated 1.7.5 Since this version, Jetpack connection is considered active after registration, making no_user_testing_mode obsolete. + * + * @return bool Whether Jetpack's No User Testing Mode is active. + */ + public function is_no_user_testing_mode() { + _deprecated_function( __METHOD__, '1.7.5' ); + return true; + } + + /** + * Whether this is a system with a multiple networks. + * Implemented since there is no core is_multi_network function. + * Right now there is no way to tell which network is the dominant network on the system. + * + * @return boolean + */ + public function is_multi_network() { + global $wpdb; + + $cached = Cache::get( 'is_multi_network' ); + if ( null !== $cached ) { + return $cached; + } + + // If we don't have a multi site setup no need to do any more. + if ( ! is_multisite() ) { + Cache::set( 'is_multi_network', false ); + return false; + } + + $num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" ); + if ( $num_sites > 1 ) { + Cache::set( 'is_multi_network', true ); + return true; + } + + Cache::set( 'is_multi_network', false ); + return false; + } + + /** + * Whether the current site is single user site. + * + * @return bool + */ + public function is_single_user_site() { + global $wpdb; + + $ret = Cache::get( 'is_single_user_site' ); + if ( null === $ret ) { + $some_users = get_transient( 'jetpack_is_single_user' ); + if ( false === $some_users ) { + $some_users = $wpdb->get_var( "SELECT COUNT(*) FROM (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}capabilities' LIMIT 2) AS someusers" ); + set_transient( 'jetpack_is_single_user', (int) $some_users, 12 * HOUR_IN_SECONDS ); + } + $ret = 1 === (int) $some_users; + Cache::set( 'is_single_user_site', $ret ); + } + return $ret; + } + + /** + * If the site is a local site. + * + * @since 1.3.0 + * + * @return bool + */ + public function is_local_site() { + $cached = Cache::get( 'is_local_site' ); + if ( null !== $cached ) { + return $cached; + } + + $site_url = site_url(); + + // Check for localhost and sites using an IP only first. + $is_local = $site_url && false === strpos( $site_url, '.' ); + + // @todo Remove function_exists when the package has a documented minimum WP version. + // Use Core's environment check, if available. Added in 5.5.0 / 5.5.1 (for `local` return value). + if ( function_exists( 'wp_get_environment_type' ) && 'local' === wp_get_environment_type() ) { + $is_local = true; + } + + // Then check for usual usual domains used by local dev tools. + $known_local = array( + '#\.local$#i', + '#\.localhost$#i', + '#\.test$#i', + '#\.docksal$#i', // Docksal. + '#\.docksal\.site$#i', // Docksal. + '#\.dev\.cc$#i', // ServerPress. + '#\.lndo\.site$#i', // Lando. + ); + + if ( ! $is_local ) { + foreach ( $known_local as $url ) { + if ( preg_match( $url, $site_url ) ) { + $is_local = true; + break; + } + } + } + + /** + * Filters is_local_site check. + * + * @since 1.3.0 + * + * @param bool $is_local If the current site is a local site. + */ + $is_local = apply_filters( 'jetpack_is_local_site', $is_local ); + + Cache::set( 'is_local_site', $is_local ); + return $is_local; + } + + /** + * If is a staging site. + * + * @todo Add IDC detection to a package. + * + * @return bool + */ + public function is_staging_site() { + $cached = Cache::get( 'is_staging_site' ); + if ( null !== $cached ) { + return $cached; + } + + // @todo Remove function_exists when the package has a documented minimum WP version. + // Core's wp_get_environment_type allows for a few specific options. We should default to bowing out gracefully for anything other than production or local. + $is_staging = function_exists( 'wp_get_environment_type' ) && ! in_array( wp_get_environment_type(), array( 'production', 'local' ), true ); + + $known_staging = array( + 'urls' => array( + '#\.staging\.wpengine\.com$#i', // WP Engine. This is their legacy staging URL structure. Their new platform does not have a common URL. https://github.com/Automattic/jetpack/issues/21504 + '#\.staging\.kinsta\.com$#i', // Kinsta.com. + '#\.kinsta\.cloud$#i', // Kinsta.com. + '#\.stage\.site$#i', // DreamPress. + '#\.newspackstaging\.com$#i', // Newspack. + '#\.pantheonsite\.io$#i', // Pantheon. + '#\.flywheelsites\.com$#i', // Flywheel. + '#\.flywheelstaging\.com$#i', // Flywheel. + '#\.cloudwaysapps\.com$#i', // Cloudways. + '#\.azurewebsites\.net$#i', // Azure. + '#\.wpserveur\.net$#i', // WPServeur. + '#\-liquidwebsites\.com$#i', // Liquidweb. + ), + 'constants' => array( + 'IS_WPE_SNAPSHOT', // WP Engine. This is used on their legacy staging environment. Their new platform does not have a constant. https://github.com/Automattic/jetpack/issues/21504 + 'KINSTA_DEV_ENV', // Kinsta.com. + 'WPSTAGECOACH_STAGING', // WP Stagecoach. + 'JETPACK_STAGING_MODE', // Generic. + 'WP_LOCAL_DEV', // Generic. + ), + ); + /** + * Filters the flags of known staging sites. + * + * @since 1.1.1 + * @since-jetpack 3.9.0 + * + * @param array $known_staging { + * An array of arrays that each are used to check if the current site is staging. + * @type array $urls URLs of staging sites in regex to check against site_url. + * @type array $constants PHP constants of known staging/developement environments. + * } + */ + $known_staging = apply_filters( 'jetpack_known_staging', $known_staging ); + + if ( isset( $known_staging['urls'] ) ) { + $site_url = site_url(); + foreach ( $known_staging['urls'] as $url ) { + if ( preg_match( $url, wp_parse_url( $site_url, PHP_URL_HOST ) ) ) { + $is_staging = true; + break; + } + } + } + + if ( isset( $known_staging['constants'] ) ) { + foreach ( $known_staging['constants'] as $constant ) { + if ( defined( $constant ) && constant( $constant ) ) { + $is_staging = true; + } + } + } + + // Last, let's check if sync is erroring due to an IDC. If so, set the site to staging mode. + if ( ! $is_staging && method_exists( 'Automattic\\Jetpack\\Identity_Crisis', 'validate_sync_error_idc_option' ) && \Automattic\Jetpack\Identity_Crisis::validate_sync_error_idc_option() ) { + $is_staging = true; + } + + /** + * Filters is_staging_site check. + * + * @since 1.1.1 + * @since-jetpack 3.9.0 + * + * @param bool $is_staging If the current site is a staging site. + */ + $is_staging = apply_filters( 'jetpack_is_staging_site', $is_staging ); + + Cache::set( 'is_staging_site', $is_staging ); + return $is_staging; + } + + /** + * Whether the site is currently onboarding or not. + * A site is considered as being onboarded if it currently has an onboarding token. + * + * @since-jetpack 5.8 + * + * @access public + * @static + * + * @return bool True if the site is currently onboarding, false otherwise + */ + public function is_onboarding() { + return \Jetpack_Options::get_option( 'onboarding' ) !== false; + } + + /** + * Whether the site is currently private or not. + * On WordPress.com and WoA, sites can be marked as private + * + * @since 1.16.0 + * + * @return bool True if the site is private. + */ + public function is_private_site() { + $ret = Cache::get( 'is_private_site' ); + if ( null === $ret ) { + $is_private_site = '-1' === get_option( 'blog_public' ); + + /** + * Filters the is_private_site check. + * + * @since 1.16.1 + * + * @param bool $is_private_site True if the site is private. + */ + $is_private_site = apply_filters( 'jetpack_is_private_site', $is_private_site ); + + Cache::set( 'is_private_site', $is_private_site ); + return $is_private_site; + } + return $ret; + } + + /** + * Whether the site is currently unlaunched or not. + * On WordPress.com and WoA, sites can be marked as "coming soon", aka unlaunched + * + * @since 1.16.0 + * + * @return bool True if the site is not launched. + */ + public function is_coming_soon() { + $ret = Cache::get( 'is_coming_soon' ); + if ( null === $ret ) { + $is_coming_soon = (bool) ( function_exists( 'site_is_coming_soon' ) && \site_is_coming_soon() ) + || get_option( 'wpcom_public_coming_soon' ); + + /** + * Filters the is_coming_soon check. + * + * @since 1.16.1 + * + * @param bool $is_coming_soon True if the site is coming soon (i.e. unlaunched). + */ + $is_coming_soon = apply_filters( 'jetpack_is_coming_soon', $is_coming_soon ); + + Cache::set( 'is_coming_soon', $is_coming_soon ); + return $is_coming_soon; + } + return $ret; + } + + /** + * Returns the site slug suffix to be used as part of Calypso URLs. + * + * Strips http:// or https:// from a url, replaces forward slash with ::. + * + * @since 1.6.0 + * + * @param string $url Optional. URL to build the site suffix from. Default: Home URL. + * + * @return string + */ + public function get_site_suffix( $url = '' ) { + // On WordPress.com, site suffixes are a bit different. + if ( method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { + return WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); + } + + // Grab the 'site_url' option for WoA sites to avoid plugins to interfere with the site + // identifier (e.g. i18n plugins may change the main url to '/', but we + // want to exclude the locale since it's not part of the site suffix). + if ( ( new Host() )->is_woa_site() ) { + $url = \site_url(); + } + + if ( empty( $url ) ) { + // WordPress can be installed in subdirectories (e.g. make.wordpress.org/plugins) + // where the 'site_url' option points to the root domain (e.g. make.wordpress.org) + // which could collide with another site in the same domain but with WordPress + // installed in a different subdirectory (e.g. make.wordpress.org/core). To avoid + // such collision, we identify the site with the 'home_url' option. + $url = \home_url(); + } + + $url = preg_replace( '#^.*?://#', '', $url ); + $url = str_replace( '/', '::', $url ); + + return rtrim( $url, ':' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php new file mode 100644 index 00000000..d80d891d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php @@ -0,0 +1,44 @@ + 0 + +### Fixed +- Fix PHP 8.1 deprecation warnings. + +## [1.27.1] - 2021-11-02 +### Changed +- Set `convertDeprecationsToExceptions` true in PHPUnit config. +- Update PHPUnit configs to include just what needs coverage rather than include everything then try to exclude stuff that doesn't. + +## [1.27.0] - 2021-10-26 +### Added +- Added the _wpas_feature_enabled meta key to the sync list +- Sync Error Log to capture failed sync requests. + +### Fixed +- Check the return value of get_comment() before to use it. +- Increase send timeout to 20 seconds allowing capture of WP.com 408 responses. + +## [1.26.4] - 2021-10-13 +### Changed +- Sync Checksums: Convert text fields to latin1 before generating checksum. +- Updated package dependencies. + +### Fixed +- Sync Checksums - Update distinct clause to use $wpdb-> table names to accouunt for differences in prefixes. + +## [1.26.3] - 2021-10-12 +### Changed +- Updated package dependencies + +### Removed +- Remove initialization of the identity-crisis package. That will be handled by the Config package. + +### Fixed +- Reduce transient expiration for how often we check the state of the queue. +- Sync Checksums - exclude locale from checksum if same as site setting +- Sync Checksums - use distinct query when calculating count of Term Relationships + +## [1.26.2] - 2021-09-28 +### Added +- Add support for checksumming user-related tabled: wp_users and wp_usermeta + +### Changed +- Update annotations versions. +- Updated package dependencies. + +### Fixed +- Resolve indirect modification notice. +- Sync Checksums: utilize distinct clause in term counts. +- Sync Queue: better handling of serialization issues and empty actions. + +## [1.26.1] - 2021-09-03 +### Fixed +- Add better checks if the WooCommerce tables should be enabled for checksum/fix. +- Prevent PHP notices on queue_pull if all args are not set. + +## [1.26.0] - 2021-08-30 +### Added +- Add support for WooCommerce table to the checksum/fix process. +- Enable support for utf8 conversion during checksum calculation. + +### Changed +- Don't run composer install on regular phpunit script +- Tests: update PHPUnit polyfills dependency (yoast/phpunit-polyfills). + +### Fixed +- Sync Checksums - ensure last object is included in histogram + +## [1.25.0] - 2021-08-12 +### Added +- Add package version tracking. +- Add `wpcom_is_fse_activated` to sync list +- Made /sync/object endpoint accessible over POST, not only GET, to allow fetching more items in a single request. + +## [1.24.2] - 2021-08-02 + +- Reverted: Sync option for the Carousel to display colorized slide background. + +## [1.24.1] - 2021-07-29 +### Changed +- Utilize an import for WP_Error in all instances. + +### Fixed +- Fixed unqualified WP_Error use in the Rest_Sender class. + +## [1.24.0] - 2021-07-27 +### Added +- Add a package version constant. +- Add Full Site Editing support to callback options. +- Sync option for the Carousel to display colorized slide background. + +### Fixed +- Update Sender so it adheres to max upload bytes when not encoding items. + +## [1.23.3] - 2021-07-16 +### Fixed +- Update Options module to return jetpack_sync_settings_* values from the Settings class vs direct option lookup. + +## [1.23.2] - 2021-07-13 +### Changed +- Updated package dependencies. + +### Fixed +- Performance of Sync checksums degraded with the update to correlated subquery. This restricts its usage to term_taxonomy joins only." + +## [1.23.1] - 2021-07-01 +### Changed +- Checksum parent_table joins need distinct selection to account for possibility of multiple rows. + +### Fixed +- Update term_taxonomy checksum query to an allowed list vs disallowed + +## [1.23.0] - 2021-06-29 +### Added +- Add jetpack_idc_disonnect action to clear Sync options on disconnect. +- Add support to callables to sync/object endpoint. +- Enable sync/object endpoint support for theme-info. +- Enhance updates module to support get_objects_by_id. +- Expand sync/object to support constants. +- Extend sync/object to support callables. +- Implement v4 REST endpoints. +- Initialize the IDC package in the Sync package. + +### Removed +- Remove product_cat from blocked taxonomies + +## [1.22.0] - 2021-06-15 +### Changed +- Sync: Adding the Identity_Crisis package. +- Updated package dependencies. + +### Deprecated +- Deprecated URL methods in `Automattic\Jetpack\Sync\Functions` in favor of `Automattic\Jetpack\Connection\Urls`. + +## [1.21.3] - 2021-05-25 +### Changed +- Performance: If no Full Sync is in process early return before we update options. + +### Fixed +- Janitorial: avoid PHP notices in some edge-cases +- Update Meta Module so get_object_by_id returns all meta values. + +## [1.21.2] - 2021-04-27 +### Added +- Added the password-checker package the the Sync package composer.json file. + +### Changed +- Updated package dependencies. + +### Fixed +- Sync: removed references to the JETPACK__PLUGIN_DIR constant. +- Sync Checksums : updated postmeta range query performance #19337. + +## [1.21.1] - 2021-03-30 +### Added +- Composer alias for dev-master, to improve dependencies +- Implement a 60 second back-off for non-200 respones, if no retry-after header is present in the response. +- Impose a max limit of 2MB on post meta values that are synced. +- Impose a max limit of 5MB on post_content that can be synced. + +### Changed +- Sync: Use the new Password_Checker package instead of Jetpack_Password_Checker. +- Update package dependencies. +- Use the Heartbeat package to generate the stats array + +### Fixed +- Migrate locks to update_option to avaoid memcache inconsistencies that can be introduced by delete_option usage. +- Update Sync Queue so that serialize is wrapped to catch errors + +## [1.21.0] - 2021-02-23 + +- General: update WordPress version requirements to WP 5.6 +- Update Checksums to support blacklisted taxonomies. +- Refactor Jetpack callables into the plugin using existing filter jetpack_sync_callable_whitelist +- Wrap call_user_func in is_callable so that we don't trigger warnings for callables that don't exist. +- Sync: Trigger initial sync on jetpack_site_registered +- Update Comments checksum field to comment_date_gmt. We cannot use comment_content directly due to charset/filters. +- Deprecate jetpack_json_wrap +- Remove Sync's usage of wp_startswith + +## [1.20.2] - 2021-02-08 + +- Update dependencies to latest stable + +## [1.20.1] - 2021-01-28 + +- Update dependencies to latest stable + +## [1.20.0] - 2021-01-26 + +- Sync Concurrency / Race Conditions +- Sync: Prevent an PHP warning +- Jetpack Sync: Checksums: Use a better way to fetch and validate fields against table +- Add mirror-repo information to all current composer packages +- Full Sync :: Reduce Concurrency. +- Monorepo: Reorganize all projects +- Various PHPCS and Cleanup + +## [1.19.4] - 2021-01-18 + +- Update dependencies to latest stable + +## [1.19.3] - 2021-01-18 + +- Full Sync :: Reduce Concurrency. + +## [1.19.2] - 2020-12-21 + +- Update the do_full_sync function to early return if we are in SYNC READ ONLY mode. +- Return an empty array if the specified range is empty. (It was returning the checksum for the WHOLE dataset). + +## [1.19.1] - 2020-12-17 + +## [1.19.0] - 2020-12-17 + +- sync: Improve sync checksum algorithm and endpoints +- wp_get_environment_type as callable. +- Disallow amp_validated_url as it is not site content but instead validation errors for amp mark-up. +- Whitelist (allow) jetpack_sync_settings_* options to be synced +- Re-order Sync default option whitelist (allowlist) + +## [1.18.1] - 2020-11-24 + +- Version packages for release + +## [1.18.0] - 2020-11-24 + +- Migrate jetpack_published_post to wp_after_insert_post hook +- Check value to determine if we should enable sync after an action enqueuement. +- General: update minimum required version to WordPress 5.5 +- Fix remaining phpcs warnings in most of requirelist +- Update access of comment_status_to_approval_value to allow extension. +- Update get_term Replicastore function to handle term_taxonomy_id option +- Update get_terms to utilize ensure_taxonomy so that the Taxonomy is registered. +- Addtion of note on explict return of null instead of false if option not found. +- Alignment of comment_status_to_approval_value function. Addition of post-trashed status and cleanup of cases. +- Alignment with implemenations. Call ensure_taxonomy to ensure Taxonomies have been initialized. +- Call ensure_taxonomy within get_object_terms so that the taxonomy is registered before action is performed. +- Updated PHPCS: Packages and Debugger + +## [1.17.2] - 2020-11-05 + +- Update dependencies to latest stable + +## [1.17.1] - 2020-10-29 + +- Update dependencies to latest stable + +## [1.17.0] - 2020-10-27 + +- WPCOM Block Editor: Update meta key name +- Resolve PHP Warning with array_filter usage in sync of action_links. +- Sync: Seperate theme data ( name, version, slug and uri) from theme support data +- Replaced intval() with (int) as part of issue #17432. +- Replaced strval() with type casting (string) as part of issue #17432. +- Replaced floatval() with type cast (float) as part of issue #17432. +- Make XMLRPC methods available for blog token + +## [1.16.4] - 2020-10-14 + +- Update dependencies to latest stable + +## [1.16.3] - 2020-10-09 + +- Update dependencies to latest stable + +## [1.16.2] - 2020-10-06 + +- Update dependencies to latest stable + +## [1.16.1] - 2020-10-01 + +- Update dependencies to latest stable + +## [1.16.0] - 2020-09-29 + +- Publicize: Allow publishing a post as a Twitter thread. +- props @jmdodd - filter out set_object_terms actions that don't perform any update. Includes unit tests. +- Sort Arrays by keys before generating callable checksums +- Packages: avoid PHPCS warnings +- Adding 'review' to whitelisted comment types +- Disable Sync sending on Backup API Requests +- Sync: stop trying to check for edit_comment capability +- Added options to sync wc whitelist +- Sync: Improve theme support syncing + +## [1.15.1] - 2020-09-09 + +- Update dependencies to latest stable + +## [1.15.0] - 2020-08-26 + +- Sync: add Creative Mail configuration option to synced options +- Extend sync_status endpoint with optional debug_details field +- REST API endpoints: expand management endpoints +- Sync: Fix nonce action string in theme edit sync +- WP 5.5 Compat: Align Jetpack and Core's plugin autoupdates +- use current user token to updateRole request +- Resolve Sync Errors from empty edge case and WP.com returning concurrent_request_error +- Rework Sender to properly return state during do_full_sync + +## [1.14.4] - 2020-08-10 + +- WP 5.5 Compat: Align Jetpack and Core's plugin autoupdates + +## [1.14.3] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.14.2] - 2020-08-10 + +- Update dependencies to latest stable + +## [1.14.1] - 2020-08-10 + +- Resolve Sync Errors from empty edge case and WP.com returning concurrent_request_error + +## [1.14.0] - 2020-07-28 + +- Core Compat: Site Environment +- Unit Tests: fix tests according to changes in Core +- Utilize the blog token vs master user token to send sync actions. + +## [1.13.2] - 2020-07-06 + +- Update dependencies to latest stable + +## [1.13.1] - 2020-07-01 + +- Update dependencies to latest stable + +## [1.13.0] - 2020-06-30 + +- Block Flamingo Plugin post types in Jetpack Sync +- Explicit single execution of do_full_sync from cron +- Update to reference the property defined in the Jetpack Connection Manager class +- PHPCS: Clean up the packages +- WordAds: Add consent support for California Consumer Privacy Act (CCPA) +- Sync: Add additional support for theme_support_whitelist + +## [1.12.4] - 2020-06-02 + +- Revert "Fix `jetpack sync start` CLI command (#16010)" + +## [1.12.3] - 2020-06-01 + +- Update dependencies to latest stable + +## [1.12.2] - 2020-06-01 + +- Fix `jetpack sync start` CLI command + +## [1.12.1] - 2020-05-29 + +- Sync: Add additional support for theme_support_whitelist + +## [1.12.0] - 2020-05-26 + +- Update ReplicaStore to call clean_comment_cache when comments are upserted or a reset is perofrmed. +- Store the list of active plugins that uses connection in an option +- Jetpack Sync :: Alternate non-blocking flow +- Settings - Writing: add a toggle to Carousel so users can hide comment area +- Sender needs to load consistently utilizing logic +- Always delete items from the queue even if the buffer is no longer checked out. +- Update the hook of Sync's Comment module to not send meta actions when the comment_type is not whitelisted. +- Sync Comments apply whitelist to all actions + +## [1.11.0] - 2020-04-28 + +- Correct inline documentation "Array" type +- Filter out blacklisted post_types for deleted_post actions. +- Publicize: Add jetpack_publicize_options +- Blacklisting Post Types from Sync +- Comments: update default comment type +- Jetpack Sync: Split `jetpack_post_meta_batch_delete` in action to be called in chunks of 100 items, compared to all at once. +- Update Sync limits based on analysis of data loss events. + +## [1.10.0] - 2020-03-31 + +- Update dependencies to latest stable + +## [1.9.0] - 2020-03-31 + +- Debugger: Add sync health progress bar +- Add main network WPCOM blog ID to sync functions +- Masterbar: send wpcom user ID to wpcom when attempting to log… +- Sync: a better readme + +## [1.8.0] - 2020-02-25 + +- Minileven: add options back as they still exist on sites +- Sync: add queue size to actions +- Mobile Theme: remove feature + +## [1.7.6] - 2020-02-14 + +- get_sync_status does not properly account for unexpected states. + +## [1.7.5] - 2020-02-14 + +- Empty Helper function for checkin handler +- Sync Health: fix excessive data loss reports +- Initial Sync Health Status Class and Data Loss Handler +- Stop REST API Log entries from being synced + +## [1.7.4+vip] - 2020-02-14 + +- Empty Helper function for checkin handler + +## [1.7.4] - 2020-01-23 + +- Sync Chunk Keys need to be unique + +## [1.7.3] - 2020-01-20 + +- Sync: ensure we run the initial sync on new connections + +## [1.7.2] - 2020-01-17 + +- Sync Package: use Full_Sync_Immediately by default +- Adding new managed WordPress hosts to be identified in class-functions.php. + +## [1.7.1] - 2020-01-14 + +- Packages: Various improvements for wp.com or self-contained consumers + +## [1.7.0] - 2020-01-14 + +- Trying to add deterministic initialization. + +## [1.6.3] - 2020-01-07 + +- Fix git history. + +## [1.6.2] - 2019-12-31 + +- Sync: Remove DEFAULT_SYNC_MODULES legacy map +- Connection: Loose Comparison for Port Number in Signatures + +## [1.6.1] - 2019-12-13 + +- tweak default sync settings + +## [1.6.0] - 2019-12-02 + +- Sync: Full Sync: Send immediately. + +## [1.5.1] - 2019-11-26 + +- Marked the xmlrpc_api_url method as deprecated. + +## [1.5.0] - 2019-11-25 + +- Remove sync settings cache + +## [1.4.0] - 2019-11-19 + +- Full Sync: Don't allow more than one request to enqueue +- Sync: Update Max Int + +## [1.3.4] - 2019-11-08 + +- Packages: Use classmap instead of PSR-4 + +## [1.3.3] - 2019-11-08 + +- Deprecate Jetpack::is_development_mode() in favor of the packaged Status()->is_development_mode() + +## [1.3.2] - 2019-11-01 + +- Full Sync updates to allow full enqueuing of chunks. + +## [1.3.1] - 2019-10-29 + +- PHPCS: Rest of the packages + +## [1.3.0] - 2019-10-29 + +- Sync: Checkout Endpoint: Add `pop` argument 😱 + +## [1.2.1] - 2019-10-28 + +- Sync: Add Settings to enable/disable the sender for a particular queue + +## [1.2.0] - 2019-10-24 + +- Sync: Fix how we enqueue term_relationships on full sync 🏝 +- WP 5.3: Use modern wp_timezone +- Check for last_error when enqueuing IDs + +## [1.1.1] - 2019-10-23 + +- Use spread operator instead of func_get_args + +## [1.1.0] - 2019-10-07 + +- Sync: Ensure a post object is returned +- PHPCS: Sync Functions +- Sync: Bail initial sync if there is an ongoing full sync + +## [1.0.2] - 2019-09-25 + +- Sync: Only allow white listed comment types to be inserted. +- Sync: Move sync_object XML-RPC method from connection to sync +- Sync: do not sync comments made via Action Scheduler +- Docs: Unify usage of @package phpdoc tags + +## [1.0.1] - 2019-09-14 + +## 1.0.0 - 2019-09-14 + +- Packages: Move sync to a classmapped package + +[1.47.4]: https://github.com/Automattic/jetpack-sync/compare/v1.47.3...v1.47.4 +[1.47.3]: https://github.com/Automattic/jetpack-sync/compare/v1.47.2...v1.47.3 +[1.47.2]: https://github.com/Automattic/jetpack-sync/compare/v1.47.1...v1.47.2 +[1.47.1]: https://github.com/Automattic/jetpack-sync/compare/v1.47.0...v1.47.1 +[1.47.0]: https://github.com/Automattic/jetpack-sync/compare/v1.46.1...v1.47.0 +[1.46.1]: https://github.com/Automattic/jetpack-sync/compare/v1.46.0...v1.46.1 +[1.46.0]: https://github.com/Automattic/jetpack-sync/compare/v1.45.0...v1.46.0 +[1.45.0]: https://github.com/Automattic/jetpack-sync/compare/v1.44.2...v1.45.0 +[1.44.2]: https://github.com/Automattic/jetpack-sync/compare/v1.44.1...v1.44.2 +[1.44.1]: https://github.com/Automattic/jetpack-sync/compare/v1.44.0...v1.44.1 +[1.44.0]: https://github.com/Automattic/jetpack-sync/compare/v1.43.2...v1.44.0 +[1.43.2]: https://github.com/Automattic/jetpack-sync/compare/v1.43.1...v1.43.2 +[1.43.1]: https://github.com/Automattic/jetpack-sync/compare/v1.43.0...v1.43.1 +[1.43.0]: https://github.com/Automattic/jetpack-sync/compare/v1.42.0...v1.43.0 +[1.42.0]: https://github.com/Automattic/jetpack-sync/compare/v1.41.0...v1.42.0 +[1.41.0]: https://github.com/Automattic/jetpack-sync/compare/v1.40.3...v1.41.0 +[1.40.3]: https://github.com/Automattic/jetpack-sync/compare/v1.40.2...v1.40.3 +[1.40.2]: https://github.com/Automattic/jetpack-sync/compare/v1.40.1...v1.40.2 +[1.40.1]: https://github.com/Automattic/jetpack-sync/compare/v1.40.0...v1.40.1 +[1.40.0]: https://github.com/Automattic/jetpack-sync/compare/v1.39.0...v1.40.0 +[1.39.0]: https://github.com/Automattic/jetpack-sync/compare/v1.38.4...v1.39.0 +[1.38.4]: https://github.com/Automattic/jetpack-sync/compare/v1.38.3...v1.38.4 +[1.38.3]: https://github.com/Automattic/jetpack-sync/compare/v1.38.2...v1.38.3 +[1.38.2]: https://github.com/Automattic/jetpack-sync/compare/v1.38.1...v1.38.2 +[1.38.1]: https://github.com/Automattic/jetpack-sync/compare/v1.38.0...v1.38.1 +[1.38.0]: https://github.com/Automattic/jetpack-sync/compare/v1.37.1...v1.38.0 +[1.37.1]: https://github.com/Automattic/jetpack-sync/compare/v1.37.0...v1.37.1 +[1.37.0]: https://github.com/Automattic/jetpack-sync/compare/v1.36.1...v1.37.0 +[1.36.1]: https://github.com/Automattic/jetpack-sync/compare/v1.36.0...v1.36.1 +[1.36.0]: https://github.com/Automattic/jetpack-sync/compare/v1.35.2...v1.36.0 +[1.35.2]: https://github.com/Automattic/jetpack-sync/compare/v1.35.1...v1.35.2 +[1.35.1]: https://github.com/Automattic/jetpack-sync/compare/v1.35.0...v1.35.1 +[1.35.0]: https://github.com/Automattic/jetpack-sync/compare/v1.34.0...v1.35.0 +[1.34.0]: https://github.com/Automattic/jetpack-sync/compare/v1.33.1...v1.34.0 +[1.33.1]: https://github.com/Automattic/jetpack-sync/compare/v1.33.0...v1.33.1 +[1.33.0]: https://github.com/Automattic/jetpack-sync/compare/v1.32.0...v1.33.0 +[1.32.0]: https://github.com/Automattic/jetpack-sync/compare/v1.31.1...v1.32.0 +[1.31.1]: https://github.com/Automattic/jetpack-sync/compare/v1.31.0...v1.31.1 +[1.31.0]: https://github.com/Automattic/jetpack-sync/compare/v1.30.8...v1.31.0 +[1.30.8]: https://github.com/Automattic/jetpack-sync/compare/v1.30.7...v1.30.8 +[1.30.7]: https://github.com/Automattic/jetpack-sync/compare/v1.30.6...v1.30.7 +[1.30.6]: https://github.com/Automattic/jetpack-sync/compare/v1.30.5...v1.30.6 +[1.30.5]: https://github.com/Automattic/jetpack-sync/compare/v1.30.4...v1.30.5 +[1.30.4]: https://github.com/Automattic/jetpack-sync/compare/v1.30.3...v1.30.4 +[1.30.3]: https://github.com/Automattic/jetpack-sync/compare/v1.30.2...v1.30.3 +[1.30.2]: https://github.com/Automattic/jetpack-sync/compare/v1.30.1...v1.30.2 +[1.30.1]: https://github.com/Automattic/jetpack-sync/compare/v1.30.0...v1.30.1 +[1.30.0]: https://github.com/Automattic/jetpack-sync/compare/v1.29.2...v1.30.0 +[1.29.2]: https://github.com/Automattic/jetpack-sync/compare/v1.29.1...v1.29.2 +[1.29.1]: https://github.com/Automattic/jetpack-sync/compare/v1.29.0...v1.29.1 +[1.29.0]: https://github.com/Automattic/jetpack-sync/compare/v1.28.2...v1.29.0 +[1.28.2]: https://github.com/Automattic/jetpack-sync/compare/v1.28.1...v1.28.2 +[1.28.1]: https://github.com/Automattic/jetpack-sync/compare/v1.28.0...v1.28.1 +[1.28.0]: https://github.com/Automattic/jetpack-sync/compare/v1.27.6...v1.28.0 +[1.27.6]: https://github.com/Automattic/jetpack-sync/compare/v1.27.5...v1.27.6 +[1.27.5]: https://github.com/Automattic/jetpack-sync/compare/v1.27.4...v1.27.5 +[1.27.4]: https://github.com/Automattic/jetpack-sync/compare/v1.27.3...v1.27.4 +[1.27.3]: https://github.com/Automattic/jetpack-sync/compare/v1.27.2...v1.27.3 +[1.27.2]: https://github.com/Automattic/jetpack-sync/compare/v1.27.1...v1.27.2 +[1.27.1]: https://github.com/Automattic/jetpack-sync/compare/v1.27.0...v1.27.1 +[1.27.0]: https://github.com/Automattic/jetpack-sync/compare/v1.26.4...v1.27.0 +[1.26.4]: https://github.com/Automattic/jetpack-sync/compare/v1.26.3...v1.26.4 +[1.26.3]: https://github.com/Automattic/jetpack-sync/compare/v1.26.2...v1.26.3 +[1.26.2]: https://github.com/Automattic/jetpack-sync/compare/v1.26.1...v1.26.2 +[1.26.1]: https://github.com/Automattic/jetpack-sync/compare/v1.26.0...v1.26.1 +[1.26.0]: https://github.com/Automattic/jetpack-sync/compare/v1.25.0...v1.26.0 +[1.25.0]: https://github.com/Automattic/jetpack-sync/compare/v1.24.2...v1.25.0 +[1.24.2]: https://github.com/Automattic/jetpack-sync/compare/v1.24.1...v1.24.2 +[1.24.1]: https://github.com/Automattic/jetpack-sync/compare/v1.24.0...v1.24.1 +[1.24.0]: https://github.com/Automattic/jetpack-sync/compare/v1.23.3...v1.24.0 +[1.23.3]: https://github.com/Automattic/jetpack-sync/compare/v1.23.2...v1.23.3 +[1.23.2]: https://github.com/Automattic/jetpack-sync/compare/v1.23.1...v1.23.2 +[1.23.1]: https://github.com/Automattic/jetpack-sync/compare/v1.23.0...v1.23.1 +[1.23.0]: https://github.com/Automattic/jetpack-sync/compare/v1.22.0...v1.23.0 +[1.22.0]: https://github.com/Automattic/jetpack-sync/compare/v1.21.3...v1.22.0 +[1.21.3]: https://github.com/Automattic/jetpack-sync/compare/v1.21.2...v1.21.3 +[1.21.2]: https://github.com/Automattic/jetpack-sync/compare/v1.21.1...v1.21.2 +[1.21.1]: https://github.com/Automattic/jetpack-sync/compare/v1.21.0...v1.21.1 +[1.21.0]: https://github.com/Automattic/jetpack-sync/compare/v1.20.2...v1.21.0 +[1.20.2]: https://github.com/Automattic/jetpack-sync/compare/v1.20.1...v1.20.2 +[1.20.1]: https://github.com/Automattic/jetpack-sync/compare/v1.20.0...v1.20.1 +[1.20.0]: https://github.com/Automattic/jetpack-sync/compare/v1.19.4...v1.20.0 +[1.19.4]: https://github.com/Automattic/jetpack-sync/compare/v1.19.3...v1.19.4 +[1.19.3]: https://github.com/Automattic/jetpack-sync/compare/v1.19.2...v1.19.3 +[1.19.2]: https://github.com/Automattic/jetpack-sync/compare/v1.19.1...v1.19.2 +[1.19.1]: https://github.com/Automattic/jetpack-sync/compare/v1.19.0...v1.19.1 +[1.19.0]: https://github.com/Automattic/jetpack-sync/compare/v1.18.1...v1.19.0 +[1.18.1]: https://github.com/Automattic/jetpack-sync/compare/v1.18.0...v1.18.1 +[1.18.0]: https://github.com/Automattic/jetpack-sync/compare/v1.17.2...v1.18.0 +[1.17.2]: https://github.com/Automattic/jetpack-sync/compare/v1.17.1...v1.17.2 +[1.17.1]: https://github.com/Automattic/jetpack-sync/compare/v1.17.0...v1.17.1 +[1.17.0]: https://github.com/Automattic/jetpack-sync/compare/v1.16.4...v1.17.0 +[1.16.4]: https://github.com/Automattic/jetpack-sync/compare/v1.16.3...v1.16.4 +[1.16.3]: https://github.com/Automattic/jetpack-sync/compare/v1.16.2...v1.16.3 +[1.16.2]: https://github.com/Automattic/jetpack-sync/compare/v1.16.1...v1.16.2 +[1.16.1]: https://github.com/Automattic/jetpack-sync/compare/v1.16.0...v1.16.1 +[1.16.0]: https://github.com/Automattic/jetpack-sync/compare/v1.15.1...v1.16.0 +[1.15.1]: https://github.com/Automattic/jetpack-sync/compare/v1.15.0...v1.15.1 +[1.15.0]: https://github.com/Automattic/jetpack-sync/compare/v1.14.4...v1.15.0 +[1.14.4]: https://github.com/Automattic/jetpack-sync/compare/v1.14.3...v1.14.4 +[1.14.3]: https://github.com/Automattic/jetpack-sync/compare/v1.14.2...v1.14.3 +[1.14.2]: https://github.com/Automattic/jetpack-sync/compare/v1.14.1...v1.14.2 +[1.14.1]: https://github.com/Automattic/jetpack-sync/compare/v1.14.0...v1.14.1 +[1.14.0]: https://github.com/Automattic/jetpack-sync/compare/v1.13.2...v1.14.0 +[1.13.2]: https://github.com/Automattic/jetpack-sync/compare/v1.13.1...v1.13.2 +[1.13.1]: https://github.com/Automattic/jetpack-sync/compare/v1.13.0...v1.13.1 +[1.13.0]: https://github.com/Automattic/jetpack-sync/compare/v1.12.4...v1.13.0 +[1.12.4]: https://github.com/Automattic/jetpack-sync/compare/v1.12.3...v1.12.4 +[1.12.3]: https://github.com/Automattic/jetpack-sync/compare/v1.12.2...v1.12.3 +[1.12.2]: https://github.com/Automattic/jetpack-sync/compare/v1.12.1...v1.12.2 +[1.12.1]: https://github.com/Automattic/jetpack-sync/compare/v1.12.0...v1.12.1 +[1.12.0]: https://github.com/Automattic/jetpack-sync/compare/v1.11.0...v1.12.0 +[1.11.0]: https://github.com/Automattic/jetpack-sync/compare/v1.10.0...v1.11.0 +[1.10.0]: https://github.com/Automattic/jetpack-sync/compare/v1.9.0...v1.10.0 +[1.9.0]: https://github.com/Automattic/jetpack-sync/compare/v1.8.0...v1.9.0 +[1.8.0]: https://github.com/Automattic/jetpack-sync/compare/v1.7.6...v1.8.0 +[1.7.6]: https://github.com/Automattic/jetpack-sync/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/Automattic/jetpack-sync/compare/v1.7.4+vip...v1.7.5 +[1.7.4+vip]: https://github.com/Automattic/jetpack-sync/compare/v1.7.4...v1.7.4+vip +[1.7.4]: https://github.com/Automattic/jetpack-sync/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/Automattic/jetpack-sync/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/Automattic/jetpack-sync/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/Automattic/jetpack-sync/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/Automattic/jetpack-sync/compare/v1.6.3...v1.7.0 +[1.6.3]: https://github.com/Automattic/jetpack-sync/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/Automattic/jetpack-sync/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/Automattic/jetpack-sync/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/Automattic/jetpack-sync/compare/v1.5.1...v1.6.0 +[1.5.1]: https://github.com/Automattic/jetpack-sync/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/Automattic/jetpack-sync/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/Automattic/jetpack-sync/compare/v1.3.4...v1.4.0 +[1.3.4]: https://github.com/Automattic/jetpack-sync/compare/v1.3.3...v1.3.4 +[1.3.3]: https://github.com/Automattic/jetpack-sync/compare/v1.3.2...v1.3.3 +[1.3.2]: https://github.com/Automattic/jetpack-sync/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/Automattic/jetpack-sync/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/Automattic/jetpack-sync/compare/v1.2.1...v1.3.0 +[1.2.1]: https://github.com/Automattic/jetpack-sync/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/Automattic/jetpack-sync/compare/v1.1.1...v1.2.0 +[1.1.1]: https://github.com/Automattic/jetpack-sync/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/Automattic/jetpack-sync/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/Automattic/jetpack-sync/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/Automattic/jetpack-sync/compare/v1.0.0...v1.0.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json new file mode 100644 index 00000000..75a89ebf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/composer.json @@ -0,0 +1,56 @@ +{ + "name": "automattic/jetpack-sync", + "description": "Everything needed to allow syncing to the WP.com infrastructure.", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-connection": "^1.51.3", + "automattic/jetpack-constants": "^1.6.21", + "automattic/jetpack-identity-crisis": "^0.8.40", + "automattic/jetpack-password-checker": "^0.2.12", + "automattic/jetpack-ip": "^0.1.1", + "automattic/jetpack-roles": "^1.4.22", + "automattic/jetpack-status": "^1.16.3" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4", + "automattic/wordbless": "@dev" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-sync", + "textdomain": "jetpack-sync", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-sync/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.47.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php new file mode 100644 index 00000000..c1711af3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php @@ -0,0 +1,1074 @@ +do_dedicated_sync_and_exit(); + } + } + + /** + * Define JETPACK_SYNC_READ_ONLY constant if not defined. + * This notifies sync to not run in shutdown if it was initialized during init. + * + * @access public + * @static + */ + public static function mark_sync_read_only() { + Constants::set_constant( 'JETPACK_SYNC_READ_ONLY', true ); + } + + /** + * Decides if the sender should run on shutdown for this request. + * + * @access public + * @static + * + * @return bool + */ + public static function should_initialize_sender() { + + // Allow for explicit disable of Sync from request param jetpack_sync_read_only. + if ( isset( $_REQUEST['jetpack_sync_read_only'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification + self::mark_sync_read_only(); + return false; + } + + if ( Constants::is_true( 'DOING_CRON' ) ) { + return self::sync_via_cron_allowed(); + } + + /** + * For now, if dedicated Sync is enabled we will always initialize send, even for GET and unauthenticated requests. + */ + if ( Settings::is_dedicated_sync_enabled() ) { + return true; + } + + if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD'] ) { + return true; + } + + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + if ( is_admin() ) { + return true; + } + + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + return true; + } + + if ( Constants::get_constant( 'WP_CLI' ) ) { + return true; + } + + return false; + } + + /** + * Decides if the sender should run on shutdown when actions are queued. + * + * @access public + * @static + * + * @param bool $enable Should we initilize sender. + * @return bool + */ + public static function should_initialize_sender_enqueue( $enable ) { + + // If $enabled is false don't modify it, only check cron if enabled. + if ( false === $enable ) { + return $enable; + } + + if ( Constants::is_true( 'DOING_CRON' ) ) { + return self::sync_via_cron_allowed(); + } + + return true; + } + + /** + * Decides if sync should run at all during this request. + * + * @access public + * @static + * + * @return bool + */ + public static function sync_allowed() { + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + return false; + } + + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + return true; + } + + if ( ! Settings::is_sync_enabled() ) { + return false; + } + + if ( ( new Status() )->is_offline_mode() ) { + return false; + } + + if ( ( new Status() )->is_staging_site() ) { + return false; + } + + $connection = new Jetpack_Connection(); + if ( ! $connection->is_connected() ) { + if ( ! doing_action( 'jetpack_site_registered' ) ) { + return false; + } + } + + return true; + } + + /** + * Helper function to get details as to why sync is not allowed, if it is not allowed. + * + * @return array + */ + public static function get_debug_details() { + $debug = array(); + $debug['debug_details']['sync_allowed'] = self::sync_allowed(); + $debug['debug_details']['sync_health'] = Health::get_status(); + if ( false === $debug['debug_details']['sync_allowed'] ) { + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + $debug['debug_details']['is_wpcom'] = true; + } + if ( defined( 'PHPUNIT_JETPACK_TESTSUITE' ) ) { + $debug['debug_details']['PHPUNIT_JETPACK_TESTSUITE'] = true; + } + if ( ! Settings::is_sync_enabled() ) { + $debug['debug_details']['is_sync_enabled'] = false; + $debug['debug_details']['jetpack_sync_disable'] = Settings::get_setting( 'disable' ); + $debug['debug_details']['jetpack_sync_network_disable'] = Settings::get_setting( 'network_disable' ); + } + if ( ( new Status() )->is_offline_mode() ) { + $debug['debug_details']['is_offline_mode'] = true; + } + if ( ( new Status() )->is_staging_site() ) { + $debug['debug_details']['is_staging_site'] = true; + } + $connection = new Jetpack_Connection(); + if ( ! $connection->is_connected() ) { + $debug['debug_details']['active_connection'] = false; + } + } + + // Sync locks. + $debug['debug_details']['dedicated_sync_enabled'] = Settings::is_dedicated_sync_enabled(); + + $queue = self::$sender->get_sync_queue(); + $full_queue = self::$sender->get_full_sync_queue(); + + $debug['debug_details']['sync_locks'] = array( + 'retry_time_sync' => get_option( self::RETRY_AFTER_PREFIX . 'sync' ), + 'retry_time_full_sync' => get_option( self::RETRY_AFTER_PREFIX . 'full_sync' ), + 'next_sync_time_sync' => self::$sender->get_next_sync_time( 'sync' ), + 'next_sync_time_full_sync' => self::$sender->get_next_sync_time( 'full_sync' ), + 'queue_locked_sync' => $queue->is_locked(), + 'queue_locked_full_sync' => $full_queue->is_locked(), + 'dedicated_sync_request_lock' => \Jetpack_Options::get_raw_option( Dedicated_Sender::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ), + 'dedicated_sync_temporary_disable_flag' => get_transient( Dedicated_Sender::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ), + ); + + // Sync Logs. + $debug['debug_details']['last_succesful_sync'] = get_option( self::LAST_SUCCESS_PREFIX . 'sync', '' ); + $debug['debug_details']['sync_error_log'] = get_option( self::ERROR_LOG_PREFIX . 'sync', '' ); + + return $debug; + } + + /** + * Determines if syncing during a cron job is allowed. + * + * @access public + * @static + * + * @return bool|int + */ + public static function sync_via_cron_allowed() { + return ( Settings::get_setting( 'sync_via_cron' ) ); + } + + /** + * Decides if the given post should be Publicized based on its type. + * + * @access public + * @static + * + * @param bool $should_publicize Publicize status prior to this filter running. + * @param \WP_Post $post The post to test for Publicizability. + * @return bool + */ + public static function prevent_publicize_blacklisted_posts( $should_publicize, $post ) { + if ( in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + return false; + } + + return $should_publicize; + } + + /** + * Set an importing flag to `true` in sync settings. + * + * @access public + * @static + */ + public static function set_is_importing_true() { + Settings::set_importing( true ); + } + + /** + * Sends data to WordPress.com via an XMLRPC request. + * + * @access public + * @static + * + * @param object $data Data relating to a sync action. + * @param string $codec_name The name of the codec that encodes the data. + * @param float $sent_timestamp Current server time so we can compensate for clock differences. + * @param string $queue_id The queue the action belongs to, sync or full_sync. + * @param float $checkout_duration Time spent retrieving queue items from the DB. + * @param float $preprocess_duration Time spent converting queue items into data to send. + * @param int $queue_size The size of the sync queue at the time of processing. + * @param string $buffer_id The ID of the Queue buffer checked out for processing. + * @return mixed|WP_Error The result of the sending request. + */ + public static function send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration, $queue_size = null, $buffer_id = null ) { + + $query_args = array( + 'sync' => '1', // Add an extra parameter to the URL so we can tell it's a sync action. + 'codec' => $codec_name, + 'timestamp' => $sent_timestamp, + 'queue' => $queue_id, + 'cd' => sprintf( '%.4f', $checkout_duration ), + 'pd' => sprintf( '%.4f', $preprocess_duration ), + 'queue_size' => $queue_size, + 'buffer_id' => $buffer_id, + // TODO this will be extended in the future. Might be good to extract in a separate method to support future entries too. + 'sync_flow_type' => Settings::is_dedicated_sync_enabled() ? 'dedicated' : 'default', + ); + + $query_args['timeout'] = Settings::is_doing_cron() ? 30 : 20; + + if ( 'immediate-send' === $queue_id ) { + $query_args['timeout'] = 30; + } + + /** + * Filters query parameters appended to the Sync request URL sent to WordPress.com. + * + * @since 1.6.3 + * @since-jetpack 4.7.0 + * + * @param array $query_args associative array of query parameters. + */ + $query_args = apply_filters( 'jetpack_sync_send_data_query_args', $query_args ); + + $connection = new Jetpack_Connection(); + $url = add_query_arg( $query_args, $connection->xmlrpc_api_url() ); + + // If we're currently updating to Jetpack 7.7, the IXR client may be missing briefly + // because since 7.7 it's being autoloaded with Composer. + if ( ! class_exists( '\\Jetpack_IXR_Client' ) ) { + return new WP_Error( + 'ixr_client_missing', + esc_html__( 'Sync has been aborted because the IXR client is missing.', 'jetpack-sync' ) + ); + } + + $rpc = new \Jetpack_IXR_Client( + array( + 'url' => $url, + 'timeout' => $query_args['timeout'], + ) + ); + + $result = $rpc->query( 'jetpack.syncActions', $data ); + + // Adhere to Retry-After headers. + $retry_after = $rpc->get_response_header( 'Retry-After' ); + if ( false !== $retry_after ) { + if ( (int) $retry_after > 0 ) { + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + (int) $retry_after, false ); + } else { + // if unexpected value default to 3 minutes. + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + 180, false ); + } + } + + // Enable/Disable Dedicated Sync flow via response headers. + $dedicated_sync_header = $rpc->get_response_header( 'Jetpack-Dedicated-Sync' ); + if ( false !== $dedicated_sync_header ) { + Dedicated_Sender::maybe_change_dedicated_sync_status_from_wpcom_header( $dedicated_sync_header ); + } + + if ( ! $result ) { + if ( false === $retry_after ) { + // We received a non standard response from WP.com, lets backoff from sending requests for 1 minute. + update_option( self::RETRY_AFTER_PREFIX . $queue_id, microtime( true ) + 60, false ); + } + // Record Sync Errors. + $error_log = get_option( self::ERROR_LOG_PREFIX . $queue_id, array() ); + if ( ! is_array( $error_log ) ) { + $error_log = array(); + } + // Trim existing array to last 4 entries. + if ( 5 <= count( $error_log ) ) { + $error_log = array_slice( $error_log, -4, null, true ); + } + // Add new error indexed to time. + $error = $rpc->get_jetpack_error(); + $error->add_data( $rpc->get_last_response() ); + $error_log[ (string) microtime( true ) ] = $error; + // Update the error log. + update_option( self::ERROR_LOG_PREFIX . $queue_id, $error_log ); + + // return request error. + return $rpc->get_jetpack_error(); + } + + $response = $rpc->getResponse(); + + // Check if WordPress.com IDC mitigation blocked the sync request. + if ( Identity_Crisis::init()->check_response_for_idc( $response ) ) { + return new WP_Error( + 'sync_error_idc', + esc_html__( 'Sync has been blocked from WordPress.com because it would cause an identity crisis', 'jetpack-sync' ) + ); + } + + // Record last successful sync. + update_option( self::LAST_SUCCESS_PREFIX . $queue_id, microtime( true ), false ); + + return $response; + } + + /** + * Kicks off the initial sync. + * + * @access public + * @static + * + * @return bool|null False if sync is not allowed. + */ + public static function do_initial_sync() { + // Let's not sync if we are not supposed to. + if ( ! self::sync_allowed() ) { + return false; + } + + // Don't start new sync if a full sync is in process. + $full_sync_module = Modules::get_module( 'full-sync' ); + if ( $full_sync_module && $full_sync_module->is_started() && ! $full_sync_module->is_finished() ) { + return false; + } + + $initial_sync_config = array( + 'options' => true, + 'functions' => true, + 'constants' => true, + 'users' => array( get_current_user_id() ), + 'network_options' => true, + ); + + self::do_full_sync( $initial_sync_config ); + } + + /** + * Do an initial full sync only if one has not already been started. + * + * @return bool|null False if the initial full sync was already started, otherwise null. + */ + public static function do_only_first_initial_sync() { + $full_sync_module = Modules::get_module( 'full-sync' ); + if ( $full_sync_module && $full_sync_module->is_started() ) { + return false; + } + + static::do_initial_sync(); + } + + /** + * Kicks off a full sync. + * + * @access public + * @static + * + * @param array $modules The sync modules should be included in this full sync. All will be included if null. + * @return bool True if full sync was successfully started. + */ + public static function do_full_sync( $modules = null ) { + if ( ! self::sync_allowed() ) { + return false; + } + + $full_sync_module = Modules::get_module( 'full-sync' ); + + if ( ! $full_sync_module ) { + return false; + } + + self::initialize_listener(); + + $full_sync_module->start( $modules ); + + return true; + } + + /** + * Adds a cron schedule for regular syncing via cron, unless the schedule already exists. + * + * @access public + * @static + * + * @param array $schedules The list of WordPress cron schedules prior to this filter. + * @return array A list of WordPress cron schedules with the Jetpack sync interval added. + */ + public static function jetpack_cron_schedule( $schedules ) { + if ( ! isset( $schedules[ self::DEFAULT_SYNC_CRON_INTERVAL_NAME ] ) ) { + $minutes = (int) ( self::DEFAULT_SYNC_CRON_INTERVAL_VALUE / 60 ); + $display = ( 1 === $minutes ) ? + __( 'Every minute', 'jetpack-sync' ) : + /* translators: %d is an integer indicating the number of minutes. */ + sprintf( __( 'Every %d minutes', 'jetpack-sync' ), $minutes ); + $schedules[ self::DEFAULT_SYNC_CRON_INTERVAL_NAME ] = array( + 'interval' => self::DEFAULT_SYNC_CRON_INTERVAL_VALUE, + 'display' => $display, + ); + } + return $schedules; + } + + /** + * Starts an incremental sync via cron. + * + * @access public + * @static + */ + public static function do_cron_sync() { + self::do_cron_sync_by_type( 'sync' ); + } + + /** + * Starts a full sync via cron. + * + * @access public + * @static + */ + public static function do_cron_full_sync() { + self::do_cron_sync_by_type( 'full_sync' ); + } + + /** + * Try to send actions until we run out of things to send, + * or have to wait more than 15s before sending again, + * or we hit a lock or some other sending issue + * + * @access public + * @static + * + * @param string $type Sync type. Can be `sync` or `full_sync`. + */ + public static function do_cron_sync_by_type( $type ) { + if ( ! self::sync_allowed() || ( 'sync' !== $type && 'full_sync' !== $type ) ) { + return; + } + + self::initialize_sender(); + + $time_limit = Settings::get_setting( 'cron_sync_time_limit' ); + $start_time = time(); + $executions = 0; + + do { + $next_sync_time = self::$sender->get_next_sync_time( $type ); + + if ( $next_sync_time ) { + $delay = $next_sync_time - time() + 1; + if ( $delay > 15 ) { + break; + } elseif ( $delay > 0 ) { + sleep( $delay ); + } + } + + // Explicitly only allow 1 do_full_sync call until issue with Immediate Full Sync is resolved. + // For more context see p1HpG7-9pe-p2. + if ( 'full_sync' === $type && $executions >= 1 ) { + break; + } + + /** + * Only try to sync once if Dedicated Sync is enabled. Dedicated Sync has its own requeueing mechanism + * that will re-run it if there are items in the queue at the end. + */ + if ( 'sync' === $type && $executions >= 1 && Settings::is_dedicated_sync_enabled() ) { + break; + } + + $result = 'full_sync' === $type ? self::$sender->do_full_sync() : self::$sender->do_sync(); + + // # of send actions performed. + ++$executions; + + } while ( $result && ! is_wp_error( $result ) && ( $start_time + $time_limit ) > time() ); + + return $executions; + } + + /** + * Initialize the sync listener. + * + * @access public + * @static + */ + public static function initialize_listener() { + self::$listener = Listener::get_instance(); + } + + /** + * Initializes the sync sender. + * + * @access public + * @static + */ + public static function initialize_sender() { + self::$sender = Sender::get_instance(); + add_filter( 'jetpack_sync_send_data', array( __CLASS__, 'send_data' ), 10, 8 ); + } + + /** + * Initializes sync for WooCommerce. + * + * @access public + * @static + */ + public static function initialize_woocommerce() { + if ( false === class_exists( 'WooCommerce' ) ) { + return; + } + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_woocommerce_sync_module' ) ); + } + + /** + * Initializes sync for Instant Search. + * + * @access public + * @static + */ + public static function initialize_search() { + if ( false === class_exists( 'Automattic\\Jetpack\\Search\\Module_Control' ) ) { + return; + } + $search_module = new \Automattic\Jetpack\Search\Module_Control(); + if ( $search_module->is_instant_search_enabled() ) { + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_search_sync_module' ) ); + } + } + + /** + * Add Search updates to Sync Filters. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filter. + * @return array A list of sync modules that now includes Search's modules. + */ + public static function add_search_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\Search'; + return $sync_modules; + } + + /** + * Adds Woo's sync modules to existing modules for sending. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filter. + * @return array A list of sync modules that now includes Woo's modules. + */ + public static function add_woocommerce_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce'; + return $sync_modules; + } + + /** + * Initializes sync for WP Super Cache. + * + * @access public + * @static + */ + public static function initialize_wp_super_cache() { + if ( false === function_exists( 'wp_cache_is_enabled' ) ) { + return; + } + add_filter( 'jetpack_sync_modules', array( __CLASS__, 'add_wp_super_cache_sync_module' ) ); + } + + /** + * Adds WP Super Cache's sync modules to existing modules for sending. + * + * @access public + * @static + * + * @param array $sync_modules The list of sync modules declared prior to this filer. + * @return array A list of sync modules that now includes WP Super Cache's modules. + */ + public static function add_wp_super_cache_sync_module( $sync_modules ) { + $sync_modules[] = 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache'; + return $sync_modules; + } + + /** + * Sanitizes the name of sync's cron schedule. + * + * @access public + * @static + * + * @param string $schedule The name of a WordPress cron schedule. + * @return string The sanitized name of sync's cron schedule. + */ + public static function sanitize_filtered_sync_cron_schedule( $schedule ) { + $schedule = sanitize_key( $schedule ); + $schedules = wp_get_schedules(); + + // Make sure that the schedule has actually been registered using the `cron_intervals` filter. + if ( isset( $schedules[ $schedule ] ) ) { + return $schedule; + } + + return self::DEFAULT_SYNC_CRON_INTERVAL_NAME; + } + + /** + * Allows offsetting of start times for sync cron jobs. + * + * @access public + * @static + * + * @param string $schedule The name of a cron schedule. + * @param string $hook The hook that this method is responding to. + * @return int The offset for the sync cron schedule. + */ + public static function get_start_time_offset( $schedule = '', $hook = '' ) { + $start_time_offset = is_multisite() + ? wp_rand( 0, ( 2 * self::DEFAULT_SYNC_CRON_INTERVAL_VALUE ) ) + : 0; + + /** + * Allows overriding the offset that the sync cron jobs will first run. This can be useful when scheduling + * cron jobs across multiple sites in a network. + * + * @since 1.6.3 + * @since-jetpack 4.5.0 + * + * @param int $start_time_offset + * @param string $hook + * @param string $schedule + */ + return (int) apply_filters( + 'jetpack_sync_cron_start_time_offset', + $start_time_offset, + $hook, + $schedule + ); + } + + /** + * Decides if a sync cron should be scheduled. + * + * @access public + * @static + * + * @param string $schedule The name of a cron schedule. + * @param string $hook The hook that this method is responding to. + */ + public static function maybe_schedule_sync_cron( $schedule, $hook ) { + if ( ! $hook ) { + return; + } + $schedule = self::sanitize_filtered_sync_cron_schedule( $schedule ); + + $start_time = time() + self::get_start_time_offset( $schedule, $hook ); + if ( ! wp_next_scheduled( $hook ) ) { + // Schedule a job to send pending queue items once a minute. + wp_schedule_event( $start_time, $schedule, $hook ); + } elseif ( wp_get_schedule( $hook ) !== $schedule ) { + // If the schedule has changed, update the schedule. + wp_clear_scheduled_hook( $hook ); + wp_schedule_event( $start_time, $schedule, $hook ); + } + } + + /** + * Clears Jetpack sync cron jobs. + * + * @access public + * @static + */ + public static function clear_sync_cron_jobs() { + wp_clear_scheduled_hook( 'jetpack_sync_cron' ); + wp_clear_scheduled_hook( 'jetpack_sync_full_cron' ); + } + + /** + * Initializes Jetpack sync cron jobs. + * + * @access public + * @static + */ + public static function init_sync_cron_jobs() { + add_filter( 'cron_schedules', array( __CLASS__, 'jetpack_cron_schedule' ) ); // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected + + add_action( 'jetpack_sync_cron', array( __CLASS__, 'do_cron_sync' ) ); + add_action( 'jetpack_sync_full_cron', array( __CLASS__, 'do_cron_full_sync' ) ); + + /** + * Allows overriding of the default incremental sync cron schedule which defaults to once every 5 minutes. + * + * @since 1.6.3 + * @since-jetpack 4.3.2 + * + * @param string self::DEFAULT_SYNC_CRON_INTERVAL_NAME + */ + $incremental_sync_cron_schedule = apply_filters( 'jetpack_sync_incremental_sync_interval', self::DEFAULT_SYNC_CRON_INTERVAL_NAME ); + self::maybe_schedule_sync_cron( $incremental_sync_cron_schedule, 'jetpack_sync_cron' ); + + /** + * Allows overriding of the full sync cron schedule which defaults to once every 5 minutes. + * + * @since 1.6.3 + * @since-jetpack 4.3.2 + * + * @param string self::DEFAULT_SYNC_CRON_INTERVAL_NAME + */ + $full_sync_cron_schedule = apply_filters( 'jetpack_sync_full_sync_interval', self::DEFAULT_SYNC_CRON_INTERVAL_NAME ); + self::maybe_schedule_sync_cron( $full_sync_cron_schedule, 'jetpack_sync_full_cron' ); + } + + /** + * Perform maintenance when a plugin upgrade occurs. + * + * @access public + * @static + * + * @param string $new_version New version of the plugin. + * @param string $old_version Old version of the plugin. + */ + public static function cleanup_on_upgrade( $new_version = '', $old_version = '' ) { + if ( wp_next_scheduled( 'jetpack_sync_send_db_checksum' ) ) { + wp_clear_scheduled_hook( 'jetpack_sync_send_db_checksum' ); + } + + $is_new_sync_upgrade = version_compare( $old_version, '4.2', '>=' ); + if ( ! empty( $old_version ) && $is_new_sync_upgrade && version_compare( $old_version, '4.5', '<' ) ) { + self::clear_sync_cron_jobs(); + Settings::update_settings( + array( + 'render_filtered_content' => Defaults::$default_render_filtered_content, + ) + ); + } + + Health::on_jetpack_upgraded(); + } + + /** + * Get syncing status for the given fields. + * + * @access public + * @static + * + * @param string|null $fields A comma-separated string of the fields to include in the array from the JSON response. + * @return array An associative array with the status report. + */ + public static function get_sync_status( $fields = null ) { + self::initialize_sender(); + + $sync_module = Modules::get_module( 'full-sync' ); + $queue = self::$sender->get_sync_queue(); + + // _get_cron_array can be false + $cron_timestamps = ( _get_cron_array() ) ? array_keys( _get_cron_array() ) : array(); + $next_cron = ( ! empty( $cron_timestamps ) ) ? $cron_timestamps[0] - time() : ''; + + $checksums = array(); + $debug = array(); + + if ( ! empty( $fields ) ) { + $store = new Replicastore(); + $fields_params = array_map( 'trim', explode( ',', $fields ) ); + + if ( in_array( 'posts_checksum', $fields_params, true ) ) { + $checksums['posts_checksum'] = $store->posts_checksum(); + } + if ( in_array( 'comments_checksum', $fields_params, true ) ) { + $checksums['comments_checksum'] = $store->comments_checksum(); + } + if ( in_array( 'post_meta_checksum', $fields_params, true ) ) { + $checksums['post_meta_checksum'] = $store->post_meta_checksum(); + } + if ( in_array( 'comment_meta_checksum', $fields_params, true ) ) { + $checksums['comment_meta_checksum'] = $store->comment_meta_checksum(); + } + + if ( in_array( 'debug_details', $fields_params, true ) ) { + $debug = self::get_debug_details(); + } + } + + $full_sync_status = ( $sync_module ) ? $sync_module->get_status() : array(); + + $full_queue = self::$sender->get_full_sync_queue(); + + $result = array_merge( + $full_sync_status, + $checksums, + $debug, + array( + 'cron_size' => count( $cron_timestamps ), + 'next_cron' => $next_cron, + 'queue_size' => $queue->size(), + 'queue_lag' => $queue->lag(), + 'queue_next_sync' => ( self::$sender->get_next_sync_time( 'sync' ) - microtime( true ) ), + 'full_queue_next_sync' => ( self::$sender->get_next_sync_time( 'full_sync' ) - microtime( true ) ), + ) + ); + + // Verify $sync_module is not false. + if ( ( $sync_module ) && false === strpos( get_class( $sync_module ), 'Full_Sync_Immediately' ) ) { + $result['full_queue_size'] = $full_queue->size(); + $result['full_queue_lag'] = $full_queue->lag(); + } + return $result; + } + + /** + * Reset Sync locks. + * + * @access public + * @static + * @since 1.43.0 + * + * @param bool $unlock_queues Whether to unlock Sync queues. Defaults to true. + */ + public static function reset_sync_locks( $unlock_queues = true ) { + // Next sync locks. + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_sync' ); + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_full_sync' ); + delete_option( Sender::NEXT_SYNC_TIME_OPTION_NAME . '_full-sync-enqueue' ); + // Retry after locks. + delete_option( self::RETRY_AFTER_PREFIX . 'sync' ); + delete_option( self::RETRY_AFTER_PREFIX . 'full_sync' ); + // Dedicated sync locks. + \Jetpack_Options::delete_raw_option( Dedicated_Sender::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME ); + delete_transient( Dedicated_Sender::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ); + + // Queue locks. + // Note that we are just unlocking the queues here, not reseting them. + if ( $unlock_queues ) { + $sync_queue = new Queue( 'sync' ); + $sync_queue->unlock(); + + $full_sync_queue = new Queue( 'full_sync' ); + $full_sync_queue->unlock(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php new file mode 100644 index 00000000..b1a4cb83 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php @@ -0,0 +1,416 @@ + array( + 'Automattic\\Jetpack\\Sync\\Modules\\Callables', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately', // enable Initial Sync on Site Connection. + 'Automattic\\Jetpack\\Sync\\Modules\\Options', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates', + ), + 'jetpack_sync_callable_whitelist' => array( + 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), + 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), + 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), + 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), + 'wp_get_environment_type' => 'wp_get_environment_type', + 'wp_max_upload_size' => 'wp_max_upload_size', + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + ), + 'jetpack_sync_constants_whitelist' => array( + 'ABSPATH', + 'ALTERNATE_WP_CRON', + 'ATOMIC_CLIENT_ID', + 'AUTOMATIC_UPDATER_DISABLED', + 'DISABLE_WP_CRON', + 'DISALLOW_FILE_EDIT', + 'DISALLOW_FILE_MODS', + 'EMPTY_TRASH_DAYS', + 'FS_METHOD', + 'IS_PRESSABLE', + 'PHP_VERSION', + 'WP_ACCESSIBLE_HOSTS', + 'WP_AUTO_UPDATE_CORE', + 'WP_CONTENT_DIR', + 'WP_CRON_LOCK_TIMEOUT', + 'WP_DEBUG', + 'WP_HTTP_BLOCK_EXTERNAL', + 'WP_MAX_MEMORY_LIMIT', + 'WP_MEMORY_LIMIT', + 'WP_POST_REVISIONS', + ), + 'jetpack_sync_options_whitelist' => array( + /** + * Sync related options + */ + 'jetpack_sync_non_blocking', + 'jetpack_sync_non_public_post_stati', + 'jetpack_sync_settings_comment_meta_whitelist', + 'jetpack_sync_settings_post_meta_whitelist', + 'jetpack_sync_settings_post_types_blacklist', + 'jetpack_sync_settings_taxonomies_blacklist', + 'jetpack_sync_settings_dedicated_sync_enabled', + /** + * Connection related options + */ + 'jetpack_connection_active_plugins', + /** + * Generic site options + */ + 'blog_charset', + 'blog_public', + 'blogdescription', + 'blogname', + 'permalink_structure', + 'stylesheet', + 'time_format', + 'timezone_string', + ), + ); + + const MODULE_FILTER_MAPPING = array( + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => array( + 'jetpack_sync_options_whitelist', + 'jetpack_sync_options_contentless', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array( + 'jetpack_sync_constants_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array( + 'jetpack_sync_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array( + 'jetpack_sync_post_meta_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array( + 'jetpack_sync_comment_meta_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => array( + 'jetpack_sync_capabilities_whitelist', + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => array( + 'jetpack_sync_known_importers', + ), + ); + + const MODULES_FILTER_NAME = 'jetpack_sync_modules'; + + /** + * The static data settings array which contains the aggregated data settings for + * each sync filter. + * + * @var array + */ + private static $data_settings = array(); + + /** + * The static array which contains the list of filter hooks that have already been set up. + * + * @var array + */ + private static $set_filter_hooks = array(); + + /** + * Adds the data settings provided by a plugin to the Sync data settings. + * + * @param array $plugin_settings The array provided by the plugin. The array must use filters + * from the DATA_FILTER_DEFAULTS list as keys. + */ + public function add_settings_list( $plugin_settings = array() ) { + if ( empty( $plugin_settings ) || ! is_array( $plugin_settings ) ) { + /* + * No custom plugin settings, so use defaults for everything and bail early. + */ + $this->set_all_defaults(); + return; + } + + $this->add_filters_custom_settings_and_hooks( $plugin_settings ); + + if ( ! did_action( 'jetpack_sync_add_required_data_settings' ) ) { + $this->add_required_settings(); + /** + * Fires when the required settings have been adding to the static + * data_settings array. + * + * @since 1.29.2 + * + * @module sync + */ + do_action( 'jetpack_sync_add_required_data_settings' ); + } + } + + /** + * Sets the default values for sync modules and all sync data filters. + */ + private function set_all_defaults() { + $this->add_sync_filter_setting( self::MODULES_FILTER_NAME, Modules::DEFAULT_SYNC_MODULES ); + + foreach ( array_keys( Default_Filter_Settings::DATA_FILTER_DEFAULTS ) as $filter ) { + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + } + } + + /** + * Returns the default settings for the given filter. + * + * @param string $filter The filter name. + * + * @return array The filter's default settings array. + */ + private function get_default_setting_for_filter( $filter ) { + if ( self::MODULES_FILTER_NAME === $filter ) { + return Modules::DEFAULT_SYNC_MODULES; + } + + return ( new Default_Filter_Settings() )->get_default_settings( $filter ); + } + + /** + * Adds the custom settings and sets up the necessary filter hooks. + * + * @param array $filters_settings The custom settings. + */ + private function add_filters_custom_settings_and_hooks( $filters_settings ) { + if ( isset( $filters_settings[ self::MODULES_FILTER_NAME ] ) && is_array( $filters_settings[ self::MODULES_FILTER_NAME ] ) ) { + $this->add_custom_filter_setting( self::MODULES_FILTER_NAME, $filters_settings[ self::MODULES_FILTER_NAME ] ); + $enabled_modules = $filters_settings[ self::MODULES_FILTER_NAME ]; + } else { + $this->add_sync_filter_setting( self::MODULES_FILTER_NAME, Modules::DEFAULT_SYNC_MODULES ); + $enabled_modules = Modules::DEFAULT_SYNC_MODULES; + } + + $all_modules = Modules::DEFAULT_SYNC_MODULES; + + foreach ( $all_modules as $module ) { + if ( in_array( $module, $enabled_modules, true ) || in_array( $module, self::MUST_SYNC_DATA_SETTINGS['jetpack_sync_modules'], true ) ) { + $this->add_filters_for_enabled_module( $module, $filters_settings ); + } else { + $this->add_filters_for_disabled_module( $module ); + } + } + } + + /** + * Adds the filters for the provided enabled module. If the settings provided custom filter settings + * for the module's filters, those are used. Otherwise, the filter's default settings are used. + * + * @param string $module The module name. + * @param array $filters_settings The settings for the filters. + */ + private function add_filters_for_enabled_module( $module, $filters_settings ) { + $module_mapping = self::MODULE_FILTER_MAPPING; + $filters_for_module = isset( $module_mapping[ $module ] ) ? $module_mapping[ $module ] : array(); + + foreach ( $filters_for_module as $filter ) { + if ( isset( $filters_settings[ $filter ] ) ) { + $this->add_custom_filter_setting( $filter, $filters_settings[ $filter ] ); + } else { + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + } + } + } + + /** + * Adds the filters for the provided disabled module. The disabled module's associated filter settings are + * set to an empty array. + * + * @param string $module The module name. + */ + private function add_filters_for_disabled_module( $module ) { + $module_mapping = self::MODULE_FILTER_MAPPING; + $filters_for_module = isset( $module_mapping[ $module ] ) ? $module_mapping[ $module ] : array(); + + foreach ( $filters_for_module as $filter ) { + $this->add_custom_filter_setting( $filter, array() ); + } + } + + /** + * Adds the provided custom setting for a filter. If the filter setting isn't valid, the default + * value is used. + * + * If the filter's hook hasn't already been set up, it gets set up. + * + * @param string $filter The filter. + * @param array $setting The filter setting. + */ + private function add_custom_filter_setting( $filter, $setting ) { + if ( ! $this->is_valid_filter_setting( $filter, $setting ) ) { + /* + * The provided setting isn't valid, so use the default for this filter. + * We're using the default values so there's no need to set the filter hook. + */ + $this->add_sync_filter_setting( $filter, $this->get_default_setting_for_filter( $filter ) ); + return; + } + + if ( ! isset( static::$set_filter_hooks[ $filter ] ) ) { + // First time a custom modules setting is provided, so set the filter hook. + add_filter( $filter, array( $this, 'sync_data_filter_hook' ) ); + static::$set_filter_hooks[ $filter ] = 1; + } + + $this->add_sync_filter_setting( $filter, $setting ); + } + + /** + * Determines whether the filter setting is valid. The setting array is in the correct format (associative or indexed). + * + * @param string $filter The filter to check. + * @param array $filter_settings The filter settings. + * + * @return bool Whether the filter settings can be used. + */ + private function is_valid_filter_setting( $filter, $filter_settings ) { + if ( ! is_array( $filter_settings ) ) { + // The settings for each filter must be an array. + return false; + } + + if ( empty( $filter_settings ) ) { + // Empty settings are allowed. + return true; + } + + $indexed_array = isset( $filter_settings[0] ); + if ( in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) && ! $indexed_array ) { + return true; + } elseif ( ! in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) && $indexed_array ) { + return true; + } + + return false; + } + + /** + * Adds the data settings that are always required for every plugin that uses Sync. + */ + private function add_required_settings() { + foreach ( self::MUST_SYNC_DATA_SETTINGS as $filter => $setting ) { + // If the corresponding setting is already set and matches the default one, no need to proceed. + if ( isset( static::$data_settings[ $filter ] ) && static::$data_settings[ $filter ] === $this->get_default_setting_for_filter( $filter ) ) { + continue; + } + $this->add_custom_filter_setting( $filter, $setting ); + } + } + + /** + * Adds the provided data setting for the provided filter. + * + * @param string $filter The filter name. + * @param array $value The data setting. + */ + private function add_sync_filter_setting( $filter, $value ) { + if ( ! isset( static::$data_settings[ $filter ] ) ) { + static::$data_settings[ $filter ] = $value; + return; + } + + if ( in_array( $filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) ) { + $this->add_associative_filter_setting( $filter, $value ); + } else { + $this->add_indexed_filter_setting( $filter, $value ); + } + } + + /** + * Adds the provided data setting for the provided filter. This method handles + * adding settings to data that is stored as an associative array. + * + * @param string $filter The filter name. + * @param array $settings The data settings. + */ + private function add_associative_filter_setting( $filter, $settings ) { + foreach ( $settings as $key => $item ) { + if ( ! array_key_exists( $key, static::$data_settings[ $filter ] ) ) { + static::$data_settings[ $filter ][ $key ] = $item; + } + } + } + + /** + * Adds the provided data setting for the provided filter. This method handles + * adding settings to data that is stored as an indexed array. + * + * @param string $filter The filter name. + * @param array $settings The data settings. + */ + private function add_indexed_filter_setting( $filter, $settings ) { + static::$data_settings[ $filter ] = array_unique( + array_merge( + static::$data_settings[ $filter ], + $settings + ) + ); + } + + /** + * The callback function added to the sync data filters. Combines the list in the $data_settings property + * with any non-default values from the received array. + * + * @param array $filtered_values The data revieved from the filter. + * + * @return array The data settings for the filter. + */ + public function sync_data_filter_hook( $filtered_values ) { + if ( ! is_array( $filtered_values ) ) { + // Something is wrong with the input, so set it to an empty array. + $filtered_values = array(); + } + + $current_filter = current_filter(); + + if ( ! isset( static::$data_settings[ $current_filter ] ) ) { + return $filtered_values; + } + + if ( in_array( $current_filter, Default_Filter_Settings::ASSOCIATIVE_FILTERS, true ) ) { + $extra_filters = array_diff_key( $filtered_values, $this->get_default_setting_for_filter( $current_filter ) ); + $this->add_associative_filter_setting( $current_filter, $extra_filters ); + return static::$data_settings[ $current_filter ]; + } + + $extra_filters = array_diff( $filtered_values, $this->get_default_setting_for_filter( $current_filter ) ); + $this->add_indexed_filter_setting( $current_filter, $extra_filters ); + return static::$data_settings[ $current_filter ]; + } + + /** + * Sets the $data_settings property to an empty array. This is useful for testing. + */ + public function empty_data_settings_and_hooks() { + static::$data_settings = array(); + static::$set_filter_hooks = array(); + } + + /** + * Returns the $data_settings property. + * + * @return array The data_settings property. + */ + public function get_data_settings() { + return static::$data_settings; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php new file mode 100644 index 00000000..5b49c57e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php @@ -0,0 +1,411 @@ +is_locked() ) { + return new WP_Error( 'locked_queue_' . $queue->id ); + } + + if ( $queue->size() === 0 ) { + return new WP_Error( 'empty_queue_' . $queue->id ); + } + + // Return early if we've gotten a retry-after header response that is not expired. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . $queue->id ); + if ( $retry_time && $retry_time >= microtime( true ) ) { + return new WP_Error( 'retry_after_' . $queue->id ); + } + + // Don't sync if we are throttled. + $sync_next_time = Sender::get_instance()->get_next_sync_time( $queue->id ); + if ( $sync_next_time > microtime( true ) ) { + return new WP_Error( 'sync_throttled_' . $queue->id ); + } + /** + * How much time to wait before we start suspecting Dedicated Sync is in trouble. + */ + $queue_send_time_threshold = 30 * MINUTE_IN_SECONDS; + + $queue_lag = $queue->lag(); + + // Only check if we're failing to send events if the queue lag is longer than the threshold. + if ( $queue_lag > $queue_send_time_threshold ) { + /** + * Check if Dedicated Sync is healthy and revert to Default Sync if such case is detected. + */ + $last_successful_queue_send_time = get_option( Actions::LAST_SUCCESS_PREFIX . $queue->id, null ); + + if ( $last_successful_queue_send_time === null ) { + /** + * No successful sync sending completed. This might be either a "new" sync site or a site that's totally stuck. + */ + self::on_dedicated_sync_lag_not_sending_threshold_reached(); + + return new WP_Error( 'dedicated_sync_not_sending', 'Dedicated Sync is not successfully sending events' ); + } else { + /** + * We have recorded a successful sending of events. Let's see if that is not too long ago in the past. + */ + $time_since_last_succesful_send = time() - $last_successful_queue_send_time; + + if ( $time_since_last_succesful_send > $queue_send_time_threshold ) { + // We haven't successfully sent stuff in more than 30 minutes. Revert to Default Sync + self::on_dedicated_sync_lag_not_sending_threshold_reached(); + + return new WP_Error( 'dedicated_sync_not_sending', 'Dedicated Sync is not successfully sending events' ); + } + } + } + + /** + * Try to acquire a request lock, so we don't spawn multiple requests at the same time. + * This should prevent cases where sites might have limits on the amount of simultaneous requests. + */ + $request_lock = self::try_lock_spawn_request(); + if ( ! $request_lock ) { + return new WP_Error( 'dedicated_request_lock', 'Unable to acquire request lock' ); + } + + $url = rest_url( 'jetpack/v4/sync/spawn-sync' ); + $url = add_query_arg( 'time', time(), $url ); // Enforce Cache busting. + $url = add_query_arg( self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME, $request_lock, $url ); + + $args = array( + 'cookies' => $_COOKIE, + 'blocking' => false, + 'timeout' => 0.01, + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), + ); + + $result = wp_remote_get( $url, $args ); + if ( is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Attempt to acquire a request lock. + * + * To avoid spawning multiple requests at the same time, we need to have a quick lock that will + * allow only a single request to continue if we try to spawn multiple at the same time. + * + * @return false|mixed|string + */ + public static function try_lock_spawn_request() { + $current_microtime = (string) microtime( true ); + + $current_lock_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + + if ( ! empty( $current_lock_value ) ) { + // Check if time has passed to overwrite the lock - min 5s? + if ( is_numeric( $current_lock_value ) && ( ( $current_microtime - $current_lock_value ) < self::DEDICATED_SYNC_REQUEST_LOCK_TIMEOUT ) ) { + // Still in previous lock, quit + return false; + } + + // If the value is not numeric (float/current time), we want to just overwrite it and continue. + } + + // Update. We don't want it to autoload, as we want to fetch it right before the checks. + \Jetpack_Options::update_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, $current_microtime, false ); + // Give some time for the update to happen + usleep( wp_rand( 1000, 3000 ) ); + + $updated_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + + if ( $updated_value === $current_microtime ) { + return $current_microtime; + } + + return false; + } + + /** + * Attempt to release the request lock. + * + * @param string $lock_id The request lock that's currently being held. + * + * @return bool|WP_Error + */ + public static function try_release_lock_spawn_request( $lock_id = '' ) { + // Try to get the lock_id from the current request if it's not supplied. + if ( empty( $lock_id ) ) { + $lock_id = self::get_request_lock_id_from_request(); + } + + // If it's still not a valid lock_id, throw an error and let the lock process figure it out. + if ( empty( $lock_id ) || ! is_numeric( $lock_id ) ) { + return new WP_Error( 'dedicated_request_lock_invalid', 'Invalid lock_id supplied for unlock' ); + } + + $current_lock_value = \Jetpack_Options::get_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME, null ); + + // If this is the flow that has the lock, let's release it so we can spawn other requests afterwards + if ( (string) $lock_id === $current_lock_value ) { + \Jetpack_Options::delete_raw_option( self::DEDICATED_SYNC_REQUEST_LOCK_OPTION_NAME ); + return true; + } + + return false; + } + + /** + * Try to get the request lock id from the current request. + * + * @return array|string|string[]|null + */ + public static function get_request_lock_id_from_request() { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! isset( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ) || ! is_numeric( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ) ) { + return null; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + return wp_unslash( $_GET[ self::DEDICATED_SYNC_REQUEST_LOCK_QUERY_PARAM_NAME ] ); + } + + /** + * Test Sync spawning functionality by making a request to the + * Sync spawning endpoint and storing the result (status code) in a transient. + * + * @since $$next_version$$ + * + * @return bool True if we got a successful response, false otherwise. + */ + public static function can_spawn_dedicated_sync_request() { + $dedicated_sync_check_transient = self::DEDICATED_SYNC_CHECK_TRANSIENT; + + $dedicated_sync_response_body = get_transient( $dedicated_sync_check_transient ); + + if ( false === $dedicated_sync_response_body ) { + $url = rest_url( 'jetpack/v4/sync/spawn-sync' ); + $url = add_query_arg( 'time', time(), $url ); // Enforce Cache busting. + $args = array( + 'cookies' => $_COOKIE, + 'timeout' => 30, + /** This filter is documented in wp-includes/class-wp-http-streams.php */ + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), + ); + + $response = wp_remote_get( $url, $args ); + $dedicated_sync_response_code = wp_remote_retrieve_response_code( $response ); + $dedicated_sync_response_body = trim( wp_remote_retrieve_body( $response ) ); + + /** + * Limit the size of the body that we save in the transient to avoid cases where an error + * occurs and a whole generated HTML page is returned. We don't need to store the whole thing. + * + * The regexp check is done to make sure we can detect the string even if the body returns some additional + * output, like some caching plugins do when they try to pad the request. + */ + $regexp = '!' . preg_quote( self::DEDICATED_SYNC_VALIDATION_STRING, '!' ) . '!uis'; + if ( preg_match( $regexp, $dedicated_sync_response_body ) ) { + $saved_response_body = self::DEDICATED_SYNC_VALIDATION_STRING; + } else { + $saved_response_body = time(); + } + + set_transient( $dedicated_sync_check_transient, $saved_response_body, HOUR_IN_SECONDS ); + + // Send a bit more information to WordPress.com to help debugging issues. + if ( $saved_response_body !== self::DEDICATED_SYNC_VALIDATION_STRING ) { + $data = array( + 'timestamp' => microtime( true ), + 'response_code' => $dedicated_sync_response_code, + 'response_body' => $dedicated_sync_response_body, + + // Send the flow type that was attempted. + 'sync_flow_type' => 'dedicated', + ); + + $sender = Sender::get_instance(); + + $sender->send_action( 'jetpack_sync_flow_error_enable', $data ); + } + } + + return self::DEDICATED_SYNC_VALIDATION_STRING === $dedicated_sync_response_body; + } + + /** + * Disable dedicated sync and set a transient to prevent re-enabling it for some time. + * + * @return void + */ + public static function on_dedicated_sync_lag_not_sending_threshold_reached() { + set_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG, true, 6 * HOUR_IN_SECONDS ); + + Settings::update_settings( + array( + 'dedicated_sync_enabled' => 0, + ) + ); + + // Inform that we had to temporarily disable Dedicated Sync + $data = array( + 'timestamp' => microtime( true ), + + // Send the flow type that was attempted. + 'sync_flow_type' => 'dedicated', + ); + + $sender = Sender::get_instance(); + + $sender->send_action( 'jetpack_sync_flow_error_temp_disable', $data ); + } + + /** + * Disable or enable Dedicated Sync sender based on the header value returned from WordPress.com + * + * @param string $dedicated_sync_header The Dedicated Sync header value - `on` or `off`. + * + * @return bool Whether Dedicated Sync is going to be enabled or not. + */ + public static function maybe_change_dedicated_sync_status_from_wpcom_header( $dedicated_sync_header ) { + $dedicated_sync_enabled = 'on' === $dedicated_sync_header ? 1 : 0; + + // Prevent enabling of Dedicated sync via header flag if we're in an autoheal timeout. + if ( $dedicated_sync_enabled ) { + $check_transient = get_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ); + + if ( $check_transient ) { + // Something happened and Dedicated Sync should not be automatically re-enabled. + return false; + } + } + + Settings::update_settings( + array( + 'dedicated_sync_enabled' => $dedicated_sync_enabled, + ) + ); + + return Settings::is_dedicated_sync_enabled(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php new file mode 100644 index 00000000..81946fe8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php @@ -0,0 +1,80 @@ + 'default_options_whitelist', + 'jetpack_sync_options_contentless' => 'default_options_contentless', + 'jetpack_sync_constants_whitelist' => 'default_constants_whitelist', + 'jetpack_sync_callable_whitelist' => 'default_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist' => 'default_multisite_callable_whitelist', + 'jetpack_sync_post_meta_whitelist' => 'post_meta_whitelist', + 'jetpack_sync_comment_meta_whitelist' => 'comment_meta_whitelist', + 'jetpack_sync_capabilities_whitelist' => 'default_capabilities_whitelist', + 'jetpack_sync_known_importers' => 'default_known_importers', + ); + + /** + * The data associated with these filters are stored as associative arrays. + * (All other filters store data as indexed arrays.) + */ + const ASSOCIATIVE_FILTERS = array( + 'jetpack_sync_callable_whitelist', + 'jetpack_sync_multisite_callable_whitelist', + 'jetpack_sync_known_importers', + ); + + /** + * Returns the default data settings list for the provided filter. + * + * @param string $filter The filter name. + * + * @return array|false The default list of data settings. Returns false if the provided + * filter doesn't not have an array of default settings. + */ + public function get_default_settings( $filter ) { + if ( ! is_string( $filter ) || ! array_key_exists( $filter, self::DATA_FILTER_DEFAULTS ) ) { + return false; + } + + $property = self::DATA_FILTER_DEFAULTS[ $filter ]; + $class = self::DEFAULT_FILTER_CLASS; + return $class::$$property; + } + + /** + * Returns an array containing the default values for all of the filters shown + * in DATA_FILTER_DEFAULTS. + * + * @return array The array containing all sync data filters and their default values. + */ + public function get_all_filters_default_settings() { + $defaults = array(); + + foreach ( self::DATA_FILTER_DEFAULTS as $filter => $default_location ) { + $defaults[ $filter ] = $this->get_default_settings( $filter ); + } + return $defaults; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php new file mode 100644 index 00000000..ef2ce369 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php @@ -0,0 +1,1299 @@ + array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'get_plugins_action_links' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins_action_links' ), + 'has_file_system_write_access' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'file_system_write_access' ), + 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), + 'hosting_provider' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_hosting_provider' ), + 'is_fse_theme' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_is_fse_theme' ), + 'is_main_network' => array( __CLASS__, 'is_multi_network' ), + 'is_multi_site' => 'is_multisite', + 'is_version_controlled' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'is_version_controlled' ), + 'locale' => 'get_locale', + 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), + 'main_network_site_wpcom_id' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'main_network_site_wpcom_id' ), + 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), + 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), + 'post_type_features' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_type_features' ), + 'post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_types' ), + 'rest_api_allowed_post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_post_types' ), + 'rest_api_allowed_public_metadata' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_public_metadata' ), + 'roles' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'roles' ), + 'shortcodes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_shortcodes' ), + 'site_icon_url' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'site_icon_url' ), + 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), + 'taxonomies' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_taxonomies' ), + 'theme_support' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_theme_support' ), + 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), + 'wp_get_environment_type' => 'wp_get_environment_type', + 'wp_max_upload_size' => 'wp_max_upload_size', + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + 'active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_active_modules' ), + ); + + /** + * Array of post type attributes synced. + * + * @var array Default post type attributes. + */ + public static $default_post_type_attributes = array( + '_builtin' => false, + '_edit_link' => 'post.php?post=%d', + 'can_export' => true, + 'cap' => array(), + 'capabilities' => array(), + 'capability_type' => 'post', + 'delete_with_user' => null, + 'description' => '', + 'exclude_from_search' => true, + 'has_archive' => false, + 'hierarchical' => false, + 'label' => '', + 'labels' => array(), + 'map_meta_cap' => true, + 'menu_icon' => null, + 'menu_position' => null, + 'name' => '', + 'public' => false, + 'publicly_queryable' => null, + 'query_var' => true, + 'rest_base' => false, + 'rewrite' => true, + 'show_in_admin_bar' => false, + 'show_in_menu' => null, + 'show_in_nav_menus' => null, + 'show_in_rest' => false, + 'show_ui' => false, + 'supports' => array(), + 'taxonomies' => array(), + ); + + /** + * Get the whitelist of callables allowed to be managed via the JSON API. + * + * @return array Whitelist of callables allowed to be managed via the JSON API. + */ + public static function get_callable_whitelist() { + /** + * Filter the list of callables that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of callables. + */ + return apply_filters( 'jetpack_sync_callable_whitelist', self::$default_callable_whitelist ); + } + + /** + * Post types that will not be synced. + * + * These are usually automated post types (sitemaps, logs, etc). + * + * @var array Blacklisted post types. + */ + public static $blacklisted_post_types = array( + '_term_meta', + 'ai1ec_event', + 'ai_log', // Logger - https://github.com/alleyinteractive/logger. + 'amp_validated_url', // AMP Validation Errors. + 'bwg_album', + 'bwg_gallery', + 'customize_changeset', // WP built-in post type for Customizer changesets. + 'dn_wp_yt_log', + 'flamingo_contact', // https://wordpress.org/plugins/flamingo/. + 'flamingo_inbound', + 'flamingo_outbound', + 'http', + 'idx_page', + 'jetpack_migration', + 'jp_img_sitemap', + 'jp_img_sitemap_index', + 'jp_sitemap', + 'jp_sitemap_index', + 'jp_sitemap_master', + 'jp_vid_sitemap', + 'jp_vid_sitemap_index', + 'msm_sitemap', // Metro Sitemap Plugin. + 'postman_sent_mail', + 'rssap-feed', + 'rssmi_feed_item', + 'scheduled-action', // Action Scheduler - Job Queue for WordPress https://github.com/woocommerce/woocommerce/tree/e7762627c37ec1f7590e6cac4218ba0c6a20024d/includes/libraries/action-scheduler . + 'secupress_log_action', + 'sg_optimizer_jobs', + 'sl-insta-media', + 'snitch', + 'vip-legacy-redirect', + 'wp-rest-api-log', // https://wordpress.org/plugins/wp-rest-api-log/. + 'wp_automatic', + 'wp_log', // WP Logging Plugin. + 'wpephpcompat_jobs', + 'wprss_feed_item', + ); + + /** + * Taxonomies that we're not syncing by default. + * + * The list is compiled by auditing the dynamic filters and actions that contain taxonomy slugs + * and could conflict with other existing filters/actions in WP core, Jetpack and WooCommerce. + * + * @var array + */ + public static $blacklisted_taxonomies = array( + 'ancestors', + 'archives_link', + 'attached_file', + 'attached_media', + 'attached_media_args', + 'attachment', + 'available_languages', + 'avatar', + 'avatar_comment_types', + 'avatar_data', + 'avatar_url', + 'bloginfo_rss', + 'blogs_of_user', + 'bookmark_link', + 'bookmarks', + 'calendar', + 'canonical_url', + 'categories_per_page', + 'categories_taxonomy', + 'category_form', + 'category_form_fields', + 'category_form_pre', + 'comment', + 'comment_ID', + 'comment_author', + 'comment_author_IP', + 'comment_author_email', + 'comment_author_link', + 'comment_author_url', + 'comment_author_url_link', + 'comment_date', + 'comment_excerpt', + 'comment_link', + 'comment_misc_actions', + 'comment_text', + 'comment_time', + 'comment_type', + 'comments_link', + 'comments_number', + 'comments_pagenum_link', + 'custom_logo', + 'date_sql', + 'default_comment_status', + 'delete_post_link', + 'edit_bookmark_link', + 'edit_comment_link', + 'edit_post_link', + 'edit_tag_link', + 'edit_term_link', + 'edit_user_link', + 'enclosed', + 'feed_build_date', + 'form_advanced', + 'form_after_editor', + 'form_after_title', + 'form_before_permalink', + 'form_top', + 'handle_product_cat', + 'header_image_tag', + 'header_video_url', + 'image_tag', + 'image_tag_class', + 'lastpostdate', + 'lastpostmodified', + 'link', + 'link_category_form', + 'link_category_form_fields', + 'link_category_form_pre', + 'main_network_id', + 'media', + 'media_item_args', + 'ms_user', + 'network', + 'object_terms', + 'option', + 'page', + 'page_form', + 'page_of_comment', + 'page_uri', + 'pagenum_link', + 'pages', + 'plugin', + 'post', + 'post_galleries', + 'post_gallery', + 'post_link', + 'post_modified_time', + 'post_status', + 'post_time', + 'postmeta', + 'posts_per_page', + 'product_search_form', + 'profile_url', + 'pung', + 'role_list', + 'sample_permalink', + 'sample_permalink_html', + 'schedule', + 'search_form', + 'search_query', + 'shortlink', + 'site', + 'site_email_content', + 'site_icon_url', + 'site_option', + 'space_allowed', + 'tag', + 'tag_form', + 'tag_form_fields', + 'tag_form_pre', + 'tag_link', + 'tags', + 'tags_per_page', + 'term', + 'term_link', + 'term_relationships', + 'term_taxonomies', + 'term_taxonomy', + 'terms', + 'terms_args', + 'terms_defaults', + 'terms_fields', + 'terms_orderby', + 'the_archive_description', + 'the_archive_title', + 'the_categories', + 'the_date', + 'the_excerpt', + 'the_guid', + 'the_modified_date', + 'the_modified_time', + 'the_post_type_description', + 'the_tags', + 'the_terms', + 'the_time', + 'theme_starter_content', + 'to_ping', + 'user', + 'user_created_user', + 'user_form', + 'user_profile', + 'user_profile_update', + 'usermeta', + 'usernumposts', + 'users_drafts', + 'webhook', + 'widget', + 'woocommerce_archive', + 'wp_title_rss', + ); + + /** + * Default array of post table columns. + * + * @var array Post table columns. + */ + public static $default_post_checksum_columns = array( + 'ID', + 'post_modified', + ); + + /** + * Default array of post meta table columns. + * + * @var array Post meta table columns. + */ + public static $default_post_meta_checksum_columns = array( + 'meta_id', + 'meta_value', + ); + + /** + * Default array of comment table columns. + * + * @var array Default comment table columns. + */ + public static $default_comment_checksum_columns = array( + 'comment_ID', + 'comment_content', + ); + + /** + * Default array of comment meta columns. + * + * @var array Comment meta table columns. + */ + public static $default_comment_meta_checksum_columns = array( + 'meta_id', + 'meta_value', + ); + + /** + * Default array of option table columns. + * + * @var array Default array of option columns. + */ + public static $default_option_checksum_columns = array( + 'option_name', + 'option_value', + ); + + /** + * Default array of term columns. + * + * @var array array of term columns. + */ + public static $default_term_checksum_columns = array( + 'name', + 'slug', + 'term_id', + ); + + /** + * Default array of term taxonomy columns. + * + * @var array Array of term taxonomy columns. + */ + public static $default_term_taxonomy_checksum_columns = array( + 'count', + 'parent', + 'taxonomy', + 'term_id', + 'term_taxonomy_id', + ); + + /** + * Default term relationship columns. + * + * @var array Array of term relationship columns. + */ + public static $default_term_relationships_checksum_columns = array( + 'object_id', + 'term_order', + 'term_taxonomy_id', + ); + + /** + * Default multisite callables able to be managed via JSON API. + * + * @var array multsite callables whitelisted + */ + public static $default_multisite_callable_whitelist = array(); + + /** + * Get array of multisite callables whitelisted. + * + * @return array Multisite callables managable via JSON API. + */ + public static function get_multisite_callable_whitelist() { + /** + * Filter the list of multisite callables that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of multisite callables. + */ + return apply_filters( 'jetpack_sync_multisite_callable_whitelist', self::$default_multisite_callable_whitelist ); + } + + /** + * Array of post meta keys whitelisted. + * + * @var array Post meta whitelist. + */ + public static $post_meta_whitelist = array( + '_feedback_akismet_values', + '_feedback_email', + '_feedback_extra_fields', + '_g_feedback_shortcode', + '_jetpack_post_thumbnail', + '_last_editor_used_jetpack', + '_menu_item_classes', + '_menu_item_menu_item_parent', + '_menu_item_object', + '_menu_item_object_id', + '_menu_item_orphaned', + '_menu_item_type', + '_menu_item_xfn', + '_publicize_facebook_user', + '_publicize_twitter_user', + '_thumbnail_id', + '_wp_attached_file', + '_wp_attachment_backup_sizes', + '_wp_attachment_context', + '_wp_attachment_image_alt', + '_wp_attachment_is_custom_background', + '_wp_attachment_is_custom_header', + '_wp_attachment_metadata', + '_wp_page_template', + '_wp_trash_meta_comments_status', + '_wpas_feature_enabled', + '_wpas_is_tweetstorm', + '_wpas_mess', + '_wpas_options', + 'advanced_seo_description', // Jetpack_SEO_Posts::DESCRIPTION_META_KEY. + 'content_width', + 'custom_css_add', + 'custom_css_preprocessor', + 'enclosure', + 'imagedata', + 'nova_price', + 'publicize_results', + 'sharing_disabled', + 'switch_like_status', + 'videopress_guid', + 'vimeo_poster_image', + '_jetpack_blogging_prompt_key', + ); + + /** + * Get the post meta key whitelist. + * + * @return array Post meta whitelist. + */ + public static function get_post_meta_whitelist() { + /** + * Filter the list of post meta data that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 4.8.0 + * + * @param array The default list of meta data keys. + */ + return apply_filters( 'jetpack_sync_post_meta_whitelist', self::$post_meta_whitelist ); + } + + /** + * Comment meta whitelist. + * + * @var array Comment meta whitelist. + */ + public static $comment_meta_whitelist = array( + 'hc_avatar', + 'hc_foreign_user_id', + 'hc_post_as', + 'hc_wpcom_id_sig', + ); + + /** + * Get the comment meta whitelist. + * + * @return array + */ + public static function get_comment_meta_whitelist() { + /** + * Filter the list of comment meta data that are manageable via the JSON API. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.7.0 + * + * @param array The default list of comment meta data keys. + */ + return apply_filters( 'jetpack_sync_comment_meta_whitelist', self::$comment_meta_whitelist ); + } + + /** + * Default theme support whitelist. + * + * @todo move this to server? - these are theme support values + * that should be synced as jetpack_current_theme_supports_foo option values + * + * @var array Default theme support whitelist. + */ + public static $default_theme_support_whitelist = array( + 'align-wide', + 'appearance-tools', // In Gutenberg. + 'automatic-feed-links', + 'block-templates', + 'block-template-parts', // WP 6.1. Added via https://core.trac.wordpress.org/changeset/54176 + 'custom-background', + 'custom-header', + 'custom-logo', + 'customize-selective-refresh-widgets', + 'dark-editor-style', + 'default-color-palette', // In Gutenberg. + 'default-gradient-presets', // In Gutenberg. + 'disable-custom-colors', + 'disable-custom-font-sizes', + 'disable-custom-gradients', + 'disable-layout-styles', // WP 6.1. Added via https://core.trac.wordpress.org/changeset/54159 + 'editor-color-palette', + 'editor-font-sizes', + 'editor-gradient-presets', + 'editor-style', // deprecated. + 'editor-styles', + 'html5', + 'infinite-scroll', + 'jetpack-responsive-videos', + 'jetpack-social-menu', + 'menus', + 'post-formats', + 'post-thumbnails', + 'responsive-embeds', + 'site-logo', + 'title-tag', + 'widgets', + 'wp-block-styles', + ); + + /** + * Is an option whitelisted? + * + * @param string $option Option name. + * @return bool If option is on the whitelist. + */ + public static function is_whitelisted_option( $option ) { + $whitelisted_options = self::get_options_whitelist(); + foreach ( $whitelisted_options as $whitelisted_option ) { + if ( '/' === $whitelisted_option[0] && preg_match( $whitelisted_option, $option ) ) { + return true; + } elseif ( $whitelisted_option === $option ) { + return true; + } + } + + return false; + } + + /** + * Default whitelist of capabilities to sync. + * + * @var array Array of WordPress capabilities. + */ + public static $default_capabilities_whitelist = array( + 'activate_plugins', + 'add_users', + 'create_users', + 'customize', + 'delete_others_pages', + 'delete_others_posts', + 'delete_pages', + 'delete_plugins', + 'delete_posts', + 'delete_private_pages', + 'delete_private_posts', + 'delete_published_pages', + 'delete_published_posts', + 'delete_site', + 'delete_themes', + 'delete_users', + 'edit_dashboard', + 'edit_files', + 'edit_others_pages', + 'edit_others_posts', + 'edit_pages', + 'edit_plugins', + 'edit_posts', + 'edit_private_pages', + 'edit_private_posts', + 'edit_published_pages', + 'edit_published_posts', + 'edit_theme_options', + 'edit_themes', + 'edit_users', + 'export', + 'import', + 'install_plugins', + 'install_themes', + 'list_users', + 'manage_categories', + 'manage_links', + 'manage_options', + 'moderate_comments', + 'promote_users', + 'publish_pages', + 'publish_posts', + 'read', + 'read_private_pages', + 'read_private_posts', + 'remove_users', + 'switch_themes', + 'unfiltered_html', + 'unfiltered_upload', + 'update_core', + 'update_plugins', + 'update_themes', + 'upload_files', + 'upload_plugins', + 'upload_themes', + ); + + /** + * Get default capabilities whitelist. + * + * @return array + */ + public static function get_capabilities_whitelist() { + /** + * Filter the list of capabilities that we care about + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.5.0 + * + * @param array The default list of capabilities. + */ + return apply_filters( 'jetpack_sync_capabilities_whitelist', self::$default_capabilities_whitelist ); + } + + /** + * Get max execution sync time. + * + * @return float Number of seconds. + */ + public static function get_max_sync_execution_time() { + $max_exec_time = (int) ini_get( 'max_execution_time' ); + if ( 0 === $max_exec_time ) { + // 0 actually means "unlimited", but let's not treat it that way. + $max_exec_time = 60; + } + return floor( $max_exec_time / 3 ); + } + + /** + * Get default for a given setting. + * + * @param string $setting Setting to get. + * @return mixed Value will be a string, int, array, based on the particular setting requested. + */ + public static function get_default_setting( $setting ) { + $default_name = "default_$setting"; // e.g. default_dequeue_max_bytes. + return self::$$default_name; + } + + /** + * Default list of network options. + * + * @var array network options + */ + public static $default_network_options_whitelist = array( + 'active_sitewide_plugins', + 'auto_update_plugins', // WordPress 5.5+ auto-updates. + 'jetpack_protect_global_whitelist', + 'jetpack_protect_key', + 'site_name', + ); + + /** + * A mapping of known importers to friendly names. + * + * Keys are the class name of the known importer. + * Values are the friendly name. + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @var array + */ + public static $default_known_importers = array( + 'Blogger_Importer' => 'blogger', + 'LJ_API_Import' => 'livejournal', + 'MT_Import' => 'mt', + 'RSS_Import' => 'rss', + 'WC_Tax_Rate_Importer' => 'woo-tax-rate', + 'WP_Import' => 'wordpress', + ); + + /** + * Returns a list of known importers. + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @return array Known importers with importer class names as keys and friendly names as values. + */ + public static function get_known_importers() { + /** + * Filter the list of known importers. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @param array The default list of known importers. + */ + return apply_filters( 'jetpack_sync_known_importers', self::$default_known_importers ); + } + + /** + * Whether this is a system with a multiple networks. + * We currently need this static wrapper because we statically define our default list of callables. + * + * @since 1.6.3 + * @since-jetpack 7.6.0 + * + * @uses Automattic\Jetpack\Status::is_multi_network + * + * @return boolean + */ + public static function is_multi_network() { + $status = new Status(); + return $status->is_multi_network(); + } + + /** + * Default bytes to dequeue. + * + * @var int Bytes. + */ + public static $default_dequeue_max_bytes = 500000; // very conservative value, 1/2 MB. + + /** + * Default upload bytes. + * + * This value is a little bigger than the upload limit to account for serialization. + * + * @var int Bytes. + */ + public static $default_upload_max_bytes = 600000; + + /** + * Default number of rows uploaded. + * + * @var int Number of rows. + */ + public static $default_upload_max_rows = 500; + + /** + * Default sync wait time. + * + * @var int Number of seconds. + */ + public static $default_sync_wait_time = 10; // seconds, between syncs. + + /** + * Only wait before next send if the current send took more than this number of seconds. + * + * @var int Number of seconds. + */ + public static $default_sync_wait_threshold = 10; + + /** + * Default wait between attempting to continue a full sync via requests. + * + * @var int Number of seconds. + */ + public static $default_enqueue_wait_time = 1; + + /** + * Maximum queue size. + * + * Each item is represented with a new row in the wp_options table. + * + * @var int Number of queue items. + */ + public static $default_max_queue_size = 5000; + + /** + * Default maximum lag allowed in the queue. + * + * @var int Number of seconds + */ + public static $default_max_queue_lag = 7200; // 2 hours. + + /** + * Default for default writes per sec. + * + * @var int Rows per second. + */ + public static $default_queue_max_writes_sec = 100; // 100 rows a second. + + /** + * Default for post types blacklist. + * + * @var array Empty array. + */ + public static $default_post_types_blacklist = array(); + + /** + * Default for taxonomies blacklist. + * + * @var array Empty array. + */ + public static $default_taxonomies_blacklist = array(); + + /** + * Default for taxonomies whitelist. + * + * @var array Empty array. + */ + public static $default_taxonomy_whitelist = array(); + + /** + * Default for post meta whitelist. + * + * @var array Empty array. + */ + public static $default_post_meta_whitelist = array(); + + /** + * Default for comment meta whitelist. + * + * @var array Empty array. + */ + public static $default_comment_meta_whitelist = array(); + + /** + * Default for disabling sync across the site. + * + * @var int Bool-ish. Default to 0. + */ + public static $default_disable = 0; // completely disable sending data to wpcom. + + /** + * Default for disabling sync across the entire network on multisite. + * + * @var int Bool-ish. Default 0. + */ + public static $default_network_disable = 0; + + /** + * Default for disabling checksums. + * + * @var int Bool-ish. Default 0. + */ + public static $default_checksum_disable = 0; + + /** + * Should Sync use cron? + * + * @var int Bool-ish value. Default 1. + */ + public static $default_sync_via_cron = 1; + + /** + * Default if Sync should render content. + * + * @var int Bool-ish value. Default is 0. + */ + public static $default_render_filtered_content = 0; + + /** + * Default number of items to enqueue at a time when running full sync. + * + * @var int Number of items. + */ + public static $default_max_enqueue_full_sync = 100; + + /** + * Default for maximum queue size during a full sync. + * + * Each item will represent a value in the wp_options table. + * + * @var int Number of items. + */ + public static $default_max_queue_size_full_sync = 1000; // max number of total items in the full sync queue. + + /** + * Default max time for sending in immediate mode. + * + * @var float Number of Seconds + */ + public static $default_full_sync_send_duration = 9; + + /** + * Defaul for time between syncing callables. + * + * @var int Number of seconds. + */ + public static $default_sync_callables_wait_time = MINUTE_IN_SECONDS; // seconds before sending callables again. + + /** + * Default for time between syncing constants. + * + * @var int Number of seconds. + */ + public static $default_sync_constants_wait_time = HOUR_IN_SECONDS; // seconds before sending constants again. + /** + * Default for sync queue lock timeout time. + * + * @var int Number of seconds. + */ + public static $default_sync_queue_lock_timeout = 120; // 2 minutes. + + /** + * Default for cron sync time limit. + * + * @var int Number of seconds. + */ + public static $default_cron_sync_time_limit = 4 * MINUTE_IN_SECONDS; + + /** + * Default for number of term relationship items sent in an full sync item. + * + * @var int Number of items. + */ + public static $default_term_relationships_full_sync_item_size = 100; + + /** + * Default for enabling incremental sync. + * + * @var int 1 for true. + */ + public static $default_sync_sender_enabled = 1; // Should send incremental sync items. + + /** + * Default for enabling Full Sync. + * + * @var int 1 for true. + */ + public static $default_full_sync_sender_enabled = 1; // Should send full sync items. + + /** + * Default Full Sync config + * + * @var array list of module names. + */ + public static $default_full_sync_config = array( + 'comments' => 1, + 'constants' => 1, + 'functions' => 1, + 'options' => 1, + 'posts' => 1, + 'term_relationships' => 1, + 'terms' => 1, + 'themes' => 1, + 'updates' => 1, + 'users' => 1, + ); + + /** + * Default Full Sync max objects to send on a single request. + * + * @var array list of module => max. + */ + public static $default_full_sync_limits = array( + 'comments' => array( + 'chunk_size' => 100, + 'max_chunks' => 10, + ), + 'posts' => array( + 'chunk_size' => 100, + 'max_chunks' => 1, + ), + 'term_relationships' => array( + 'chunk_size' => 1000, + 'max_chunks' => 10, + ), + 'terms' => array( + 'chunk_size' => 1000, + 'max_chunks' => 10, + ), + 'users' => array( + 'chunk_size' => 100, + 'max_chunks' => 10, + ), + ); + + /** + * Default for enabling dedicated Sync flow. + * + * @var int Bool-ish. Default 0. + */ + public static $default_dedicated_sync_enabled = 0; + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php new file mode 100644 index 00000000..1a5d9c7d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php @@ -0,0 +1,674 @@ +get_modules(); + } + + return array(); + } + + /** + * Return array of taxonomies registered on the site. + * + * @return array + */ + public static function get_taxonomies() { + global $wp_taxonomies; + $wp_taxonomies_without_callbacks = array(); + foreach ( $wp_taxonomies as $taxonomy_name => $taxonomy ) { + $sanitized_taxonomy = self::sanitize_taxonomy( $taxonomy ); + if ( ! empty( $sanitized_taxonomy ) ) { + $wp_taxonomies_without_callbacks[ $taxonomy_name ] = $sanitized_taxonomy; + } + } + return $wp_taxonomies_without_callbacks; + } + + /** + * Return array of registered shortcodes. + * + * @return array + */ + public static function get_shortcodes() { + global $shortcode_tags; + return array_keys( $shortcode_tags ); + } + + /** + * Removes any callback data since we will not be able to process it on our side anyways. + * + * @param \WP_Taxonomy $taxonomy \WP_Taxonomy item. + * + * @return mixed|null + */ + public static function sanitize_taxonomy( $taxonomy ) { + + // Lets clone the taxonomy object instead of modifing the global one. + $cloned_taxonomy = json_decode( wp_json_encode( $taxonomy ) ); + + // recursive taxonomies are no fun. + if ( $cloned_taxonomy === null ) { + return null; + } + // Remove any meta_box_cb if they are not the default wp ones. + if ( isset( $cloned_taxonomy->meta_box_cb ) && + ! in_array( $cloned_taxonomy->meta_box_cb, array( 'post_tags_meta_box', 'post_categories_meta_box' ), true ) ) { + $cloned_taxonomy->meta_box_cb = null; + } + // Remove update call back. + if ( isset( $cloned_taxonomy->update_count_callback ) && + $cloned_taxonomy->update_count_callback !== null ) { + $cloned_taxonomy->update_count_callback = null; + } + // Remove rest_controller_class if it something other then the default. + if ( isset( $cloned_taxonomy->rest_controller_class ) && + 'WP_REST_Terms_Controller' !== $cloned_taxonomy->rest_controller_class ) { + $cloned_taxonomy->rest_controller_class = null; + } + return $cloned_taxonomy; + } + + /** + * Return array of registered post types. + * + * @return array + */ + public static function get_post_types() { + global $wp_post_types; + + $post_types_without_callbacks = array(); + foreach ( $wp_post_types as $post_type_name => $post_type ) { + $sanitized_post_type = self::sanitize_post_type( $post_type ); + if ( ! empty( $sanitized_post_type ) ) { + $post_types_without_callbacks[ $post_type_name ] = $sanitized_post_type; + } + } + return $post_types_without_callbacks; + } + + /** + * Sanitizes by cloning post type object. + * + * @param object $post_type \WP_Post_Type. + * + * @return object + */ + public static function sanitize_post_type( $post_type ) { + // Lets clone the post type object instead of modifing the global one. + $sanitized_post_type = array(); + foreach ( Defaults::$default_post_type_attributes as $attribute_key => $default_value ) { + if ( isset( $post_type->{ $attribute_key } ) ) { + $sanitized_post_type[ $attribute_key ] = $post_type->{ $attribute_key }; + } + } + return (object) $sanitized_post_type; + } + + /** + * Return information about a synced post type. + * + * @param array $sanitized_post_type Array of args used in constructing \WP_Post_Type. + * @param string $post_type Post type name. + * + * @return object \WP_Post_Type + */ + public static function expand_synced_post_type( $sanitized_post_type, $post_type ) { + $post_type = sanitize_key( $post_type ); + $post_type_object = new \WP_Post_Type( $post_type, $sanitized_post_type ); + $post_type_object->add_supports(); + $post_type_object->add_rewrite_rules(); + $post_type_object->add_hooks(); + $post_type_object->register_taxonomies(); + return (object) $post_type_object; + } + + /** + * Returns site's post_type_features. + * + * @return array + */ + public static function get_post_type_features() { + global $_wp_post_type_features; + + return $_wp_post_type_features; + } + + /** + * Return hosting provider. + * + * Uses a set of known constants, classes, or functions to help determine the hosting platform. + * + * @return string Hosting provider. + */ + public static function get_hosting_provider() { + $hosting_provider_detection_methods = array( + 'get_hosting_provider_by_known_constant', + 'get_hosting_provider_by_known_class', + 'get_hosting_provider_by_known_function', + ); + + $functions = new Functions(); + foreach ( $hosting_provider_detection_methods as $method ) { + $hosting_provider = call_user_func( array( $functions, $method ) ); + if ( false !== $hosting_provider ) { + return $hosting_provider; + } + } + + return 'unknown'; + } + + /** + * Return a hosting provider using a set of known constants. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_constant() { + $hosting_provider_constants = array( + 'GD_SYSTEM_PLUGIN_DIR' => 'gd-managed-wp', + 'MM_BASE_DIR' => 'bh', + 'PAGELYBIN' => 'pagely', + 'KINSTAMU_VERSION' => 'kinsta', + 'FLYWHEEL_CONFIG_DIR' => 'flywheel', + 'IS_PRESSABLE' => 'pressable', + 'VIP_GO_ENV' => 'vip-go', + ); + + foreach ( $hosting_provider_constants as $constant => $constant_value ) { + if ( Constants::is_defined( $constant ) ) { + if ( 'VIP_GO_ENV' === $constant && false === Constants::get_constant( 'VIP_GO_ENV' ) ) { + continue; + } + return $constant_value; + } + } + + return false; + } + + /** + * Return a hosting provider using a set of known classes. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_class() { + $hosting_provider = false; + + switch ( true ) { + case ( class_exists( '\\WPaaS\\Plugin' ) ): + $hosting_provider = 'gd-managed-wp'; + break; + } + + return $hosting_provider; + } + + /** + * Return a hosting provider using a set of known functions. + * + * @return mixed A host identifier string or false. + */ + public function get_hosting_provider_by_known_function() { + $hosting_provider = false; + + switch ( true ) { + case ( function_exists( 'is_wpe' ) || function_exists( 'is_wpe_snapshot' ) ): + $hosting_provider = 'wpe'; + break; + } + + return $hosting_provider; + } + + /** + * Return array of allowed REST API post types. + * + * @return array Array of allowed post types. + */ + public static function rest_api_allowed_post_types() { + /** This filter is already documented in class.json-api-endpoints.php */ + return apply_filters( 'rest_api_allowed_post_types', array( 'post', 'page', 'revision' ) ); + } + + /** + * Return array of allowed REST API public metadata. + * + * @return array Array of allowed metadata. + */ + public static function rest_api_allowed_public_metadata() { + /** + * Filters the meta keys accessible by the REST API. + * + * @see https://developer.wordpress.com/2013/04/26/custom-post-type-and-metadata-support-in-the-rest-api/ + * + * @module json-api + * + * @since 1.6.3 + * @since-jetpack 2.2.3 + * + * @param array $whitelisted_meta Array of metadata that is accessible by the REST API. + */ + return apply_filters( 'rest_api_allowed_public_metadata', array() ); + } + + /** + * Finds out if a site is using a version control system. + * + * @return bool + **/ + public static function is_version_controlled() { + + if ( ! class_exists( 'WP_Automatic_Updater' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + $updater = new \WP_Automatic_Updater(); + + return (bool) (string) $updater->is_vcs_checkout( ABSPATH ); + } + + /** + * Returns true if the site has file write access false otherwise. + * + * @return bool + **/ + public static function file_system_write_access() { + if ( ! function_exists( 'get_filesystem_method' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + require_once ABSPATH . 'wp-admin/includes/template.php'; + + $filesystem_method = get_filesystem_method(); + if ( 'direct' === $filesystem_method ) { + return true; + } + + ob_start(); + + if ( ! function_exists( 'request_filesystem_credentials' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); + ob_end_clean(); + if ( $filesystem_credentials_are_stored ) { + return true; + } + + return false; + } + + /** + * Helper function that is used when getting home or siteurl values. Decides + * whether to get the raw or filtered value. + * + * @deprecated 1.23.1 + * + * @param string $url_type URL to get, home or siteurl. + * @return string + */ + public static function get_raw_or_filtered_url( $url_type ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_raw_or_filtered_url' ); + return Urls::get_raw_or_filtered_url( $url_type ); + } + + /** + * Return the escaped home_url. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function home_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::home_url' ); + return Urls::home_url(); + } + + /** + * Return the escaped siteurl. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function site_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::site_url' ); + return Urls::site_url(); + } + + /** + * Return main site URL with a normalized protocol. + * + * @deprecated 1.23.1 + * + * @return string + */ + public static function main_network_site_url() { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::main_network_site_url' ); + return Urls::main_network_site_url(); + } + + /** + * Return main site WordPress.com site ID. + * + * @return string + */ + public static function main_network_site_wpcom_id() { + /** + * Return the current site WPCOM ID for single site installs + */ + if ( ! is_multisite() ) { + return \Jetpack_Options::get_option( 'id' ); + } + + /** + * Return the main network site WPCOM ID for multi-site installs + */ + $current_network = get_network(); + switch_to_blog( $current_network->blog_id ); + $wpcom_blog_id = \Jetpack_Options::get_option( 'id' ); + restore_current_blog(); + return $wpcom_blog_id; + } + + /** + * Return URL with a normalized protocol. + * + * @deprecated 1.23.1 + * + * @param callable $callable Function to retrieve URL option. + * @param string $new_value URL Protocol to set URLs to. + * @return string Normalized URL. + */ + public static function get_protocol_normalized_url( $callable, $new_value ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_protocol_normalized_url' ); + return Urls::get_protocol_normalized_url( $callable, $new_value ); + } + + /** + * Return URL from option or PHP constant. + * + * @deprecated 1.23.1 + * + * @param string $option_name (e.g. 'home'). + * + * @return mixed|null URL. + */ + public static function get_raw_url( $option_name ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::get_raw_url' ); + return Urls::get_raw_url( $option_name ); + } + + /** + * Normalize domains by removing www unless declared in the site's option. + * + * @deprecated 1.23.1 + * + * @param string $option Option value from the site. + * @param callable $url_function Function retrieving the URL to normalize. + * @return mixed|string URL. + */ + public static function normalize_www_in_url( $option, $url_function ) { + _deprecated_function( __METHOD__, '1.23.1', '\\Automattic\\Jetpack\\Connection\\Urls::normalize_www_in_url' ); + return Urls::normalize_www_in_url( $option, $url_function ); + } + + /** + * Return filtered value of get_plugins. + * + * @return mixed|void + */ + public static function get_plugins() { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ + return apply_filters( 'all_plugins', get_plugins() ); + } + + /** + * Get custom action link tags that the plugin is using + * Ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) + * + * @param string $plugin_file_singular Particular plugin. + * @return array of plugin action links (key: link name value: url) + */ + public static function get_plugins_action_links( $plugin_file_singular = null ) { + // Some sites may have DOM disabled in PHP fail early. + if ( ! class_exists( 'DOMDocument' ) ) { + return array(); + } + $plugins_action_links = get_option( 'jetpack_plugin_api_action_links', array() ); + if ( ! empty( $plugins_action_links ) ) { + if ( $plugin_file_singular === null ) { + return $plugins_action_links; + } + return ( isset( $plugins_action_links[ $plugin_file_singular ] ) ? $plugins_action_links[ $plugin_file_singular ] : null ); + } + return array(); + } + + /** + * Return the WP version as defined in the $wp_version global. + * + * @return string + */ + public static function wp_version() { + global $wp_version; + return $wp_version; + } + + /** + * Return site icon url used on the site. + * + * @param int $size Size of requested icon in pixels. + * @return mixed|string|void + */ + public static function site_icon_url( $size = 512 ) { + $site_icon = get_site_icon_url( $size ); + return $site_icon ? $site_icon : get_option( 'jetpack_site_icon_url' ); + } + + /** + * Return roles registered on the site. + * + * @return array + */ + public static function roles() { + $wp_roles = wp_roles(); + return $wp_roles->roles; + } + + /** + * Determine time zone from WordPress' options "timezone_string" + * and "gmt_offset". + * + * 1. Check if `timezone_string` is set and return it. + * 2. Check if `gmt_offset` is set, formats UTC-offset from it and return it. + * 3. Default to "UTC+0" if nothing is set. + * + * Note: This function is specifically not using wp_timezone() to keep consistency with + * the existing formatting of the timezone string. + * + * @return string + */ + public static function get_timezone() { + $timezone_string = get_option( 'timezone_string' ); + + if ( ! empty( $timezone_string ) ) { + return str_replace( '_', ' ', $timezone_string ); + } + + $gmt_offset = get_option( 'gmt_offset', 0 ); + + $formatted_gmt_offset = sprintf( '%+g', (float) $gmt_offset ); + + $formatted_gmt_offset = str_replace( + array( '.25', '.5', '.75' ), + array( ':15', ':30', ':45' ), + (string) $formatted_gmt_offset + ); + + /* translators: %s is UTC offset, e.g. "+1" */ + return sprintf( __( 'UTC%s', 'jetpack-sync' ), $formatted_gmt_offset ); + } + + /** + * Return list of paused themes. + * + * @return array|bool Array of paused themes or false if unsupported. + */ + public static function get_paused_themes() { + $paused_themes = wp_paused_themes(); + return $paused_themes->get_all(); + } + + /** + * Return list of paused plugins. + * + * @return array|bool Array of paused plugins or false if unsupported. + */ + public static function get_paused_plugins() { + $paused_plugins = wp_paused_plugins(); + return $paused_plugins->get_all(); + } + + /** + * Return the theme's supported features. + * Used for syncing the supported feature that we care about. + * + * @return array List of features that the theme supports. + */ + public static function get_theme_support() { + global $_wp_theme_features; + + $theme_support = array(); + foreach ( Defaults::$default_theme_support_whitelist as $theme_feature ) { + $has_support = current_theme_supports( $theme_feature ); + if ( $has_support ) { + $theme_support[ $theme_feature ] = $_wp_theme_features[ $theme_feature ]; + } + } + + return $theme_support; + } + + /** + * Returns if the current theme is a Full Site Editing theme. + * + * @return bool Theme is a Full Site Editing theme. + */ + public static function get_is_fse_theme() { + return function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme(); + } + + /** + * Wraps data in a way so that we can distinguish between objects and array and also prevent object recursion. + * + * @since 1.21.0 + * + * @param array|obj $any Source data to be cleaned up. + * @param array $seen_nodes Built array of nodes. + * + * @return array + */ + public static function json_wrap( &$any, $seen_nodes = array() ) { + if ( is_object( $any ) ) { + $input = get_object_vars( $any ); + $input['__o'] = 1; + } else { + $input = &$any; + } + + if ( is_array( $input ) ) { + $seen_nodes[] = &$any; + + $return = array(); + + foreach ( $input as $k => &$v ) { + if ( ( is_array( $v ) || is_object( $v ) ) ) { + if ( in_array( $v, $seen_nodes, true ) ) { + continue; + } + $return[ $k ] = self::json_wrap( $v, $seen_nodes ); + } else { + $return[ $k ] = $v; + } + } + + return $return; + } + + return $any; + } + + /** + * Return the list of installed themes + * + * @since 1.31.0 + * + * @return array + */ + public static function get_themes() { + $current_stylesheet = get_stylesheet(); + $installed_themes = wp_get_themes(); + $synced_headers = array( 'Name', 'ThemeURI', 'Author', 'Version', 'Template', 'Status', 'TextDomain', 'RequiresWP', 'RequiresPHP' ); + $themes = array(); + foreach ( $installed_themes as $stylesheet => $theme ) { + $themes[ $stylesheet ] = array(); + foreach ( $synced_headers as $header ) { + $themes[ $stylesheet ][ $header ] = $theme->get( $header ); + } + $themes[ $stylesheet ]['active'] = $stylesheet === $current_stylesheet; + if ( method_exists( $theme, 'is_block_theme' ) ) { + $themes[ $stylesheet ]['is_block_theme'] = $theme->is_block_theme(); + } + } + /** + * Filters the output of Sync's get_theme callable + * + * @since 1.31.0 + * + * @param array $themes The list of installed themes formatted in an array with a collection of information extracted from the Theme's headers + */ + return apply_filters( 'jetpack_sync_get_themes_callable', $themes ); + } + + /** + * Return the list of active Jetpack modules. + * + * @since $$next_version$$ + * + * @return array + */ + public static function get_active_modules() { + return ( new Jetpack_Modules() )->get_active(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php new file mode 100644 index 00000000..2aa2465c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-health.php @@ -0,0 +1,189 @@ + self::STATUS_UNKNOWN, + self::OPTION_TIMESTAMP_KEY => microtime( true ), + ); + + switch ( $status ) { + case self::STATUS_DISABLED: + case self::STATUS_OUT_OF_SYNC: + case self::STATUS_IN_SYNC: + $new_status[ self::OPTION_STATUS_KEY ] = $status; + break; + } + + \Jetpack_Options::update_option( self::STATUS_OPTION, $new_status ); + return true; + } + + /** + * Check if Status has been previously set. + * + * @return bool is a Status defined + */ + public static function is_status_defined() { + $status = \Jetpack_Options::get_option( self::STATUS_OPTION ); + + if ( false === $status || ! is_array( $status ) || empty( $status[ self::OPTION_STATUS_KEY ] ) ) { + return false; + } else { + return true; + } + } + + /** + * Update Sync Status if Full Sync ended of Posts + * + * @param string $checksum The checksum that's currently being processed. + * @param array $range The ranges of object types being processed. + */ + public static function full_sync_end_update_status( $checksum, $range ) { + if ( isset( $range['posts'] ) ) { + self::update_status( self::STATUS_IN_SYNC ); + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php new file mode 100644 index 00000000..ecc33a94 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php @@ -0,0 +1,93 @@ +json_serialize( $object ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode + } + + /** + * Decode compressed serialized value. + * + * @param string $input Item to decode. + * @return array|mixed|object + */ + public function decode( $input ) { + return $this->json_unserialize( gzinflate( base64_decode( $input ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + } + + /** + * Serialize JSON + * + * @see https://gist.github.com/muhqu/820694 + * + * @param string $any Value to serialize and wrap. + * + * @return false|string + */ + protected function json_serialize( $any ) { + return wp_json_encode( Functions::json_wrap( $any ) ); + } + + /** + * Unserialize JSON + * + * @param string $str JSON string. + * @return array|object Unwrapped JSON. + */ + protected function json_unserialize( $str ) { + return $this->json_unwrap( json_decode( $str, true ) ); + } + + /** + * Unwraps a json_decode return. + * + * @param array|object $any json_decode object. + * @return array|object + */ + private function json_unwrap( $any ) { + if ( is_array( $any ) ) { + foreach ( $any as $k => $v ) { + if ( '__o' === $k ) { + continue; + } + $any[ $k ] = $this->json_unwrap( $v ); + } + + if ( isset( $any['__o'] ) ) { + unset( $any['__o'] ); + $any = (object) $any; + } + } + + return $any; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php new file mode 100644 index 00000000..41f8aaf8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php @@ -0,0 +1,483 @@ +:( + */ + protected function __construct() { + $this->set_defaults(); + $this->init(); + } + + /** + * Sync Listener init. + */ + private function init() { + $handler = array( $this, 'action_handler' ); + $full_sync_handler = array( $this, 'full_sync_action_handler' ); + + foreach ( Modules::get_modules() as $module ) { + $module->init_listeners( $handler ); + $module->init_full_sync_listeners( $full_sync_handler ); + } + + // Module Activation. + add_action( 'jetpack_activate_module', $handler ); + add_action( 'jetpack_deactivate_module', $handler ); + + // Jetpack Upgrade. + add_action( 'updating_jetpack_version', $handler, 10, 2 ); + + // Send periodic checksum. + add_action( 'jetpack_sync_checksum', $handler ); + } + + /** + * Get incremental sync queue. + */ + public function get_sync_queue() { + return $this->sync_queue; + } + + /** + * Gets the full sync queue. + */ + public function get_full_sync_queue() { + return $this->full_sync_queue; + } + + /** + * Sets queue size limit. + * + * @param int $limit Queue size limit. + */ + public function set_queue_size_limit( $limit ) { + $this->sync_queue_size_limit = $limit; + } + + /** + * Get queue size limit. + */ + public function get_queue_size_limit() { + return $this->sync_queue_size_limit; + } + + /** + * Sets the queue lag limit. + * + * @param int $age Queue lag limit. + */ + public function set_queue_lag_limit( $age ) { + $this->sync_queue_lag_limit = $age; + } + + /** + * Return value of queue lag limit. + */ + public function get_queue_lag_limit() { + return $this->sync_queue_lag_limit; + } + + /** + * Force a recheck of the queue limit. + */ + public function force_recheck_queue_limit() { + delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->sync_queue->id ); + delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->full_sync_queue->id ); + } + + /** + * Determine if an item can be added to the queue. + * + * Prevent adding items to the queue if it hasn't sent an item for 15 mins + * AND the queue is over 1000 items long (by default). + * + * @param object $queue Sync queue. + * @return bool + */ + public function can_add_to_queue( $queue ) { + if ( ! Settings::is_sync_enabled() ) { + return false; + } + + $state_transient_name = self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $queue->id; + + $queue_state = get_transient( $state_transient_name ); + + if ( false === $queue_state ) { + $queue_state = array( $queue->size(), $queue->lag() ); + set_transient( $state_transient_name, $queue_state, self::QUEUE_STATE_CHECK_TIMEOUT ); + } + + list( $queue_size, $queue_age ) = $queue_state; + + return ( $queue_age < $this->sync_queue_lag_limit ) + || + ( ( $queue_size + 1 ) < $this->sync_queue_size_limit ); + } + + /** + * Full sync action handler. + * + * @param mixed ...$args Args passed to the action. + */ + public function full_sync_action_handler( ...$args ) { + $this->enqueue_action( current_filter(), $args, $this->full_sync_queue ); + } + + /** + * Action handler. + * + * @param mixed ...$args Args passed to the action. + */ + public function action_handler( ...$args ) { + $this->enqueue_action( current_filter(), $args, $this->sync_queue ); + } + + // add many actions to the queue directly, without invoking them. + + /** + * Bulk add action to the queue. + * + * @param string $action_name The name the full sync action. + * @param array $args_array Array of chunked arguments. + */ + public function bulk_enqueue_full_sync_actions( $action_name, $args_array ) { + $queue = $this->get_full_sync_queue(); + + /* + * If we add any items to the queue, we should try to ensure that our script + * can't be killed before they are sent. + */ + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + $data_to_enqueue = array(); + $user_id = get_current_user_id(); + $currtime = microtime( true ); + $is_importing = Settings::is_importing(); + + foreach ( $args_array as $args ) { + $previous_end = isset( $args['previous_end'] ) ? $args['previous_end'] : null; + $args = isset( $args['ids'] ) ? $args['ids'] : $args; + + /** + * Modify or reject the data within an action before it is enqueued locally. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @module sync + * + * @param array The action parameters + */ + $args = apply_filters( "jetpack_sync_before_enqueue_$action_name", $args ); + $action_data = array( $args ); + if ( $previous_end !== null ) { + $action_data[] = $previous_end; + } + // allow listeners to abort. + if ( false === $args ) { + continue; + } + + $data_to_enqueue[] = array( + $action_name, + $action_data, + $user_id, + $currtime, + $is_importing, + ); + } + + $queue->add_all( $data_to_enqueue ); + } + + /** + * Enqueue the action. + * + * @param string $current_filter Current WordPress filter. + * @param object $args Sync args. + * @param string $queue Sync queue. + */ + public function enqueue_action( $current_filter, $args, $queue ) { + // don't enqueue an action during the outbound http request - this prevents recursion. + if ( Settings::is_sending() ) { + return; + } + + if ( ! ( new Connection_Manager() )->is_connected() ) { + // Don't enqueue an action if the site is disconnected. + return; + } + + /** + * Add an action hook to execute when anything on the whitelist gets sent to the queue to sync. + * + * @module sync + * + * @since 1.6.3 + * @since-jetpack 5.9.0 + */ + do_action( 'jetpack_sync_action_before_enqueue' ); + + /** + * Modify or reject the data within an action before it is enqueued locally. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array The action parameters + */ + $args = apply_filters( "jetpack_sync_before_enqueue_$current_filter", $args ); + + // allow listeners to abort. + if ( false === $args ) { + return; + } + + /* + * Periodically check the size of the queue, and disable adding to it if + * it exceeds some limit AND the oldest item exceeds the age limit (i.e. sending has stopped). + */ + if ( ! $this->can_add_to_queue( $queue ) ) { + if ( 'sync' === $queue->id ) { + $this->sync_data_loss( $queue ); + } + return; + } + + /* + * If we add any items to the queue, we should try to ensure that our script + * can't be killed before they are sent. + */ + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + if ( + 'sync' === $queue->id || + in_array( + $current_filter, + array( + 'jetpack_full_sync_start', + 'jetpack_full_sync_end', + 'jetpack_full_sync_cancel', + ), + true + ) + ) { + $queue->add( + array( + $current_filter, + $args, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + $this->get_actor( $current_filter, $args ), + ) + ); + } else { + $queue->add( + array( + $current_filter, + $args, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + ) + ); + } + + // since we've added some items, let's try to load the sender so we can send them as quickly as possible. + if ( ! Actions::$sender ) { + add_filter( 'jetpack_sync_sender_should_load', __NAMESPACE__ . '\Actions::should_initialize_sender_enqueue', 10, 1 ); + if ( did_action( 'init' ) ) { + Actions::add_sender_shutdown(); + } + } + } + + /** + * Sync Data Loss Handler + * + * @param Queue $queue Sync queue. + * @return boolean was send successful + */ + public function sync_data_loss( $queue ) { + if ( ! Settings::is_sync_enabled() ) { + return; + } + $updated = Health::update_status( Health::STATUS_OUT_OF_SYNC ); + + if ( ! $updated ) { + return; + } + + $data = array( + 'timestamp' => microtime( true ), + 'queue_size' => $queue->size(), + 'queue_lag' => $queue->lag(), + ); + + $sender = Sender::get_instance(); + return $sender->send_action( 'jetpack_sync_data_loss', $data ); + } + + /** + * Get the event's actor. + * + * @param string $current_filter Current wp-admin page. + * @param object $args Sync event. + * @return array Actor information. + */ + public function get_actor( $current_filter, $args ) { + if ( 'wp_login' === $current_filter ) { + $user = get_user_by( 'ID', $args[1]->data->ID ); + } else { + $user = wp_get_current_user(); + } + + $roles = new Roles(); + $translated_role = $roles->translate_user_to_role( $user ); + + $actor = array( + 'wpcom_user_id' => null, + 'external_user_id' => isset( $user->ID ) ? $user->ID : null, + 'display_name' => isset( $user->display_name ) ? $user->display_name : null, + 'user_email' => isset( $user->user_email ) ? $user->user_email : null, + 'user_roles' => isset( $user->roles ) ? $user->roles : null, + 'translated_role' => $translated_role ? $translated_role : null, + 'is_cron' => defined( 'DOING_CRON' ) ? DOING_CRON : false, + 'is_rest' => defined( 'REST_API_REQUEST' ) ? REST_API_REQUEST : false, + 'is_xmlrpc' => defined( 'XMLRPC_REQUEST' ) ? XMLRPC_REQUEST : false, + 'is_wp_rest' => defined( 'REST_REQUEST' ) ? REST_REQUEST : false, + 'is_ajax' => defined( 'DOING_AJAX' ) ? DOING_AJAX : false, + 'is_wp_admin' => is_admin(), + 'is_cli' => defined( 'WP_CLI' ) ? WP_CLI : false, + 'from_url' => $this->get_request_url(), + ); + + if ( $this->should_send_user_data_with_actor( $current_filter ) ) { + $ip = IP_Utils::get_ip(); + + $actor['ip'] = $ip ? $ip : ''; + $actor['user_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : 'unknown'; + } + + return $actor; + } + + /** + * Should user data be sent as the actor? + * + * @param string $current_filter The current WordPress filter being executed. + * @return bool + */ + public function should_send_user_data_with_actor( $current_filter ) { + $should_send = in_array( $current_filter, array( 'jetpack_wp_login', 'wp_logout', 'jetpack_valid_failed_login_attempt' ), true ); + /** + * Allow or deny sending actor's user data ( IP and UA ) during a sync event + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param bool True if we should send user data + * @param string The current filter that is performing the sync action + */ + return apply_filters( 'jetpack_sync_actor_user_data', $should_send, $current_filter ); + } + + /** + * Sets Listener defaults. + */ + public function set_defaults() { + $this->sync_queue = new Queue( 'sync' ); + $this->full_sync_queue = new Queue( 'full_sync' ); + $this->set_queue_size_limit( Settings::get_setting( 'max_queue_size' ) ); + $this->set_queue_lag_limit( Settings::get_setting( 'max_queue_lag' ) ); + } + + /** + * Get the request URL. + * + * @return string Request URL, if known. Otherwise, wp-admin or home_url. + */ + public function get_request_url() { + if ( isset( $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ) ) { + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- False positive, sniff misses the call to esc_url_raw. + return esc_url_raw( 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' . wp_unslash( "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) ); + } + return is_admin() ? get_admin_url( get_current_blog_id() ) : home_url(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php new file mode 100644 index 00000000..61b89a1c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php @@ -0,0 +1,77 @@ + $locked_time ) { + update_option( $lock_name, false, false ); + } + return false; + } + + $locked_time = microtime( true ) + $expiry; + update_option( $lock_name, $locked_time, false ); + return $locked_time; + } + + /** + * Remove the lock. + * + * @access public + * + * @param string $name lock name. + * @param bool|float $lock_expiration lock expiration. + */ + public function remove( $name, $lock_expiration = false ) { + $lock_name = self::LOCK_PREFIX . $name; + + // Only remove lock if current value matches our lock. + if ( true === $lock_expiration || (string) get_option( $lock_name ) === (string) $lock_expiration ) { + update_option( $lock_name, false, false ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php new file mode 100644 index 00000000..b3998c90 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-main.php @@ -0,0 +1,114 @@ +uninstall(); + } + + /** + * Sets the Sync data settings. + * + * @param array $data_settings An array containing the Sync data options. An empty array indicates that the default + * values will be used for all Sync data. + */ + public static function set_sync_data_options( $data_settings = array() ) { + ( new Data_Settings() )->add_settings_list( $data_settings ); + } + + /** + * Initialize the main sync actions. + * + * @action plugins_loaded + */ + public static function on_plugins_loaded_early() { + /** + * Additional Sync modules can be carried out into their own packages and they + * will get their own config settings. + * + * For now additional modules are enabled based on whether the third party plugin + * class exists or not. + */ + Sync_Actions::initialize_search(); + Sync_Actions::initialize_woocommerce(); + Sync_Actions::initialize_wp_super_cache(); + + // We need to define this here so that it's hooked before `updating_jetpack_version` is called. + add_action( 'updating_jetpack_version', array( 'Automattic\\Jetpack\\Sync\\Actions', 'cleanup_on_upgrade' ), 10, 2 ); + } + + /** + * Runs after most of plugins_loaded hook functions have been run. + * + * @action plugins_loaded + */ + public static function on_plugins_loaded_late() { + /* + * Init after plugins loaded and before the `init` action. This helps with issues where plugins init + * with a high priority or sites that use alternate cron. + */ + Sync_Actions::init(); + + // Enable non-blocking Jetpack Sync flow. + $non_block_enabled = (bool) get_option( 'jetpack_sync_non_blocking', false ); + + /** + * Filters the option to enable non-blocking sync. + * + * Default value is false, filter to true to enable non-blocking mode which will have + * WP.com return early and use the sync/close endpoint to check-in processed items. + * + * @since 1.12.3 + * + * @param bool $enabled Should non-blocking flow be enabled. + */ + $filtered = (bool) apply_filters( 'jetpack_sync_non_blocking', $non_block_enabled ); + + if ( $non_block_enabled !== $filtered ) { + update_option( 'jetpack_sync_non_blocking', $filtered, false ); + } + + // Initialize health-related hooks after plugins have loaded. + Health::init(); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php new file mode 100644 index 00000000..993ebef5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php @@ -0,0 +1,160 @@ +set_defaults(); + } + } + + /** + * Gets the name of an initialized module. Returns false if given module has not been initialized. + * + * @access public + * @static + * + * @param string $module_name A module name. + * + * @return bool|Automattic\Jetpack\Sync\Modules\Module + */ + public static function get_module( $module_name ) { + foreach ( self::get_modules() as $module ) { + if ( $module->name() === $module_name ) { + return $module; + } + } + + return false; + } + + /** + * Loads and sets defaults for all declared modules. + * + * @access public + * @static + * + * @return array + */ + public static function initialize_modules() { + /** + * Filters the list of class names of sync modules. + * If you add to this list, make sure any classes implement the + * Jetpack_Sync_Module interface. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + $modules = apply_filters( 'jetpack_sync_modules', self::DEFAULT_SYNC_MODULES ); + + $modules = array_map( array( __CLASS__, 'load_module' ), $modules ); + + return array_map( array( __CLASS__, 'set_module_defaults' ), $modules ); + } + + /** + * Returns an instance of the given module class. + * + * @access public + * @static + * + * @param string $module_class The classname of a Jetpack sync module. + * + * @return Automattic\Jetpack\Sync\Modules\Module + */ + public static function load_module( $module_class ) { + return new $module_class(); + } + + /** + * Sets defaults for the given instance of a Jetpack sync module. + * + * @access public + * @static + * + * @param Automattic\Jetpack\Sync\Modules\Module $module Instance of a Jetpack sync module. + * + * @return Automattic\Jetpack\Sync\Modules\Module + */ + public static function set_module_defaults( $module ) { + $module->set_defaults(); + if ( method_exists( $module, 'set_late_default' ) ) { + add_action( 'init', array( $module, 'set_late_default' ), 90 ); + } + return $module; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php new file mode 100644 index 00000000..3450d5a5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php @@ -0,0 +1,30 @@ +id = $id; + $this->items_with_ids = $items_with_ids; + } + + /** + * Retrieve the sync items in the buffer, in an ID => value form. + * + * @access public + * + * @return bool|array Sync items in the buffer. + */ + public function get_items() { + return array_combine( $this->get_item_ids(), $this->get_item_values() ); + } + + /** + * Retrieve the values of the sync items in the buffer. + * + * @access public + * + * @return array Sync items values. + */ + public function get_item_values() { + return Utils::get_item_values( $this->items_with_ids ); + } + + /** + * Retrieve the IDs of the sync items in the buffer. + * + * @access public + * + * @return array Sync items IDs. + */ + public function get_item_ids() { + return Utils::get_item_ids( $this->items_with_ids ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php new file mode 100644 index 00000000..c6fdca1d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php @@ -0,0 +1,758 @@ +id = str_replace( '-', '_', $id ); // Necessary to ensure we don't have ID collisions in the SQL. + $this->row_iterator = 0; + $this->random_int = wp_rand( 1, 1000000 ); + } + + /** + * Add a single item to the queue. + * + * @param object $item Event object to add to queue. + */ + public function add( $item ) { + global $wpdb; + $added = false; + + // If empty, don't add. + if ( empty( $item ) ) { + return; + } + + // Attempt to serialize data, if an exception (closures) return early. + try { + $item = serialize( $item ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + } catch ( \Exception $ex ) { + return; + } + + // This basically tries to add the option until enough time has elapsed that + // it has a unique (microtime-based) option key. + while ( ! $added ) { + $rows_added = $wpdb->query( + $wpdb->prepare( + "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES (%s, %s,%s)", + $this->get_next_data_row_option_name(), + $item, + 'no' + ) + ); + $added = ( 0 !== $rows_added ); + } + } + + /** + * Insert all the items in a single SQL query. May be subject to query size limits! + * + * @param array $items Array of events to add to the queue. + * + * @return bool|\WP_Error + */ + public function add_all( $items ) { + global $wpdb; + $base_option_name = $this->get_next_data_row_option_name(); + + $query = "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES "; + + $rows = array(); + $count_items = count( $items ); + for ( $i = 0; $i < $count_items; ++$i ) { + // skip empty items. + if ( empty( $items[ $i ] ) ) { + continue; + } + try { + $option_name = esc_sql( $base_option_name . '-' . $i ); + $option_value = esc_sql( serialize( $items[ $i ] ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + $rows[] = "('$option_name', '$option_value', 'no')"; + } catch ( \Exception $e ) { + // Item cannot be serialized so skip. + continue; + } + } + + $rows_added = $wpdb->query( $query . join( ',', $rows ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + + if ( count( $items ) !== $rows_added ) { + return new WP_Error( 'row_count_mismatch', "The number of rows inserted didn't match the size of the input array" ); + } + return true; + } + + /** + * Get the front-most item on the queue without checking it out. + * + * @param int $count Number of items to return when looking at the items. + * + * @return array + */ + public function peek( $count = 1 ) { + $items = $this->fetch_items( $count ); + if ( $items ) { + return Utils::get_item_values( $items ); + } + + return array(); + } + + /** + * Gets items with particular IDs. + * + * @param array $item_ids Array of item IDs to retrieve. + * + * @return array + */ + public function peek_by_id( $item_ids ) { + $items = $this->fetch_items_by_id( $item_ids ); + if ( $items ) { + return Utils::get_item_values( $items ); + } + + return array(); + } + + /** + * Gets the queue lag. + * Lag is the difference in time between the age of the oldest item + * (aka first or frontmost item) and the current time. + * + * @param microtime $now The current time in microtime. + * + * @return float|int|mixed|null + */ + public function lag( $now = null ) { + global $wpdb; + + $first_item_name = $wpdb->get_var( + $wpdb->prepare( + "SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT 1", + "jpsq_{$this->id}-%" + ) + ); + + if ( ! $first_item_name ) { + return 0; + } + + if ( null === $now ) { + $now = microtime( true ); + } + + // Break apart the item name to get the timestamp. + $matches = null; + if ( preg_match( '/^jpsq_' . $this->id . '-(\d+\.\d+)-/', $first_item_name, $matches ) ) { + return $now - (float) $matches[1]; + } else { + return 0; + } + } + + /** + * Resets the queue. + */ + public function reset() { + global $wpdb; + $this->delete_checkout_id(); + $wpdb->query( + $wpdb->prepare( + "DELETE FROM $wpdb->options WHERE option_name LIKE %s", + "jpsq_{$this->id}-%" + ) + ); + } + + /** + * Return the size of the queue. + * + * @return int + */ + public function size() { + global $wpdb; + + return (int) $wpdb->get_var( + $wpdb->prepare( + "SELECT count(*) FROM $wpdb->options WHERE option_name LIKE %s", + "jpsq_{$this->id}-%" + ) + ); + } + + /** + * Lets you know if there is any items in the queue. + * + * We use this peculiar implementation because it's much faster than count(*). + * + * @return bool + */ + public function has_any_items() { + global $wpdb; + $value = $wpdb->get_var( + $wpdb->prepare( + "SELECT exists( SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s )", + "jpsq_{$this->id}-%" + ) + ); + + return ( '1' === $value ); + } + + /** + * Used to checkout the queue. + * + * @param int $buffer_size Size of the buffer to checkout. + * + * @return Automattic\Jetpack\Sync\Queue_Buffer|bool|int|\WP_Error + */ + public function checkout( $buffer_size ) { + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + $buffer_id = uniqid(); + + $result = $this->set_checkout_id( $buffer_id ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + $items = $this->fetch_items( $buffer_size ); + + if ( count( $items ) === 0 ) { + return false; + } + + $buffer = new Queue_Buffer( $buffer_id, array_slice( $items, 0, $buffer_size ) ); + + return $buffer; + } + + /** + * Given a list of items return the items ids. + * + * @param array $items List of item objects. + * + * @return array Ids of the items. + */ + public function get_ids( $items ) { + return array_map( + function ( $item ) { + return $item->id; + }, + $items + ); + } + + /** + * Pop elements from the queue. + * + * @param int $limit Number of items to pop from the queue. + * + * @return array|object|null + */ + public function pop( $limit ) { + $items = $this->fetch_items( $limit ); + + $ids = $this->get_ids( $items ); + + $this->delete( $ids ); + + return $items; + } + + /** + * Get the items from the queue with a memory limit. + * + * This checks out rows until it either empties the queue or hits a certain memory limit + * it loads the sizes from the DB first so that it doesn't accidentally + * load more data into memory than it needs to. + * The only way it will load more items than $max_size is if a single queue item + * exceeds the memory limit, but in that case it will send that item by itself. + * + * @param int $max_memory (bytes) Maximum memory threshold. + * @param int $max_buffer_size Maximum buffer size (number of items). + * + * @return Automattic\Jetpack\Sync\Queue_Buffer|bool|int|\WP_Error + */ + public function checkout_with_memory_limit( $max_memory, $max_buffer_size = 500 ) { + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + $buffer_id = uniqid(); + + $result = $this->set_checkout_id( $buffer_id ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + // Get the map of buffer_id -> memory_size. + global $wpdb; + + $items_with_size = $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, LENGTH(option_value) AS value_size FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d", + "jpsq_{$this->id}-%", + $max_buffer_size + ), + OBJECT + ); + + if ( count( $items_with_size ) === 0 ) { + return false; + } + + $total_memory = 0; + $max_item_id = $items_with_size[0]->id; + $min_item_id = $max_item_id; + + foreach ( $items_with_size as $id => $item_with_size ) { + $total_memory += $item_with_size->value_size; + + // If this is the first item and it exceeds memory, allow loop to continue + // we will exit on the next iteration instead. + if ( $total_memory > $max_memory && $id > 0 ) { + break; + } + + $max_item_id = $item_with_size->id; + } + + $query = $wpdb->prepare( + "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name >= %s and option_name <= %s ORDER BY option_name ASC", + $min_item_id, + $max_item_id + ); + + $items = $wpdb->get_results( $query, OBJECT ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + foreach ( $items as $item ) { + // @codingStandardsIgnoreStart + $item->value = @unserialize( $item->value ); + // @codingStandardsIgnoreEnd + } + + if ( count( $items ) === 0 ) { + $this->delete_checkout_id(); + + return false; + } + + $buffer = new Queue_Buffer( $buffer_id, $items ); + + return $buffer; + } + + /** + * Check in the queue. + * + * @param Automattic\Jetpack\Sync\Queue_Buffer $buffer Queue_Buffer object. + * + * @return bool|\WP_Error + */ + public function checkin( $buffer ) { + $is_valid = $this->validate_checkout( $buffer ); + + if ( is_wp_error( $is_valid ) ) { + return $is_valid; + } + + $this->delete_checkout_id(); + + return true; + } + + /** + * Close the buffer. + * + * @param Automattic\Jetpack\Sync\Queue_Buffer $buffer Queue_Buffer object. + * @param null|array $ids_to_remove Ids to remove from the queue. + * + * @return bool|\WP_Error + */ + public function close( $buffer, $ids_to_remove = null ) { + $is_valid = $this->validate_checkout( $buffer ); + + if ( is_wp_error( $is_valid ) ) { + // Always delete ids_to_remove even when buffer is no longer checked-out. + // They were processed by WP.com so safe to remove from queue. + if ( $ids_to_remove !== null ) { + $this->delete( $ids_to_remove ); + } + return $is_valid; + } + + $this->delete_checkout_id(); + + // By default clear all items in the buffer. + if ( $ids_to_remove === null ) { + $ids_to_remove = $buffer->get_item_ids(); + } + + $this->delete( $ids_to_remove ); + + return true; + } + + /** + * Delete elements from the queue. + * + * @param array $ids Ids to delete. + * + * @return bool|int + */ + private function delete( $ids ) { + if ( 0 === count( $ids ) ) { + return 0; + } + global $wpdb; + $sql = "DELETE FROM $wpdb->options WHERE option_name IN (" . implode( ', ', array_fill( 0, count( $ids ), '%s' ) ) . ')'; + $query = call_user_func_array( array( $wpdb, 'prepare' ), array_merge( array( $sql ), $ids ) ); + + return $wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + } + + /** + * Flushes all items from the queue. + * + * @return array + */ + public function flush_all() { + $items = Utils::get_item_values( $this->fetch_items() ); + $this->reset(); + + return $items; + } + + /** + * Get all the items from the queue. + * + * @return array|object|null + */ + public function get_all() { + return $this->fetch_items(); + } + + /** + * Forces Checkin of the queue. + * Use with caution, this could allow multiple processes to delete + * and send from the queue at the same time + */ + public function force_checkin() { + $this->delete_checkout_id(); + } + + /** + * Checks if the queue is locked. + * + * @return bool + */ + public function is_locked() { + return (bool) $this->get_checkout_id(); + } + + /** + * Locks checkouts from the queue + * tries to wait up to $timeout seconds for the queue to be empty. + * + * @param int $timeout The wait time in seconds for the queue to be empty. + * + * @return bool|int|\WP_Error + */ + public function lock( $timeout = 30 ) { + $tries = 0; + + while ( $this->has_any_items() && $tries < $timeout ) { + sleep( 1 ); + ++$tries; + } + + if ( 30 === $tries ) { + return new WP_Error( 'lock_timeout', 'Timeout waiting for sync queue to empty' ); + } + + if ( $this->get_checkout_id() ) { + return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' ); + } + + // Hopefully this means we can acquire a checkout? + $result = $this->set_checkout_id( 'lock' ); + + if ( ! $result || is_wp_error( $result ) ) { + return $result; + } + + return true; + } + + /** + * Unlocks the queue. + * + * @return bool|int + */ + public function unlock() { + return $this->delete_checkout_id(); + } + + /** + * This option is specifically chosen to, as much as possible, preserve time order + * and minimise the possibility of collisions between multiple processes working + * at the same time. + * + * @return string + */ + protected function generate_option_name_timestamp() { + return sprintf( '%.6f', microtime( true ) ); + } + + /** + * Gets the checkout ID. + * + * @return bool|string + */ + private function get_checkout_id() { + global $wpdb; + $checkout_value = $wpdb->get_var( + $wpdb->prepare( + "SELECT option_value FROM $wpdb->options WHERE option_name = %s", + $this->get_lock_option_name() + ) + ); + + if ( $checkout_value ) { + list( $checkout_id, $timestamp ) = explode( ':', $checkout_value ); + if ( (int) $timestamp > time() ) { + return $checkout_id; + } + } + + return false; + } + + /** + * Sets the checkout id. + * + * @param string $checkout_id The ID of the checkout. + * + * @return bool|int + */ + private function set_checkout_id( $checkout_id ) { + global $wpdb; + + $expires = time() + Defaults::$default_sync_queue_lock_timeout; + $updated_num = $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->options SET option_value = %s WHERE option_name = %s", + "$checkout_id:$expires", + $this->get_lock_option_name() + ) + ); + + if ( ! $updated_num ) { + $updated_num = $wpdb->query( + $wpdb->prepare( + "INSERT INTO $wpdb->options ( option_name, option_value, autoload ) VALUES ( %s, %s, 'no' )", + $this->get_lock_option_name(), + "$checkout_id:$expires" + ) + ); + } + + return $updated_num; + } + + /** + * Deletes the checkout ID. + * + * @return bool|int + */ + private function delete_checkout_id() { + global $wpdb; + // Rather than delete, which causes fragmentation, we update in place. + return $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->options SET option_value = %s WHERE option_name = %s", + '0:0', + $this->get_lock_option_name() + ) + ); + } + + /** + * Return the lock option name. + * + * @return string + */ + private function get_lock_option_name() { + return "jpsq_{$this->id}_checkout"; + } + + /** + * Return the next data row option name. + * + * @return string + */ + private function get_next_data_row_option_name() { + $timestamp = $this->generate_option_name_timestamp(); + + // Row iterator is used to avoid collisions where we're writing data waaay fast in a single process. + if ( PHP_INT_MAX === $this->row_iterator ) { + $this->row_iterator = 0; + } else { + $this->row_iterator += 1; + } + + return 'jpsq_' . $this->id . '-' . $timestamp . '-' . $this->random_int . '-' . $this->row_iterator; + } + + /** + * Return the items in the queue. + * + * @param null|int $limit Limit to the number of items we fetch at once. + * + * @return array|object|null + */ + private function fetch_items( $limit = null ) { + global $wpdb; + + if ( $limit ) { + $items = $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d", + "jpsq_{$this->id}-%", + $limit + ), + OBJECT + ); + } else { + $items = $wpdb->get_results( + $wpdb->prepare( + "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC", + "jpsq_{$this->id}-%" + ), + OBJECT + ); + } + + return $this->unserialize_values( $items ); + } + + /** + * Return items with specific ids. + * + * @param array $items_ids Array of event ids. + * + * @return array|object|null + */ + private function fetch_items_by_id( $items_ids ) { + global $wpdb; + + // return early if $items_ids is empty or not an array. + if ( empty( $items_ids ) || ! is_array( $items_ids ) ) { + return null; + } + + $ids_placeholders = implode( ', ', array_fill( 0, count( $items_ids ), '%s' ) ); + $query_with_placeholders = "SELECT option_name AS id, option_value AS value + FROM $wpdb->options + WHERE option_name IN ( $ids_placeholders )"; + $items = $wpdb->get_results( + $wpdb->prepare( + $query_with_placeholders, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $items_ids + ), + OBJECT + ); + + return $this->unserialize_values( $items ); + } + + /** + * Unserialize item values. + * + * @param array $items Events from the Queue to be unserialized. + * + * @return mixed + */ + private function unserialize_values( $items ) { + array_walk( + $items, + function ( $item ) { + // @codingStandardsIgnoreStart + $item->value = @unserialize( $item->value ); + // @codingStandardsIgnoreEnd + } + ); + + return $items; + } + + /** + * Return true if the buffer is still valid or an Error other wise. + * + * @param Automattic\Jetpack\Sync\Queue_Buffer $buffer The Queue_Buffer. + * + * @return bool|WP_Error + */ + private function validate_checkout( $buffer ) { + if ( ! $buffer instanceof Queue_Buffer ) { + return new WP_Error( 'not_a_buffer', 'You must checkin an instance of Automattic\\Jetpack\\Sync\\Queue_Buffer' ); + } + + $checkout_id = $this->get_checkout_id(); + + if ( ! $checkout_id ) { + return new WP_Error( 'buffer_not_checked_out', 'There are no checked out buffers' ); + } + + // TODO: change to strict comparison. + if ( $checkout_id != $buffer->id ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual + return new WP_Error( 'buffer_mismatch', 'The buffer you checked in was not checked out' ); + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php new file mode 100644 index 00000000..ae947009 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php @@ -0,0 +1,1457 @@ +query( "DELETE FROM $wpdb->posts" ); + + // Delete comments from cache. + $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments" ); + if ( ! empty( $comment_ids ) ) { + clean_comment_cache( $comment_ids ); + } + $wpdb->query( "DELETE FROM $wpdb->comments" ); + + // Also need to delete terms from cache. + $term_ids = $wpdb->get_col( "SELECT term_id FROM $wpdb->terms" ); + foreach ( $term_ids as $term_id ) { + wp_cache_delete( $term_id, 'terms' ); + } + + $wpdb->query( "DELETE FROM $wpdb->terms" ); + + $wpdb->query( "DELETE FROM $wpdb->term_taxonomy" ); + $wpdb->query( "DELETE FROM $wpdb->term_relationships" ); + + // Callables and constants. + $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'jetpack_%'" ); + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key NOT LIKE '\_%'" ); + } + + /** + * Ran when full sync has just started. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + */ + public function full_sync_start( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->reset(); + } + + /** + * Ran when full sync has just finished. + * + * @access public + * + * @param string $checksum Deprecated since 7.3.0. + */ + public function full_sync_end( $checksum ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop right now. + } + + /** + * Retrieve the number of terms. + * + * @access public + * + * @return int Number of terms. + */ + public function term_count() { + global $wpdb; + return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->terms" ); + } + + /** + * Retrieve the number of rows in the `term_taxonomy` table. + * + * @access public + * + * @return int Number of terms. + */ + public function term_taxonomy_count() { + global $wpdb; + return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_taxonomy" ); + } + + /** + * Retrieve the number of term relationships. + * + * @access public + * + * @return int Number of rows in the term relationships table. + */ + public function term_relationship_count() { + global $wpdb; + return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->term_relationships" ); + } + + /** + * Retrieve the number of posts with a particular post status within a certain range. + * + * @access public + * + * @todo Prepare the SQL query before executing it. + * + * @param string $status Post status. + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return int Number of posts. + */ + public function post_count( $status = null, $min_id = null, $max_id = null ) { + global $wpdb; + + $where = ''; + + if ( $status ) { + $where = "post_status = '" . esc_sql( $status ) . "'"; + } else { + $where = '1=1'; + } + + if ( ! empty( $min_id ) ) { + $where .= ' AND ID >= ' . (int) $min_id; + } + + if ( ! empty( $max_id ) ) { + $where .= ' AND ID <= ' . (int) $max_id; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE $where" ); + } + + /** + * Retrieve the posts with a particular post status. + * + * @access public + * + * @todo Implement range and actually use max_id/min_id arguments. + * + * @param string $status Post status. + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return array Array of posts. + */ + public function get_posts( $status = null, $min_id = null, $max_id = null ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $args = array( + 'orderby' => 'ID', + 'posts_per_page' => -1, + ); + + if ( $status ) { + $args['post_status'] = $status; + } else { + $args['post_status'] = 'any'; + } + + return get_posts( $args ); + } + + /** + * Retrieve a post object by the post ID. + * + * @access public + * + * @param int $id Post ID. + * @return \WP_Post Post object. + */ + public function get_post( $id ) { + return get_post( $id ); + } + + /** + * Update or insert a post. + * + * @access public + * + * @param \WP_Post $post Post object. + * @param bool $silent Whether to perform a silent action. Not used in this implementation. + */ + public function upsert_post( $post, $silent = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + global $wpdb; + + // Reject the post if it's not a \WP_Post. + if ( ! $post instanceof \WP_Post ) { + return; + } + + $post = $post->to_array(); + + // Reject posts without an ID. + if ( ! isset( $post['ID'] ) ) { + return; + } + + $now = current_time( 'mysql' ); + $now_gmt = get_gmt_from_date( $now ); + + $defaults = array( + 'ID' => 0, + 'post_author' => '0', + 'post_content' => '', + 'post_content_filtered' => '', + 'post_title' => '', + 'post_name' => '', + 'post_excerpt' => '', + 'post_status' => 'draft', + 'post_type' => 'post', + 'comment_status' => 'closed', + 'comment_count' => '0', + 'ping_status' => '', + 'post_password' => '', + 'to_ping' => '', + 'pinged' => '', + 'post_parent' => 0, + 'menu_order' => 0, + 'guid' => '', + 'post_date' => $now, + 'post_date_gmt' => $now_gmt, + 'post_modified' => $now, + 'post_modified_gmt' => $now_gmt, + ); + + $post = array_intersect_key( $post, $defaults ); + + $post = sanitize_post( $post, 'db' ); + + unset( $post['filter'] ); + + $exists = $wpdb->get_var( $wpdb->prepare( "SELECT EXISTS( SELECT 1 FROM $wpdb->posts WHERE ID = %d )", $post['ID'] ) ); + + if ( $exists ) { + $wpdb->update( $wpdb->posts, $post, array( 'ID' => $post['ID'] ) ); + } else { + $wpdb->insert( $wpdb->posts, $post ); + } + + clean_post_cache( $post['ID'] ); + } + + /** + * Delete a post by the post ID. + * + * @access public + * + * @param int $post_id Post ID. + */ + public function delete_post( $post_id ) { + wp_delete_post( $post_id, true ); + } + + /** + * Retrieve the checksum for posts within a range. + * + * @access public + * + * @param int $min_id Minimum post ID. + * @param int $max_id Maximum post ID. + * @return int The checksum. + */ + public function posts_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'posts', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the checksum for post meta within a range. + * + * @access public + * + * @param int $min_id Minimum post meta ID. + * @param int $max_id Maximum post meta ID. + * @return int The checksum. + */ + public function post_meta_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'postmeta', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the number of comments with a particular comment status within a certain range. + * + * @access public + * + * @todo Prepare the SQL query before executing it. + * + * @param string $status Comment status. + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return int Number of comments. + */ + public function comment_count( $status = null, $min_id = null, $max_id = null ) { + global $wpdb; + + $comment_approved = $this->comment_status_to_approval_value( $status ); + + if ( false !== $comment_approved ) { + $where = "comment_approved = '" . esc_sql( $comment_approved ) . "'"; + } else { + $where = '1=1'; + } + + if ( ! empty( $min_id ) ) { + $where .= ' AND comment_ID >= ' . (int) $min_id; + } + + if ( ! empty( $max_id ) ) { + $where .= ' AND comment_ID <= ' . (int) $max_id; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE $where" ); + } + + /** + * Translate a comment status to a value of the comment_approved field. + * + * @access protected + * + * @param string $status Comment status. + * @return string|bool New comment_approved value, false if the status doesn't affect it. + */ + protected function comment_status_to_approval_value( $status ) { + switch ( (string) $status ) { + case 'approve': + case '1': + return '1'; + case 'hold': + case '0': + return '0'; + case 'spam': + return 'spam'; + case 'trash': + return 'trash'; + case 'post-trashed': + return 'post-trashed'; + case 'any': + case 'all': + default: + return false; + } + } + + /** + * Retrieve the comments with a particular comment status. + * + * @access public + * + * @todo Implement range and actually use max_id/min_id arguments. + * + * @param string $status Comment status. + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return array Array of comments. + */ + public function get_comments( $status = null, $min_id = null, $max_id = null ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $args = array( + 'orderby' => 'ID', + 'status' => 'all', + ); + + if ( $status ) { + $args['status'] = $status; + } + + return get_comments( $args ); + } + + /** + * Retrieve a comment object by the comment ID. + * + * @access public + * + * @param int $id Comment ID. + * @return \WP_Comment Comment object. + */ + public function get_comment( $id ) { + return \WP_Comment::get_instance( $id ); + } + + /** + * Update or insert a comment. + * + * @access public + * + * @param \WP_Comment $comment Comment object. + */ + public function upsert_comment( $comment ) { + global $wpdb; + + $comment = $comment->to_array(); + + // Filter by fields on comment table. + $comment_fields_whitelist = array( + 'comment_ID', + 'comment_post_ID', + 'comment_author', + 'comment_author_email', + 'comment_author_url', + 'comment_author_IP', + 'comment_date', + 'comment_date_gmt', + 'comment_content', + 'comment_karma', + 'comment_approved', + 'comment_agent', + 'comment_type', + 'comment_parent', + 'user_id', + ); + + foreach ( $comment as $key => $value ) { + if ( ! in_array( $key, $comment_fields_whitelist, true ) ) { + unset( $comment[ $key ] ); + } + } + + $exists = $wpdb->get_var( + $wpdb->prepare( + "SELECT EXISTS( SELECT 1 FROM $wpdb->comments WHERE comment_ID = %d )", + $comment['comment_ID'] + ) + ); + + if ( $exists ) { + $wpdb->update( $wpdb->comments, $comment, array( 'comment_ID' => $comment['comment_ID'] ) ); + } else { + $wpdb->insert( $wpdb->comments, $comment ); + } + // Remove comment from cache. + clean_comment_cache( $comment['comment_ID'] ); + + wp_update_comment_count( $comment['comment_post_ID'] ); + } + + /** + * Trash a comment by the comment ID. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function trash_comment( $comment_id ) { + wp_delete_comment( $comment_id ); + } + + /** + * Delete a comment by the comment ID. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function delete_comment( $comment_id ) { + wp_delete_comment( $comment_id, true ); + } + + /** + * Mark a comment by the comment ID as spam. + * + * @access public + * + * @param int $comment_id Comment ID. + */ + public function spam_comment( $comment_id ) { + wp_spam_comment( $comment_id ); + } + + /** + * Trash the comments of a post. + * + * @access public + * + * @param int $post_id Post ID. + * @param array $statuses Post statuses. Not used in this implementation. + */ + public function trashed_post_comments( $post_id, $statuses ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + wp_trash_post_comments( $post_id ); + } + + /** + * Untrash the comments of a post. + * + * @access public + * + * @param int $post_id Post ID. + */ + public function untrashed_post_comments( $post_id ) { + wp_untrash_post_comments( $post_id ); + } + + /** + * Retrieve the checksum for comments within a range. + * + * @access public + * + * @param int $min_id Minimum comment ID. + * @param int $max_id Maximum comment ID. + * @return int The checksum. + */ + public function comments_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'comments', null, $min_id, $max_id ) ); + } + + /** + * Retrieve the checksum for comment meta within a range. + * + * @access public + * + * @param int $min_id Minimum comment meta ID. + * @param int $max_id Maximum comment meta ID. + * @return int The checksum. + */ + public function comment_meta_checksum( $min_id = null, $max_id = null ) { + return $this->summarize_checksum_histogram( $this->checksum_histogram( 'commentmeta', null, $min_id, $max_id ) ); + } + + /** + * Update the value of an option. + * + * @access public + * + * @param string $option Option name. + * @param mixed $value Option value. + * @return bool False if value was not updated and true if value was updated. + */ + public function update_option( $option, $value ) { + return update_option( $option, $value ); + } + + /** + * Retrieve an option value based on an option name. + * + * @access public + * + * @param string $option Name of option to retrieve. + * @param mixed $default Optional. Default value to return if the option does not exist. + * @return mixed Value set for the option. + */ + public function get_option( $option, $default = false ) { + return get_option( $option, $default ); + } + + /** + * Remove an option by name. + * + * @access public + * + * @param string $option Name of option to remove. + * @return bool True, if option is successfully deleted. False on failure. + */ + public function delete_option( $option ) { + return delete_option( $option ); + } + + /** + * Change the info of the current theme. + * + * @access public + * + * @param array $theme_info Theme info array. + */ + public function set_theme_info( $theme_info ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop. + } + + /** + * Whether the current theme supports a certain feature. + * + * @access public + * + * @param string $feature Name of the feature. + */ + public function current_theme_supports( $feature ) { + return current_theme_supports( $feature ); + } + + /** + * Retrieve metadata for the specified object. + * + * @access public + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param string $meta_key Meta key. + * @param bool $single If true, return only the first value of the specified meta_key. + * + * @return mixed Single metadata value, or array of values. + */ + public function get_metadata( $type, $object_id, $meta_key = '', $single = false ) { + return get_metadata( $type, $object_id, $meta_key, $single ); + } + + /** + * Stores remote meta key/values alongside an ID mapping key. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param string $meta_key Meta key. + * @param mixed $meta_value Meta value. + * @param int $meta_id ID of the meta. + * + * @return bool False if meta table does not exist, true otherwise. + */ + public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id ) { + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + + global $wpdb; + + $exists = $wpdb->get_var( + $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT EXISTS( SELECT 1 FROM $table WHERE meta_id = %d )", + $meta_id + ) + ); + + if ( $exists ) { + $wpdb->update( + $table, + array( + 'meta_key' => $meta_key, + 'meta_value' => maybe_serialize( $meta_value ), + ), + array( 'meta_id' => $meta_id ) + ); + } else { + $object_id_field = $type . '_id'; + $wpdb->insert( + $table, + array( + 'meta_id' => $meta_id, + $object_id_field => $object_id, + 'meta_key' => $meta_key, + 'meta_value' => maybe_serialize( $meta_value ), + ) + ); + } + + wp_cache_delete( $object_id, $type . '_meta' ); + + return true; + } + + /** + * Delete metadata for the specified object. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param int $object_id ID of the object. + * @param array $meta_ids IDs of the meta objects to delete. + */ + public function delete_metadata( $type, $object_id, $meta_ids ) { + global $wpdb; + + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + + foreach ( $meta_ids as $meta_id ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE meta_id = %d", $meta_id ) ); + } + + // If we don't have an object ID what do we do - invalidate ALL meta? + if ( $object_id ) { + wp_cache_delete( $object_id, $type . '_meta' ); + } + } + + /** + * Delete metadata with a certain key for the specified objects. + * + * @access public + * + * @todo Test this out to make sure it works as expected. + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param string $type Meta type. + * @param array $object_ids IDs of the objects. + * @param string $meta_key Meta key. + */ + public function delete_batch_metadata( $type, $object_ids, $meta_key ) { + global $wpdb; + + $table = _get_meta_table( $type ); + if ( ! $table ) { + return false; + } + $column = sanitize_key( $type . '_id' ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE $column IN (%s) && meta_key = %s", implode( ',', $object_ids ), $meta_key ) ); + + // If we don't have an object ID what do we do - invalidate ALL meta? + foreach ( $object_ids as $object_id ) { + wp_cache_delete( $object_id, $type . '_meta' ); + } + } + + /** + * Retrieve value of a constant based on the constant name. + * + * We explicitly return null instead of false if the constant doesn't exist. + * + * @access public + * + * @param string $constant Name of constant to retrieve. + * @return mixed Value set for the constant. + */ + public function get_constant( $constant ) { + $value = get_option( 'jetpack_constant_' . $constant ); + + if ( $value ) { + return $value; + } + + return null; + } + + /** + * Set the value of a constant. + * + * @access public + * + * @param string $constant Name of constant to retrieve. + * @param mixed $value Value set for the constant. + */ + public function set_constant( $constant, $value ) { + update_option( 'jetpack_constant_' . $constant, $value ); + } + + /** + * Retrieve the number of the available updates of a certain type. + * Type is one of: `plugins`, `themes`, `wordpress`, `translations`, `total`, `wp_update_version`. + * + * @access public + * + * @param string $type Type of updates to retrieve. + * @return int|null Number of updates available, `null` if type is invalid or missing. + */ + public function get_updates( $type ) { + $all_updates = get_option( 'jetpack_updates', array() ); + + if ( isset( $all_updates[ $type ] ) ) { + return $all_updates[ $type ]; + } else { + return null; + } + } + + /** + * Set the available updates of a certain type. + * Type is one of: `plugins`, `themes`, `wordpress`, `translations`, `total`, `wp_update_version`. + * + * @access public + * + * @param string $type Type of updates to set. + * @param int $updates Total number of updates. + */ + public function set_updates( $type, $updates ) { + $all_updates = get_option( 'jetpack_updates', array() ); + $all_updates[ $type ] = $updates; + update_option( 'jetpack_updates', $all_updates ); + } + + /** + * Retrieve a callable value based on its name. + * + * @access public + * + * @param string $name Name of the callable to retrieve. + * @return mixed Value of the callable. + */ + public function get_callable( $name ) { + $value = get_option( 'jetpack_' . $name ); + + if ( $value ) { + return $value; + } + + return null; + } + + /** + * Update the value of a callable. + * + * @access public + * + * @param string $name Callable name. + * @param mixed $value Callable value. + */ + public function set_callable( $name, $value ) { + update_option( 'jetpack_' . $name, $value ); + } + + /** + * Retrieve a network option value based on a network option name. + * + * @access public + * + * @param string $option Name of network option to retrieve. + * @return mixed Value set for the network option. + */ + public function get_site_option( $option ) { + return get_option( 'jetpack_network_' . $option ); + } + + /** + * Update the value of a network option. + * + * @access public + * + * @param string $option Network option name. + * @param mixed $value Network option value. + * @return bool False if value was not updated and true if value was updated. + */ + public function update_site_option( $option, $value ) { + return update_option( 'jetpack_network_' . $option, $value ); + } + + /** + * Remove a network option by name. + * + * @access public + * + * @param string $option Name of option to remove. + * @return bool True, if option is successfully deleted. False on failure. + */ + public function delete_site_option( $option ) { + return delete_option( 'jetpack_network_' . $option ); + } + + /** + * Retrieve the terms from a particular taxonomy. + * + * @access public + * + * @param string $taxonomy Taxonomy slug. + * + * @return array|WP_Error Array of terms or WP_Error object on failure. + */ + public function get_terms( $taxonomy ) { + $t = $this->ensure_taxonomy( $taxonomy ); + if ( ! $t || is_wp_error( $t ) ) { + return $t; + } + return get_terms( $taxonomy ); + } + + /** + * Retrieve a particular term. + * + * @access public + * + * @param string $taxonomy Taxonomy slug. + * @param int $term_id ID of the term. + * @param string $term_key ID Field `term_id` or `term_taxonomy_id`. + * + * @return \WP_Term|WP_Error Term object on success, \WP_Error object on failure. + */ + public function get_term( $taxonomy, $term_id, $term_key = 'term_id' ) { + + // Full Sync will pass false for the $taxonomy so a check for term_taxonomy_id is needed before ensure_taxonomy. + if ( 'term_taxonomy_id' === $term_key ) { + return get_term_by( 'term_taxonomy_id', $term_id ); + } + + $t = $this->ensure_taxonomy( $taxonomy ); + if ( ! $t || is_wp_error( $t ) ) { + return $t; + } + + return get_term( $term_id, $taxonomy ); + } + + /** + * Verify a taxonomy is legitimate and register it if necessary. + * + * @access private + * + * @param string $taxonomy Taxonomy slug. + * + * @return bool|void|WP_Error True if already exists; void if it was registered; \WP_Error on error. + */ + private function ensure_taxonomy( $taxonomy ) { + if ( ! taxonomy_exists( $taxonomy ) ) { + // Try re-registering synced taxonomies. + $taxonomies = $this->get_callable( 'taxonomies' ); + if ( ! isset( $taxonomies[ $taxonomy ] ) ) { + // Doesn't exist, or somehow hasn't been synced. + return new WP_Error( 'invalid_taxonomy', "The taxonomy '$taxonomy' doesn't exist" ); + } + $t = $taxonomies[ $taxonomy ]; + + return register_taxonomy( + $taxonomy, + $t->object_type, + (array) $t + ); + } + + return true; + } + + /** + * Retrieve all terms from a taxonomy that are related to an object with a particular ID. + * + * @access public + * + * @param int $object_id Object ID. + * @param string $taxonomy Taxonomy slug. + * + * @return array|bool|WP_Error Array of terms on success, `false` if no terms or post doesn't exist, \WP_Error on failure. + */ + public function get_the_terms( $object_id, $taxonomy ) { + return get_the_terms( $object_id, $taxonomy ); + } + + /** + * Insert or update a term. + * + * @access public + * + * @param \WP_Term $term_object Term object. + * + * @return array|bool|WP_Error Array of term_id and term_taxonomy_id if updated, true if inserted, \WP_Error on failure. + */ + public function update_term( $term_object ) { + $taxonomy = $term_object->taxonomy; + global $wpdb; + $exists = $wpdb->get_var( + $wpdb->prepare( + "SELECT EXISTS( SELECT 1 FROM $wpdb->terms WHERE term_id = %d )", + $term_object->term_id + ) + ); + if ( ! $exists ) { + $term_object = sanitize_term( clone $term_object, $taxonomy, 'db' ); + $term = array( + 'term_id' => $term_object->term_id, + 'name' => $term_object->name, + 'slug' => $term_object->slug, + 'term_group' => $term_object->term_group, + ); + $term_taxonomy = array( + 'term_taxonomy_id' => $term_object->term_taxonomy_id, + 'term_id' => $term_object->term_id, + 'taxonomy' => $term_object->taxonomy, + 'description' => $term_object->description, + 'parent' => (int) $term_object->parent, + 'count' => (int) $term_object->count, + ); + $wpdb->insert( $wpdb->terms, $term ); + $wpdb->insert( $wpdb->term_taxonomy, $term_taxonomy ); + + return true; + } + + return wp_update_term( $term_object->term_id, $taxonomy, (array) $term_object ); + } + + /** + * Delete a term by the term ID and its corresponding taxonomy. + * + * @access public + * + * @param int $term_id Term ID. + * @param string $taxonomy Taxonomy slug. + * + * @return bool|int|WP_Error True on success, false if term doesn't exist. Zero if trying with default category. \WP_Error on invalid taxonomy. + */ + public function delete_term( $term_id, $taxonomy ) { + $this->ensure_taxonomy( $taxonomy ); + return wp_delete_term( $term_id, $taxonomy ); + } + + /** + * Add/update terms of a particular taxonomy of an object with the specified ID. + * + * @access public + * + * @param int $object_id The object to relate to. + * @param string $taxonomy The context in which to relate the term to the object. + * @param string|int|array $terms A single term slug, single term id, or array of either term slugs or ids. + * @param bool $append Optional. If false will delete difference of terms. Default false. + */ + public function update_object_terms( $object_id, $taxonomy, $terms, $append ) { + $this->ensure_taxonomy( $taxonomy ); + wp_set_object_terms( $object_id, $terms, $taxonomy, $append ); + } + + /** + * Remove certain term relationships from the specified object. + * + * @access public + * + * @todo Refactor to not use interpolated values when preparing the SQL query. + * + * @param int $object_id ID of the object. + * @param array $tt_ids Term taxonomy IDs. + * @return bool True on success, false on failure. + */ + public function delete_object_terms( $object_id, $tt_ids ) { + global $wpdb; + + if ( is_array( $tt_ids ) && ! empty( $tt_ids ) ) { + // Escape. + $tt_ids_sanitized = array_map( 'intval', $tt_ids ); + + $taxonomies = array(); + foreach ( $tt_ids_sanitized as $tt_id ) { + $term = get_term_by( 'term_taxonomy_id', $tt_id ); + $taxonomies[ $term->taxonomy ][] = $tt_id; + } + $in_tt_ids = implode( ', ', $tt_ids_sanitized ); + + /** + * Fires immediately before an object-term relationship is deleted. + * + * @since 1.6.3 + * @since-jetpack 2.9.0 + * + * @param int $object_id Object ID. + * @param array $tt_ids An array of term taxonomy IDs. + */ + do_action( 'delete_term_relationships', $object_id, $tt_ids_sanitized ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) ); + foreach ( $taxonomies as $taxonomy => $taxonomy_tt_ids ) { + $this->ensure_taxonomy( $taxonomy ); + wp_cache_delete( $object_id, $taxonomy . '_relationships' ); + /** + * Fires immediately after an object-term relationship is deleted. + * + * @since 1.6.3 + * @since-jetpack 2.9.0 + * + * @param int $object_id Object ID. + * @param array $tt_ids An array of term taxonomy IDs. + */ + do_action( 'deleted_term_relationships', $object_id, $taxonomy_tt_ids ); + wp_update_term_count( $taxonomy_tt_ids, $taxonomy ); + } + + return (bool) $deleted; + } + + return false; + } + + /** + * Retrieve the number of users. + * Not supported in this replicastore. + * + * @access public + */ + public function user_count() { + // Noop. + } + + /** + * Retrieve a user object by the user ID. + * + * @access public + * + * @param int $user_id User ID. + * @return \WP_User User object. + */ + public function get_user( $user_id ) { + return \WP_User::get_instance( $user_id ); + } + + /** + * Insert or update a user. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param \WP_User $user User object. + */ + public function upsert_user( $user ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Delete a user. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + */ + public function delete_user( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Update/insert user locale. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + * @param string $local The user locale. + */ + public function upsert_user_locale( $user_id, $local ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Delete user locale. + * Not supported in this replicastore. + * + * @access public + * @throws Exception If this method is invoked. + * + * @param int $user_id User ID. + */ + public function delete_user_locale( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $this->invalid_call(); + } + + /** + * Retrieve the user locale. + * + * @access public + * + * @param int $user_id User ID. + * @return string The user locale. + */ + public function get_user_locale( $user_id ) { + return get_user_locale( $user_id ); + } + + /** + * Retrieve the allowed mime types for the user. + * Not supported in this replicastore. + * + * @access public + * + * @param int $user_id User ID. + */ + public function get_allowed_mime_types( $user_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Noop. + } + + /** + * Retrieve all the checksums we are interested in. + * Currently that is posts, comments, post meta and comment meta. + * + * @access public + * + * @param boolean $perform_text_conversion If text fields should be latin1 converted. + * + * @return array Checksums. + */ + public function checksum_all( $perform_text_conversion = false ) { + $post_checksum = $this->checksum_histogram( 'posts', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $comments_checksum = $this->checksum_histogram( 'comments', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $post_meta_checksum = $this->checksum_histogram( 'postmeta', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $comment_meta_checksum = $this->checksum_histogram( 'commentmeta', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $terms_checksum = $this->checksum_histogram( 'terms', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $term_relationships_checksum = $this->checksum_histogram( 'term_relationships', null, null, null, null, true, '', false, false, $perform_text_conversion ); + $term_taxonomy_checksum = $this->checksum_histogram( 'term_taxonomy', null, null, null, null, true, '', false, false, $perform_text_conversion ); + + $result = array( + 'posts' => $this->summarize_checksum_histogram( $post_checksum ), + 'comments' => $this->summarize_checksum_histogram( $comments_checksum ), + 'post_meta' => $this->summarize_checksum_histogram( $post_meta_checksum ), + 'comment_meta' => $this->summarize_checksum_histogram( $comment_meta_checksum ), + 'terms' => $this->summarize_checksum_histogram( $terms_checksum ), + 'term_relationships' => $this->summarize_checksum_histogram( $term_relationships_checksum ), + 'term_taxonomy' => $this->summarize_checksum_histogram( $term_taxonomy_checksum ), + ); + + /** + * WooCommerce tables + */ + + /** + * On WordPress.com, we can't directly check if the site has support for WooCommerce. + * Having the option to override the functionality here helps with syncing WooCommerce tables. + * + * @since 10.1 + * + * @param bool If we should we force-enable WooCommerce tables support. + */ + $force_woocommerce_support = apply_filters( 'jetpack_table_checksum_force_enable_woocommerce', false ); + + if ( $force_woocommerce_support || class_exists( 'WooCommerce' ) ) { + /** + * Guard in Try/Catch as it's possible for the WooCommerce class to exist, but + * the tables to not. If we don't do this, the response will be just the exception, without + * returning any valid data. This will prevent us from ever performing a checksum/fix + * for sites like this. + * It's better to just skip the tables in the response, instead of completely failing. + */ + + try { + $woocommerce_order_items_checksum = $this->checksum_histogram( 'woocommerce_order_items' ); + $result['woocommerce_order_items'] = $this->summarize_checksum_histogram( $woocommerce_order_items_checksum ); + } catch ( Exception $ex ) { + $result['woocommerce_order_items'] = null; + } + + try { + $woocommerce_order_itemmeta_checksum = $this->checksum_histogram( 'woocommerce_order_itemmeta' ); + $result['woocommerce_order_itemmeta'] = $this->summarize_checksum_histogram( $woocommerce_order_itemmeta_checksum ); + } catch ( Exception $ex ) { + $result['woocommerce_order_itemmeta'] = null; + } + } + + return $result; + } + + /** + * Return the summarized checksum from buckets or the WP_Error. + * + * @param array $histogram checksum_histogram result. + * + * @return int|WP_Error checksum or Error. + */ + protected function summarize_checksum_histogram( $histogram ) { + if ( is_wp_error( $histogram ) ) { + return $histogram; + } else { + return array_sum( $histogram ); + } + } + + /** + * Grabs the minimum and maximum object ids for the given parameters. + * + * @access public + * + * @param string $id_field The id column in the table to query. + * @param string $object_table The table to query. + * @param string $where A sql where clause without 'WHERE'. + * @param int $bucket_size The maximum amount of objects to include in the query. + * For `term_relationships` table, the bucket size will refer to the amount + * of distinct object ids. This will likely include more database rows than + * the bucket size implies. + * + * @return object An object with min_id and max_id properties. + */ + public function get_min_max_object_id( $id_field, $object_table, $where, $bucket_size ) { + global $wpdb; + + // The term relationship table's unique key is a combination of 2 columns. `DISTINCT` helps us get a more acurate query. + $distinct_sql = ( $wpdb->term_relationships === $object_table ) ? 'DISTINCT' : ''; + $where_sql = $where ? "WHERE $where" : ''; + + // Since MIN() and MAX() do not work with LIMIT, we'll need to adjust the dataset we query if a limit is present. + // With a limit present, we'll look at a dataset consisting of object_ids that meet the constructs of the $where clause. + // Without a limit, we can use the actual table as a dataset. + $from = $bucket_size ? + "( SELECT $distinct_sql $id_field FROM $object_table $where_sql ORDER BY $id_field ASC LIMIT $bucket_size ) as ids" : + "$object_table $where_sql ORDER BY $id_field ASC"; + + return $wpdb->get_row( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT MIN($id_field) as min, MAX($id_field) as max FROM $from" + ); + } + + /** + * Retrieve the checksum histogram for a specific object type. + * + * @access public + * + * @param string $table Object type. + * @param null $buckets Number of buckets to split the objects to. + * @param null $start_id Minimum object ID. + * @param null $end_id Maximum object ID. + * @param null $columns Table columns to calculate the checksum from. + * @param bool $strip_non_ascii Whether to strip non-ASCII characters. + * @param string $salt Salt, used for $wpdb->prepare()'s args. + * @param bool $only_range_edges Only return the range edges and not the actual checksums. + * @param bool $detailed_drilldown If the call should return a detailed drilldown for the checksum or only the checksum. + * @param bool $perform_text_conversion If text fields should be converted to latin1 during the checksum calculation. + * + * @return array|WP_Error The checksum histogram. + * @throws Exception Throws an exception if data validation fails inside `Table_Checksum` calls. + */ + public function checksum_histogram( $table, $buckets = null, $start_id = null, $end_id = null, $columns = null, $strip_non_ascii = true, $salt = '', $only_range_edges = false, $detailed_drilldown = false, $perform_text_conversion = false ) { + global $wpdb; + + $wpdb->queries = array(); + try { + $checksum_table = $this->get_table_checksum_instance( $table, $salt, $perform_text_conversion ); + } catch ( Exception $ex ) { + return new WP_Error( 'checksum_disabled', $ex->getMessage() ); + } + + // Validate / Determine Buckets. + if ( $buckets === null || $buckets < 1 ) { + $buckets = $this->calculate_buckets( $table, $start_id, $end_id ); + } + if ( is_wp_error( $buckets ) ) { + return $buckets; + } + + $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); + + if ( $only_range_edges ) { + return $range_edges; + } + + $object_count = (int) $range_edges['item_count']; + + if ( 0 === $object_count ) { + return array(); + } + + $bucket_size = (int) ceil( $object_count / $buckets ); + $previous_max_id = max( 0, $range_edges['min_range'] ); + $histogram = array(); + + do { + $ids_range = $checksum_table->get_range_edges( $previous_max_id, null, $bucket_size ); + + if ( empty( $ids_range['min_range'] ) || empty( $ids_range['max_range'] ) ) { + // Nothing to checksum here... + break; + } + + // Get the checksum value. + $batch_checksum = $checksum_table->calculate_checksum( $ids_range['min_range'], $ids_range['max_range'], null, $detailed_drilldown ); + + if ( is_wp_error( $batch_checksum ) ) { + return $batch_checksum; + } + + if ( $ids_range['min_range'] === $ids_range['max_range'] ) { + $histogram[ $ids_range['min_range'] ] = $batch_checksum; + } else { + $histogram[ "{$ids_range[ 'min_range' ]}-{$ids_range[ 'max_range' ]}" ] = $batch_checksum; + } + + $previous_max_id = $ids_range['max_range'] + 1; + // If we've reached the max_range lets bail out. + if ( $previous_max_id > $range_edges['max_range'] ) { + break; + } + } while ( true ); + + return $histogram; + } + + /** + * Retrieve the type of the checksum. + * + * @access public + * + * @return string Type of the checksum. + */ + public function get_checksum_type() { + return 'sum'; + } + + /** + * Used in methods that are not implemented and shouldn't be invoked. + * + * @access private + * @throws Exception If this method is invoked. + */ + private function invalid_call() { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + $backtrace = debug_backtrace(); + $caller = $backtrace[1]['function']; + throw new Exception( "This function $caller is not supported on the WP Replicastore" ); + } + + /** + * Determine number of buckets to use in full table checksum. + * + * @param string $table Object Type. + * @param int $start_id Min Object ID. + * @param int $end_id Max Object ID. + * @return int|WP_Error Number of Buckets to use. + */ + private function calculate_buckets( $table, $start_id = null, $end_id = null ) { + // Get # of objects. + try { + $checksum_table = $this->get_table_checksum_instance( $table ); + } catch ( Exception $ex ) { + return new WP_Error( 'checksum_disabled', $ex->getMessage() ); + } + $range_edges = $checksum_table->get_range_edges( $start_id, $end_id ); + $object_count = $range_edges['item_count']; + + // Ensure no division by 0. + if ( 0 === (int) $object_count ) { + return 1; + } + + // Default Bucket sizes. + $bucket_size = 10000; // Default bucket size is 10,000 items. + switch ( $table ) { + case 'postmeta': + case 'commentmeta': + case 'order_itemmeta': + $bucket_size = 1000; // Meta bucket size is restricted to 1000 items. + } + + return (int) ceil( $object_count / $bucket_size ); + } + + /** + * Return an instance for `Table_Checksum`, depending on the table. + * + * Some tables require custom instances, due to different checksum logic. + * + * @param string $table The table that we want to get the instance for. + * @param null $salt Salt to be used when generating the checksums. + * @param false $perform_text_conversion Should we perform text encoding conversion when calculating the checksum. + * + * @return Table_Checksum|Table_Checksum_Usermeta + * @throws Exception Might throw an exception if any of the input parameters were invalid. + */ + public function get_table_checksum_instance( $table, $salt = null, $perform_text_conversion = false ) { + if ( 'users' === $table ) { + return new Table_Checksum_Users( $table, $salt, $perform_text_conversion ); + } + if ( 'usermeta' === $table ) { + return new Table_Checksum_Usermeta( $table, $salt, $perform_text_conversion ); + } + + return new Table_Checksum( $table, $salt, $perform_text_conversion ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php new file mode 100644 index 00000000..2e29adbb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php @@ -0,0 +1,872 @@ + WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::full_sync_start', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'modules' => array( + 'description' => __( 'Data Modules that should be included in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'users' => array( + 'description' => __( 'User IDs to include in Full Sync or "initial"', 'jetpack-sync' ), + 'required' => false, + ), + 'posts' => array( + 'description' => __( 'Post IDs to include in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'comments' => array( + 'description' => __( 'Comment IDs to include in Full Sync', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + ), + ) + ); + + // Obtain Sync status. + register_rest_route( + 'jetpack/v4', + '/sync/status', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::sync_status', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'fields' => array( + 'description' => __( 'Comma seperated list of additional fields that should be included in status.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + ), + ) + ); + + // Update Sync health status. + register_rest_route( + 'jetpack/v4', + '/sync/health', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::sync_health', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'status' => array( + 'description' => __( 'New Sync health status', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Obtain Sync settings. + register_rest_route( + 'jetpack/v4', + '/sync/settings', + array( + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_sync_settings', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ), + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_sync_settings', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ), + ) + ); + + // Retrieve Sync Object(s). + register_rest_route( + 'jetpack/v4', + '/sync/object', + array( + 'methods' => WP_REST_Server::ALLMETHODS, + 'callback' => __CLASS__ . '::get_sync_objects', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'module_name' => array( + 'description' => __( 'Name of Sync module', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'object_type' => array( + 'description' => __( 'Object Type', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'object_ids' => array( + 'description' => __( 'Objects Identifiers', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + ), + ) + ); + + // Retrieve Sync Object(s). + register_rest_route( + 'jetpack/v4', + '/sync/now', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::do_sync', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'queue' => array( + 'description' => __( 'Name of Sync queue.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Checkout Sync Objects. + register_rest_route( + 'jetpack/v4', + '/sync/checkout', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::checkout', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + + // Checkin Sync Objects. + register_rest_route( + 'jetpack/v4', + '/sync/close', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::close', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + + // Unlock Sync Queue. + register_rest_route( + 'jetpack/v4', + '/sync/unlock', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::unlock_queue', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'queue' => array( + 'description' => __( 'Name of Sync queue.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Retrieve range of Object Ids. + register_rest_route( + 'jetpack/v4', + '/sync/object-id-range', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::get_object_id_range', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'sync_module' => array( + 'description' => __( 'Name of Sync module.', 'jetpack-sync' ), + 'type' => 'string', + 'required' => true, + ), + 'batch_size' => array( + 'description' => __( 'Size of batches', 'jetpack-sync' ), + 'type' => 'int', + 'required' => true, + ), + ), + ) + ); + + // Obtain table checksums. + register_rest_route( + 'jetpack/v4', + '/sync/data-check', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::data_check', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'perform_text_conversion' => array( + 'description' => __( 'If text fields should be converted to latin1 in checksum calculation.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + ), + ) + ); + + // Obtain histogram. + register_rest_route( + 'jetpack/v4', + '/sync/data-histogram', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::data_histogram', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + 'args' => array( + 'columns' => array( + 'description' => __( 'Column mappings', 'jetpack-sync' ), + 'type' => 'array', + 'required' => false, + ), + 'object_type' => array( + 'description' => __( 'Object Type', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'buckets' => array( + 'description' => __( 'Number of histogram buckets.', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'start_id' => array( + 'description' => __( 'Start ID for the histogram', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'end_id' => array( + 'description' => __( 'End ID for the histogram', 'jetpack-sync' ), + 'type' => 'int', + 'required' => false, + ), + 'strip_non_ascii' => array( + 'description' => __( 'Strip non-ascii characters?', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'shared_salt' => array( + 'description' => __( 'Shared Salt to use when generating checksum', 'jetpack-sync' ), + 'type' => 'string', + 'required' => false, + ), + 'only_range_edges' => array( + 'description' => __( 'Should only range endges be returned', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'detailed_drilldown' => array( + 'description' => __( 'Do we want the checksum or object ids.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + 'perform_text_conversion' => array( + 'description' => __( 'If text fields should be converted to latin1 in checksum calculation.', 'jetpack-sync' ), + 'type' => 'boolean', + 'required' => false, + ), + ), + ) + ); + + // Trigger Dedicated Sync request. + register_rest_route( + 'jetpack/v4', + '/sync/spawn-sync', + array( + 'methods' => WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::spawn_sync', + 'permission_callback' => '__return_true', + ) + ); + + // Reset Sync locks. + register_rest_route( + 'jetpack/v4', + '/sync/locks', + array( + 'methods' => WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::reset_locks', + 'permission_callback' => __CLASS__ . '::verify_default_permissions', + ) + ); + } + + /** + * Trigger a Full Sync of specified modules. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response|WP_Error + */ + public static function full_sync_start( $request ) { + + $modules = $request->get_param( 'modules' ); + + // convert list of modules into array format of "$modulename => true". + if ( ! empty( $modules ) ) { + $modules = array_map( '__return_true', array_flip( $modules ) ); + } + + // Process additional options. + foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) { + if ( 'users' === $module_name && 'initial' === $request->get_param( 'users' ) ) { + $modules['users'] = 'initial'; + } elseif ( is_array( $request->get_param( $module_name ) ) ) { + $ids = $request->get_param( $module_name ); + if ( count( $ids ) > 0 ) { + $modules[ $module_name ] = $ids; + } + } + } + + if ( empty( $modules ) ) { + $modules = null; + } + + return rest_ensure_response( + array( + 'scheduled' => Actions::do_full_sync( $modules ), + ) + ); + } + + /** + * Return Sync's status. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function sync_status( $request ) { + $fields = $request->get_param( 'fields' ); + return rest_ensure_response( Actions::get_sync_status( $fields ) ); + } + + /** + * Return table checksums. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function data_check( $request ) { + // Disable Sync during this call, so we can resolve faster. + Actions::mark_sync_read_only(); + $store = new Replicastore(); + + $perform_text_conversion = false; + if ( true === $request->get_param( 'perform_text_conversion' ) ) { + $perform_text_conversion = true; + } + + return rest_ensure_response( $store->checksum_all( $perform_text_conversion ) ); + } + + /** + * Return Histogram. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function data_histogram( $request ) { + + // Disable Sync during this call, so we can resolve faster. + Actions::mark_sync_read_only(); + + $args = $request->get_params(); + + if ( empty( $args['columns'] ) ) { + $args['columns'] = null; // go with defaults. + } + + if ( false !== $args['strip_non_ascii'] ) { + $args['strip_non_ascii'] = true; + } + + if ( true !== $args['perform_text_conversion'] ) { + $args['perform_text_conversion'] = false; + } + + /** + * Hack: nullify the values of `start_id` and `end_id` if we're only requesting ranges. + * + * The endpoint doesn't support nullable values :( + */ + if ( true === $args['only_range_edges'] ) { + if ( 0 === $args['start_id'] ) { + $args['start_id'] = null; + } + + if ( 0 === $args['end_id'] ) { + $args['end_id'] = null; + } + } + + $store = new Replicastore(); + $histogram = $store->checksum_histogram( $args['object_type'], $args['buckets'], $args['start_id'], $args['end_id'], $args['columns'], $args['strip_non_ascii'], $args['shared_salt'], $args['only_range_edges'], $args['detailed_drilldown'], $args['perform_text_conversion'] ); + + return rest_ensure_response( + array( + 'histogram' => $histogram, + 'type' => $store->get_checksum_type(), + ) + ); + } + + /** + * Update Sync health. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function sync_health( $request ) { + + switch ( $request->get_param( 'status' ) ) { + case Health::STATUS_IN_SYNC: + case Health::STATUS_OUT_OF_SYNC: + Health::update_status( $request->get_param( 'status' ) ); + break; + default: + return new WP_Error( 'invalid_status', 'Invalid Sync Status Provided.' ); + } + + // re-fetch so we see what's really being stored. + return rest_ensure_response( + array( + 'success' => Health::get_status(), + ) + ); + } + + /** + * Obtain Sync settings. + * + * @since 1.23.1 + * + * @return \WP_REST_Response + */ + public static function get_sync_settings() { + return rest_ensure_response( Settings::get_settings() ); + } + + /** + * Update Sync settings. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function update_sync_settings( $request ) { + $args = $request->get_params(); + $sync_settings = Settings::get_settings(); + + foreach ( $args as $key => $value ) { + if ( false !== $value ) { + if ( is_numeric( $value ) ) { + $value = (int) $value; + } + + // special case for sending empty arrays - a string with value 'empty'. + if ( 'empty' === $value ) { + $value = array(); + } + + $sync_settings[ $key ] = $value; + } + } + + Settings::update_settings( $sync_settings ); + + // re-fetch so we see what's really being stored. + return rest_ensure_response( Settings::get_settings() ); + } + + /** + * Retrieve Sync Objects. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function get_sync_objects( $request ) { + $args = $request->get_params(); + + $module_name = $args['module_name']; + // Verify valid Sync Module. + $sync_module = Modules::get_module( $module_name ); + if ( ! $sync_module ) { + return new WP_Error( 'invalid_module', 'You specified an invalid sync module' ); + } + + Actions::mark_sync_read_only(); + + $codec = Sender::get_instance()->get_codec(); + Settings::set_is_syncing( true ); + $objects = $codec->encode( $sync_module->get_objects_by_id( $args['object_type'], $args['object_ids'] ) ); + Settings::set_is_syncing( false ); + + return rest_ensure_response( + array( + 'objects' => $objects, + 'codec' => $codec->name(), + ) + ); + } + + /** + * Request Sync processing. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function do_sync( $request ) { + + $queue_name = self::validate_queue( $request->get_param( 'queue' ) ); + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + $sender = Sender::get_instance(); + $response = $sender->do_sync_for_queue( new Queue( $queue_name ) ); + + return rest_ensure_response( + array( + 'response' => $response, + ) + ); + } + + /** + * Request sync data from specified queue. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function checkout( $request ) { + $args = $request->get_params(); + $queue_name = self::validate_queue( $args['queue'] ); + + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + $number_of_items = $args['number_of_items']; + if ( $number_of_items < 1 || $number_of_items > 100 ) { + return new WP_Error( 'invalid_number_of_items', 'Number of items needs to be an integer that is larger than 0 and less then 100', 400 ); + } + + // REST Sender. + $sender = new REST_Sender(); + + if ( 'immediate' === $queue_name ) { + return rest_ensure_response( $sender->immediate_full_sync_pull( $number_of_items ) ); + } + + return rest_ensure_response( $sender->queue_pull( $queue_name, $number_of_items, $args ) ); + } + + /** + * Unlock a Sync queue. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function unlock_queue( $request ) { + + $queue_name = $request->get_param( 'queue' ); + + if ( ! in_array( $queue_name, array( 'sync', 'full_sync' ), true ) ) { + return new WP_Error( 'invalid_queue', 'Queue name should be sync or full_sync', 400 ); + } + $queue = new Queue( $queue_name ); + + // False means that there was no lock to delete. + $response = $queue->unlock(); + return rest_ensure_response( + array( + 'success' => $response, + ) + ); + } + + /** + * Checkin Sync actions. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function close( $request ) { + + $request_body = $request->get_params(); + $queue_name = self::validate_queue( $request_body['queue'] ); + + if ( is_wp_error( $queue_name ) ) { + return $queue_name; + } + + if ( empty( $request_body['buffer_id'] ) ) { + return new WP_Error( 'missing_buffer_id', 'Please provide a buffer id', 400 ); + } + + if ( ! is_array( $request_body['item_ids'] ) ) { + return new WP_Error( 'missing_item_ids', 'Please provide a list of item ids in the item_ids argument', 400 ); + } + + // Limit to A-Z,a-z,0-9,_,- . + $request_body['buffer_id'] = preg_replace( '/[^A-Za-z0-9]/', '', $request_body['buffer_id'] ); + $request_body['item_ids'] = array_filter( array_map( array( 'Automattic\Jetpack\Sync\REST_Endpoints', 'sanitize_item_ids' ), $request_body['item_ids'] ) ); + + $queue = new Queue( $queue_name ); + + $items = $queue->peek_by_id( $request_body['item_ids'] ); + + // Update Full Sync Status if queue is "full_sync". + if ( 'full_sync' === $queue_name ) { + $full_sync_module = Modules::get_module( 'full-sync' ); + $full_sync_module->update_sent_progress_action( $items ); + } + + $buffer = new Queue_Buffer( $request_body['buffer_id'], $request_body['item_ids'] ); + $response = $queue->close( $buffer, $request_body['item_ids'] ); + + // Perform another checkout? + if ( isset( $request_body['continue'] ) && $request_body['continue'] ) { + if ( in_array( $queue_name, array( 'full_sync', 'immediate' ), true ) ) { + // Send Full Sync Actions. + Sender::get_instance()->do_full_sync(); + } elseif ( $queue->has_any_items() ) { + // Send Incremental Sync Actions. + Sender::get_instance()->do_sync(); + } + } + + if ( is_wp_error( $response ) ) { + return $response; + } + + return rest_ensure_response( + array( + 'success' => $response, + 'status' => Actions::get_sync_status(), + ) + ); + } + + /** + * Retrieve range of Object Ids for a specified Sync module. + * + * @since 1.23.1 + * + * @param \WP_REST_Request $request The request sent to the WP REST API. + * + * @return \WP_REST_Response + */ + public static function get_object_id_range( $request ) { + + $module_name = $request->get_param( 'sync_module' ); + $batch_size = $request->get_param( 'batch_size' ); + + if ( ! self::is_valid_sync_module( $module_name ) ) { + return new WP_Error( 'invalid_module', 'This sync module cannot be used to calculate a range.', 400 ); + } + $module = Modules::get_module( $module_name ); + + return rest_ensure_response( + array( + 'ranges' => $module->get_min_max_object_ids_for_batches( $batch_size ), + ) + ); + } + + /** + * This endpoint is used by Sync to spawn a + * dedicated Sync request which will trigger Sync to run. + * + * If Dedicated Sync is enabled, this callback should never run as + * processing of Sync actions will occur earlier and exit. + * + * @see Actions::init + * @see Sender::do_dedicated_sync_and_exit + * + * @since $$next_version$$ + * + * @return \WP_REST_Response + */ + public static function spawn_sync() { + nocache_headers(); + + if ( ! Settings::is_dedicated_sync_enabled() ) { + return new WP_Error( + 'dedicated_sync_disabled', + 'Dedicated Sync flow is disabled.', + array( 'status' => 422 ) + ); + } + + return new WP_Error( + 'dedicated_sync_failed', + 'Failed to process Dedicated Sync request', + array( 'status' => 500 ) + ); + } + + /** + * Reset Sync locks. + * + * @since 1.43.0 + * + * @return \WP_REST_Response + */ + public static function reset_locks() { + Actions::reset_sync_locks(); + + return rest_ensure_response( + array( + 'success' => true, + ) + ); + } + + /** + * Verify that request has default permissions to perform sync actions. + * + * @since 1.23.1 + * + * @return bool Whether user has capability 'manage_options' or a blog token is used. + */ + public static function verify_default_permissions() { + if ( current_user_can( 'manage_options' ) || Rest_Authentication::is_signed_with_blog_token() ) { + return true; + } + + $error_msg = esc_html__( + 'You do not have the correct user permissions to perform this action. + Please contact your site admin if you think this is a mistake.', + 'jetpack-sync' + ); + + return new WP_Error( 'invalid_user_permission_sync', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Validate Queue name. + * + * @param string $value Queue Name. + * + * @return WP_Error + */ + protected static function validate_queue( $value ) { + if ( ! isset( $value ) ) { + return new WP_Error( 'invalid_queue', 'Queue name is required', 400 ); + } + + if ( ! in_array( $value, array( 'sync', 'full_sync', 'immediate' ), true ) ) { + return new WP_Error( 'invalid_queue', 'Queue name should be sync, full_sync or immediate', 400 ); + } + return $value; + } + + /** + * Validate name is a valid Sync module. + * + * @param string $module_name Name of Sync Module. + * + * @return bool + */ + protected static function is_valid_sync_module( $module_name ) { + return in_array( + $module_name, + array( + 'comments', + 'posts', + 'terms', + 'term_relationships', + 'users', + ), + true + ); + } + + /** + * Sanitize Item Ids. + * + * @param string $item Sync item identifier. + * + * @return string|string[]|null + */ + protected static function sanitize_item_ids( $item ) { + // lets not delete any options that don't start with jpsq_sync- . + if ( ! is_string( $item ) || substr( $item, 0, 5 ) !== 'jpsq_' ) { + return null; + } + // Limit to A-Z,a-z,0-9,_,-,. . + return preg_replace( '/[^A-Za-z0-9-_.]/', '', $item ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php new file mode 100644 index 00000000..1c5a2a33 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php @@ -0,0 +1,144 @@ +size() ) { + return new WP_Error( 'queue_size', 'The queue is empty and there is nothing to send', 400 ); + } + + $sender = Sender::get_instance(); + + // try to give ourselves as much time as possible. + set_time_limit( 0 ); + + if ( ! empty( $args['pop'] ) ) { + $buffer = new Queue_Buffer( 'pop', $queue->pop( $number_of_items ) ); + } else { + // let's delete the checkin state. + if ( $args['force'] ) { + $queue->unlock(); + } + $buffer = $this->get_buffer( $queue, $number_of_items ); + } + // Check that the $buffer is not checkout out already. + if ( is_wp_error( $buffer ) ) { + return new WP_Error( 'buffer_open', "We couldn't get the buffer it is currently checked out", 400 ); + } + + if ( ! is_object( $buffer ) ) { + return new WP_Error( 'buffer_non-object', 'Buffer is not an object', 400 ); + } + + $encode = isset( $args['encode'] ) ? $args['encode'] : true; + + Settings::set_is_syncing( true ); + list( $items_to_send, $skipped_items_ids ) = $sender->get_items_to_send( $buffer, $encode ); + Settings::set_is_syncing( false ); + + return array( + 'buffer_id' => $buffer->id, + 'items' => $items_to_send, + 'skipped_items' => $skipped_items_ids, + 'codec' => $encode ? $sender->get_codec()->name() : null, + 'sent_timestamp' => time(), + ); + } + + /** + * Adds Sync items to local property. + */ + public function jetpack_sync_send_data_listener() { + foreach ( func_get_args()[0] as $key => $item ) { + $this->items[ $key ] = $item; + } + } + + /** + * Check out a buffer of full sync actions. + * + * @return array Sync Actions to be returned to requestor + */ + public function immediate_full_sync_pull() { + // try to give ourselves as much time as possible. + set_time_limit( 0 ); + + $original_send_data_cb = array( 'Automattic\Jetpack\Sync\Actions', 'send_data' ); + $temp_send_data_cb = array( $this, 'jetpack_sync_send_data_listener' ); + + Sender::get_instance()->set_enqueue_wait_time( 0 ); + remove_filter( 'jetpack_sync_send_data', $original_send_data_cb ); + add_filter( 'jetpack_sync_send_data', $temp_send_data_cb, 10, 6 ); + Sender::get_instance()->do_full_sync(); + remove_filter( 'jetpack_sync_send_data', $temp_send_data_cb ); + add_filter( 'jetpack_sync_send_data', $original_send_data_cb, 10, 6 ); + + return array( + 'items' => $this->items, + 'codec' => Sender::get_instance()->get_codec()->name(), + 'sent_timestamp' => time(), + 'status' => Actions::get_sync_status(), + ); + } + + /** + * Checkout items out of the sync queue. + * + * @param Queue $queue Sync Queue. + * @param int $number_of_items Number of items to checkout. + * + * @return WP_Error + */ + protected function get_buffer( $queue, $number_of_items ) { + $start = time(); + $max_duration = 5; // this will try to get the buffer. + + $buffer = $queue->checkout( $number_of_items ); + $duration = time() - $start; + + while ( is_wp_error( $buffer ) && $duration < $max_duration ) { + sleep( 2 ); + $duration = time() - $start; + $buffer = $queue->checkout( $number_of_items ); + } + + if ( false === $buffer ) { + return new WP_Error( 'queue_size', 'The queue is empty and there is nothing to send', 400 ); + } + + return $buffer; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php new file mode 100644 index 00000000..9a7981a2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php @@ -0,0 +1,1003 @@ +:( + * + * @access protected + * @static + */ + protected function __construct() { + $this->set_defaults(); + $this->init(); + } + + /** + * Initialize the sender. + * Prepares the current user and initializes all sync modules. + * + * @access private + */ + private function init() { + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_set_user_from_token' ), 1 ); + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_clear_user_from_token' ), 20 ); + add_filter( 'jetpack_xmlrpc_unauthenticated_methods', array( $this, 'register_jetpack_xmlrpc_methods' ) ); + foreach ( Modules::get_modules() as $module ) { + $module->init_before_send(); + } + } + + /** + * Detect if this is a XMLRPC request with a valid signature. + * If so, changes the user to the new one. + * + * @access public + */ + public function maybe_set_user_from_token() { + $connection = new Manager(); + $verified_user = $connection->verify_xml_rpc_signature(); + if ( Constants::is_true( 'XMLRPC_REQUEST' ) && + ! is_wp_error( $verified_user ) + && $verified_user + ) { + $old_user = wp_get_current_user(); + $this->old_user = isset( $old_user->ID ) ? $old_user->ID : 0; + wp_set_current_user( $verified_user['user_id'] ); + } + } + + /** + * If we used to have a previous current user, revert back to it. + * + * @access public + */ + public function maybe_clear_user_from_token() { + if ( isset( $this->old_user ) ) { + wp_set_current_user( $this->old_user ); + } + } + + /** + * Retrieve the next sync time. + * + * Update @since 1.43.2 + * Sometimes when we process Sync requests in Jetpack, the server clock can be a + * bit in the future and this can lock Sync to not send stuff for a while. + * We are introducing an extra check, to make sure to limit the next_sync_time + * to be at most one hour in the future from the current time. + * + * @access public + * + * @param string $queue_name Name of the queue. + * @return float Timestamp of the next sync. + */ + public function get_next_sync_time( $queue_name ) { + $option_name = self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name; + $next_sync_time = (float) get_option( $option_name, 0 ); + + $is_more_than_one_hour = ( $next_sync_time - microtime( true ) ) >= HOUR_IN_SECONDS; + + if ( $is_more_than_one_hour ) { + delete_option( $option_name ); + $next_sync_time = 0; + } + + return $next_sync_time; + } + + /** + * Set the next sync time. + * + * @access public + * + * @param int $time Timestamp of the next sync. + * @param string $queue_name Name of the queue. + * @return boolean True if update was successful, false otherwise. + */ + public function set_next_sync_time( $time, $queue_name ) { + return update_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, $time, true ); + } + + /** + * Trigger a full sync. + * + * @access public + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_full_sync() { + $sync_module = Modules::get_module( 'full-sync' ); + if ( ! $sync_module ) { + return; + } + // Full Sync Disabled. + if ( ! Settings::get_setting( 'full_sync_sender_enabled' ) ) { + return; + } + + // Don't sync if request is marked as read only. + if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) { + return new WP_Error( 'jetpack_sync_read_only' ); + } + + // Sync not started or Sync finished. + $status = $sync_module->get_status(); + if ( false === $status['started'] || ( ! empty( $status['started'] ) && ! empty( $status['finished'] ) ) ) { + return false; + } + + $this->continue_full_sync_enqueue(); + // immediate full sync sends data in continue_full_sync_enqueue. + if ( false === strpos( get_class( $sync_module ), 'Full_Sync_Immediately' ) ) { + return $this->do_sync_and_set_delays( $this->full_sync_queue ); + } else { + $status = $sync_module->get_status(); + // Sync not started or Sync finished. + if ( false === $status['started'] || ( ! empty( $status['started'] ) && ! empty( $status['finished'] ) ) ) { + return false; + } else { + return true; + } + } + } + + /** + * Enqueue the next sync items for sending. + * Will not be done if the current request is a WP import one. + * Will be delayed until the next sync time comes. + * + * @access private + */ + private function continue_full_sync_enqueue() { + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { + return false; + } + + if ( $this->get_next_sync_time( 'full-sync-enqueue' ) > microtime( true ) ) { + return false; + } + + Modules::get_module( 'full-sync' )->continue_enqueuing(); + + $this->set_next_sync_time( time() + $this->get_enqueue_wait_time(), 'full-sync-enqueue' ); + } + + /** + * Trigger incremental sync. + * + * @access public + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync() { + if ( ! Settings::is_dedicated_sync_enabled() ) { + $result = $this->do_sync_and_set_delays( $this->sync_queue ); + } else { + $result = Dedicated_Sender::spawn_sync( $this->sync_queue ); + } + + return $result; + } + + /** + * Trigger incremental sync and early exit on Dedicated Sync request. + * + * @access public + * + * @param bool $do_real_exit If we should exit at the end of the request. We should by default. + * In the context of running this in the REST API, we actually want to return an error. + * + * @return void|WP_Error + */ + public function do_dedicated_sync_and_exit( $do_real_exit = true ) { + nocache_headers(); + + if ( ! Settings::is_dedicated_sync_enabled() ) { + return new WP_Error( 'dedicated_sync_disabled', 'Dedicated Sync flow is disabled.' ); + } + + if ( ! Dedicated_Sender::is_dedicated_sync_request() ) { + return new WP_Error( 'non_dedicated_sync_request', 'Not a Dedicated Sync request.' ); + } + + /** + * Output an `OK` to show that Dedicated Sync is enabled and we can process events. + * This is used to test the feature is working. + * + * @see \Automattic\Jetpack\Sync\Dedicated_Sender::can_spawn_dedicated_sync_request + */ + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo Dedicated_Sender::DEDICATED_SYNC_VALIDATION_STRING; + + // Try to disconnect the request as quickly as possible and process things in the background. + $this->fastcgi_finish_request(); + + /** + * Close the PHP session to free up the server threads to handle other requests while we + * send sync data with Dedicated Sync. + * + * When we spawn Dedicated Sync, we send `$_COOKIES` with the request to help out with any + * firewall and/or caching functionality that might prevent us to ping the site directly. + * + * This will cause Dedicated Sync to reuse the visitor's PHP session and lock it until the + * request finishes, which can take anywhere from 1 to 30+ seconds, depending on the server + * `max_execution_time` configuration. + * + * By closing the session we're freeing up the session, so other requests can acquire the + * lock and proceed with their own tasks. + */ + if ( session_status() === PHP_SESSION_ACTIVE ) { + session_write_close(); + } + + // Output not used right now. Try to release dedicated sync lock + Dedicated_Sender::try_release_lock_spawn_request(); + + // Actually try to send Sync events. + $result = $this->do_sync_and_set_delays( $this->sync_queue ); + + // If no errors occurred, re-spawn a dedicated Sync request. + if ( true === $result ) { + Dedicated_Sender::spawn_sync( $this->sync_queue ); + } + + if ( $do_real_exit ) { + exit; + } + } + + /** + * Trigger sync for a certain sync queue. + * Responsible for setting next sync time. + * Will not be delayed if the current request is a WP import one. + * Will be delayed until the next sync time comes. + * + * @access public + * + * @param Automattic\Jetpack\Sync\Queue $queue Queue object. + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync_and_set_delays( $queue ) { + // Don't sync if importing. + if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { + return new WP_Error( 'is_importing' ); + } + + // Don't sync if request is marked as read only. + if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) { + return new WP_Error( 'jetpack_sync_read_only' ); + } + + if ( ! Settings::is_sender_enabled( $queue->id ) ) { + return new WP_Error( 'sender_disabled_for_queue_' . $queue->id ); + } + + // Return early if we've gotten a retry-after header response. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . $queue->id ); + if ( $retry_time ) { + // If expired update to false but don't send. Send will occurr in new request to avoid race conditions. + if ( microtime( true ) > $retry_time ) { + update_option( Actions::RETRY_AFTER_PREFIX . $queue->id, false, false ); + } + return new WP_Error( 'retry_after' ); + } + + // Don't sync if we are throttled. + if ( $this->get_next_sync_time( $queue->id ) > microtime( true ) ) { + return new WP_Error( 'sync_throttled' ); + } + + $start_time = microtime( true ); + + Settings::set_is_syncing( true ); + + $sync_result = $this->do_sync_for_queue( $queue ); + + Settings::set_is_syncing( false ); + + $exceeded_sync_wait_threshold = ( microtime( true ) - $start_time ) > (float) $this->get_sync_wait_threshold(); + + if ( is_wp_error( $sync_result ) ) { + if ( 'unclosed_buffer' === $sync_result->get_error_code() ) { + $this->set_next_sync_time( time() + self::QUEUE_LOCKED_SYNC_DELAY, $queue->id ); + } + if ( 'wpcom_error' === $sync_result->get_error_code() ) { + $this->set_next_sync_time( time() + self::WPCOM_ERROR_SYNC_DELAY, $queue->id ); + } + } elseif ( $exceeded_sync_wait_threshold ) { + // If we actually sent data and it took a while, wait before sending again. + $this->set_next_sync_time( time() + $this->get_sync_wait_time(), $queue->id ); + } + + return $sync_result; + } + + /** + * Retrieve the next sync items to send. + * + * @access public + * + * @param (array|Automattic\Jetpack\Sync\Queue_Buffer) $buffer_or_items Queue buffer or array of objects. + * @param boolean $encode Whether to encode the items. + * @return array Sync items to send. + */ + public function get_items_to_send( $buffer_or_items, $encode = true ) { + // Track how long we've been processing so we can avoid request timeouts. + $start_time = microtime( true ); + $upload_size = 0; + $items_to_send = array(); + $items = is_array( $buffer_or_items ) ? $buffer_or_items : $buffer_or_items->get_items(); + if ( ! is_array( $items ) ) { + $items = array(); + } + + // Set up current screen to avoid errors rendering content. + require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php'; + require_once ABSPATH . 'wp-admin/includes/screen.php'; + set_current_screen( 'sync' ); + $skipped_items_ids = array(); + /** + * We estimate the total encoded size as we go by encoding each item individually. + * This is expensive, but the only way to really know :/ + */ + foreach ( $items as $key => $item ) { + // Suspending cache addition help prevent overloading in memory cache of large sites. + wp_suspend_cache_addition( true ); + /** + * Modify the data within an action before it is serialized and sent to the server + * For example, during full sync this expands Post ID's into full Post objects, + * so that we don't have to serialize the whole object into the queue. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array The action parameters + * @param int The ID of the user who triggered the action + */ + $item[1] = apply_filters( 'jetpack_sync_before_send_' . $item[0], $item[1], $item[2] ); + wp_suspend_cache_addition( false ); + // Serialization usage can lead to empty, null or false action_name. Lets skip as there is no information to send. + if ( empty( $item[0] ) || false === $item[1] ) { + $skipped_items_ids[] = $key; + continue; + } + $encoded_item = $this->codec->encode( $item ); + $upload_size += strlen( $encoded_item ); + if ( $upload_size > $this->upload_max_bytes && count( $items_to_send ) > 0 ) { + break; + } + $items_to_send[ $key ] = $encode ? $encoded_item : $item; + if ( microtime( true ) - $start_time > $this->max_dequeue_time ) { + break; + } + } + + return array( $items_to_send, $skipped_items_ids, $items, microtime( true ) - $start_time ); + } + + /** + * If supported, flush all response data to the client and finish the request. + * This allows for time consuming tasks to be performed without leaving the connection open. + * + * @access private + */ + private function fastcgi_finish_request() { + if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) { + fastcgi_finish_request(); + } + } + + /** + * Perform sync for a certain sync queue. + * + * @access public + * + * @param Automattic\Jetpack\Sync\Queue $queue Queue object. + * + * @return boolean|WP_Error True if this sync sending was successful, error object otherwise. + */ + public function do_sync_for_queue( $queue ) { + do_action( 'jetpack_sync_before_send_queue_' . $queue->id ); + if ( $queue->size() === 0 ) { + return new WP_Error( 'empty_queue_' . $queue->id ); + } + + /** + * Now that we're sure we are about to sync, try to ignore user abort + * so we can avoid getting into a bad state. + */ + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } + + /* Don't make the request block till we finish, if possible. */ + if ( Constants::is_true( 'REST_REQUEST' ) || Constants::is_true( 'XMLRPC_REQUEST' ) ) { + $this->fastcgi_finish_request(); + } + + $checkout_start_time = microtime( true ); + + $buffer = $queue->checkout_with_memory_limit( $this->dequeue_max_bytes, $this->upload_max_rows ); + + if ( ! $buffer ) { + // Buffer has no items. + return new WP_Error( 'empty_buffer' ); + } + + if ( is_wp_error( $buffer ) ) { + return $buffer; + } + + $checkout_duration = microtime( true ) - $checkout_start_time; + + list( $items_to_send, $skipped_items_ids, $items, $preprocess_duration ) = $this->get_items_to_send( $buffer, true ); + if ( ! empty( $items_to_send ) ) { + /** + * Fires when data is ready to send to the server. + * Return false or WP_Error to abort the sync (e.g. if there's an error) + * The items will be automatically re-sent later + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array $data The action buffer + * @param string $codec The codec name used to encode the data + * @param double $time The current time + * @param string $queue The queue used to send ('sync' or 'full_sync') + * @param float $checkout_duration The duration of the checkout operation. + * @param float $preprocess_duration The duration of the pre-process operation. + * @param int $queue_size The size of the sync queue at the time of processing. + */ + Settings::set_is_sending( true ); + $processed_item_ids = apply_filters( 'jetpack_sync_send_data', $items_to_send, $this->codec->name(), microtime( true ), $queue->id, $checkout_duration, $preprocess_duration, $queue->size(), $buffer->id ); + Settings::set_is_sending( false ); + } else { + $processed_item_ids = $skipped_items_ids; + $skipped_items_ids = array(); + } + + if ( 'non-blocking' !== $processed_item_ids ) { + if ( ! $processed_item_ids || is_wp_error( $processed_item_ids ) ) { + $checked_in_item_ids = $queue->checkin( $buffer ); + if ( is_wp_error( $checked_in_item_ids ) ) { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log + error_log( 'Error checking in buffer: ' . $checked_in_item_ids->get_error_message() ); + $queue->force_checkin(); + } + if ( is_wp_error( $processed_item_ids ) ) { + return new WP_Error( 'wpcom_error', $processed_item_ids->get_error_code() ); + } + + // Returning a wpcom_error is a sign to the caller that we should wait a while before syncing again. + return new WP_Error( 'wpcom_error', 'jetpack_sync_send_data_false' ); + } else { + // Detect if the last item ID was an error. + $had_wp_error = is_wp_error( end( $processed_item_ids ) ); + if ( $had_wp_error ) { + $wp_error = array_pop( $processed_item_ids ); + } + // Also checkin any items that were skipped. + if ( count( $skipped_items_ids ) > 0 ) { + $processed_item_ids = array_merge( $processed_item_ids, $skipped_items_ids ); + } + $processed_items = array_intersect_key( $items, array_flip( $processed_item_ids ) ); + /** + * Allows us to keep track of all the actions that have been sent. + * Allows us to calculate the progress of specific actions. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array $processed_actions The actions that we send successfully. + */ + do_action( 'jetpack_sync_processed_actions', $processed_items ); + $queue->close( $buffer, $processed_item_ids ); + // Returning a WP_Error is a sign to the caller that we should wait a while before syncing again. + if ( $had_wp_error ) { + return new WP_Error( 'wpcom_error', $wp_error->get_error_code() ); + } + } + } + + return true; + } + + /** + * Immediately sends a single item without firing or enqueuing it + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + * + * @return Items processed. TODO: this doesn't make much sense anymore, it should probably be just a bool. + */ + public function send_action( $action_name, $data = null ) { + if ( ! Settings::is_sender_enabled( 'full_sync' ) ) { + return array(); + } + + // Compose the data to be sent. + $action_to_send = $this->create_action_to_send( $action_name, $data ); + + list( $items_to_send, $skipped_items_ids, $items, $preprocess_duration ) = $this->get_items_to_send( $action_to_send, true ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + Settings::set_is_sending( true ); + $processed_item_ids = apply_filters( 'jetpack_sync_send_data', $items_to_send, $this->get_codec()->name(), microtime( true ), 'immediate-send', 0, $preprocess_duration ); + Settings::set_is_sending( false ); + + /** + * Allows us to keep track of all the actions that have been sent. + * Allows us to calculate the progress of specific actions. + * + * @param array $processed_actions The actions that we send successfully. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_processed_actions', $action_to_send ); + + return $processed_item_ids; + } + + /** + * Create an synthetic action for direct sending to WPCOM during full sync (for example) + * + * @access private + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + * @return array An array of synthetic sync actions keyed by current microtime(true) + */ + private function create_action_to_send( $action_name, $data ) { + return array( + (string) microtime( true ) => array( + $action_name, + $data, + get_current_user_id(), + microtime( true ), + Settings::is_importing(), + ), + ); + } + + /** + * Returns any object that is able to be synced. + * + * @access public + * + * @param array $args the synchronized object parameters. + * @return string Encoded sync object. + */ + public function sync_object( $args ) { + // For example: posts, post, 5. + list( $module_name, $object_type, $id ) = $args; + + $sync_module = Modules::get_module( $module_name ); + $codec = $this->get_codec(); + + return $codec->encode( $sync_module->get_object_by_id( $object_type, $id ) ); + } + + /** + * Register additional sync XML-RPC methods available to Jetpack for authenticated users. + * + * @access public + * @since 1.6.3 + * @since-jetpack 7.8.0 + * + * @param array $jetpack_methods XML-RPC methods available to the Jetpack Server. + * @return array Filtered XML-RPC methods. + */ + public function register_jetpack_xmlrpc_methods( $jetpack_methods ) { + $jetpack_methods['jetpack.syncObject'] = array( $this, 'sync_object' ); + return $jetpack_methods; + } + + /** + * Get the incremental sync queue object. + * + * @access public + * + * @return Automattic\Jetpack\Sync\Queue Queue object. + */ + public function get_sync_queue() { + return $this->sync_queue; + } + + /** + * Get the full sync queue object. + * + * @access public + * + * @return Automattic\Jetpack\Sync\Queue Queue object. + */ + public function get_full_sync_queue() { + return $this->full_sync_queue; + } + + /** + * Get the codec object. + * + * @access public + * + * @return Automattic\Jetpack\Sync\Codec_Interface Codec object. + */ + public function get_codec() { + return $this->codec; + } + + /** + * Determine the codec object. + * Use gzip deflate if supported. + * + * @access public + */ + public function set_codec() { + if ( function_exists( 'gzinflate' ) ) { + $this->codec = new JSON_Deflate_Array_Codec(); + } else { + $this->codec = new Simple_Codec(); + } + } + + /** + * Compute and send all the checksums. + * + * @access public + */ + public function send_checksum() { + $store = new Replicastore(); + do_action( 'jetpack_sync_checksum', $store->checksum_all() ); + } + + /** + * Reset the incremental sync queue. + * + * @access public + */ + public function reset_sync_queue() { + $this->sync_queue->reset(); + } + + /** + * Reset the full sync queue. + * + * @access public + */ + public function reset_full_sync_queue() { + $this->full_sync_queue->reset(); + } + + /** + * Set the maximum bytes to checkout without exceeding the memory limit. + * + * @access public + * + * @param int $size Maximum bytes to checkout. + */ + public function set_dequeue_max_bytes( $size ) { + $this->dequeue_max_bytes = $size; + } + + /** + * Set the maximum bytes in a single encoded item. + * + * @access public + * + * @param int $max_bytes Maximum bytes in a single encoded item. + */ + public function set_upload_max_bytes( $max_bytes ) { + $this->upload_max_bytes = $max_bytes; + } + + /** + * Set the maximum number of sync items in a single action. + * + * @access public + * + * @param int $max_rows Maximum number of sync items. + */ + public function set_upload_max_rows( $max_rows ) { + $this->upload_max_rows = $max_rows; + } + + /** + * Set the sync wait time (in seconds). + * + * @access public + * + * @param int $seconds Sync wait time. + */ + public function set_sync_wait_time( $seconds ) { + $this->sync_wait_time = $seconds; + } + + /** + * Get current sync wait time (in seconds). + * + * @access public + * + * @return int Sync wait time. + */ + public function get_sync_wait_time() { + return $this->sync_wait_time; + } + + /** + * Set the enqueue wait time (in seconds). + * + * @access public + * + * @param int $seconds Enqueue wait time. + */ + public function set_enqueue_wait_time( $seconds ) { + $this->enqueue_wait_time = $seconds; + } + + /** + * Get current enqueue wait time (in seconds). + * + * @access public + * + * @return int Enqueue wait time. + */ + public function get_enqueue_wait_time() { + return $this->enqueue_wait_time; + } + + /** + * Set the sync wait threshold (in seconds). + * + * @access public + * + * @param int $seconds Sync wait threshold. + */ + public function set_sync_wait_threshold( $seconds ) { + $this->sync_wait_threshold = $seconds; + } + + /** + * Get current sync wait threshold (in seconds). + * + * @access public + * + * @return int Sync wait threshold. + */ + public function get_sync_wait_threshold() { + return $this->sync_wait_threshold; + } + + /** + * Set the maximum time for perfirming a checkout of items from the queue (in seconds). + * + * @access public + * + * @param int $seconds Maximum dequeue time. + */ + public function set_max_dequeue_time( $seconds ) { + $this->max_dequeue_time = $seconds; + } + + /** + * Initialize the sync queues, codec and set the default settings. + * + * @access public + */ + public function set_defaults() { + $this->sync_queue = new Queue( 'sync' ); + $this->full_sync_queue = new Queue( 'full_sync' ); + $this->set_codec(); + + // Saved settings. + Settings::set_importing( null ); + $settings = Settings::get_settings(); + $this->set_dequeue_max_bytes( $settings['dequeue_max_bytes'] ); + $this->set_upload_max_bytes( $settings['upload_max_bytes'] ); + $this->set_upload_max_rows( $settings['upload_max_rows'] ); + $this->set_sync_wait_time( $settings['sync_wait_time'] ); + $this->set_enqueue_wait_time( $settings['enqueue_wait_time'] ); + $this->set_sync_wait_threshold( $settings['sync_wait_threshold'] ); + $this->set_max_dequeue_time( Defaults::get_max_sync_execution_time() ); + } + + /** + * Reset sync queues, modules and settings. + * + * @access public + */ + public function reset_data() { + $this->reset_sync_queue(); + $this->reset_full_sync_queue(); + + foreach ( Modules::get_modules() as $module ) { + $module->reset_data(); + } + // Reset Sync locks without unlocking queues since we already reset those. + Actions::reset_sync_locks( false ); + + Settings::reset_data(); + } + + /** + * Perform cleanup at the event of plugin uninstallation. + * + * @access public + */ + public function uninstall() { + // Lets delete all the other fun stuff like transient and option and the sync queue. + $this->reset_data(); + + // Delete the full sync status. + delete_option( 'jetpack_full_sync_status' ); + + // Clear the sync cron. + wp_clear_scheduled_hook( 'jetpack_sync_cron' ); + wp_clear_scheduled_hook( 'jetpack_sync_full_cron' ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php new file mode 100644 index 00000000..7b6d0545 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-server.php @@ -0,0 +1,195 @@ +:( + * + * @access public + */ + public function __construct() { + $this->codec = new JSON_Deflate_Array_Codec(); + } + + /** + * Set the codec instance. + * + * @access public + * + * @param Automattic\Jetpack\Sync\Codec_Interface $codec Codec instance. + */ + public function set_codec( Codec_Interface $codec ) { + $this->codec = $codec; + } + + /** + * Attempt to lock the request when the server receives concurrent requests from the same blog. + * + * @access public + * + * @param int $blog_id ID of the blog. + * @param int $expiry Blog lock transient lifetime. + * @return boolean True if succeeded, false otherwise. + */ + public function attempt_request_lock( $blog_id, $expiry = self::BLOG_LOCK_TRANSIENT_EXPIRY ) { + $transient_name = $this->get_concurrent_request_transient_name( $blog_id ); + $locked_time = get_site_transient( $transient_name ); + if ( $locked_time ) { + return false; + } + set_site_transient( $transient_name, microtime( true ), $expiry ); + + return true; + } + + /** + * Retrieve the blog lock transient name for a particular blog. + * + * @access public + * + * @param int $blog_id ID of the blog. + * @return string Name of the blog lock transient. + */ + private function get_concurrent_request_transient_name( $blog_id ) { + return self::BLOG_LOCK_TRANSIENT_PREFIX . $blog_id; + } + + /** + * Remove the request lock from a particular blog ID. + * + * @access public + * + * @param int $blog_id ID of the blog. + */ + public function remove_request_lock( $blog_id ) { + delete_site_transient( $this->get_concurrent_request_transient_name( $blog_id ) ); + } + + /** + * Receive and process sync events. + * + * @access public + * + * @param array $data Sync events. + * @param object $token The auth token used to invoke the API. + * @param int $sent_timestamp Timestamp (in seconds) when the actions were transmitted. + * @param string $queue_id ID of the queue from which the event was sent (`sync` or `full_sync`). + * @return array Processed sync events. + */ + public function receive( $data, $token = null, $sent_timestamp = null, $queue_id = null ) { + $start_time = microtime( true ); + if ( ! is_array( $data ) ) { + return new WP_Error( 'action_decoder_error', 'Events must be an array' ); + } + + if ( $token && ! $this->attempt_request_lock( $token->blog_id ) ) { + /** + * Fires when the server receives two concurrent requests from the same blog + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param token The token object of the misbehaving site + */ + do_action( 'jetpack_sync_multi_request_fail', $token ); + + return new WP_Error( 'concurrent_request_error', 'There is another request running for the same blog ID' ); + } + + $events = wp_unslash( array_map( array( $this->codec, 'decode' ), $data ) ); + $events_processed = array(); + + /** + * Fires when an array of actions are received from a remote Jetpack site + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array Array of actions received from the remote site + */ + do_action( 'jetpack_sync_remote_actions', $events, $token ); + + foreach ( $events as $key => $event ) { + list( $action_name, $args, $user_id, $timestamp, $silent ) = $event; + + /** + * Fires when an action is received from a remote Jetpack site + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param string $action_name The name of the action executed on the remote site + * @param array $args The arguments passed to the action + * @param int $user_id The external_user_id who did the action + * @param bool $silent Whether the item was created via import + * @param double $timestamp Timestamp (in seconds) when the action occurred + * @param double $sent_timestamp Timestamp (in seconds) when the action was transmitted + * @param string $queue_id ID of the queue from which the event was sent (sync or full_sync) + * @param array $token The auth token used to invoke the API + */ + do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token ); + + $events_processed[] = $key; + + if ( microtime( true ) - $start_time > self::MAX_TIME_PER_REQUEST_IN_SECONDS ) { + break; + } + } + + if ( $token ) { + $this->remove_request_lock( $token->blog_id ); + } + + return $events_processed; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php new file mode 100644 index 00000000..31cee3b2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php @@ -0,0 +1,588 @@ + true, + 'upload_max_bytes' => true, + 'upload_max_rows' => true, + 'sync_wait_time' => true, + 'sync_wait_threshold' => true, + 'enqueue_wait_time' => true, + 'max_queue_size' => true, + 'max_queue_lag' => true, + 'queue_max_writes_sec' => true, + 'post_types_blacklist' => true, + 'taxonomies_blacklist' => true, + 'disable' => true, + 'network_disable' => true, + 'render_filtered_content' => true, + 'post_meta_whitelist' => true, + 'comment_meta_whitelist' => true, + 'max_enqueue_full_sync' => true, + 'max_queue_size_full_sync' => true, + 'sync_via_cron' => true, + 'cron_sync_time_limit' => true, + 'known_importers' => true, + 'term_relationships_full_sync_item_size' => true, + 'sync_sender_enabled' => true, + 'full_sync_sender_enabled' => true, + 'full_sync_send_duration' => true, + 'full_sync_limits' => true, + 'checksum_disable' => true, + 'dedicated_sync_enabled' => true, + ); + + /** + * Whether WordPress is currently running an import. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_importing; + + /** + * Whether WordPress is currently running a WP cron request. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_doing_cron; + + /** + * Whether we're currently syncing. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_syncing; + + /** + * Whether we're currently sending sync items. + * + * @access public + * @static + * + * @var null|boolean + */ + public static $is_sending; + + /** + * Retrieve all settings with their current values. + * + * @access public + * @static + * + * @return array All current settings. + */ + public static function get_settings() { + $settings = array(); + foreach ( array_keys( self::$valid_settings ) as $setting ) { + $settings[ $setting ] = self::get_setting( $setting ); + } + + return $settings; + } + + /** + * Fetches the setting. It saves it if the setting doesn't exist, so that it gets + * autoloaded on page load rather than re-queried every time. + * + * @access public + * @static + * + * @param string $setting The setting name. + * @return mixed The setting value. + */ + public static function get_setting( $setting ) { + if ( ! isset( self::$valid_settings[ $setting ] ) ) { + return false; + } + + if ( self::is_network_setting( $setting ) ) { + if ( is_multisite() ) { + $value = get_site_option( self::SETTINGS_OPTION_PREFIX . $setting ); + } else { + // On single sites just return the default setting. + return Defaults::get_default_setting( $setting ); + } + } else { + $value = get_option( self::SETTINGS_OPTION_PREFIX . $setting ); + } + + if ( false === $value ) { // No default value is set. + $value = Defaults::get_default_setting( $setting ); + if ( self::is_network_setting( $setting ) ) { + update_site_option( self::SETTINGS_OPTION_PREFIX . $setting, $value ); + } else { + // We set one so that it gets autoloaded. + update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true ); + } + } + + if ( is_numeric( $value ) ) { + $value = (int) $value; + } + $default_array_value = null; + switch ( $setting ) { + case 'post_types_blacklist': + $default_array_value = Defaults::$blacklisted_post_types; + break; + case 'taxonomies_blacklist': + $default_array_value = Defaults::$blacklisted_taxonomies; + break; + case 'post_meta_whitelist': + $default_array_value = Defaults::get_post_meta_whitelist(); + break; + case 'comment_meta_whitelist': + $default_array_value = Defaults::get_comment_meta_whitelist(); + break; + case 'known_importers': + $default_array_value = Defaults::get_known_importers(); + break; + } + + if ( $default_array_value ) { + if ( is_array( $value ) ) { + $value = array_unique( array_merge( $value, $default_array_value ) ); + } else { + $value = $default_array_value; + } + } + + return $value; + } + + /** + * Change multiple settings in the same time. + * + * @access public + * @static + * + * @param array $new_settings The new settings. + */ + public static function update_settings( $new_settings ) { + $validated_settings = array_intersect_key( $new_settings, self::$valid_settings ); + foreach ( $validated_settings as $setting => $value ) { + + if ( self::is_network_setting( $setting ) ) { + if ( is_multisite() && is_main_site() ) { + $updated = update_site_option( self::SETTINGS_OPTION_PREFIX . $setting, $value ); + } + } else { + $updated = update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true ); + } + + // If we set the disabled option to true, clear the queues. + if ( ( 'disable' === $setting || 'network_disable' === $setting ) && (bool) $value ) { + $listener = Listener::get_instance(); + $listener->get_sync_queue()->reset(); + $listener->get_full_sync_queue()->reset(); + } + + // Do not enable Dedicated Sync if we cannot spawn a Dedicated Sync request. + if ( 'dedicated_sync_enabled' === $setting && $updated && (bool) $value ) { + if ( ! Dedicated_Sender::can_spawn_dedicated_sync_request() ) { + update_option( self::SETTINGS_OPTION_PREFIX . $setting, 0, true ); + } + } + } + } + + /** + * Whether the specified setting is a network setting. + * + * @access public + * @static + * + * @param string $setting Setting name. + * @return boolean Whether the setting is a network setting. + */ + public static function is_network_setting( $setting ) { + return strpos( $setting, 'network_' ) === 0; + } + + /** + * Returns escaped SQL for blacklisted post types. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_blacklisted_post_types_sql() { + return 'post_type NOT IN (\'' . join( '\', \'', array_map( 'esc_sql', self::get_setting( 'post_types_blacklist' ) ) ) . '\')'; + } + + /** + * Returns escaped values for disallowed post types. + * + * @access public + * @static + * + * @return array Post type filter values + */ + public static function get_disallowed_post_types_structured() { + return array( + 'post_type' => array( + 'operator' => 'NOT IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'post_types_blacklist' ) ), + ), + ); + } + + /** + * Returns escaped SQL for blacklisted taxonomies. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_blacklisted_taxonomies_sql() { + return "taxonomy NOT IN ('" . join( "', '", array_map( 'esc_sql', self::get_setting( 'taxonomies_blacklist' ) ) ) . "')"; + } + + /** + * Returns escaped SQL for blacklisted post meta. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_whitelisted_post_meta_sql() { + return 'meta_key IN (\'' . join( '\', \'', array_map( 'esc_sql', self::get_setting( 'post_meta_whitelist' ) ) ) . '\')'; + } + + /** + * Returns escaped SQL for allowed post meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_post_meta_structured() { + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'post_meta_whitelist' ) ), + ), + ); + } + + /** + * Returns structured SQL clause for blacklisted taxonomies. + * + * @access public + * @static + * + * @return array taxonomies filter values + */ + public static function get_blacklisted_taxonomies_structured() { + return array( + 'taxonomy' => array( + 'operator' => 'NOT IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'taxonomies_blacklist' ) ), + ), + ); + } + + /** + * Returns structured SQL clause for allowed taxonomies. + * + * @access public + * @static + * + * @return array taxonomies filter values + */ + public static function get_allowed_taxonomies_structured() { + global $wp_taxonomies; + + $allowed_taxonomies = array_keys( $wp_taxonomies ); + $allowed_taxonomies = array_diff( $allowed_taxonomies, self::get_setting( 'taxonomies_blacklist' ) ); + return array( + 'taxonomy' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', $allowed_taxonomies ), + ), + ); + } + + /** + * Returns escaped SQL for blacklisted comment meta. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_whitelisted_comment_meta_sql() { + return 'meta_key IN (\'' . join( '\', \'', array_map( 'esc_sql', self::get_setting( 'comment_meta_whitelist' ) ) ) . '\')'; + } + + /** + * Returns SQL-escaped values for allowed post meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_comment_meta_structured() { + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', self::get_setting( 'comment_meta_whitelist' ) ), + ), + ); + } + + /** + * Returns SQL-escaped values for allowed order_item meta keys. + * + * @access public + * @static + * + * @return array Meta keys filter values + */ + public static function get_allowed_order_itemmeta_structured() { + // Make sure that we only try to add the properties when the class exists. + if ( ! class_exists( '\Automattic\Jetpack\Sync\Modules\WooCommerce' ) ) { + return array(); + } + + $values = \Automattic\Jetpack\Sync\Modules\WooCommerce::$order_item_meta_whitelist; + + return array( + 'meta_key' => array( + 'operator' => 'IN', + 'values' => array_map( 'esc_sql', $values ), + ), + ); + } + + /** + * Returns escaped SQL for comments, excluding any spam comments. + * Can be injected directly into a WHERE clause. + * + * @access public + * @static + * + * @return string SQL WHERE clause. + */ + public static function get_comments_filter_sql() { + return "comment_approved <> 'spam'"; + } + + /** + * Delete any settings options and clean up the current settings state. + * + * @access public + * @static + */ + public static function reset_data() { + $valid_settings = self::$valid_settings; + foreach ( $valid_settings as $option => $value ) { + delete_option( self::SETTINGS_OPTION_PREFIX . $option ); + } + self::set_importing( null ); + self::set_doing_cron( null ); + self::set_is_syncing( null ); + self::set_is_sending( null ); + } + + /** + * Set the importing state. + * + * @access public + * @static + * + * @param boolean $is_importing Whether WordPress is currently importing. + */ + public static function set_importing( $is_importing ) { + // Set to NULL to revert to WP_IMPORTING, the standard behavior. + self::$is_importing = $is_importing; + } + + /** + * Whether WordPress is currently importing. + * + * @access public + * @static + * + * @return boolean Whether WordPress is currently importing. + */ + public static function is_importing() { + if ( self::$is_importing !== null ) { + return self::$is_importing; + } + + return defined( 'WP_IMPORTING' ) && WP_IMPORTING; + } + + /** + * Whether sync is enabled. + * + * @access public + * @static + * + * @return boolean Whether sync is enabled. + */ + public static function is_sync_enabled() { + return ! ( self::get_setting( 'disable' ) || self::get_setting( 'network_disable' ) ); + } + + /** + * Set the WP cron state. + * + * @access public + * @static + * + * @param boolean $is_doing_cron Whether WordPress is currently doing WP cron. + */ + public static function set_doing_cron( $is_doing_cron ) { + // Set to NULL to revert to WP_IMPORTING, the standard behavior. + self::$is_doing_cron = $is_doing_cron; + } + + /** + * Whether WordPress is currently doing WP cron. + * + * @access public + * @static + * + * @return boolean Whether WordPress is currently doing WP cron. + */ + public static function is_doing_cron() { + if ( self::$is_doing_cron !== null ) { + return self::$is_doing_cron; + } + + return defined( 'DOING_CRON' ) && DOING_CRON; + } + + /** + * Whether we are currently syncing. + * + * @access public + * @static + * + * @return boolean Whether we are currently syncing. + */ + public static function is_syncing() { + return (bool) self::$is_syncing || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST ); + } + + /** + * Set the syncing state. + * + * @access public + * @static + * + * @param boolean $is_syncing Whether we are currently syncing. + */ + public static function set_is_syncing( $is_syncing ) { + self::$is_syncing = $is_syncing; + } + + /** + * Whether we are currently sending sync items. + * + * @access public + * @static + * + * @return boolean Whether we are currently sending sync items. + */ + public static function is_sending() { + return (bool) self::$is_sending; + } + + /** + * Set the sending state. + * + * @access public + * @static + * + * @param boolean $is_sending Whether we are currently sending sync items. + */ + public static function set_is_sending( $is_sending ) { + self::$is_sending = $is_sending; + } + + /** + * Whether should send from the queue + * + * @access public + * @static + * + * @param string $queue_id The queue identifier. + * + * @return boolean Whether sync is enabled. + */ + public static function is_sender_enabled( $queue_id ) { + return (bool) self::get_setting( $queue_id . '_sender_enabled' ); + } + + /** + * Whether checksums are enabled. + * + * @access public + * @static + * + * @return boolean Whether sync is enabled. + */ + public static function is_checksum_enabled() { + return ! (bool) self::get_setting( 'checksum_disable' ); + } + + /** + * Whether dedicated Sync flow is enabled. + * + * @access public + * @static + * + * @return boolean Whether dedicated Sync flow is enabled. + */ + public static function is_dedicated_sync_enabled() { + return (bool) self::get_setting( 'dedicated_sync_enabled' ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php new file mode 100644 index 00000000..613323fd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php @@ -0,0 +1,63 @@ +json_serialize( $object ) ); + } + + /** + * Encode a sync object. + * + * @access public + * + * @param string $input Encoded sync object to decode. + * @return mixed Decoded sync object. + */ + public function decode( $input ) { + // This is intentionally using base64_decode(). + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + return $this->json_unserialize( base64_decode( $input ) ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php new file mode 100644 index 00000000..316df9ce --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-users.php @@ -0,0 +1,152 @@ +has_connected_user() ) { + // Kick off synchronization of user role when it changes. + add_action( 'set_user_role', array( __CLASS__, 'user_role_change' ) ); + } + } + + /** + * Synchronize connected user role changes. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + */ + public static function user_role_change( $user_id ) { + $connection = new Jetpack_Connection(); + if ( $connection->is_user_connected( $user_id ) ) { + self::update_role_on_com( $user_id ); + // Try to choose a new master if we're demoting the current one. + self::maybe_demote_master_user( $user_id ); + } + } + + /** + * Retrieve the role of a user by their ID. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + * @return string Role of the user. + */ + public static function get_role( $user_id ) { + if ( isset( self::$user_roles[ $user_id ] ) ) { + return self::$user_roles[ $user_id ]; + } + + $current_user_id = get_current_user_id(); + wp_set_current_user( $user_id ); + $roles = new Roles(); + $role = $roles->translate_current_user_to_role(); + wp_set_current_user( $current_user_id ); + self::$user_roles[ $user_id ] = $role; + + return $role; + } + + /** + * Retrieve the signed role of a user by their ID. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + * @return string Signed role of the user. + */ + public static function get_signed_role( $user_id ) { + $connection = new Jetpack_Connection(); + return $connection->sign_role( self::get_role( $user_id ), $user_id ); + } + + /** + * Retrieve the signed role and update it in WP.com for that user. + * + * @access public + * @static + * + * @param int $user_id ID of the user. + */ + public static function update_role_on_com( $user_id ) { + $signed_role = self::get_signed_role( $user_id ); + XMLRPC_Async_Call::add_call( 'jetpack.updateRole', get_current_user_id(), $user_id, $signed_role ); + } + + /** + * Choose a new master user if we're demoting the current one. + * + * @access public + * @static + * @todo Disconnect if there is no user with enough capabilities to be the master user. + * @uses \WP_User_Query + * + * @param int $user_id ID of the user. + */ + public static function maybe_demote_master_user( $user_id ) { + $master_user_id = (int) \Jetpack_Options::get_option( 'master_user' ); + $role = self::get_role( $user_id ); + if ( $user_id === $master_user_id && 'administrator' !== $role ) { + $query = new \WP_User_Query( + array( + 'fields' => array( 'ID' ), + 'role' => 'administrator', + 'orderby' => 'ID', + 'exclude' => array( $master_user_id ), + ) + ); + $new_master = false; + $connection = new Jetpack_Connection(); + foreach ( $query->results as $result ) { + $found_user_id = absint( $result->ID ); + if ( $found_user_id && $connection->is_user_connected( $found_user_id ) ) { + $new_master = $found_user_id; + break; + } + } + + if ( $new_master ) { + \Jetpack_Options::update_option( 'master_user', $new_master ); + } + // TODO: else disconnect..? + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php new file mode 100644 index 00000000..23f24e95 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php @@ -0,0 +1,65 @@ +value; + } + + /** + * Get the ID of a sync item. + * + * @access private + * @static + * + * @param array $item Sync item. + * @return int Sync item ID. + */ + private static function get_item_id( $item ) { + return $item->id; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php new file mode 100644 index 00000000..7653f26d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php @@ -0,0 +1,44 @@ +post_parent && 0 !== $attachment_after->post_parent ) { + /** + * Fires when an existing attachment is added to a post for the first time + * + * @since 1.6.3 + * @since-jetpack 6.6.0 + * + * @param int $attachment_id Attachment ID. + * @param \WP_Post $attachment_after Attachment post object after the update. + */ + do_action( 'jetpack_sync_save_attach_attachment', $attachment_id, $attachment_after ); + } else { + /** + * Fires when the client needs to sync an updated attachment + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param int $attachment_id Attachment ID. + * @param \WP_Post $attachment_after Attachment post object after the update. + * + * Previously this action was synced using jetpack_sync_save_add_attachment action. + */ + do_action( 'jetpack_sync_save_update_attachment', $attachment_id, $attachment_after ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php new file mode 100644 index 00000000..18d4ca21 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php @@ -0,0 +1,646 @@ + 'home_url', + 'siteurl' => 'site_url', + 'jetpack_active_modules' => 'active_modules', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'functions'; + } + + /** + * Set module defaults. + * Define the callable whitelist based on whether this is a single site or a multisite installation. + * + * @access public + */ + public function set_defaults() { + if ( is_multisite() ) { + $this->callable_whitelist = array_merge( Defaults::get_callable_whitelist(), Defaults::get_multisite_callable_whitelist() ); + } else { + $this->callable_whitelist = Defaults::get_callable_whitelist(); + } + $this->force_send_callables_on_next_tick = false; // Resets here as well mostly for tests. + } + + /** + * Initialize callables action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'jetpack_sync_callable', $callable, 10, 2 ); + add_action( 'current_screen', array( $this, 'set_plugin_action_links' ), 9999 ); // Should happen very late. + + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option ) { + add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable' ) ); + add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable' ) ); + } + + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS_NEXT_TICK as $option ) { + add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) ); + add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) ); + } + + // Provide a hook so that hosts can send changes to certain callables right away. + // Especially useful when a host uses constants to change home and siteurl. + add_action( 'jetpack_sync_unlock_sync_callable', array( $this, 'unlock_sync_callable' ) ); + + // get_plugins and wp_version + // gets fired when new code gets installed, updates etc. + add_action( 'upgrader_process_complete', array( $this, 'unlock_plugin_action_link_and_callables' ) ); + add_action( 'update_option_active_plugins', array( $this, 'unlock_plugin_action_link_and_callables' ) ); + } + + /** + * Initialize callables action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_callables', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_sync_callables' ) ); + + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_callables', array( $this, 'expand_callables' ) ); + } + + /** + * Perform module cleanup. + * Deletes any transients and options that this module uses. + * Usually triggered when uninstalling the plugin. + * + * @access public + */ + public function reset_data() { + delete_option( self::CALLABLES_CHECKSUM_OPTION_NAME ); + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + + $url_callables = array( 'home_url', 'site_url', 'main_network_site_url' ); + foreach ( $url_callables as $callable ) { + delete_option( Functions::HTTPS_CHECK_OPTION_PREFIX . $callable ); + } + } + + /** + * Set the callable whitelist. + * + * @access public + * + * @param array $callables The new callables whitelist. + */ + public function set_callable_whitelist( $callables ) { + $this->callable_whitelist = $callables; + } + + /** + * Get the callable whitelist. + * + * @access public + * + * @return array The callables whitelist. + */ + public function get_callable_whitelist() { + return $this->callable_whitelist; + } + + /** + * Retrieve all callables as per the current callables whitelist. + * + * @access public + * + * @return array All callables. + */ + public function get_all_callables() { + // get_all_callables should run as the master user always. + $current_user_id = get_current_user_id(); + wp_set_current_user( \Jetpack_Options::get_option( 'master_user' ) ); + $callables = array_combine( + array_keys( $this->get_callable_whitelist() ), + array_map( array( $this, 'get_callable' ), array_values( $this->get_callable_whitelist() ) ) + ); + wp_set_current_user( $current_user_id ); + return $callables; + } + + /** + * Invoke a particular callable. + * Used as a wrapper to standartize invocation. + * + * @access private + * + * @param callable $callable Callable to invoke. + * @return mixed Return value of the callable, null if not callable. + */ + private function get_callable( $callable ) { + if ( is_callable( $callable ) ) { + return call_user_func( $callable ); + } else { + return null; + } + } + + /** + * Enqueue the callable actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all callables to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand callables (should always be true) + */ + do_action( 'jetpack_full_sync_callables', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the callable actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $status This Module Full Sync Status. + * + * @return array This Module Full Sync Status. + */ + public function send_full_sync_actions( $config, $send_until, $status ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_callables', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_callables' ); + } + + /** + * Unlock callables so they would be available for syncing again. + * + * @access public + */ + public function unlock_sync_callable() { + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + } + + /** + * Unlock callables on the next tick. + * Sometime the true callable values are only present on the next tick. + * When switching themes for example. + * + * @access public + */ + public function unlock_sync_callable_next_tick() { + $this->force_send_callables_on_next_tick = true; + } + + /** + * Unlock callables and plugin action links. + * + * @access public + */ + public function unlock_plugin_action_link_and_callables() { + delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ); + delete_transient( 'jetpack_plugin_api_action_links_refresh' ); + add_filter( 'jetpack_check_and_send_callables', '__return_true' ); + } + + /** + * Parse and store the plugin action links if on the plugins page. + * + * @uses \DOMDocument + * @uses libxml_use_internal_errors + * @uses mb_convert_encoding + * + * @access public + */ + public function set_plugin_action_links() { + if ( + ! class_exists( '\DOMDocument' ) || + ! function_exists( 'libxml_use_internal_errors' ) || + ! function_exists( 'mb_convert_encoding' ) + ) { + return; + } + + $current_screeen = get_current_screen(); + + $plugins_action_links = array(); + // Is the transient lock in place? + $plugins_lock = get_transient( 'jetpack_plugin_api_action_links_refresh', false ); + if ( ! empty( $plugins_lock ) && ( isset( $current_screeen->id ) && 'plugins' !== $current_screeen->id ) ) { + return; + } + $plugins = array_keys( Functions::get_plugins() ); + foreach ( $plugins as $plugin_file ) { + /** + * Plugins often like to unset things but things break if they are not able to. + */ + $action_links = array( + 'deactivate' => '', + 'activate' => '', + 'details' => '', + 'delete' => '', + 'edit' => '', + ); + /** This filter is documented in src/wp-admin/includes/class-wp-plugins-list-table.php */ + $action_links = apply_filters( 'plugin_action_links', $action_links, $plugin_file, null, 'all' ); + // Verify $action_links is still an array. + if ( ! is_array( $action_links ) ) { + $action_links = array(); + } + /** This filter is documented in src/wp-admin/includes/class-wp-plugins-list-table.php */ + $action_links = apply_filters( "plugin_action_links_{$plugin_file}", $action_links, $plugin_file, null, 'all' ); + // Verify $action_links is still an array to resolve warnings from filters not returning an array. + if ( is_array( $action_links ) ) { + $action_links = array_filter( $action_links ); + } else { + $action_links = array(); + } + $formatted_action_links = null; + if ( ! empty( $action_links ) && count( $action_links ) > 0 ) { + $dom_doc = new \DOMDocument(); + foreach ( $action_links as $action_link ) { + // The @ is not enough to suppress errors when dealing with libxml, + // we have to tell it directly how we want to handle errors. + libxml_use_internal_errors( true ); + $dom_doc->loadHTML( '' . $action_link ); + libxml_use_internal_errors( false ); + + $link_elements = $dom_doc->getElementsByTagName( 'a' ); + if ( 0 === $link_elements->length ) { + continue; + } + + $link_element = $link_elements->item( 0 ); + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + if ( $link_element->hasAttribute( 'href' ) && $link_element->nodeValue ) { + $link_url = trim( $link_element->getAttribute( 'href' ) ); + + // Add the full admin path to the url if the plugin did not provide it. + $link_url_scheme = wp_parse_url( $link_url, PHP_URL_SCHEME ); + if ( empty( $link_url_scheme ) ) { + $link_url = admin_url( $link_url ); + } + + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $formatted_action_links[ $link_element->nodeValue ] = $link_url; + } + } + } + if ( $formatted_action_links ) { + $plugins_action_links[ $plugin_file ] = $formatted_action_links; + } + } + // Cache things for a long time. + set_transient( 'jetpack_plugin_api_action_links_refresh', time(), DAY_IN_SECONDS ); + update_option( 'jetpack_plugin_api_action_links', $plugins_action_links ); + } + + /** + * Whether a certain callable should be sent. + * + * @access public + * + * @param array $callable_checksums Callable checksums. + * @param string $name Name of the callable. + * @param string $checksum A checksum of the callable. + * @return boolean Whether to send the callable. + */ + public function should_send_callable( $callable_checksums, $name, $checksum ) { + $idc_override_callables = array( + 'main_network_site', + 'home_url', + 'site_url', + ); + if ( in_array( $name, $idc_override_callables, true ) && \Jetpack_Options::get_option( 'migrate_for_idc' ) ) { + return true; + } + + return ! $this->still_valid_checksum( $callable_checksums, $name, $checksum ); + } + + /** + * Sync the callables if we're supposed to. + * + * @access public + */ + public function maybe_sync_callables() { + $callables = $this->get_all_callables(); + if ( ! apply_filters( 'jetpack_check_and_send_callables', false ) ) { + /** + * Treating Dedicated Sync requests a bit differently from normal. We want to send callables + * normally with all Sync actions, no matter if they were with admin action origin or not, + * since Dedicated Sync runs out of bound and the requests are never coming from an admin. + */ + if ( ! is_admin() && ! Dedicated_Sender::is_dedicated_sync_request() ) { + // If we're not an admin and we're not doing cron and this isn't WP_CLI, don't sync anything. + if ( ! Settings::is_doing_cron() && ! Jetpack_Constants::get_constant( 'WP_CLI' ) ) { + return; + } + // If we're not an admin and we are doing cron, sync the Callables that are always supposed to sync ( See https://github.com/Automattic/jetpack/issues/12924 ). + $callables = $this->get_always_sent_callables(); + } + if ( get_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ) ) { + if ( $this->force_send_callables_on_next_tick ) { + $this->unlock_sync_callable(); + } + return; + } + } + + if ( empty( $callables ) ) { + return; + } + // No need to set the transiant we are trying to remove it anyways. + if ( ! $this->force_send_callables_on_next_tick ) { + set_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME, microtime( true ), Defaults::$default_sync_callables_wait_time ); + } + + $callable_checksums = (array) \Jetpack_Options::get_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, array() ); + $has_changed = false; + // Only send the callables that have changed. + foreach ( $callables as $name => $value ) { + $checksum = $this->get_check_sum( $value ); + + // Explicitly not using Identical comparison as get_option returns a string. + if ( $value !== null && $this->should_send_callable( $callable_checksums, $name, $checksum ) ) { + + // Only send callable if the non sorted checksum also does not match. + if ( $this->should_send_callable( $callable_checksums, $name, $this->get_check_sum( $value, false ) ) ) { + + /** + * Tells the client to sync a callable (aka function) to the server + * + * @param string The name of the callable + * @param mixed The value of the callable + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_callable', $name, $value ); + } + + $callable_checksums[ $name ] = $checksum; + $has_changed = true; + } else { + $callable_checksums[ $name ] = $checksum; + } + } + if ( $has_changed ) { + \Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callable_checksums ); + } + + if ( $this->force_send_callables_on_next_tick ) { + $this->unlock_sync_callable(); + } + } + + /** + * Get the callables that should always be sent, e.g. on cron. + * + * @return array Callables that should always be sent + */ + protected function get_always_sent_callables() { + $callables = $this->get_all_callables(); + $cron_callables = array(); + foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option_name ) { + if ( array_key_exists( $option_name, $callables ) ) { + $cron_callables[ $option_name ] = $callables[ $option_name ]; + continue; + } + + // Check for the Callable name/key for the option, if different from option name. + if ( array_key_exists( $option_name, self::OPTION_NAMES_TO_CALLABLE_NAMES ) ) { + $callable_name = self::OPTION_NAMES_TO_CALLABLE_NAMES[ $option_name ]; + if ( array_key_exists( $callable_name, $callables ) ) { + $cron_callables[ $callable_name ] = $callables[ $callable_name ]; + } + } + } + return $cron_callables; + } + + /** + * Expand the callables within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_callables( $args ) { + if ( $args[0] ) { + $callables = $this->get_all_callables(); + $callables_checksums = array(); + foreach ( $callables as $name => $value ) { + $callables_checksums[ $name ] = $this->get_check_sum( $value ); + } + \Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callables_checksums ); + return $callables; + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( $this->get_callable_whitelist() ); + } + + /** + * Retrieve a set of callables by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'callable' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'CALLABLE-DOES-NOT-EXIST' !== $object ) { + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Retrieve a callable by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Callable. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'callable' === $object_type ) { + + // Only whitelisted options can be returned. + if ( array_key_exists( $id, $this->get_callable_whitelist() ) ) { + // requires master user to be in context. + $current_user_id = get_current_user_id(); + wp_set_current_user( \Jetpack_Options::get_option( 'master_user' ) ); + $callable = $this->get_callable( $this->callable_whitelist[ $id ] ); + wp_set_current_user( $current_user_id ); + return $callable; + } elseif ( 'all' === $id ) { + return $this->get_all_callables(); + } + } + + return 'CALLABLE-DOES-NOT-EXIST'; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php new file mode 100644 index 00000000..30268305 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php @@ -0,0 +1,495 @@ +filter_comment( $comment ); + } + } + + return false; + } + + /** + * Initialize comments action listeners. + * Also responsible for initializing comment meta listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'wp_insert_comment', $callable, 10, 2 ); + add_action( 'deleted_comment', $callable ); + add_action( 'trashed_comment', $callable ); + add_action( 'spammed_comment', $callable ); + add_action( 'trashed_post_comments', $callable, 10, 2 ); + add_action( 'untrash_post_comments', $callable ); + add_action( 'comment_approved_to_unapproved', $callable ); + add_action( 'comment_unapproved_to_approved', $callable ); + add_action( 'jetpack_modified_comment_contents', $callable, 10, 2 ); + add_action( 'untrashed_comment', $callable, 10, 2 ); + add_action( 'unspammed_comment', $callable, 10, 2 ); + add_filter( 'wp_update_comment_data', array( $this, 'handle_comment_contents_modification' ), 10, 3 ); + + // comment actions. + add_filter( 'jetpack_sync_before_enqueue_wp_insert_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_deleted_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_trashed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_untrashed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_spammed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_unspammed_comment', array( $this, 'only_allow_white_listed_comment_types' ) ); + + // comment status transitions. + add_filter( 'jetpack_sync_before_enqueue_comment_approved_to_unapproved', array( $this, 'only_allow_white_listed_comment_type_transitions' ) ); + add_filter( 'jetpack_sync_before_enqueue_comment_unapproved_to_approved', array( $this, 'only_allow_white_listed_comment_type_transitions' ) ); + + // Post Actions. + add_filter( 'jetpack_sync_before_enqueue_trashed_post_comments', array( $this, 'filter_blacklisted_post_types' ) ); + add_filter( 'jetpack_sync_before_enqueue_untrash_post_comments', array( $this, 'filter_blacklisted_post_types' ) ); + + /** + * Even though it's messy, we implement these hooks because + * the edit_comment hook doesn't include the data + * so this saves us a DB read for every comment event. + */ + foreach ( $this->get_whitelisted_comment_types() as $comment_type ) { + foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { + $comment_action_name = "comment_{$comment_status}_{$comment_type}"; + add_action( $comment_action_name, $callable, 10, 2 ); + } + } + + // Listen for meta changes. + $this->init_listeners_for_meta_type( 'comment', $callable ); + $this->init_meta_whitelist_handler( 'comment', array( $this, 'filter_meta' ) ); + } + + /** + * Handler for any comment content updates. + * + * @access public + * + * @param array $new_comment The new, processed comment data. + * @param array $old_comment The old, unslashed comment data. + * @param array $new_comment_with_slashes The new, raw comment data. + * @return array The new, processed comment data. + */ + public function handle_comment_contents_modification( $new_comment, $old_comment, $new_comment_with_slashes ) { + $changes = array(); + $content_fields = array( + 'comment_author', + 'comment_author_email', + 'comment_author_url', + 'comment_content', + ); + foreach ( $content_fields as $field ) { + if ( $new_comment_with_slashes[ $field ] !== $old_comment[ $field ] ) { + $changes[ $field ] = array( $new_comment[ $field ], $old_comment[ $field ] ); + } + } + + if ( ! empty( $changes ) ) { + /** + * Signals to the sync listener that this comment's contents were modified and a sync action + * reflecting the change(s) to the content should be sent + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param int $new_comment['comment_ID'] ID of comment whose content was modified + * @param mixed $changes Array of changed comment fields with before and after values + */ + do_action( 'jetpack_modified_comment_contents', $new_comment['comment_ID'], $changes ); + } + return $new_comment; + } + + /** + * Initialize comments action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_comments', $callable ); // Also send comments meta. + } + + /** + * Gets a filtered list of comment types that sync can hook into. + * + * @access public + * + * @return array Defaults to [ '', 'trackback', 'pingback' ]. + */ + public function get_whitelisted_comment_types() { + /** + * Comment types present in this list will sync their status changes to WordPress.com. + * + * @since 1.6.3 + * @since-jetpack 7.6.0 + * + * @param array A list of comment types. + */ + return apply_filters( + 'jetpack_sync_whitelisted_comment_types', + array( '', 'comment', 'trackback', 'pingback', 'review' ) + ); + } + + /** + * Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com. + * + * @param array $args Arguments passed to wp_insert_comment, deleted_comment, spammed_comment, etc. + * + * @return bool or array $args Arguments passed to wp_insert_comment, deleted_comment, spammed_comment, etc. + */ + public function only_allow_white_listed_comment_types( $args ) { + $comment = false; + + if ( isset( $args[1] ) ) { + // comment object is available. + $comment = $args[1]; + } elseif ( is_numeric( $args[0] ) ) { + // comment_id is available. + $comment = get_comment( $args[0] ); + } + + if ( + isset( $comment->comment_type ) + && ! in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ) + ) { + return false; + } + + return $args; + } + + /** + * Filter all blacklisted post types. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_blacklisted_post_types( $args ) { + $post_id = $args[0]; + $posts_module = Modules::get_module( 'posts' ); + + if ( false !== $posts_module && ! $posts_module->is_post_type_allowed( $post_id ) ) { + return false; + } + + return $args; + } + + /** + * Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com. + * + * @param array $args Arguments passed to wp_{old_status}_to_{new_status}. + * + * @return bool or array $args Arguments passed to wp_{old_status}_to_{new_status} + */ + public function only_allow_white_listed_comment_type_transitions( $args ) { + $comment = $args[0]; + + if ( ! in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ) ) { + return false; + } + + return $args; + } + + /** + * Whether a comment type is allowed. + * A comment type is allowed if it's present in the comment type whitelist. + * + * @param int $comment_id ID of the comment. + * @return boolean Whether the comment type is allowed. + */ + public function is_comment_type_allowed( $comment_id ) { + $comment = get_comment( $comment_id ); + + if ( isset( $comment->comment_type ) ) { + return in_array( $comment->comment_type, $this->get_whitelisted_comment_types(), true ); + } + return false; + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) ); + + foreach ( $this->get_whitelisted_comment_types() as $comment_type ) { + foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { + $comment_action_name = "comment_{$comment_status}_{$comment_type}"; + add_filter( + 'jetpack_sync_before_send_' . $comment_action_name, + array( + $this, + 'expand_wp_insert_comment', + ) + ); + } + } + + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_comments', array( $this, 'expand_comment_ids' ) ); + } + + /** + * Enqueue the comments actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_comments', $wpdb->comments, 'comment_ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->comments"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + if ( is_array( $config ) ) { + return 'comment_ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return '1=1'; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_comments' ); + } + + /** + * Count all the actions that are going to be sent. + * + * @access public + * + * @param array $action_names Names of all the actions that will be sent. + * @return int Number of actions. + */ + public function count_full_sync_actions( $action_names ) { + return $this->count_actions( $action_names, array( 'jetpack_full_sync_comments' ) ); + } + + /** + * Expand the comment status change before the data is serialized and sent to the server. + * + * @access public + * @todo This is not used currently - let's implement it. + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_wp_comment_status_change( $args ) { + return array( $args[0], $this->filter_comment( $args[1] ) ); + } + + /** + * Expand the comment creation before the data is serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_wp_insert_comment( $args ) { + return array( $args[0], $this->filter_comment( $args[1] ) ); + } + + /** + * Filter a comment object to the fields we need. + * + * @access public + * + * @param \WP_Comment $comment The unfiltered comment object. + * @return \WP_Comment Filtered comment object. + */ + public function filter_comment( $comment ) { + /** + * Filters whether to prevent sending comment data to .com + * + * Passing true to the filter will prevent the comment data from being sent + * to the WordPress.com. + * Instead we pass data that will still enable us to do a checksum against the + * Jetpacks data but will prevent us from displaying the data on in the API as well as + * other services. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean false prevent post data from bing synced to WordPress.com + * @param mixed $comment WP_COMMENT object + */ + if ( apply_filters( 'jetpack_sync_prevent_sending_comment_data', false, $comment ) ) { + $blocked_comment = new \stdClass(); + $blocked_comment->comment_ID = $comment->comment_ID; + $blocked_comment->comment_date = $comment->comment_date; + $blocked_comment->comment_date_gmt = $comment->comment_date_gmt; + $blocked_comment->comment_approved = 'jetpack_sync_blocked'; + return $blocked_comment; + } + + return $comment; + } + + /** + * Whether a certain comment meta key is whitelisted for sync. + * + * @access public + * + * @param string $meta_key Comment meta key. + * @return boolean Whether the meta key is whitelisted. + */ + public function is_whitelisted_comment_meta( $meta_key ) { + return in_array( $meta_key, Settings::get_setting( 'comment_meta_whitelist' ), true ); + } + + /** + * Handler for filtering out non-whitelisted comment meta. + * + * @access public + * + * @param array $args Hook args. + * @return array|boolean False if not whitelisted, the original hook args otherwise. + */ + public function filter_meta( $args ) { + if ( $this->is_comment_type_allowed( $args[1] ) && $this->is_whitelisted_comment_meta( $args[2] ) ) { + return $args; + } + + return false; + } + + /** + * Expand the comment IDs to comment objects and meta before being serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array The expanded hook parameters. + */ + public function expand_comment_ids( $args ) { + list( $comment_ids, $previous_interval_end ) = $args; + $comments = get_comments( + array( + 'include_unapproved' => true, + 'comment__in' => $comment_ids, + 'orderby' => 'comment_ID', + 'order' => 'DESC', + ) + ); + + return array( + $comments, + $this->get_metadata( $comment_ids, 'comment', Settings::get_setting( 'comment_meta_whitelist' ) ), + $previous_interval_end, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php new file mode 100644 index 00000000..db0d9ff4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php @@ -0,0 +1,339 @@ +constants_whitelist = $constants; + } + + /** + * Get the constants whitelist. + * + * @access public + * + * @return array The constants whitelist. + */ + public function get_constants_whitelist() { + return Defaults::get_constants_whitelist(); + } + + /** + * Enqueue the constants actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all constants to the server + * + * @param boolean Whether to expand constants (should always be true) + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_constants', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the constants actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_constants', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_constants' ); + } + + /** + * Sync the constants if we're supposed to. + * + * @access public + */ + public function maybe_sync_constants() { + if ( get_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME ) ) { + return; + } + + set_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME, microtime( true ), Defaults::$default_sync_constants_wait_time ); + + $constants = $this->get_all_constants(); + if ( empty( $constants ) ) { + return; + } + + $constants_checksums = (array) get_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, array() ); + + foreach ( $constants as $name => $value ) { + $checksum = $this->get_check_sum( $value ); + // Explicitly not using Identical comparison as get_option returns a string. + if ( ! $this->still_valid_checksum( $constants_checksums, $name, $checksum ) && $value !== null ) { + /** + * Tells the client to sync a constant to the server + * + * @param string The name of the constant + * @param mixed The value of the constant + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_sync_constant', $name, $value ); + $constants_checksums[ $name ] = $checksum; + } else { + $constants_checksums[ $name ] = $checksum; + } + } + update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums ); + } + + /** + * Retrieve all constants as per the current constants whitelist. + * Public so that we don't have to store an option for each constant. + * + * @access public + * + * @return array All constants. + */ + public function get_all_constants() { + $constants_whitelist = $this->get_constants_whitelist(); + + return array_combine( + $constants_whitelist, + array_map( array( $this, 'get_constant' ), $constants_whitelist ) + ); + } + + /** + * Retrieve the value of a constant. + * Used as a wrapper to standartize access to constants. + * + * @access private + * + * @param string $constant Constant name. + * + * @return mixed Return value of the constant. + */ + private function get_constant( $constant ) { + return ( defined( $constant ) ) ? + constant( $constant ) + : null; + } + + /** + * Expand the constants within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * + * @return array $args The hook parameters. + */ + public function expand_constants( $args ) { + if ( $args[0] ) { + $constants = $this->get_all_constants(); + $constants_checksums = array(); + foreach ( $constants as $name => $value ) { + $constants_checksums[ $name ] = $this->get_check_sum( $value ); + } + update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums ); + + return $constants; + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( $this->get_constants_whitelist() ); + } + + /** + * Retrieve a set of constants by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'constant' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + + return $objects; + } + + /** + * Retrieve a constant by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Constant. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'constant' === $object_type ) { + + // Only whitelisted constants can be returned. + if ( in_array( $id, $this->get_constants_whitelist(), true ) ) { + return $this->get_constant( $id ); + } elseif ( 'all' === $id ) { + return $this->get_all_constants(); + } + } + + return false; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php new file mode 100644 index 00000000..bee3e889 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php @@ -0,0 +1,470 @@ +is_started() && ! $this->is_finished() ) { + /** + * Fires when a full sync is cancelled. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_cancelled' ); + $this->send_action( 'jetpack_full_sync_cancelled' ); + } + + // Remove all evidence of previous full sync items and status. + $this->reset_data(); + + if ( ! is_array( $full_sync_config ) ) { + $full_sync_config = Defaults::$default_full_sync_config; + if ( is_multisite() ) { + $full_sync_config['network_options'] = 1; + } + } + + if ( isset( $full_sync_config['users'] ) && 'initial' === $full_sync_config['users'] ) { + $full_sync_config['users'] = Modules::get_module( 'users' )->get_initial_sync_user_config(); + } + + $this->update_status( + array( + 'started' => time(), + 'config' => $full_sync_config, + 'progress' => $this->get_initial_progress( $full_sync_config ), + ) + ); + + $range = $this->get_content_range( $full_sync_config ); + /** + * Fires when a full sync begins. This action is serialized + * and sent to the server so that it knows a full sync is coming. + * + * @param array $full_sync_config Sync configuration for all sync modules. + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * @param array $empty The modules with no items to sync during a full sync. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * @since-jetpack 7.4.0 Added $empty arg. + */ + do_action( 'jetpack_full_sync_start', $full_sync_config, $range ); + $this->send_action( 'jetpack_full_sync_start', array( $full_sync_config, $range ) ); + + return true; + } + + /** + * Whether full sync has started. + * + * @access public + * + * @return boolean + */ + public function is_started() { + return (bool) $this->get_status()['started']; + } + + /** + * Retrieve the status of the current full sync. + * + * @access public + * + * @return array Full sync status. + */ + public function get_status() { + $default = array( + 'started' => false, + 'finished' => false, + 'progress' => array(), + 'config' => array(), + ); + + return wp_parse_args( \Jetpack_Options::get_raw_option( self::STATUS_OPTION ), $default ); + } + + /** + * Returns the progress percentage of a full sync. + * + * @access public + * + * @return int|null + */ + public function get_sync_progress_percentage() { + if ( ! $this->is_started() || $this->is_finished() ) { + return null; + } + $status = $this->get_status(); + if ( empty( $status['progress'] ) ) { + return null; + } + $total_items = array_reduce( + array_values( $status['progress'] ), + function ( $sum, $sync_item ) { + return isset( $sync_item['total'] ) ? ( $sum + (int) $sync_item['total'] ) : $sum; + }, + 0 + ); + $total_sent = array_reduce( + array_values( $status['progress'] ), + function ( $sum, $sync_item ) { + return isset( $sync_item['sent'] ) ? ( $sum + (int) $sync_item['sent'] ) : $sum; + }, + 0 + ); + return floor( ( $total_sent / $total_items ) * 100 ); + } + + /** + * Whether full sync has finished. + * + * @access public + * + * @return boolean + */ + public function is_finished() { + return (bool) $this->get_status()['finished']; + } + + /** + * Clear all the full sync data. + * + * @access public + */ + public function reset_data() { + $this->clear_status(); + ( new Lock() )->remove( self::LOCK_NAME, true ); + } + + /** + * Clear all the full sync status options. + * + * @access public + */ + public function clear_status() { + \Jetpack_Options::delete_raw_option( self::STATUS_OPTION ); + } + + /** + * Updates the status of the current full sync. + * + * @access public + * + * @param array $values New values to set. + * + * @return bool True if success. + */ + public function update_status( $values ) { + return $this->set_status( wp_parse_args( $values, $this->get_status() ) ); + } + + /** + * Retrieve the status of the current full sync. + * + * @param array $values New values to set. + * + * @access public + * + * @return boolean Full sync status. + */ + public function set_status( $values ) { + return \Jetpack_Options::update_raw_option( self::STATUS_OPTION, $values ); + } + + /** + * Given an initial Full Sync configuration get the initial status. + * + * @param array $full_sync_config Full sync configuration. + * + * @return array Initial Sent status. + */ + public function get_initial_progress( $full_sync_config ) { + // Set default configuration, calculate totals, and save configuration if totals > 0. + $status = array(); + foreach ( $full_sync_config as $name => $config ) { + $module = Modules::get_module( $name ); + if ( ! $module ) { + continue; + } + $status[ $name ] = array( + 'total' => $module->total( $config ), + 'sent' => 0, + 'finished' => false, + ); + } + + return $status; + } + + /** + * Get the range for content (posts and comments) to sync. + * + * @access private + * + * @return array Array of range (min ID, max ID, total items) for all content types. + */ + private function get_content_range() { + $range = array(); + $config = $this->get_status()['config']; + // Add range only when syncing all objects. + if ( true === isset( $config['posts'] ) && $config['posts'] ) { + $range['posts'] = $this->get_range( 'posts' ); + } + + if ( true === isset( $config['comments'] ) && $config['comments'] ) { + $range['comments'] = $this->get_range( 'comments' ); + } + + return $range; + } + + /** + * Get the range (min ID, max ID and total items) of items to sync. + * + * @access public + * + * @param string $type Type of sync item to get the range for. + * + * @return array Array of min ID, max ID and total items in the range. + */ + public function get_range( $type ) { + global $wpdb; + if ( ! in_array( $type, array( 'comments', 'posts' ), true ) ) { + return array(); + } + + switch ( $type ) { + case 'posts': + $table = $wpdb->posts; + $id = 'ID'; + $where_sql = Settings::get_blacklisted_post_types_sql(); + + break; + case 'comments': + $table = $wpdb->comments; + $id = 'comment_ID'; + $where_sql = Settings::get_comments_filter_sql(); + break; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $results = $wpdb->get_results( "SELECT MAX({$id}) as max, MIN({$id}) as min, COUNT({$id}) as count FROM {$table} WHERE {$where_sql}" ); + if ( isset( $results[0] ) ) { + return $results[0]; + } + + return array(); + } + + /** + * Continue sending instead of enqueueing. + * + * @access public + */ + public function continue_enqueuing() { + $this->continue_sending(); + } + + /** + * Continue sending. + * + * @access public + */ + public function continue_sending() { + // Return early if Full Sync is not running. + if ( ! $this->is_started() || $this->get_status()['finished'] ) { + return; + } + + // Return early if we've gotten a retry-after header response. + $retry_time = get_option( Actions::RETRY_AFTER_PREFIX . 'immediate-send' ); + if ( $retry_time ) { + // If expired delete but don't send. Send will occurr in new request to avoid race conditions. + if ( microtime( true ) > $retry_time ) { + update_option( Actions::RETRY_AFTER_PREFIX . 'immediate-send', false, false ); + } + return false; + } + + // Obtain send Lock. + $lock = new Lock(); + $lock_expiration = $lock->attempt( self::LOCK_NAME ); + + // Return if unable to obtain lock. + if ( false === $lock_expiration ) { + return; + } + + // Send Full Sync actions. + $success = $this->send(); + + // Remove lock. + if ( $success ) { + $lock->remove( self::LOCK_NAME, $lock_expiration ); + } + } + + /** + * Immediately send the next items to full sync. + * + * @access public + */ + public function send() { + $config = $this->get_status()['config']; + + $max_duration = Settings::get_setting( 'full_sync_send_duration' ); + $send_until = microtime( true ) + $max_duration; + + $progress = $this->get_status()['progress']; + + foreach ( $this->get_remaining_modules_to_send() as $module ) { + $progress[ $module->name() ] = $module->send_full_sync_actions( $config[ $module->name() ], $progress[ $module->name() ], $send_until ); + if ( isset( $progress[ $module->name() ]['error'] ) ) { + unset( $progress[ $module->name() ]['error'] ); + $this->update_status( array( 'progress' => $progress ) ); + return false; + } elseif ( ! $progress[ $module->name() ]['finished'] ) { + $this->update_status( array( 'progress' => $progress ) ); + return true; + } + } + + $this->send_full_sync_end(); + $this->update_status( array( 'progress' => $progress ) ); + return true; + } + + /** + * Get Modules that are configured to Full Sync and haven't finished sending + * + * @return array + */ + public function get_remaining_modules_to_send() { + $status = $this->get_status(); + + return array_filter( + Modules::get_modules(), + /** + * Select configured and not finished modules. + * + * @return bool + * @var $module Module + */ + function ( $module ) use ( $status ) { + // Skip module if not configured for this sync or module is done. + if ( ! isset( $status['config'][ $module->name() ] ) ) { + return false; + } + if ( ! $status['config'][ $module->name() ] ) { + return false; + } + if ( isset( $status['progress'][ $module->name() ]['finished'] ) ) { + if ( true === $status['progress'][ $module->name() ]['finished'] ) { + return false; + } + } + + return true; + } + ); + } + + /** + * Send 'jetpack_full_sync_end' and update 'finished' status. + * + * @access public + */ + public function send_full_sync_end() { + $range = $this->get_content_range(); + + /** + * Fires when a full sync ends. This action is serialized + * and sent to the server. + * + * @param string $checksum Deprecated since 7.3.0 - @see https://github.com/Automattic/jetpack/pull/11945/ + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + */ + do_action( 'jetpack_full_sync_end', '', $range ); + $this->send_action( 'jetpack_full_sync_end', array( '', $range ) ); + + // Setting autoload to true means that it's faster to check whether we should continue enqueuing. + $this->update_status( array( 'finished' => time() ) ); + } + + /** + * Empty Function as we don't close buffers on Immediate Full Sync. + * + * @param array $actions an array of actions, ignored for queueless sync. + */ + public function update_sent_progress_action( $actions ) { } // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php new file mode 100644 index 00000000..90121e88 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php @@ -0,0 +1,730 @@ +is_started() && ! $this->is_finished(); + + // Remove all evidence of previous full sync items and status. + $this->reset_data(); + + if ( $was_already_running ) { + /** + * Fires when a full sync is cancelled. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + */ + do_action( 'jetpack_full_sync_cancelled' ); + } + + $this->update_status_option( 'started', time() ); + $this->update_status_option( 'params', $module_configs ); + + $enqueue_status = array(); + $full_sync_config = array(); + $include_empty = false; + $empty = array(); + + // Default value is full sync. + if ( ! is_array( $module_configs ) ) { + $module_configs = array(); + $include_empty = true; + foreach ( Modules::get_modules() as $module ) { + $module_configs[ $module->name() ] = true; + } + } + + // Set default configuration, calculate totals, and save configuration if totals > 0. + foreach ( Modules::get_modules() as $module ) { + $module_name = $module->name(); + $module_config = isset( $module_configs[ $module_name ] ) ? $module_configs[ $module_name ] : false; + + if ( ! $module_config ) { + continue; + } + + if ( 'users' === $module_name && 'initial' === $module_config ) { + $module_config = $module->get_initial_sync_user_config(); + } + + $enqueue_status[ $module_name ] = false; + + $total_items = $module->estimate_full_sync_actions( $module_config ); + + // If there's information to process, configure this module. + if ( $total_items !== null && $total_items > 0 ) { + $full_sync_config[ $module_name ] = $module_config; + $enqueue_status[ $module_name ] = array( + $total_items, // Total. + 0, // Queued. + false, // Current state. + ); + } elseif ( $include_empty && 0 === $total_items ) { + $empty[ $module_name ] = true; + } + } + + $this->set_config( $full_sync_config ); + $this->set_enqueue_status( $enqueue_status ); + + $range = $this->get_content_range( $full_sync_config ); + /** + * Fires when a full sync begins. This action is serialized + * and sent to the server so that it knows a full sync is coming. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * @since-jetpack 7.4.0 Added $empty arg. + * + * @param array $full_sync_config Sync configuration for all sync modules. + * @param array $range Range of the sync items, containing min and max IDs for some item types. + * @param array $empty The modules with no items to sync during a full sync. + */ + do_action( 'jetpack_full_sync_start', $full_sync_config, $range, $empty ); + + $this->continue_enqueuing( $full_sync_config ); + + return true; + } + + /** + * Enqueue the next items to sync. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function continue_enqueuing( $configs = null ) { + // Return early if not in progress. + if ( ! $this->get_status_option( 'started' ) || $this->get_status_option( 'queue_finished' ) ) { + return; + } + + // Attempt to obtain lock. + $lock = new Lock(); + $lock_expiration = $lock->attempt( self::ENQUEUE_LOCK_NAME ); + + // Return if unable to obtain lock. + if ( false === $lock_expiration ) { + return; + } + + // enqueue full sync actions. + $this->enqueue( $configs ); + + // Remove lock. + $lock->remove( self::ENQUEUE_LOCK_NAME, $lock_expiration ); + } + + /** + * Get Modules that are configured to Full Sync and haven't finished enqueuing + * + * @param array $configs Full sync configuration for all sync modules. + * + * @return array + */ + public function get_remaining_modules_to_enqueue( $configs ) { + $enqueue_status = $this->get_enqueue_status(); + return array_filter( + Modules::get_modules(), + /** + * Select configured and not finished modules. + * + * @var $module Module + * @return bool + */ + function ( $module ) use ( $configs, $enqueue_status ) { + // Skip module if not configured for this sync or module is done. + if ( ! isset( $configs[ $module->name() ] ) ) { + return false; + } + if ( ! $configs[ $module->name() ] ) { + return false; + } + if ( isset( $enqueue_status[ $module->name() ][2] ) ) { + if ( true === $enqueue_status[ $module->name() ][2] ) { + return false; + } + } + + return true; + } + ); + } + + /** + * Enqueue the next items to sync. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function enqueue( $configs = null ) { + if ( ! $configs ) { + $configs = $this->get_config(); + } + + $enqueue_status = $this->get_enqueue_status(); + $full_sync_queue = new Queue( 'full_sync' ); + $available_queue_slots = Settings::get_setting( 'max_queue_size_full_sync' ) - $full_sync_queue->size(); + + if ( $available_queue_slots <= 0 ) { + return; + } + + $remaining_items_to_enqueue = min( Settings::get_setting( 'max_enqueue_full_sync' ), $available_queue_slots ); + + /** + * If a module exits early (e.g. because it ran out of full sync queue slots, or we ran out of request time) + * then it should exit early + */ + foreach ( $this->get_remaining_modules_to_enqueue( $configs ) as $module ) { + list( $items_enqueued, $next_enqueue_state ) = $module->enqueue_full_sync_actions( $configs[ $module->name() ], $remaining_items_to_enqueue, $enqueue_status[ $module->name() ][2] ); + + $enqueue_status[ $module->name() ][2] = $next_enqueue_state; + + // If items were processed, subtract them from the limit. + if ( $items_enqueued !== null && $items_enqueued > 0 ) { + $enqueue_status[ $module->name() ][1] += $items_enqueued; + $remaining_items_to_enqueue -= $items_enqueued; + } + + if ( 0 >= $remaining_items_to_enqueue || true !== $next_enqueue_state ) { + $this->set_enqueue_status( $enqueue_status ); + return; + } + } + + $this->queue_full_sync_end( $configs ); + $this->set_enqueue_status( $enqueue_status ); + } + + /** + * Enqueue 'jetpack_full_sync_end' and update 'queue_finished' status. + * + * @access public + * + * @param array $configs Full sync configuration for all sync modules. + */ + public function queue_full_sync_end( $configs ) { + $range = $this->get_content_range( $configs ); + + /** + * Fires when a full sync ends. This action is serialized + * and sent to the server. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * @since-jetpack 7.3.0 Added $range arg. + * + * @param string $checksum Deprecated since 7.3.0 - @see https://github.com/Automattic/jetpack/pull/11945/ + * @param array $range Range of the sync items, containing min and max IDs for some item types. + */ + do_action( 'jetpack_full_sync_end', '', $range ); + + // Setting autoload to true means that it's faster to check whether we should continue enqueuing. + $this->update_status_option( 'queue_finished', time(), true ); + } + + /** + * Get the range (min ID, max ID and total items) of items to sync. + * + * @access public + * + * @param string $type Type of sync item to get the range for. + * @return array Array of min ID, max ID and total items in the range. + */ + public function get_range( $type ) { + global $wpdb; + if ( ! in_array( $type, array( 'comments', 'posts' ), true ) ) { + return array(); + } + + switch ( $type ) { + case 'posts': + $table = $wpdb->posts; + $id = 'ID'; + $where_sql = Settings::get_blacklisted_post_types_sql(); + + break; + case 'comments': + $table = $wpdb->comments; + $id = 'comment_ID'; + $where_sql = Settings::get_comments_filter_sql(); + break; + } + + // TODO: Call $wpdb->prepare on the following query. + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $results = $wpdb->get_results( "SELECT MAX({$id}) as max, MIN({$id}) as min, COUNT({$id}) as count FROM {$table} WHERE {$where_sql}" ); + if ( isset( $results[0] ) ) { + return $results[0]; + } + + return array(); + } + + /** + * Get the range for content (posts and comments) to sync. + * + * @access private + * + * @param array $config Full sync configuration for this all sync modules. + * @return array Array of range (min ID, max ID, total items) for all content types. + */ + private function get_content_range( $config ) { + $range = array(); + // Only when we are sending the whole range do we want to send also the range. + if ( true === isset( $config['posts'] ) && $config['posts'] ) { + $range['posts'] = $this->get_range( 'posts' ); + } + + if ( true === isset( $config['comments'] ) && $config['comments'] ) { + $range['comments'] = $this->get_range( 'comments' ); + } + return $range; + } + + /** + * Update the progress after sync modules actions have been processed on the server. + * + * @access public + * + * @param array $actions Actions that have been processed on the server. + */ + public function update_sent_progress_action( $actions ) { + // Quick way to map to first items with an array of arrays. + $actions_with_counts = array_count_values( array_filter( array_map( array( $this, 'get_action_name' ), $actions ) ) ); + + // Total item counts for each action. + $actions_with_total_counts = $this->get_actions_totals( $actions ); + + if ( ! $this->is_started() || $this->is_finished() ) { + return; + } + + if ( isset( $actions_with_counts['jetpack_full_sync_start'] ) ) { + $this->update_status_option( 'send_started', time() ); + } + + foreach ( Modules::get_modules() as $module ) { + $module_actions = $module->get_full_sync_actions(); + $status_option_name = "{$module->name()}_sent"; + $total_option_name = "{$status_option_name}_total"; + $items_sent = $this->get_status_option( $status_option_name, 0 ); + $items_sent_total = $this->get_status_option( $total_option_name, 0 ); + + foreach ( $module_actions as $module_action ) { + if ( isset( $actions_with_counts[ $module_action ] ) ) { + $items_sent += $actions_with_counts[ $module_action ]; + } + + if ( ! empty( $actions_with_total_counts[ $module_action ] ) ) { + $items_sent_total += $actions_with_total_counts[ $module_action ]; + } + } + + if ( $items_sent > 0 ) { + $this->update_status_option( $status_option_name, $items_sent ); + } + + if ( 0 !== $items_sent_total ) { + $this->update_status_option( $total_option_name, $items_sent_total ); + } + } + + if ( isset( $actions_with_counts['jetpack_full_sync_end'] ) ) { + $this->update_status_option( 'finished', time() ); + } + } + + /** + * Returns the progress percentage of a full sync. + * + * @access public + * + * @return int|null + */ + public function get_sync_progress_percentage() { + if ( ! $this->is_started() || $this->is_finished() ) { + return null; + } + $status = $this->get_status(); + if ( ! $status['queue'] || ! $status['sent'] || ! $status['total'] ) { + return null; + } + $queued_multiplier = 0.1; + $sent_multiplier = 0.9; + $count_queued = array_reduce( + $status['queue'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $count_sent = array_reduce( + $status['sent'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $count_total = array_reduce( + $status['total'], + function ( $sum, $value ) { + return $sum + $value; + }, + 0 + ); + $percent_queued = ( $count_queued / $count_total ) * $queued_multiplier * 100; + $percent_sent = ( $count_sent / $count_total ) * $sent_multiplier * 100; + return ceil( $percent_queued + $percent_sent ); + } + + /** + * Get the name of the action for an item in the sync queue. + * + * @access public + * + * @param array $queue_item Item of the sync queue. + * @return string|boolean Name of the action, false if queue item is invalid. + */ + public function get_action_name( $queue_item ) { + if ( is_array( $queue_item ) && isset( $queue_item[0] ) ) { + return $queue_item[0]; + } + return false; + } + + /** + * Retrieve the total number of items we're syncing in a particular queue item (action). + * `$queue_item[1]` is expected to contain chunks of items, and `$queue_item[1][0]` + * represents the first (and only) chunk of items to sync in that action. + * + * @access public + * + * @param array $queue_item Item of the sync queue that corresponds to a particular action. + * @return int Total number of items in the action. + */ + public function get_action_totals( $queue_item ) { + if ( is_array( $queue_item ) && isset( $queue_item[1][0] ) ) { + if ( is_array( $queue_item[1][0] ) ) { + // Let's count the items we sync in this action. + return count( $queue_item[1][0] ); + } + // -1 indicates that this action syncs all items by design. + return -1; + } + return 0; + } + + /** + * Retrieve the total number of items for a set of actions, grouped by action name. + * + * @access public + * + * @param array $actions An array of actions. + * @return array An array, representing the total number of items, grouped per action. + */ + public function get_actions_totals( $actions ) { + $totals = array(); + + foreach ( $actions as $action ) { + $name = $this->get_action_name( $action ); + $action_totals = $this->get_action_totals( $action ); + if ( ! isset( $totals[ $name ] ) ) { + $totals[ $name ] = 0; + } + $totals[ $name ] += $action_totals; + } + + return $totals; + } + + /** + * Whether full sync has started. + * + * @access public + * + * @return boolean + */ + public function is_started() { + return (bool) $this->get_status_option( 'started' ); + } + + /** + * Whether full sync has finished. + * + * @access public + * + * @return boolean + */ + public function is_finished() { + return (bool) $this->get_status_option( 'finished' ); + } + + /** + * Retrieve the status of the current full sync. + * + * @access public + * + * @return array Full sync status. + */ + public function get_status() { + $status = array( + 'started' => $this->get_status_option( 'started' ), + 'queue_finished' => $this->get_status_option( 'queue_finished' ), + 'send_started' => $this->get_status_option( 'send_started' ), + 'finished' => $this->get_status_option( 'finished' ), + 'sent' => array(), + 'sent_total' => array(), + 'queue' => array(), + 'config' => $this->get_status_option( 'params' ), + 'total' => array(), + ); + + $enqueue_status = $this->get_enqueue_status(); + + foreach ( Modules::get_modules() as $module ) { + $name = $module->name(); + + if ( ! isset( $enqueue_status[ $name ] ) ) { + continue; + } + + list( $total, $queued ) = $enqueue_status[ $name ]; + + if ( $total ) { + $status['total'][ $name ] = $total; + } + + if ( $queued ) { + $status['queue'][ $name ] = $queued; + } + + $sent = $this->get_status_option( "{$name}_sent" ); + if ( $sent ) { + $status['sent'][ $name ] = $sent; + } + + $sent_total = $this->get_status_option( "{$name}_sent_total" ); + if ( $sent_total ) { + $status['sent_total'][ $name ] = $sent_total; + } + } + + return $status; + } + + /** + * Clear all the full sync status options. + * + * @access public + */ + public function clear_status() { + $prefix = self::STATUS_OPTION_PREFIX; + \Jetpack_Options::delete_raw_option( "{$prefix}_started" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_params" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_queue_finished" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_send_started" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_finished" ); + + $this->delete_enqueue_status(); + + foreach ( Modules::get_modules() as $module ) { + \Jetpack_Options::delete_raw_option( "{$prefix}_{$module->name()}_sent" ); + \Jetpack_Options::delete_raw_option( "{$prefix}_{$module->name()}_sent_total" ); + } + } + + /** + * Clear all the full sync data. + * + * @access public + */ + public function reset_data() { + $this->clear_status(); + $this->delete_config(); + ( new Lock() )->remove( self::ENQUEUE_LOCK_NAME, true ); + + $listener = Listener::get_instance(); + $listener->get_full_sync_queue()->reset(); + } + + /** + * Get the value of a full sync status option. + * + * @access private + * + * @param string $name Name of the option. + * @param mixed $default Default value of the option. + * @return mixed Option value. + */ + private function get_status_option( $name, $default = null ) { + $value = \Jetpack_Options::get_raw_option( self::STATUS_OPTION_PREFIX . "_$name", $default ); + + return is_numeric( $value ) ? (int) $value : $value; + } + + /** + * Update the value of a full sync status option. + * + * @access private + * + * @param string $name Name of the option. + * @param mixed $value Value of the option. + * @param boolean $autoload Whether the option should be autoloaded at the beginning of the request. + */ + private function update_status_option( $name, $value, $autoload = false ) { + \Jetpack_Options::update_raw_option( self::STATUS_OPTION_PREFIX . "_$name", $value, $autoload ); + } + + /** + * Set the full sync enqueue status. + * + * @access private + * + * @param array $new_status The new full sync enqueue status. + */ + private function set_enqueue_status( $new_status ) { + \Jetpack_Options::update_raw_option( 'jetpack_sync_full_enqueue_status', $new_status ); + } + + /** + * Delete full sync enqueue status. + * + * @access private + * + * @return boolean Whether the status was deleted. + */ + private function delete_enqueue_status() { + return \Jetpack_Options::delete_raw_option( 'jetpack_sync_full_enqueue_status' ); + } + + /** + * Retrieve the current full sync enqueue status. + * + * @access private + * + * @return array Full sync enqueue status. + */ + public function get_enqueue_status() { + return \Jetpack_Options::get_raw_option( 'jetpack_sync_full_enqueue_status' ); + } + + /** + * Set the full sync enqueue configuration. + * + * @access private + * + * @param array $config The new full sync enqueue configuration. + */ + private function set_config( $config ) { + \Jetpack_Options::update_raw_option( 'jetpack_sync_full_config', $config ); + } + + /** + * Delete full sync configuration. + * + * @access private + * + * @return boolean Whether the configuration was deleted. + */ + private function delete_config() { + return \Jetpack_Options::delete_raw_option( 'jetpack_sync_full_config' ); + } + + /** + * Retrieve the current full sync enqueue config. + * + * @access private + * + * @return array Full sync enqueue config. + */ + private function get_config() { + return \Jetpack_Options::get_raw_option( 'jetpack_sync_full_config' ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php new file mode 100644 index 00000000..839434dd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php @@ -0,0 +1,220 @@ + 'jetpack_sync_import_start', + 'import_done' => 'jetpack_sync_import_end', + 'import_end' => 'jetpack_sync_import_end', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'import'; + } + + /** + * Initialize imports action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'export_wp', $callable ); + add_action( 'jetpack_sync_import_start', $callable, 10, 2 ); + add_action( 'jetpack_sync_import_end', $callable, 10, 2 ); + + // WordPress. + add_action( 'import_start', array( $this, 'sync_import_action' ) ); + + // Movable type, RSS, Livejournal. + add_action( 'import_done', array( $this, 'sync_import_action' ) ); + + // WordPress, Blogger, Livejournal, woo tax rate. + add_action( 'import_end', array( $this, 'sync_import_action' ) ); + } + + /** + * Set module defaults. + * Define an empty list of synced actions for us to fill later. + * + * @access public + */ + public function set_defaults() { + $this->synced_actions = array(); + } + + /** + * Generic handler for import actions. + * + * @access public + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + */ + public function sync_import_action( $importer ) { + $import_action = current_filter(); + // Map action to event name. + $sync_action = self::$import_sync_action_map[ $import_action ]; + + // Only sync each action once per import. + if ( array_key_exists( $sync_action, $this->synced_actions ) && $this->synced_actions[ $sync_action ] ) { + return; + } + + // Mark this action as synced. + $this->synced_actions[ $sync_action ] = true; + + // Prefer self-reported $importer value. + if ( ! $importer ) { + // Fall back to inferring by calling class name. + $importer = self::get_calling_importer_class(); + } + + // Get $importer from known_importers. + $known_importers = Settings::get_setting( 'known_importers' ); + if ( is_string( $importer ) && isset( $known_importers[ $importer ] ) ) { + $importer = $known_importers[ $importer ]; + } + + $importer_name = $this->get_importer_name( $importer ); + + switch ( $sync_action ) { + case 'jetpack_sync_import_start': + /** + * Used for syncing the start of an import + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @module sync + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @param string $importer_name The name reported by the importer, or 'Unknown Importer'. + */ + do_action( 'jetpack_sync_import_start', $importer, $importer_name ); + break; + + case 'jetpack_sync_import_end': + /** + * Used for syncing the end of an import + * + * @since 1.6.3 + * @since-jetpack 7.3.0 + * + * @module sync + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @param string $importer_name The name reported by the importer, or 'Unknown Importer'. + */ + do_action( 'jetpack_sync_import_end', $importer, $importer_name ); + break; + } + } + + /** + * Retrieve the name of the importer. + * + * @access private + * + * @param string $importer Either a string reported by the importer, the class name of the importer, or 'unknown'. + * @return string Name of the importer, or "Unknown Importer" if importer is unknown. + */ + private function get_importer_name( $importer ) { + $importers = get_importers(); + return isset( $importers[ $importer ] ) ? $importers[ $importer ][0] : 'Unknown Importer'; + } + + /** + * Determine the class that extends `WP_Importer` which is responsible for + * the current action. Designed to be used within an action handler. + * + * @access private + * @static + * + * @return string The name of the calling class, or 'unknown'. + */ + private static function get_calling_importer_class() { + // If WP_Importer doesn't exist, neither will any importer that extends it. + if ( ! class_exists( 'WP_Importer', false ) ) { + return 'unknown'; + } + + $action = current_filter(); + $backtrace = debug_backtrace( false ); //phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.debug_backtrace_optionsFound,WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + + $do_action_pos = -1; + $backtrace_len = count( $backtrace ); + for ( $i = 0; $i < $backtrace_len; $i++ ) { + // Find the location in the stack of the calling action. + if ( 'do_action' === $backtrace[ $i ]['function'] && $action === $backtrace[ $i ]['args'][0] ) { + $do_action_pos = $i; + break; + } + } + + // If the action wasn't called, the calling class is unknown. + if ( -1 === $do_action_pos ) { + return 'unknown'; + } + + // Continue iterating the stack looking for a caller that extends WP_Importer. + for ( $i = $do_action_pos + 1; $i < $backtrace_len; $i++ ) { + // If there is no class on the trace, continue. + if ( ! isset( $backtrace[ $i ]['class'] ) ) { + continue; + } + + $class_name = $backtrace[ $i ]['class']; + + // Check if the class extends WP_Importer. + if ( class_exists( $class_name, false ) ) { + $parents = class_parents( $class_name, false ); + if ( $parents && in_array( 'WP_Importer', $parents, true ) ) { + return $class_name; + } + } + } + + // If we've exhausted the stack without a match, the calling class is unknown. + return 'unknown'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php new file mode 100644 index 00000000..bf6c5620 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php @@ -0,0 +1,146 @@ +nav_items_just_added[] = $nav_item_id; + /** + * Helps sync log that a new menu item was added. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $menu_id ID of the menu. + * @param array $menu_data An array of menu data. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to add the menu item. + */ + do_action( 'jetpack_sync_updated_nav_menu_add_item', $menu_id, $menu_data, $nav_item_id, $nav_item_args ); + } + + /** + * Nav menu item update handler. + * + * @access public + * + * @param int $menu_id ID of the menu. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to update the menu item. + */ + public function update_nav_menu_update_item( $menu_id, $nav_item_id, $nav_item_args ) { + if ( in_array( $nav_item_id, $this->nav_items_just_added, true ) ) { + return; + } + $menu_data = wp_get_nav_menu_object( $menu_id ); + /** + * Helps sync log that an update to the menu item happened. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $menu_id ID of the menu. + * @param array $menu_data An array of menu data. + * @param int $nav_item_id ID of the new menu item. + * @param array $nav_item_args Arguments used to update the menu item. + */ + do_action( 'jetpack_sync_updated_nav_menu_update_item', $menu_id, $menu_data, $nav_item_id, $nav_item_args ); + } + + /** + * Remove menu items that have already been saved from the "just added" list. + * + * @access public + * + * @param int $nav_item_id ID of the new menu item. + * @param \WP_Post $post_after Nav menu item post object after the update. + */ + public function remove_just_added_menu_item( $nav_item_id, $post_after ) { + if ( 'nav_menu_item' !== $post_after->post_type ) { + return; + } + $this->nav_items_just_added = array_diff( $this->nav_items_just_added, array( $nav_item_id ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php new file mode 100644 index 00000000..de293a9b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php @@ -0,0 +1,112 @@ +prepare call to use placeholders. + * + * @param string $object_type The type of object for which we retrieve meta. Either 'post' or 'comment'. + * @param array $config Must include 'meta_key' and 'ids' keys. + * + * @return array + */ + public function get_objects_by_id( $object_type, $config ) { + $table = _get_meta_table( $object_type ); + + if ( ! $table ) { + return array(); + } + + if ( ! is_array( $config ) ) { + return array(); + } + + $meta_objects = array(); + foreach ( $config as $item ) { + $meta = null; + if ( isset( $item['id'] ) && isset( $item['meta_key'] ) ) { + $meta = $this->get_object_by_id( $object_type, (int) $item['id'], (string) $item['meta_key'] ); + } + $meta_objects[ $item['id'] . '-' . $item['meta_key'] ] = $meta; + } + + return $meta_objects; + } + + /** + * Get a single Meta Result. + * + * @param string $object_type post, comment, term, user. + * @param null $id Object ID. + * @param null $meta_key Meta Key. + * + * @return mixed|null + */ + public function get_object_by_id( $object_type, $id = null, $meta_key = null ) { + global $wpdb; + + if ( ! is_int( $id ) || ! is_string( $meta_key ) ) { + return null; + } + + $table = _get_meta_table( $object_type ); + $object_id_column = $object_type . '_id'; + + // Sanitize so that the array only has integer values. + $meta = $wpdb->get_results( + $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT * FROM {$table} WHERE {$object_id_column} = %d AND meta_key = %s", + $id, + $meta_key + ), + ARRAY_A + ); + + $meta_objects = null; + + if ( ! is_wp_error( $meta ) && ! empty( $meta ) ) { + foreach ( $meta as $meta_entry ) { + if ( 'post' === $object_type && strlen( $meta_entry['meta_value'] ) >= Posts::MAX_POST_META_LENGTH ) { + $meta_entry['meta_value'] = ''; + } + $meta_objects[] = array( + 'meta_type' => $object_type, + 'meta_id' => $meta_entry['meta_id'], + 'meta_key' => $meta_key, + 'meta_value' => $meta_entry['meta_value'], + 'object_id' => $meta_entry[ $object_id_column ], + ); + } + } + + return $meta_objects; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php new file mode 100644 index 00000000..a50cdd52 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php @@ -0,0 +1,604 @@ +recursive_ksort( $values ); + } + return crc32( wp_json_encode( Functions::json_wrap( $values ) ) ); + } + + /** + * Recursively call ksort on an Array + * + * @param array $values Array. + */ + private function recursive_ksort( &$values ) { + ksort( $values ); + foreach ( $values as &$value ) { + if ( is_array( $value ) ) { + $this->recursive_ksort( $value ); + } + } + } + + /** + * Whether a particular checksum in a set of checksums is valid. + * + * @access protected + * + * @param array $sums_to_check Array of checksums. + * @param string $name Name of the checksum. + * @param int $new_sum Checksum to compare against. + * @return boolean Whether the checksum is valid. + */ + protected function still_valid_checksum( $sums_to_check, $name, $new_sum ) { + if ( isset( $sums_to_check[ $name ] ) && $sums_to_check[ $name ] === $new_sum ) { + return true; + } + + return false; + } + + /** + * Enqueue all items of a sync type as an action. + * + * @access protected + * + * @param string $action_name Name of the action. + * @param string $table_name Name of the database table. + * @param string $id_field Name of the ID field in the database. + * @param string $where_sql The SQL WHERE clause to filter to the desired items. + * @param int $max_items_to_enqueue Maximum number of items to enqueue in the same time. + * @param boolean $state Whether enqueueing has finished. + * @return array Array, containing the number of chunks and TRUE, indicating enqueueing has finished. + */ + protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql, $max_items_to_enqueue, $state ) { + global $wpdb; + + if ( ! $where_sql ) { + $where_sql = '1 = 1'; + } + + $items_per_page = 1000; + $page = 1; + $chunk_count = 0; + $previous_interval_end = $state ? $state : '~0'; + $listener = Listener::get_instance(); + + // Count down from max_id to min_id so we get newest posts/comments/etc first. + // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition, WordPress.DB.PreparedSQL.InterpolatedNotPrepared + while ( $ids = $wpdb->get_col( "SELECT {$id_field} FROM {$table_name} WHERE {$where_sql} AND {$id_field} < {$previous_interval_end} ORDER BY {$id_field} DESC LIMIT {$items_per_page}" ) ) { + // Request posts in groups of N for efficiency. + $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); + + // If we hit our row limit, process and return. + if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { + $remaining_items_count = $max_items_to_enqueue - $chunk_count; + $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); + $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); + $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); + + $last_chunk = end( $remaining_items ); + return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); + } + $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); + + $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); + + $chunk_count += count( $chunked_ids ); + ++$page; + // The $ids are ordered in descending order. + $previous_interval_end = end( $ids ); + } + + if ( $wpdb->last_error ) { + // return the values that were passed in so all these chunks get retried. + return array( $max_items_to_enqueue, $state ); + } + + return array( $chunk_count, true ); + } + + /** + * Given the Module Full Sync Configuration and Status return the next chunk of items to send. + * + * @param array $config This module Full Sync configuration. + * @param array $status This module Full Sync status. + * @param int $chunk_size Chunk size. + * + * @return array|object|null + */ + public function get_next_chunk( $config, $status, $chunk_size ) { + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared + global $wpdb; + return $wpdb->get_col( + <<id_field()} +FROM {$wpdb->{$this->table_name()}} +WHERE {$this->get_where_sql( $config )} +AND {$this->id_field()} < {$status['last_sent']} +ORDER BY {$this->id_field()} +DESC LIMIT {$chunk_size} +SQL + ); + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared + } + + /** + * Return the initial last sent object. + * + * @return string|array initial status. + */ + public function get_initial_last_sent() { + return '~0'; + } + + /** + * Immediately send all items of a sync type as an action. + * + * @access protected + * + * @param string $config Full sync configuration for this module. + * @param array $status the current module full sync status. + * @param float $send_until timestamp until we want this request to send full sync events. + * + * @return array Status, the module full sync status updated. + */ + public function send_full_sync_actions( $config, $status, $send_until ) { + global $wpdb; + + if ( empty( $status['last_sent'] ) ) { + $status['last_sent'] = $this->get_initial_last_sent(); + } + + $limits = Settings::get_setting( 'full_sync_limits' )[ $this->name() ]; + + $chunks_sent = 0; + // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition + while ( $objects = $this->get_next_chunk( $config, $status, $limits['chunk_size'] ) ) { + if ( $chunks_sent++ === $limits['max_chunks'] || microtime( true ) >= $send_until ) { + return $status; + } + + $result = $this->send_action( 'jetpack_full_sync_' . $this->name(), array( $objects, $status['last_sent'] ) ); + + if ( is_wp_error( $result ) || $wpdb->last_error ) { + $status['error'] = true; + return $status; + } + // The $ids are ordered in descending order. + $status['last_sent'] = end( $objects ); + $status['sent'] += count( $objects ); + } + + if ( ! $wpdb->last_error ) { + $status['finished'] = true; + } + + return $status; + } + + /** + * Immediately sends a single item without firing or enqueuing it + * + * @param string $action_name The action. + * @param array $data The data associated with the action. + */ + public function send_action( $action_name, $data = null ) { + $sender = Sender::get_instance(); + return $sender->send_action( $action_name, $data ); + } + + /** + * Retrieve chunk IDs with previous interval end. + * + * @access protected + * + * @param array $chunks All remaining items. + * @param int $previous_interval_end The last item from the previous interval. + * @return array Chunk IDs with the previous interval end. + */ + protected function get_chunks_with_preceding_end( $chunks, $previous_interval_end ) { + $chunks_with_ends = array(); + foreach ( $chunks as $chunk ) { + $chunks_with_ends[] = array( + 'ids' => $chunk, + 'previous_end' => $previous_interval_end, + ); + // Chunks are ordered in descending order. + $previous_interval_end = end( $chunk ); + } + return $chunks_with_ends; + } + + /** + * Get metadata of a particular object type within the designated meta key whitelist. + * + * @access protected + * + * @todo Refactor to use $wpdb->prepare() on the SQL query. + * + * @param array $ids Object IDs. + * @param string $meta_type Meta type. + * @param array $meta_key_whitelist Meta key whitelist. + * @return array Unserialized meta values. + */ + protected function get_metadata( $ids, $meta_type, $meta_key_whitelist ) { + global $wpdb; + $table = _get_meta_table( $meta_type ); + $id = $meta_type . '_id'; + if ( ! $table ) { + return array(); + } + + $private_meta_whitelist_sql = "'" . implode( "','", array_map( 'esc_sql', $meta_key_whitelist ) ) . "'"; + + return array_map( + array( $this, 'unserialize_meta' ), + $wpdb->get_results( + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared + "SELECT $id, meta_key, meta_value, meta_id FROM $table WHERE $id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )' . + " AND meta_key IN ( $private_meta_whitelist_sql ) ", + // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared + OBJECT + ) + ); + } + + /** + * Initialize listeners for the particular meta type. + * + * @access public + * + * @param string $meta_type Meta type. + * @param callable $callable Action handler callable. + */ + public function init_listeners_for_meta_type( $meta_type, $callable ) { + add_action( "added_{$meta_type}_meta", $callable, 10, 4 ); + add_action( "updated_{$meta_type}_meta", $callable, 10, 4 ); + add_action( "deleted_{$meta_type}_meta", $callable, 10, 4 ); + } + + /** + * Initialize meta whitelist handler for the particular meta type. + * + * @access public + * + * @param string $meta_type Meta type. + * @param callable $whitelist_handler Action handler callable. + */ + public function init_meta_whitelist_handler( $meta_type, $whitelist_handler ) { + add_filter( "jetpack_sync_before_enqueue_added_{$meta_type}_meta", $whitelist_handler ); + add_filter( "jetpack_sync_before_enqueue_updated_{$meta_type}_meta", $whitelist_handler ); + add_filter( "jetpack_sync_before_enqueue_deleted_{$meta_type}_meta", $whitelist_handler ); + } + + /** + * Retrieve the term relationships for the specified object IDs. + * + * @access protected + * + * @todo This feels too specific to be in the abstract sync Module class. Move it? + * + * @param array $ids Object IDs. + * @return array Term relationships - object ID and term taxonomy ID pairs. + */ + protected function get_term_relationships( $ids ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + return $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )', OBJECT ); + } + + /** + * Unserialize the value of a meta object, if necessary. + * + * @access public + * + * @param object $meta Meta object. + * @return object Meta object with possibly unserialized value. + */ + public function unserialize_meta( $meta ) { + $meta->meta_value = maybe_unserialize( $meta->meta_value ); + return $meta; + } + + /** + * Retrieve a set of objects by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + // Only add object if we have the object. + if ( $object ) { + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Gets a list of minimum and maximum object ids for each batch based on the given batch size. + * + * @access public + * + * @param int $batch_size The batch size for objects. + * @param string|bool $where_sql The sql where clause minus 'WHERE', or false if no where clause is needed. + * + * @return array|bool An array of min and max ids for each batch. FALSE if no table can be found. + */ + public function get_min_max_object_ids_for_batches( $batch_size, $where_sql = false ) { + global $wpdb; + + if ( ! $this->table_name() ) { + return false; + } + + $results = array(); + $table = $wpdb->{$this->table_name()}; + $current_max = 0; + $current_min = 1; + $id_field = $this->id_field(); + $replicastore = new Replicastore(); + + $total = $replicastore->get_min_max_object_id( + $id_field, + $table, + $where_sql, + false + ); + + while ( $total->max > $current_max ) { + $where = $where_sql ? + $where_sql . " AND $id_field > $current_max" : + "$id_field > $current_max"; + $result = $replicastore->get_min_max_object_id( + $id_field, + $table, + $where, + $batch_size + ); + if ( empty( $result->min ) && empty( $result->max ) ) { + // Our query produced no min and max. We can assume the min from the previous query, + // and the total max we found in the initial query. + $current_max = (int) $total->max; + $result = (object) array( + 'min' => $current_min, + 'max' => $current_max, + ); + } else { + $current_min = (int) $result->min; + $current_max = (int) $result->max; + } + $results[] = $result; + } + + return $results; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { + global $wpdb; + $table = $wpdb->{$this->table_name()}; + $where = $this->get_where_sql( $config ); + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_var( "SELECT COUNT(*) FROM $table WHERE $where" ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return '1=1'; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php new file mode 100644 index 00000000..defa700e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php @@ -0,0 +1,252 @@ +network_options_whitelist = Defaults::$default_network_options_whitelist; + } + + /** + * Enqueue the network options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all options to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand options (should always be true) + */ + do_action( 'jetpack_full_sync_network_options', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the network options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_network_options', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_network_options' ); + } + + /** + * Retrieve all network options as per the current network options whitelist. + * + * @access public + * + * @return array All network options. + */ + public function get_all_network_options() { + $options = array(); + foreach ( $this->network_options_whitelist as $option ) { + $options[ $option ] = get_site_option( $option ); + } + + return $options; + } + + /** + * Set the network options whitelist. + * + * @access public + * + * @param array $options The new network options whitelist. + */ + public function set_network_options_whitelist( $options ) { + $this->network_options_whitelist = $options; + } + + /** + * Get the network options whitelist. + * + * @access public + * + * @return array The network options whitelist. + */ + public function get_network_options_whitelist() { + return $this->network_options_whitelist; + } + + /** + * Reject non-whitelisted network options. + * + * @access public + * + * @param array $args The hook parameters. + * @return array|false $args The hook parameters, false if not a whitelisted network option. + */ + public function whitelist_network_options( $args ) { + if ( ! $this->is_whitelisted_network_option( $args[0] ) ) { + return false; + } + + return $args; + } + + /** + * Whether the option is a whitelisted network option. + * + * @access public + * + * @param string $option Option name. + * @return boolean True if this is a whitelisted network option. + */ + public function is_whitelisted_network_option( $option ) { + return in_array( $option, $this->network_options_whitelist, true ); + } + + /** + * Expand the network options within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_network_options( $args ) { + if ( $args[0] ) { + return $this->get_all_network_options(); + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( $this->network_options_whitelist ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php new file mode 100644 index 00000000..5c156512 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php @@ -0,0 +1,481 @@ +update_options_whitelist(); + $this->update_options_contentless(); + } + + /** + * Set module defaults at a later time. + * + * @access public + */ + public function set_late_default() { + /** This filter is already documented in json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php */ + $late_options = apply_filters( 'jetpack_options_whitelist', array() ); + if ( ! empty( $late_options ) && is_array( $late_options ) ) { + $this->options_whitelist = array_merge( $this->options_whitelist, $late_options ); + } + } + + /** + * Add old deprecated options to the list of options to keep in sync. + * + * @since 1.14.0 + * + * @access public + * + * @param array $options The default list of site options. + */ + public function add_deprecated_options( $options ) { + global $wp_version; + + $deprecated_options = array( + 'blacklist_keys' => '5.5-alpha', // Replaced by disallowed_keys. + 'comment_whitelist' => '5.5-alpha', // Replaced by comment_previously_approved. + ); + + foreach ( $deprecated_options as $option => $version ) { + if ( version_compare( $wp_version, $version, '<=' ) ) { + $options[] = $option; + } + } + + return $options; + } + + /** + * Enqueue the options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all options to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand options (should always be true) + */ + do_action( 'jetpack_full_sync_options', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the options actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_options', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_options' ); + } + + /** + * Retrieve all options as per the current options whitelist. + * Public so that we don't have to store so much data all the options twice. + * + * @access public + * + * @return array All options. + */ + public function get_all_options() { + $options = array(); + $random_string = wp_generate_password(); + foreach ( $this->options_whitelist as $option ) { + if ( 0 === strpos( $option, Settings::SETTINGS_OPTION_PREFIX ) ) { + $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $option ) ); + $options[ $option ] = $option_value; + } else { + $option_value = get_option( $option, $random_string ); + if ( $option_value !== $random_string ) { + $options[ $option ] = $option_value; + } + } + } + + // Add theme mods. + $theme_mods_option = 'theme_mods_' . get_option( 'stylesheet' ); + $theme_mods_value = get_option( $theme_mods_option, $random_string ); + if ( $theme_mods_value === $random_string ) { + return $options; + } + $this->filter_theme_mods( $theme_mods_value ); + $options[ $theme_mods_option ] = $theme_mods_value; + return $options; + } + + /** + * Update the options whitelist to the default one. + * + * @access public + */ + public function update_options_whitelist() { + $this->options_whitelist = Defaults::get_options_whitelist(); + } + + /** + * Set the options whitelist. + * + * @access public + * + * @param array $options The new options whitelist. + */ + public function set_options_whitelist( $options ) { + $this->options_whitelist = $options; + } + + /** + * Get the options whitelist. + * + * @access public + * + * @return array The options whitelist. + */ + public function get_options_whitelist() { + return $this->options_whitelist; + } + + /** + * Update the contentless options to the defaults. + * + * @access public + */ + public function update_options_contentless() { + $this->options_contentless = Defaults::get_options_contentless(); + } + + /** + * Get the contentless options. + * + * @access public + * + * @return array Array of the contentless options. + */ + public function get_options_contentless() { + return $this->options_contentless; + } + + /** + * Reject any options that aren't whitelisted or contentless. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function whitelist_options( $args ) { + // Reject non-whitelisted options. + if ( ! $this->is_whitelisted_option( $args[0] ) ) { + return false; + } + + // Filter our weird array( false ) value for theme_mods_*. + if ( 'theme_mods_' === substr( $args[0], 0, 11 ) ) { + $this->filter_theme_mods( $args[1] ); + if ( isset( $args[2] ) ) { + $this->filter_theme_mods( $args[2] ); + } + } + + // Set value(s) of contentless option to empty string(s). + if ( $this->is_contentless_option( $args[0] ) ) { + // Create a new array matching length of $args, containing empty strings. + $empty = array_fill( 0, count( $args ), '' ); + $empty[0] = $args[0]; + return $empty; + } + + return $args; + } + + /** + * Whether a certain option is whitelisted for sync. + * + * @access public + * + * @param string $option Option name. + * @return boolean Whether the option is whitelisted. + */ + public function is_whitelisted_option( $option ) { + return in_array( $option, $this->options_whitelist, true ) || 'theme_mods_' === substr( $option, 0, 11 ); + } + + /** + * Whether a certain option is a contentless one. + * + * @access private + * + * @param string $option Option name. + * @return boolean Whether the option is contentless. + */ + private function is_contentless_option( $option ) { + return in_array( $option, $this->options_contentless, true ); + } + + /** + * Filters out falsy values from theme mod options. + * + * @access private + * + * @param array $value Option value. + */ + private function filter_theme_mods( &$value ) { + if ( is_array( $value ) && isset( $value[0] ) ) { + unset( $value[0] ); + } + } + + /** + * Handle changes in the core site icon and sync them. + * + * @access public + */ + public function jetpack_sync_core_icon() { + $url = get_site_icon_url(); + + $jetpack_url = \Jetpack_Options::get_option( 'site_icon_url' ); + if ( defined( 'JETPACK__PLUGIN_DIR' ) ) { + if ( ! function_exists( 'jetpack_site_icon_url' ) ) { + require_once JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php'; + } + $jetpack_url = jetpack_site_icon_url(); + } + + // If there's a core icon, maybe update the option. If not, fall back to Jetpack's. + if ( ! empty( $url ) && $jetpack_url !== $url ) { + // This is the option that is synced with dotcom. + \Jetpack_Options::update_option( 'site_icon_url', $url ); + } elseif ( empty( $url ) ) { + \Jetpack_Options::delete_option( 'site_icon_url' ); + } + } + + /** + * Expand all options within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_options( $args ) { + if ( $args[0] ) { + return $this->get_all_options(); + } + + return $args; + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return count( Defaults::get_options_whitelist() ); + } + + /** + * Retrieve a set of options by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'option' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + // Only add object if we have the object. + if ( 'OPTION-DOES-NOT-EXIST' !== $object ) { + if ( 'all' === $id ) { + // If all was requested it contains all options and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + } + + return $objects; + } + + /** + * Retrieve an option by its name. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Option or 'OPTION-DOES-NOT-EXIST' if not found. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'option' === $object_type ) { + // Utilize Random string as default value to distinguish between false and not exist. + $random_string = wp_generate_password(); + // Only whitelisted options can be returned. + if ( in_array( $id, $this->options_whitelist, true ) ) { + if ( 0 === strpos( $id, Settings::SETTINGS_OPTION_PREFIX ) ) { + $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $id ) ); + return $option_value; + } else { + $option_value = get_option( $id, $random_string ); + if ( $option_value !== $random_string ) { + return $option_value; + } + } + } elseif ( 'all' === $id ) { + return $this->get_all_options(); + } + } + + return 'OPTION-DOES-NOT-EXIST'; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php new file mode 100644 index 00000000..1ba86a28 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php @@ -0,0 +1,421 @@ +action_handler = $callable; + + add_action( 'deleted_plugin', array( $this, 'deleted_plugin' ), 10, 2 ); + add_action( 'activated_plugin', $callable, 10, 2 ); + add_action( 'deactivated_plugin', $callable, 10, 2 ); + add_action( 'delete_plugin', array( $this, 'delete_plugin' ) ); + add_filter( 'upgrader_pre_install', array( $this, 'populate_plugins' ), 10, 1 ); + add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_completion' ), 10, 2 ); + add_action( 'jetpack_plugin_installed', $callable, 10, 1 ); + add_action( 'jetpack_plugin_update_failed', $callable, 10, 4 ); + add_action( 'jetpack_plugins_updated', $callable, 10, 2 ); + add_action( 'admin_action_update', array( $this, 'check_plugin_edit' ) ); + add_action( 'jetpack_edited_plugin', $callable, 10, 2 ); + add_action( 'wp_ajax_edit-theme-plugin-file', array( $this, 'plugin_edit_ajax' ), 0 ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_activated_plugin', array( $this, 'expand_plugin_data' ) ); + add_filter( 'jetpack_sync_before_send_deactivated_plugin', array( $this, 'expand_plugin_data' ) ); + // Note that we don't simply 'expand_plugin_data' on the 'delete_plugin' action here because the plugin file is deleted when that action finishes. + } + + /** + * Fetch and populate all current plugins before upgrader installation. + * + * @access public + * + * @param bool|WP_Error $response Install response, true if successful, WP_Error if not. + */ + public function populate_plugins( $response ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $this->plugins = get_plugins(); + return $response; + } + + /** + * Handler for the upgrader success finishes. + * + * @access public + * + * @param \WP_Upgrader $upgrader Upgrader instance. + * @param array $details Array of bulk item update data. + */ + public function on_upgrader_completion( $upgrader, $details ) { + if ( ! isset( $details['type'] ) ) { + return; + } + if ( 'plugin' !== $details['type'] ) { + return; + } + + if ( ! isset( $details['action'] ) ) { + return; + } + + $plugins = ( isset( $details['plugins'] ) ? $details['plugins'] : null ); + if ( empty( $plugins ) ) { + $plugins = ( isset( $details['plugin'] ) ? array( $details['plugin'] ) : null ); + } + + // For plugin installer. + if ( empty( $plugins ) && method_exists( $upgrader, 'plugin_info' ) ) { + $plugins = array( $upgrader->plugin_info() ); + } + + if ( empty( $plugins ) ) { + return; // We shouldn't be here. + } + + switch ( $details['action'] ) { + case 'update': + $state = array( + 'is_autoupdate' => Jetpack_Constants::is_true( 'JETPACK_PLUGIN_AUTOUPDATE' ), + ); + $errors = $this->get_errors( $upgrader->skin ); + if ( $errors ) { + foreach ( $plugins as $slug ) { + /** + * Sync that a plugin update failed + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param string $plugin , Plugin slug + * @param string Error code + * @param string Error message + */ + do_action( 'jetpack_plugin_update_failed', $this->get_plugin_info( $slug ), $errors['code'], $errors['message'], $state ); + } + + return; + } + /** + * Sync that a plugin update + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param array () $plugin, Plugin Data + */ + do_action( 'jetpack_plugins_updated', array_map( array( $this, 'get_plugin_info' ), $plugins ), $state ); + break; + case 'install': + } + + if ( 'install' === $details['action'] ) { + /** + * Signals to the sync listener that a plugin was installed and a sync action + * reflecting the installation and the plugin info should be sent + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @module sync + * + * @param array () $plugin, Plugin Data + */ + do_action( 'jetpack_plugin_installed', array_map( array( $this, 'get_plugin_info' ), $plugins ) ); + + return; + } + } + + /** + * Retrieve the plugin information by a plugin slug. + * + * @access private + * + * @param string $slug Plugin slug. + * @return array Plugin information. + */ + private function get_plugin_info( $slug ) { + $plugins = get_plugins(); // Get the most up to date info. + if ( isset( $plugins[ $slug ] ) ) { + return array_merge( array( 'slug' => $slug ), $plugins[ $slug ] ); + } + // Try grabbing the info from before the update. + return isset( $this->plugins[ $slug ] ) ? array_merge( array( 'slug' => $slug ), $this->plugins[ $slug ] ) : array( 'slug' => $slug ); + } + + /** + * Retrieve upgrade errors. + * + * @access private + * + * @param \Automatic_Upgrader_Skin|\WP_Upgrader_Skin $skin The upgrader skin being used. + * @return array|boolean Error on error, false otherwise. + */ + private function get_errors( $skin ) { + $errors = method_exists( $skin, 'get_errors' ) ? $skin->get_errors() : null; + if ( is_wp_error( $errors ) ) { + $error_code = $errors->get_error_code(); + if ( ! empty( $error_code ) ) { + return array( + 'code' => $error_code, + 'message' => $errors->get_error_message(), + ); + } + } + + if ( isset( $skin->result ) ) { + $errors = $skin->result; + if ( is_wp_error( $errors ) ) { + return array( + 'code' => $errors->get_error_code(), + 'message' => $errors->get_error_message(), + ); + } + + if ( empty( $skin->result ) ) { + return array( + 'code' => 'unknown', + 'message' => __( 'Unknown Plugin Update Failure', 'jetpack-sync' ), + ); + } + } + return false; + } + + /** + * Handle plugin edit in the administration. + * + * @access public + * + * @todo The `admin_action_update` hook is called only for logged in users, but maybe implement nonce verification? + */ + public function check_plugin_edit() { + $screen = get_current_screen(); + // phpcs:ignore WordPress.Security.NonceVerification.Missing + if ( 'plugin-editor' !== $screen->base || ! isset( $_POST['newcontent'] ) || ! isset( $_POST['plugin'] ) ) { + return; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated manually just after. + $plugin = wp_unslash( $_POST['plugin'] ); + $plugins = get_plugins(); + if ( ! isset( $plugins[ $plugin ] ) ) { + return; + } + + /** + * Helps Sync log that a plugin was edited + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $plugin, Plugin slug + * @param mixed $plugins[ $plugin ], Array of plugin data + */ + do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); + } + + /** + * Handle plugin ajax edit in the administration. + * + * @access public + * + * @todo Update this method to use WP_Filesystem instead of fopen/fclose. + */ + public function plugin_edit_ajax() { + // This validation is based on wp_edit_theme_plugin_file(). + $args = wp_unslash( $_POST ); + if ( empty( $args['file'] ) ) { + return; + } + + $file = $args['file']; + if ( 0 !== validate_file( $file ) ) { + return; + } + + if ( ! isset( $args['newcontent'] ) ) { + return; + } + + if ( ! isset( $args['nonce'] ) ) { + return; + } + + if ( empty( $args['plugin'] ) ) { + return; + } + + $plugin = $args['plugin']; + if ( ! current_user_can( 'edit_plugins' ) ) { + return; + } + + if ( ! wp_verify_nonce( $args['nonce'], 'edit-plugin_' . $file ) ) { + return; + } + $plugins = get_plugins(); + if ( ! array_key_exists( $plugin, $plugins ) ) { + return; + } + + if ( 0 !== validate_file( $file, get_plugin_files( $plugin ) ) ) { + return; + } + + $real_file = WP_PLUGIN_DIR . '/' . $file; + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_is_writeable + if ( ! is_writeable( $real_file ) ) { + return; + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen + $file_pointer = fopen( $real_file, 'w+' ); + if ( false === $file_pointer ) { + return; + } + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + fclose( $file_pointer ); + /** + * This action is documented already in this file + */ + do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); + } + + /** + * Handle plugin deletion. + * + * @access public + * + * @param string $plugin_path Path to the plugin main file. + */ + public function delete_plugin( $plugin_path ) { + $full_plugin_path = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_path; + + // Checking for file existence because some sync plugin module tests simulate plugin installation and deletion without putting file on disk. + if ( file_exists( $full_plugin_path ) ) { + $all_plugin_data = get_plugin_data( $full_plugin_path ); + $data = array( + 'name' => $all_plugin_data['Name'], + 'version' => $all_plugin_data['Version'], + ); + } else { + $data = array( + 'name' => $plugin_path, + 'version' => 'unknown', + ); + } + + $this->plugin_info[ $plugin_path ] = $data; + } + + /** + * Invoked after plugin deletion. + * + * @access public + * + * @param string $plugin_path Path to the plugin main file. + * @param boolean $is_deleted Whether the plugin was deleted successfully. + */ + public function deleted_plugin( $plugin_path, $is_deleted ) { + call_user_func( $this->action_handler, $plugin_path, $is_deleted, $this->plugin_info[ $plugin_path ] ); + unset( $this->plugin_info[ $plugin_path ] ); + } + + /** + * Expand the plugins within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_plugin_data( $args ) { + $plugin_path = $args[0]; + $plugin_data = array(); + + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $all_plugins = get_plugins(); + if ( isset( $all_plugins[ $plugin_path ] ) ) { + $all_plugin_data = $all_plugins[ $plugin_path ]; + $plugin_data['name'] = $all_plugin_data['Name']; + $plugin_data['version'] = $all_plugin_data['Version']; + } + + return array( + $args[0], + $args[1], + $plugin_data, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php new file mode 100644 index 00000000..7b3b0e79 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php @@ -0,0 +1,776 @@ + length. + * Current Setting : 5MB. + * + * @access public + * + * @var int + */ + const MAX_POST_CONTENT_LENGTH = 5000000; + + /** + * Max bytes allowed for post meta_value => length. + * Current Setting : 2MB. + * + * @access public + * + * @var int + */ + const MAX_POST_META_LENGTH = 2000000; + + /** + * Default previous post state. + * Used for default previous post status. + * + * @access public + * + * @var string + */ + const DEFAULT_PREVIOUS_STATE = 'new'; + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'posts'; + } + + /** + * The table in the database. + * + * @access public + * + * @return string + */ + public function table_name() { + return 'posts'; + } + + /** + * Retrieve a post by its ID. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param int $id ID of the sync object. + * @return \WP_Post|bool Filtered \WP_Post object, or false if the object is not a post. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'post' === $object_type ) { + $post = get_post( (int) $id ); + if ( $post ) { + return $this->filter_post_content_and_add_links( $post ); + } + } + + return false; + } + + /** + * Initialize posts action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + $this->action_handler = $callable; + + add_action( 'wp_insert_post', array( $this, 'wp_insert_post' ), 11, 3 ); + add_action( 'wp_after_insert_post', array( $this, 'wp_after_insert_post' ), 11, 2 ); + add_action( 'jetpack_sync_save_post', $callable, 10, 4 ); + + add_action( 'deleted_post', $callable, 10 ); + add_action( 'jetpack_published_post', $callable, 10, 2 ); + add_filter( 'jetpack_sync_before_enqueue_deleted_post', array( $this, 'filter_blacklisted_post_types_deleted' ) ); + + add_action( 'transition_post_status', array( $this, 'save_published' ), 10, 3 ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_post', array( $this, 'filter_blacklisted_post_types' ) ); + + // Listen for meta changes. + $this->init_listeners_for_meta_type( 'post', $callable ); + $this->init_meta_whitelist_handler( 'post', array( $this, 'filter_meta' ) ); + + add_action( 'jetpack_daily_akismet_meta_cleanup_before', array( $this, 'daily_akismet_meta_cleanup_before' ) ); + add_action( 'jetpack_daily_akismet_meta_cleanup_after', array( $this, 'daily_akismet_meta_cleanup_after' ) ); + add_action( 'jetpack_post_meta_batch_delete', $callable, 10, 2 ); + } + + /** + * Before Akismet's daily cleanup of spam detection metadata. + * + * @access public + * + * @param array $feedback_ids IDs of feedback posts. + */ + public function daily_akismet_meta_cleanup_before( $feedback_ids ) { + remove_action( 'deleted_post_meta', $this->action_handler ); + + if ( ! is_array( $feedback_ids ) || count( $feedback_ids ) < 1 ) { + return; + } + + $ids_chunks = array_chunk( $feedback_ids, 100, false ); + foreach ( $ids_chunks as $chunk ) { + /** + * Used for syncing deletion of batch post meta + * + * @since 1.6.3 + * @since-jetpack 6.1.0 + * + * @module sync + * + * @param array $feedback_ids feedback post IDs + * @param string $meta_key to be deleted + */ + do_action( 'jetpack_post_meta_batch_delete', $chunk, '_feedback_akismet_values' ); + } + } + + /** + * After Akismet's daily cleanup of spam detection metadata. + * + * @access public + * + * @param array $feedback_ids IDs of feedback posts. + */ + public function daily_akismet_meta_cleanup_after( $feedback_ids ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + add_action( 'deleted_post_meta', $this->action_handler ); + } + + /** + * Initialize posts action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_posts', $callable ); // Also sends post meta. + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_sync_save_post', array( $this, 'expand_jetpack_sync_save_post' ) ); + + // meta. + add_filter( 'jetpack_sync_before_send_added_post_meta', array( $this, 'trim_post_meta' ) ); + add_filter( 'jetpack_sync_before_send_updated_post_meta', array( $this, 'trim_post_meta' ) ); + add_filter( 'jetpack_sync_before_send_deleted_post_meta', array( $this, 'trim_post_meta' ) ); + + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_posts', array( $this, 'expand_post_ids' ) ); + } + + /** + * Enqueue the posts actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Use $wpdb->prepare for the SQL query. + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + $where_sql = Settings::get_blacklisted_post_types_sql(); + + // Config is a list of post IDs to sync. + if ( is_array( $config ) ) { + $where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $where_sql; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_posts' ); + } + + /** + * Filter meta arguments so that we don't sync meta_values over MAX_POST_META_LENGTH. + * + * @param array $args action arguments. + * + * @return array filtered action arguments. + */ + public function trim_post_meta( $args ) { + list( $meta_id, $object_id, $meta_key, $meta_value ) = $args; + // Explicitly truncate meta_value when it exceeds limit. + // Large content will cause OOM issues and break Sync. + $serialized_value = maybe_serialize( $meta_value ); + if ( strlen( $serialized_value ) >= self::MAX_POST_META_LENGTH ) { + $meta_value = ''; + } + return array( $meta_id, $object_id, $meta_key, $meta_value ); + } + + /** + * Process content before send. + * + * @param array $args Arguments of the `wp_insert_post` hook. + * + * @return array + */ + public function expand_jetpack_sync_save_post( $args ) { + list( $post_id, $post, $update, $previous_state ) = $args; + return array( $post_id, $this->filter_post_content_and_add_links( $post ), $update, $previous_state ); + } + + /** + * Filter all blacklisted post types. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_blacklisted_post_types_deleted( $args ) { + + // deleted_post is called after the SQL delete but before cache cleanup. + // There is the potential we can't detect post_type at this point. + if ( ! $this->is_post_type_allowed( $args[0] ) ) { + return false; + } + + return $args; + } + + /** + * Filter all blacklisted post types. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if the post type is a blacklisted one. + */ + public function filter_blacklisted_post_types( $args ) { + $post = $args[1]; + + if ( in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + return false; + } + + return $args; + } + + /** + * Filter all meta that is not blacklisted, or is stored for a disallowed post type. + * + * @param array $args Hook arguments. + * @return array|false Hook arguments, or false if meta was filtered. + */ + public function filter_meta( $args ) { + if ( $this->is_post_type_allowed( $args[1] ) && $this->is_whitelisted_post_meta( $args[2] ) ) { + return $args; + } + + return false; + } + + /** + * Whether a post meta key is whitelisted. + * + * @param string $meta_key Meta key. + * @return boolean Whether the post meta key is whitelisted. + */ + public function is_whitelisted_post_meta( $meta_key ) { + // The _wpas_skip_ meta key is used by Publicize. + return in_array( $meta_key, Settings::get_setting( 'post_meta_whitelist' ), true ) || ( 0 === strpos( $meta_key, '_wpas_skip_' ) ); + } + + /** + * Whether a post type is allowed. + * A post type will be disallowed if it's present in the post type blacklist. + * + * @param int $post_id ID of the post. + * @return boolean Whether the post type is allowed. + */ + public function is_post_type_allowed( $post_id ) { + $post = get_post( (int) $post_id ); + + if ( isset( $post->post_type ) ) { + return ! in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ); + } + return false; + } + + /** + * Remove the embed shortcode. + * + * @global $wp_embed + */ + public function remove_embed() { + global $wp_embed; + remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); + // remove the embed shortcode since we would do the part later. + remove_shortcode( 'embed' ); + // Attempts to embed all URLs in a post. + remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); + } + + /** + * Add the embed shortcode. + * + * @global $wp_embed + */ + public function add_embed() { + global $wp_embed; + add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); + // Shortcode placeholder for strip_shortcodes(). + add_shortcode( 'embed', '__return_false' ); + // Attempts to embed all URLs in a post. + add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); + } + + /** + * Expands wp_insert_post to include filtered content + * + * @param \WP_Post $post_object Post object. + */ + public function filter_post_content_and_add_links( $post_object ) { + global $post; + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited + $post = $post_object; + + // Return non existant post. + $post_type = get_post_type_object( $post->post_type ); + if ( empty( $post_type ) || ! is_object( $post_type ) ) { + $non_existant_post = new \stdClass(); + $non_existant_post->ID = $post->ID; + $non_existant_post->post_modified = $post->post_modified; + $non_existant_post->post_modified_gmt = $post->post_modified_gmt; + $non_existant_post->post_status = 'jetpack_sync_non_registered_post_type'; + $non_existant_post->post_type = $post->post_type; + + return $non_existant_post; + } + /** + * Filters whether to prevent sending post data to .com + * + * Passing true to the filter will prevent the post data from being sent + * to the WordPress.com. + * Instead we pass data that will still enable us to do a checksum against the + * Jetpacks data but will prevent us from displaying the data on in the API as well as + * other services. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean false prevent post data from being synced to WordPress.com + * @param mixed $post \WP_Post object + */ + if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) { + // We only send the bare necessary object to be able to create a checksum. + $blocked_post = new \stdClass(); + $blocked_post->ID = $post->ID; + $blocked_post->post_modified = $post->post_modified; + $blocked_post->post_modified_gmt = $post->post_modified_gmt; + $blocked_post->post_status = 'jetpack_sync_blocked'; + $blocked_post->post_type = $post->post_type; + + return $blocked_post; + } + + // lets not do oembed just yet. + $this->remove_embed(); + + if ( 0 < strlen( $post->post_password ) ) { + $post->post_password = 'auto-' . wp_generate_password( 10, false ); + } + + // Explicitly omit post_content when it exceeds limit. + // Large content will cause OOM issues and break Sync. + if ( strlen( $post->post_content ) >= self::MAX_POST_CONTENT_LENGTH ) { + $post->post_content = ''; + } + + /** This filter is already documented in core. wp-includes/post-template.php */ + if ( Settings::get_setting( 'render_filtered_content' ) && $post_type->public ) { + global $shortcode_tags; + /** + * Filter prevents some shortcodes from expanding. + * + * Since we can can expand some type of shortcode better on the .com side and make the + * expansion more relevant to contexts. For example [galleries] and subscription emails + * + * @since 1.6.3 + * @since-jetpack 4.5.0 + * + * @param array of shortcode tags to remove. + */ + $shortcodes_to_remove = apply_filters( + 'jetpack_sync_do_not_expand_shortcodes', + array( + 'gallery', + 'slideshow', + ) + ); + $removed_shortcode_callbacks = array(); + foreach ( $shortcodes_to_remove as $shortcode ) { + if ( isset( $shortcode_tags[ $shortcode ] ) ) { + $removed_shortcode_callbacks[ $shortcode ] = $shortcode_tags[ $shortcode ]; + } + } + + array_map( 'remove_shortcode', array_keys( $removed_shortcode_callbacks ) ); + + $post->post_content_filtered = apply_filters( 'the_content', $post->post_content ); + $post->post_excerpt_filtered = apply_filters( 'the_excerpt', $post->post_excerpt ); + + foreach ( $removed_shortcode_callbacks as $shortcode => $callback ) { + add_shortcode( $shortcode, $callback ); + } + } + + $this->add_embed(); + + if ( has_post_thumbnail( $post->ID ) ) { + $image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); + if ( is_array( $image_attributes ) && isset( $image_attributes[0] ) ) { + $post->featured_image = $image_attributes[0]; + } + } + + $post->permalink = get_permalink( $post->ID ); + $post->shortlink = wp_get_shortlink( $post->ID ); + + if ( function_exists( 'amp_get_permalink' ) ) { + $post->amp_permalink = amp_get_permalink( $post->ID ); + } + + return $post; + } + + /** + * Handle transition from another post status to a published one. + * + * @param string $new_status New post status. + * @param string $old_status Old post status. + * @param \WP_Post $post Post object. + */ + public function save_published( $new_status, $old_status, $post ) { + if ( 'publish' === $new_status && 'publish' !== $old_status ) { + $this->just_published[ $post->ID ] = true; + } + + $this->previous_status[ $post->ID ] = $old_status; + } + + /** + * When publishing or updating a post, the Gutenberg editor sends two requests: + * 1. sent to WP REST API endpoint `wp-json/wp/v2/posts/$id` + * 2. sent to wp-admin/post.php `?post=$id&action=edit&classic-editor=1&meta_box=1` + * + * The 2nd request is to update post meta, which is not supported on WP REST API. + * When syncing post data, we will include if this was a meta box update. + * + * @todo Implement nonce verification. + * + * @return boolean Whether this is a Gutenberg meta box update. + */ + public function is_gutenberg_meta_box_update() { + // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended + return ( + isset( $_POST['action'], $_GET['classic-editor'], $_GET['meta_box'] ) && + 'editpost' === $_POST['action'] && + '1' === $_GET['classic-editor'] && + '1' === $_GET['meta_box'] + // phpcs:enable WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended + ); + } + + /** + * Handler for the wp_insert_post hook. + * Called upon creation of a new post. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + * @param boolean $update Whether this is an existing post being updated or not. + */ + public function wp_insert_post( $post_ID, $post = null, $update = null ) { + if ( ! is_numeric( $post_ID ) || $post === null ) { + return; + } + + // Workaround for https://github.com/woocommerce/woocommerce/issues/18007. + if ( $post && 'shop_order' === $post->post_type ) { + $post = get_post( $post_ID ); + } + + $previous_status = isset( $this->previous_status[ $post_ID ] ) ? $this->previous_status[ $post_ID ] : self::DEFAULT_PREVIOUS_STATE; + + $just_published = isset( $this->just_published[ $post_ID ] ) ? $this->just_published[ $post_ID ] : false; + + $state = array( + 'is_auto_save' => (bool) Jetpack_Constants::get_constant( 'DOING_AUTOSAVE' ), + 'previous_status' => $previous_status, + 'just_published' => $just_published, + 'is_gutenberg_meta_box_update' => $this->is_gutenberg_meta_box_update(), + ); + /** + * Filter that is used to add to the post flags ( meta data ) when a post gets published + * + * @since 1.6.3 + * @since-jetpack 5.8.0 + * + * @param int $post_ID the post ID + * @param mixed $post \WP_Post object + * @param bool $update Whether this is an existing post being updated or not. + * @param mixed $state state + * + * @module sync + */ + do_action( 'jetpack_sync_save_post', $post_ID, $post, $update, $state ); + unset( $this->previous_status[ $post_ID ] ); + } + + /** + * Handler for the wp_after_insert_post hook. + * Called after creation/update of a new post. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + **/ + public function wp_after_insert_post( $post_ID, $post ) { + if ( ! is_numeric( $post_ID ) || $post === null ) { + return; + } + + // Workaround for https://github.com/woocommerce/woocommerce/issues/18007. + if ( $post && 'shop_order' === $post->post_type ) { + $post = get_post( $post_ID ); + } + + $this->send_published( $post_ID, $post ); + } + + /** + * Send a published post for sync. + * + * @param int $post_ID Post ID. + * @param \WP_Post $post Post object. + */ + public function send_published( $post_ID, $post ) { + if ( ! isset( $this->just_published[ $post_ID ] ) ) { + return; + } + + // Post revisions cause race conditions where this send_published add the action before the actual post gets synced. + if ( wp_is_post_autosave( $post ) || wp_is_post_revision( $post ) ) { + return; + } + + $post_flags = array( + 'post_type' => $post->post_type, + ); + + $author_user_object = get_user_by( 'id', $post->post_author ); + if ( $author_user_object ) { + $roles = new Roles(); + + $post_flags['author'] = array( + 'id' => $post->post_author, + 'wpcom_user_id' => get_user_meta( $post->post_author, 'wpcom_user_id', true ), + 'display_name' => $author_user_object->display_name, + 'email' => $author_user_object->user_email, + 'translated_role' => $roles->translate_user_to_role( $author_user_object ), + ); + } + + /** + * Filter that is used to add to the post flags ( meta data ) when a post gets published + * + * @since 1.6.3 + * @since-jetpack 4.4.0 + * + * @param mixed array post flags that are added to the post + * @param mixed $post \WP_Post object + */ + $flags = apply_filters( 'jetpack_published_post_flags', $post_flags, $post ); + + // Only Send Pulished Post event if post_type is not blacklisted. + if ( ! in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true ) ) { + + // Refreshing the post in the cache site before triggering the publish event. + // The true parameter means that it's an update action, not create action. + $this->wp_insert_post( $post_ID, $post, true ); + + /** + * Action that gets synced when a post type gets published. + * + * @since 1.6.3 + * @since-jetpack 4.4.0 + * + * @param int $post_ID + * @param mixed array $flags post flags that are added to the post + */ + do_action( 'jetpack_published_post', $post_ID, $flags ); + } + unset( $this->just_published[ $post_ID ] ); + + /** + * Send additional sync action for Activity Log when post is a Customizer publish + */ + if ( 'customize_changeset' === $post->post_type ) { + $post_content = json_decode( $post->post_content, true ); + foreach ( $post_content as $key => $value ) { + // Skip if it isn't a widget. + if ( 'widget_' !== substr( $key, 0, strlen( 'widget_' ) ) ) { + continue; + } + // Change key from "widget_archives[2]" to "archives-2". + $key = str_replace( 'widget_', '', $key ); + $key = str_replace( '[', '-', $key ); + $key = str_replace( ']', '', $key ); + + global $wp_registered_widgets; + if ( isset( $wp_registered_widgets[ $key ] ) ) { + $widget_data = array( + 'name' => $wp_registered_widgets[ $key ]['name'], + 'id' => $key, + 'title' => $value['value']['title'], + ); + do_action( 'jetpack_widget_edited', $widget_data ); + } + } + } + } + + /** + * Expand post IDs to post objects within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_post_ids( $args ) { + list( $post_ids, $previous_interval_end) = $args; + + $posts = array_filter( array_map( array( 'WP_Post', 'get_instance' ), $post_ids ) ); + $posts = array_map( array( $this, 'filter_post_content_and_add_links' ), $posts ); + $posts = array_values( $posts ); // Reindex in case posts were deleted. + + return array( + $posts, + $this->get_metadata( $post_ids, 'post', Settings::get_setting( 'post_meta_whitelist' ) ), + $this->get_term_relationships( $post_ids ), + $previous_interval_end, + ); + } + + /** + * Gets a list of minimum and maximum object ids for each batch based on the given batch size. + * + * @access public + * + * @param int $batch_size The batch size for objects. + * @param string|bool $where_sql The sql where clause minus 'WHERE', or false if no where clause is needed. + * + * @return array|bool An array of min and max ids for each batch. FALSE if no table can be found. + */ + public function get_min_max_object_ids_for_batches( $batch_size, $where_sql = false ) { + return parent::get_min_max_object_ids_for_batches( $batch_size, $this->get_where_sql( $where_sql ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php new file mode 100644 index 00000000..f82843f3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php @@ -0,0 +1,52 @@ + [ 'searchable_in_all_content' => true ], + * Field will be included in the all_content fields + * + * 'metakey' => [ 'available' => false, 'alternatives' => [ 'metakey_processed' ] ], + * Field not in meta.* but has data in an alternative field(s) name that + * should work similarly. For instance, woocommerce total_sales does not go into + * the index, but the percentage of sales does. + * + * @static + * @access private + * @var array + */ + private static $postmeta_to_sync = array( + // jetpack. + 'jetpack-search-meta0' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta1' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta2' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta3' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta4' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta5' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta6' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta7' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta8' => array( 'searchable_in_all_content' => true ), + 'jetpack-search-meta9' => array( 'searchable_in_all_content' => true ), + + // woocommerce. + 'exclude_product_categories' => array(), + 'exclude_product_ids' => array(), + 'free_shipping' => array(), + 'id_field' => array(), + 'individual_use' => array(), + 'limit_usage_to_x_items' => array(), + 'maximum_amount' => array(), + 'minimum_amount' => array(), + 'post_id' => array(), + 'product_categories' => array( 'searchable_in_all_content' => true ), + 'product_ids' => array(), + 'total_sales' => array( + 'available' => false, + 'alternatives' => array( + 'wc.percent_of_sales', + ), + ), + 'usage_limit' => array(), + 'usage_limit_per_user' => array(), + '_crosssell_ids' => array(), + '_downloadable' => array(), + '_featured' => array(), + '_height' => array(), + '_length' => array(), + '_price' => array( + 'alternatives' => array( + 'wc.price', + 'wc.min_price', + 'wc.max_price', + ), + ), + '_prices_include_tax' => array(), + '_product_attributes' => array(), + '_product_version' => array(), + '_regular_price' => array( + 'alternatives' => array( + 'wc.regular_price', + ), + ), + '_sale_price' => array( + 'alternatives' => array( + 'wc.sale_price', + ), + ), + '_sale_price_dates_from' => array(), + '_sale_price_dates_to' => array(), + '_sku' => array( 'searchable_in_all_content' => true ), + '_stock_status' => array(), + '_wc_average_rating' => array( + 'alternatives' => array( + 'wc.ave_rating_score', + ), + ), + '_wc_rating_count' => array( + 'alternatives' => array( + 'wc.rating', // wc.rating.count_1, wc.rating.count_2, ... + ), + ), + '_wc_review_count' => array(), + '_weight' => array(), + '_width' => array(), + + // co-authors plus. + 'cap-description' => array( 'searchable_in_all_content' => true ), + 'cap-user_login' => array( 'searchable_in_all_content' => true ), + 'cap-user_email' => array(), + 'cap-last_name' => array( 'searchable_in_all_content' => true ), + 'cap-first_name' => array( 'searchable_in_all_content' => true ), + 'cap-display_name' => array( 'searchable_in_all_content' => true ), + 'cap-website' => array(), + 'cap-jabber' => array(), + 'cap-aim' => array(), + 'cap-twitter' => array(), + 'cap-facebook' => array(), + 'cap-google_plus' => array(), + 'cap-job_title' => array( 'searchable_in_all_content' => true ), + + // bbpress. + 'bbpl_like' => array(), + 'bbpress_discussion_comments_copied' => array(), + 'bbpress_discussion_tags_copied' => array(), + 'bbpress_discussion_topic_id' => array(), + 'bbpress_discussion_use_defaults' => array(), + 'bbpress_page_header_bg' => array(), + 'bbpress_title_bg' => array(), + 'use_bbpress_discussion_topic' => array(), + + // wpml. + 'tm_meta_wpml' => array(), + 'wpml_language' => array(), + 'wpml_media_lang' => array(), + 'wpml_media_processed' => array(), + + // blogger import. + 'blogger_author' => array( 'searchable_in_all_content' => true ), + 'blogger_blog' => array( 'searchable_in_all_content' => true ), + 'blogger_permalink' => array( 'searchable_in_all_content' => true ), + + // geo. + 'geo_address' => array( 'searchable_in_all_content' => true ), + 'geo_latitude' => array(), + 'geo_longitude' => array(), + 'geo_public' => array(), + 'geolocated' => array(), + 'geolocation_city' => array( 'searchable_in_all_content' => true ), + 'geolocation_country_long' => array( 'searchable_in_all_content' => true ), + 'geolocation_country_short' => array( 'searchable_in_all_content' => true ), + 'geolocation_formatted_address' => array( 'searchable_in_all_content' => true ), + 'geolocation_lat' => array(), + 'geolocation_long' => array(), + 'geolocation_postcode' => array( 'searchable_in_all_content' => true ), + 'geolocation_state_long' => array( 'searchable_in_all_content' => true ), + 'geolocation_state_short' => array( 'searchable_in_all_content' => true ), + + // wp-ultimate-recipe. + 'recipe_alternate_image' => array(), + 'recipe_cook_time' => array(), + 'recipe_cook_time_text' => array(), + 'recipe_description' => array( 'searchable_in_all_content' => true ), + 'recipe_ingredients' => array( 'searchable_in_all_content' => true ), + 'recipe_instructions' => array( 'searchable_in_all_content' => true ), + 'recipe_notes' => array( 'searchable_in_all_content' => true ), + 'recipe_nutritional' => array( 'searchable_in_all_content' => true ), + 'recipe_passive_time' => array(), + 'recipe_passive_time_text' => array(), + 'recipe_prep_time' => array(), + 'recipe_prep_time_text' => array(), + 'recipe_rating' => array(), + 'recipe_servings' => array(), + 'recipe_servings_normalized' => array(), + 'recipe_servings_type' => array(), + 'recipe_terms' => array( 'searchable_in_all_content' => true ), + 'recipe_terms_with_parents' => array(), + 'recipe_title' => array( 'searchable_in_all_content' => true ), + 'recipe_user_ratings' => array(), + 'recipe_user_ratings_rating' => array(), + + // generic fields. + // from advanced-custom-fields and metabox.io . + 'Link' => array(), + 'Location' => array(), + 'Title' => array( 'searchable_in_all_content' => true ), + 'ad_code' => array(), + 'address' => array(), + 'admin_mail' => array(), + 'admin_only' => array(), + 'advertisers' => array( 'searchable_in_all_content' => true ), + 'age' => array(), + 'aliases' => array(), + 'alternate_title' => array(), + 'amazon' => array(), + 'answer' => array( 'searchable_in_all_content' => true ), + 'area' => array(), + 'attention' => array(), + 'attr' => array(), + 'author' => array( 'searchable_in_all_content' => true ), + 'author_name' => array( 'searchable_in_all_content' => true ), + 'blog' => array(), + 'blog_id' => array(), + 'call_to_action' => array(), + 'campaign_preview' => array(), + 'canonical_url' => array(), + 'catch_text' => array(), + 'category' => array( 'searchable_in_all_content' => true ), + 'classificacao' => array(), + 'classification' => array(), + 'code' => array(), + 'codigo' => array(), + 'company' => array( 'searchable_in_all_content' => true ), + 'company_website' => array(), + 'config' => array(), + 'construction' => array(), + 'container_ids' => array(), + 'content' => array( 'searchable_in_all_content' => true ), + 'content_body-full_content' => array( 'searchable_in_all_content' => true ), + 'copyright' => array(), + 'custom_page_title' => array( 'searchable_in_all_content' => true ), + 'custom_permalink' => array(), + 'customize' => array(), + 'data' => array(), + 'date' => array(), + 'day' => array(), + 'descripcion' => array( 'searchable_in_all_content' => true ), + 'description' => array( 'searchable_in_all_content' => true ), + 'display_settings' => array(), + 'display_type' => array(), + 'duration' => array(), + 'embed' => array(), + 'entity_ids' => array(), + 'entity_types' => array(), + 'event_subtitle' => array( 'searchable_in_all_content' => true ), + 'excluded_container_ids' => array(), + 'exclusions' => array(), + 'experience' => array(), + 'external_url' => array(), + 'featured' => array(), + 'featured_image' => array(), + 'featured_post' => array(), + 'featured_story' => array(), + 'fee' => array(), + 'filter' => array(), + 'follow' => array(), + 'footer_text' => array(), + 'from_header' => array(), + 'fullscreen_view' => array(), + 'gallery' => array(), + 'genre' => array( 'searchable_in_all_content' => true ), + 'guests' => array( 'searchable_in_all_content' => true ), + 'has_variations' => array(), + 'hashtag' => array(), + 'header_image' => array(), + 'hidden_from_ui' => array(), + 'hide_on_screen' => array(), + 'homepage_order' => array(), + 'hours' => array(), + 'i18n' => array(), + 'id' => array(), + 'image' => array(), + 'image_size' => array(), + 'image_source' => array(), + 'index' => array(), + 'intro_text' => array( 'searchable_in_all_content' => true ), + 'job_mention' => array( 'searchable_in_all_content' => true ), + 'keywords' => array( 'searchable_in_all_content' => true ), + 'latest_news' => array(), + 'layout' => array(), + 'link' => array(), + 'link_dump' => array( 'searchable_in_all_content' => true ), + 'link_url' => array(), + 'location' => array(), + 'logo' => array(), + 'main_title' => array( 'searchable_in_all_content' => true ), + 'maximum_entity_count' => array(), + 'media' => array(), + 'mentions' => array(), + 'messages' => array(), + 'meta_description' => array( 'searchable_in_all_content' => true ), + 'meta_id' => array(), + 'meta_index' => array(), + 'meta_key' => array(), + 'meta_value' => array(), + 'modal-dialog-id' => array(), + 'name' => array( 'searchable_in_all_content' => true ), + 'nombre' => array( 'searchable_in_all_content' => true ), + 'notes' => array( 'searchable_in_all_content' => true ), + 'options' => array(), + 'order_by' => array(), + 'order_direction' => array(), + 'original_cats' => array(), + 'original_headers' => array(), + 'original_link' => array(), + 'original_message' => array(), + 'original_subject' => array(), + 'original_title' => array(), + 'original_to' => array(), + 'other_setting' => array(), + 'page_canonical' => array(), + 'page_layout' => array(), + 'page_sidebar' => array(), + 'page_tags' => array(), + 'panels_data' => array(), + 'parking' => array(), + 'pdf_upload' => array(), + 'photo' => array(), + 'play_time' => array(), + 'position' => array(), + 'post-rating' => array(), + 'post_background' => array(), + 'post_color' => array(), + 'post_sidebar' => array(), + 'post_subtitle' => array( 'searchable_in_all_content' => true ), + 'price' => array(), + 'publication' => array(), + 'rating' => array(), + 'ratings_average' => array(), + 'ratings_score' => array(), + 'ratings_users' => array(), + 'relation' => array(), + 'reply_to_header' => array(), + 'required' => array(), + 'returns' => array(), + 'review_post' => array(), + 'rule' => array(), + 'section' => array( 'searchable_in_all_content' => true ), + 'session_transcript' => array(), + 'settings' => array(), + 'sex' => array(), + 'shares_count' => array(), + 'show_description' => array( 'searchable_in_all_content' => true ), + 'show_page_title' => array(), + 'side' => array(), + 'sidebar' => array(), + 'site' => array(), + 'situation' => array(), + 'slide_template' => array(), + 'slug' => array(), + 'sortorder' => array(), + 'source' => array(), + 'start_date' => array(), + 'status' => array(), + 'styles' => array(), + 'subtitle' => array( 'searchable_in_all_content' => true ), + 'subtitulo' => array(), + 'success' => array(), + 'summary' => array( 'searchable_in_all_content' => true ), + 'synopsis' => array( 'searchable_in_all_content' => true ), + 'tel' => array(), + 'tema' => array(), + 'testimonial' => array(), + 'testimonial_author' => array(), + 'text_already_subscribed' => array(), + 'text_error' => array(), + 'text_invalid_email' => array(), + 'text_not_subscribed' => array(), + 'text_required_field_missing' => array(), + 'text_subscribed' => array(), + 'text_unsubscribed' => array(), + 'thumbnail' => array(), + 'time' => array(), + 'time_jump_list' => array( 'searchable_in_all_content' => true ), + 'title' => array( 'searchable_in_all_content' => true ), + 'title_view' => array(), + 'titre' => array( 'searchable_in_all_content' => true ), + 'titulo' => array( 'searchable_in_all_content' => true ), + 'to_header' => array(), + 'toc' => array(), + 'transcript' => array( 'searchable_in_all_content' => true ), + 'transport_uri' => array(), + 'type' => array(), + 'url' => array(), + 'validation' => array(), + 'value' => array(), + 'values' => array(), + 'variation' => array(), + 'video' => array(), + 'video_type' => array(), + 'video_url' => array(), + 'videopress_guid' => array(), + 'website' => array(), + 'weight' => array(), + 'year' => array(), + + // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104 + '_app_icon' => array(), + '_featured_product_video' => array(), + 'wpcom_marketplace_org_slug' => array(), + '_wc_general_product_dependency_theme' => array(), + '_wc_general_product_dependency_plugin' => array(), + 'wpcom_marketplace_product_extra_fields' => array(), + + ); // end indexed post meta. + + /** + * Postmeta being considered for indexing + * but currently not in the index + * this list is really only for documentation. + * + * @static + * @access private + * @var array + */ + private static $unindexed_postmeta = array( + + // Core. + '_wp_attached_file' => array(), + '_wp_attachment_context' => array(), + '_wp_attachment_image_alt' => array(), + '_wp_attachment_is_custom_header' => array(), + '_wp_attachment_metadata' => array(), + '_wp_desired_post_slug' => array(), + '_wp_old_date' => array(), + '_wp_old_slug' => array(), + '_wp_page_template' => array(), + + // WooCommerce products. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-product-data-store-cpt.php#L21 . + '_backorders' => array(), + '_default_attributes' => array(), + '_download_expiry' => array(), + '_download_limit' => array(), + '_download_permissions_granted' => array(), + '_downloadable_files' => array(), + '_file_paths' => array(), + '_manage_stock' => array(), + '_product_image_gallery' => array(), + '_purchase_note' => array(), + '_recorded_sales' => array(), + '_sold_individually' => array(), + '_stock' => array(), + '_tax_class' => array(), + '_tax_status' => array(), + '_thumbnail_id' => array(), + '_upsell_ids' => array(), + '_variation_description' => array(), + '_virtual' => array(), + '_visibility' => array(), + 'coupon_amount' => array(), + 'default_source' => array(), + 'discount_type' => array(), + 'exclude_sale_items' => array(), + 'expiry_date' => array(), + + // Woocommerce orders and refunds. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L27 . + // See https://github.com/woocommerce/woocommerce/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 . + '_billing_address_1' => array(), + '_billing_address_2' => array(), + '_billing_address_index' => array(), + '_billing_city' => array(), + '_billing_company' => array(), + '_billing_country' => array(), + '_billing_email' => array(), + '_billing_first_name' => array(), + '_billing_last_name' => array(), + '_billing_phone' => array(), + '_billing_postcode' => array(), + '_billing_state' => array(), + '_cart_discount' => array(), + '_cart_discount_tax' => array(), + '_completed_date' => array(), + '_created_via' => array(), + '_customer_ip_address' => array(), + '_customer_user_agent' => array(), + '_date_completed' => array(), + '_date_paid' => array(), + '_order_currency' => array(), + '_order_key' => array(), + '_order_shipping' => array(), + '_order_shipping_tax' => array(), + '_order_stock_reduced' => array(), + '_order_tax' => array(), + '_order_total' => array(), + '_order_version' => array(), + '_paid_date' => array(), + '_payment_method' => array(), + '_payment_method_title' => array(), + '_payment_tokens' => array(), + '_recorded_coupon_usage_counts' => array(), + '_refund_amount' => array(), + '_refund_reason' => array(), + '_refunded_by' => array(), + '_shipping_address_1' => array(), + '_shipping_address_2' => array(), + '_shipping_address_index' => array(), + '_shipping_city' => array(), + '_shipping_company' => array(), + '_shipping_country' => array(), + '_shipping_first_name' => array(), + '_shipping_last_name' => array(), + '_shipping_postcode' => array(), + '_shipping_state' => array(), + '_transaction_id' => array(), + + // aioseop. + '_aioseop_description' => array(), + '_aioseop_keywords' => array(), + '_aioseop_title' => array(), + + // yoast. + '_yoast_wpseo_authorship' => array(), + '_yoast_wpseo_bctitle' => array(), + '_yoast_wpseo_canonical' => array(), + '_yoast_wpseo_content_score' => array(), + '_yoast_wpseo_focuskw' => array(), + '_yoast_wpseo_focuskw_text_input' => array(), + '_yoast_wpseo_google-plus-description' => array(), + '_yoast_wpseo_google-plus-image' => array(), + '_yoast_wpseo_linkdex' => array(), + '_yoast_wpseo_meta-robots-adv' => array(), + '_yoast_wpseo_meta-robots-nofollow' => array(), + '_yoast_wpseo_meta-robots-noindex' => array(), + '_yoast_wpseo_metadesc' => array(), + '_yoast_wpseo_metakeywords' => array(), + '_yoast_wpseo_opengraph-description' => array(), + '_yoast_wpseo_opengraph-image' => array(), + '_yoast_wpseo_opengraph-title' => array(), + '_yoast_wpseo_primary_byline' => array(), + '_yoast_wpseo_primary_category' => array(), + '_yoast_wpseo_primary_product_cat' => array(), + '_yoast_wpseo_primary_sponsor-type' => array(), + '_yoast_wpseo_primary_tema_category' => array(), + '_yoast_wpseo_primary_wpdmcategory' => array(), + '_yoast_wpseo_primary_wt_portfolio_category' => array(), + '_yoast_wpseo_redirect' => array(), + '_yoast_wpseo_sitemap-include' => array(), + '_yoast_wpseo_sitemap-prio' => array(), + '_yoast_wpseo_title' => array(), + '_yoast_wpseo_twitter-description' => array(), + '_yoast_wpseo_twitter-image' => array(), + + // bbpress. + 'bbppu_read_by' => array(), + '_bbp_activity_id' => array(), + '_bbp_attachment' => array(), + '_bbp_attachment_upload_error' => array(), + '_bbp_forum_id' => array(), + '_bbp_forum_parent_id' => array(), + '_bbp_forum_subforum_count' => array(), + '_bbp_forum_type' => array(), + '_bbp_group_ids' => array(), + '_bbp_last_active_id' => array(), + '_bbp_last_active_time' => array(), + '_bbp_last_reply_id' => array(), + '_bbp_last_topic_id' => array(), + '_bbp_old_forum_id' => array(), + '_bbp_old_sticky_status' => array(), + '_bbp_old_topic_id' => array(), + '_bbp_post_id' => array(), + '_bbp_reply_count' => array(), + '_bbp_reply_is_private' => array(), + '_bbp_reply_to' => array(), + '_bbp_revision_log' => array(), + '_bbp_status' => array(), + '_bbp_sticky_topics' => array(), + '_bbp_topic_count' => array(), + '_bbp_topic_id' => array(), + '_bbp_total_reply_count' => array(), + '_bbp_total_topic_count' => array(), + '_bbp_voice_count' => array(), + + // ??? + '_locale' => array(), + + // wp-job-manager. + '_job_title' => array(), + '_job_description' => array(), + + // wpml. + '_wpml_media_duplicate' => array(), + '_wpml_media_featured' => array(), + + // generic fields. + 'ad_clicks_count' => array(), + 'email' => array(), + 'usage_count' => array(), + 'user_mail' => array(), + 'views' => array(), + '_EventAllDay' => array(), + '_EventCost' => array(), + '_EventCurrencyPosition' => array(), + '_EventCurrencySymbol' => array(), + '_EventDuration' => array(), + '_EventEndDate' => array(), + '_EventEndDateUTC' => array(), + '_EventOrganizerID' => array(), + '_EventOrigin' => array(), + '_EventShowMap' => array(), + '_EventShowMapLink' => array(), + '_EventStartDate' => array(), + '_EventStartDateUTC' => array(), + '_EventTimezone' => array(), + '_EventTimezoneAbbr' => array(), + '_EventURL' => array(), + '_EventVenueID' => array(), + '_OrganizerEmail' => array(), + '_OrganizerOrganizer' => array(), + '_OrganizerOrigin' => array(), + '_OrganizerPhone' => array(), + '_OrganizerWebsite' => array(), + '_VenueAddress' => array(), + '_VenueCity' => array(), + '_VenueCountry' => array(), + '_VenueOrigin' => array(), + '_VenuePhone' => array(), + '_VenueProvince' => array(), + '_VenueShowMap' => array(), + '_VenueShowMapLink' => array(), + '_VenueState' => array(), + '_VenueStateProvince' => array(), + '_VenueURL' => array(), + '_VenueVenue' => array(), + '_VenueVenueID' => array(), + '_VenueZip' => array(), + '_description' => array(), + '_edit_last' => array(), + '_feedback_all_fields' => array(), + '_feedback_author' => array(), + '_feedback_author_email' => array(), + '_feedback_author_url' => array(), + '_feedback_contact_form_url' => array(), + '_feedback_ip' => array(), + '_feedback_subject' => array(), + '_layout' => array(), + '_links_to' => array(), + '_links_to_target' => array(), + '_mail' => array(), + '_mail_2' => array(), + '_messages' => array(), + '_numero' => array(), + '_post_restored_from' => array(), + '_video_url' => array(), + '_website' => array(), + + ); // end unindexed post meta. + + /** + * List of indexed taxonomy slugs - VARCHAR(32) + * + * @access private + * @static + * + * @var array + */ + private static $taxonomies_to_sync = array( + + // Core. + 'link_category', + 'nav_menu', + 'post_format', // Special, limited to certain values. + + // bbpress. + 'topic', + 'topic-tag', + 'topics', + + // buddypress. + 'bp-email-type', + 'bp-email-type', + 'bp_docs_access', + 'bp_docs_associated_item', + 'bp_docs_comment_access', + 'bp_docs_doc_in_folder', + 'bp_docs_folder_in_group', + 'bp_docs_tag', + 'bp_member_type', + + // co-authors plus. + 'author', + + // events calendar plus. + // the events calendar. + 'event-categories', + 'event-category', + 'event-tag', + 'event-tags', + 'event-type', + 'event-venue', + 'event_category', + 'event_location', + 'event_organizer', + 'event_tag', + 'event_type', + 'event_type_2', + 'event_users', + 'events_categories', + 'events_category', + 'events_feeds', + 'events_tags', + 'tribe_events_cat', + + // jetpack. + 'jetpack-portfolio-tag', + 'jetpack-portfolio-type', + 'jetpack-search-tag0', + 'jetpack-search-tag1', + 'jetpack-search-tag2', + 'jetpack-search-tag3', + 'jetpack-search-tag4', + 'jetpack-search-tag5', + 'jetpack-search-tag6', + 'jetpack-search-tag7', + 'jetpack-search-tag8', + 'jetpack-search-tag9', + + // nextgen gallery. + 'ngg_tag', + + // polylang. + // wpml. + 'language', + 'post_translations', + 'term_language', + 'term_translations', + 'translation_priority', + + // woocommerce. + 'pa_accessory-type', + 'pa_actor', + 'pa_age', + 'pa_ambulance', + 'pa_amount', + 'pa_arm-roll', + 'pa_aspectratio', + 'pa_audiencerating', + 'pa_author', + 'pa_axle', + 'pa_battery', + 'pa_belakang', + 'pa_binding', + 'pa_body-type', + 'pa_bore-x-stroke-mm', + 'pa_box-cargo', + 'pa_brakes', + 'pa_brand', + 'pa_brands', + 'pa_bus', + 'pa_c', + 'pa_cabin-to-end', + 'pa_capacity', + 'pa_catalognumberlist', + 'pa_ce-keurmerk', + 'pa_chassis-front', + 'pa_chassis-rear', + 'pa_chassis-weight-kg', + 'pa_chip-log', + 'pa_clothing-size', + 'pa_clutch', + 'pa_clutch-type', + 'pa_collection', + 'pa_color', + 'pa_colors', + 'pa_colour', + 'pa_compactor', + 'pa_condition', + 'pa_cor', + 'pa_couleur', + 'pa_country', + 'pa_countryregion-of-manufacture', + 'pa_crane', + 'pa_creator', + 'pa_culoare', + 'pa_customerpackagetype', + 'pa_depan', + 'pa_depan-belakang', + 'pa_department', + 'pa_design', + 'pa_diameter', + 'pa_diameter-cakram', + 'pa_dimension-mm', + 'pa_dimensions', + 'pa_director', + 'pa_disc-diameter', + 'pa_drive-system', + 'pa_dump', + 'pa_ean', + 'pa_eanlist', + 'pa_edition', + 'pa_electric-battery', + 'pa_engine-model', + 'pa_engine-size', + 'pa_ethnicity', + 'pa_exhaust-brake', + 'pa_fabric', + 'pa_farbe', + 'pa_farg', + 'pa_farge', + 'pa_features', + 'pa_final-gear-ratio', + 'pa_finish', + 'pa_fire-fighting', + 'pa_fits', + 'pa_flat-bed', + 'pa_flavour', + 'pa_format', + 'pa_fragrance', + 'pa_frame', + 'pa_front', + 'pa_front-overhang', + 'pa_front-rear', + 'pa_front-tread', + 'pa_fuel-tank', + 'pa_fuel-type', + 'pa_garantie', + 'pa_geadviseerd-accu-type', + 'pa_gear-ratio', + 'pa_gender', + 'pa_genre', + 'pa_gewicht-exclusief-accu', + 'pa_gift-card-amount', + 'pa_grade-ability-tan-o', + 'pa_groesse', + 'pa_gtin', + 'pa_gvwr-gcwr', + 'pa_hardwareplatform', + 'pa_hazardousmaterialtype', + 'pa_height', + 'pa_hekmotor-of-boegmotor', + 'pa_helmet-size', + 'pa_hersteller', + 'pa_high-blow-tank', + 'pa_hoehe', + 'pa_inhoud', + 'pa_isadultproduct', + 'pa_isbn', + 'pa_iseligiblefortradein', + 'pa_itemdimensions', + 'pa_itempartnumber', + 'pa_kemudi-tipe', + 'pa_kleur', + 'pa_kopling-tipe', + 'pa_label', + 'pa_languages', + 'pa_lbs', + 'pa_legaldisclaimer', + 'pa_lengte-aansluitkabel', + 'pa_length', + 'pa_liquid-tank', + 'pa_location', + 'pa_losse-motor-complete-set', + 'pa_maat', + 'pa_main-brake', + 'pa_make', + 'pa_manufacturer', + 'pa_manufacturer-part-number', + 'pa_manufacturermaximumage', + 'pa_manufacturerminimumage', + 'pa_manufacturerpartswarrantydesc', + 'pa_masseinheit', + 'pa_material', + 'pa_mau-sac', + 'pa_maximum-power-ps-rpm', + 'pa_maximum-speed', + 'pa_maximum-torque-kgm-rpm', + 'pa_mediatype', + 'pa_megethos', + 'pa_merk', + 'pa_metal-type', + 'pa_min-turning-circle', + 'pa_mixer', + 'pa_model', + 'pa_model-tipe', + 'pa_model-type', + 'pa_modelo', + 'pa_mount', + 'pa_mpn', + 'pa_nicotine-strength', + 'pa_nos-of-cylinder', + 'pa_nos-of-tire', + 'pa_numberofdiscs', + 'pa_numberofitems', + 'pa_numberofpages', + 'pa_offset', + 'pa_open-cargo', + 'pa_operatingsystem', + 'pa_options', + 'pa_other-part-number', + 'pa_overall-height', + 'pa_overall-length', + 'pa_overall-width', + 'pa_overview', + 'pa_packagedimensions', + 'pa_packagequantity', + 'pa_pages', + 'pa_parking-brake', + 'pa_part-number', + 'pa_partnumber', + 'pa_pattern', + 'pa_pattern2', + 'pa_performa', + 'pa_pictureformat', + 'pa_pin-size', + 'pa_piston-displacement-cc', + 'pa_ploshhad', + 'pa_plug-type', + 'pa_power', + 'pa_product', + 'pa_productgroup', + 'pa_producttypename', + 'pa_publicationdate', + 'pa_publisher', + 'pa_quantity', + 'pa_rear', + 'pa_rear-overhang', + 'pa_rear-tread', + 'pa_refrigerated-box', + 'pa_region', + 'pa_regioncode', + 'pa_releasedate', + 'pa_rem-parkir', + 'pa_rem-pelambat', + 'pa_rem-utama', + 'pa_reverse', + 'pa_runningtime', + 'pa_scent', + 'pa_schachtlengte', + 'pa_seeds', + 'pa_series', + 'pa_setting', + 'pa_sex', + 'pa_shape', + 'pa_shirt-size', + 'pa_size', + 'pa_sizes', + 'pa_sku', + 'pa_sky-lift', + 'pa_sleeve-length', + 'pa_snelheidsregeling', + 'pa_staart', + 'pa_steering', + 'pa_steering-type', + 'pa_storlek', + 'pa_studio', + 'pa_stuwkracht-lbs', + 'pa_style', + 'pa_suspensions', + 'pa_taille', + 'pa_talla', + 'pa_tamanho', + 'pa_tamano', + 'pa_taxi', + 'pa_ticket-type', + 'pa_tire-size', + 'pa_total-chassis-weight', + 'pa_towing-truck', + 'pa_tradeinvalue', + 'pa_trailer-t-head', + 'pa_transmisi-tipe', + 'pa_transmission', + 'pa_transmission-type', + 'pa_types', + 'pa_ukuran', + 'pa_upc', + 'pa_upclist', + 'pa_variation', + 'pa_vehicle-carrier', + 'pa_vergelijkbaar-stuwkracht', + 'pa_vermogen', + 'pa_voltage', + 'pa_volume', + 'pa_warranty', + 'pa_weight', + 'pa_wheel-base', + 'pa_wheel-configuration', + 'pa_wheel-disc-size', + 'pa_width', + 'pa_zout-water-geschikt', + 'product', + 'product-brand', + 'product_brand', + 'product-category', + 'product_cat', + 'product_delivery_time', + 'product_delivery_times', + 'product_price_label', + 'product_sale_labels', + 'product_shipping_class', + 'product_tag', + 'product_type', + 'product_unit', + 'product_visibility', + 'products', + + // wp-job-manager. + 'job-category', + 'job-location', + 'job-type', + 'job_cat', + 'job_category', + 'job_listing_category', + 'job_listing_label', + 'job_listing_region', + 'job_listing_tag', + 'job_listing_type', + 'job_salary', + 'job_tag', + 'job_type', + 'jobman_category', + 'jobpost_category', + 'jobpost_job_type', + 'jobpost_location', + 'resume_category', + 'resume_groups', + 'resume_job_type', + 'resume_job_type', + 'resume_languages', + 'resume_region', + 'resume_skill', + 'resume_specialities', + + // generic. + '_resource', + 'acadp_categories', + 'acadp_locations', + 'action-group', + 'activity', + 'actor', + 'actors', + 'ad-group', + 'adace-ad-group', + 'adace-sponsor', + 'additional_features', + 'adv_location', + 'advanced_ads_groups', + 'advert_category', + 'affcoups_coupon_category', + 'affcoups_coupon_type', + 'ai_log_context', + 'ai_log_level', + 'al_product-cat', + 'aol_ad_category', + 'aol_ad_location', + 'aol_ad_type', + 'aol_application_status', + 'area', + 'article-slug', + 'asgarosforum-category', + 'asgarosforum-usergroup', + 'attachment_category', + 'attachment_tag', + 'atum_location', + 'audience_type', + 'avhec_catgroup', + 'bartype', + 'baths', + 'beds', + 'bepro_listing_types', + 'blog_category', + 'booked_custom_calendars', + 'brand', + 'brands', + 'business', + 'business_cat', + 'business_category', + 'bwg_tag', + 'byline', + 'calendar_category', + 'calendar_feed', + 'calendar_type', + 'campaign_category', + 'campaign_tag', + 'carousel_cat', + 'carousels_category', + 'case27_job_listing_tags', + 'categories', + 'category_media', + 'category_portfolio', + 'celebrity_cat', + 'chapters', + 'chronosly_category', + 'city', + 'classified_listing_type', + 'client-types', + 'clients_groups', + 'cm-business-category', + 'cmdm_category', + 'cn_log_type', + 'coderevolution_post_source', + 'collection', + 'community', + 'companies', + 'company', + 'cont_category', + 'content_audit', + 'country', + 'course', + 'course-cat', + 'course-category', + 'course_cat', + 'course_category', + 'course_difficulty', + 'course_tag', + 'courses_type', + 'cp_campaign', + 'cp_recipe_category', + 'csco_post_featured', + 'ct_status', + 'ctl-stories', + 'cuisine', + 'dc_vendor_shop', + 'ddownload_category', + 'ddownload_tag', + 'dealstore', + 'department', + 'departments', + 'department-company', + 'developed-by', + 'dfads_group', + 'dgfw_gift_categories', + 'director', + 'district', + 'dlm_download_category', + 'dlm_download_tag', + 'doc_tag', + 'document-category', + 'document-type', + 'download_artist', + 'download_category', + 'download_tag', + 'downloads_filter', + 'dps_book', + 'dt_gallery_category', + 'dt_logos_category', + 'dt_portfolio_category', + 'dt_team_category', + 'dt_testimonials_category', + 'dtcast', + 'dtcreator', + 'dtdirector', + 'dtnetworks', + 'dtstudio', + 'dtyear', + 'dvteamtaxonomy', + 'dwqa-question_category', + 'dwqa-question_tag', + 'eafl_category', + 'easy-testimonial-category', + 'ecwd_event_category', + 'edd_log_type', + 'edition', + 'ef_editorial_meta', + 'ef_usergroup', + 'element_category', + 'elementor_library_type', + 'employees_category', + 'encyclopedia-tag', + 'envira-tag', + 'epkb_post_type_1_category', + 'espresso_event_categories', + 'espresso_event_type', + 'essential_grid_category', + 'et_post_format', + 'faq-group', + 'faq-tags', + 'faq-topic', + 'faq_cat', + 'faq_categories', + 'faq_category', + 'faqs-category', + 'fdm-menu-section', + 'feature', + 'featured_item_category', + 'featured_item_tag', + 'feedback_type', + 'feeds', + 'fl-builder-template-type', + 'flamingo_inbound_channel', + 'follow_up_email_campaign', + 'follow_up_email_type', + 'following_users', + 'football-team-taxo', + 'fpd_design_category', + 'gallery-category', + 'gallery_cat', + 'gallery_categories', + 'gallery_category', + 'gallery_entries', + 'gallerycat', + 'gd_event_tags', + 'gd_eventcategory', + 'gd_place_tags', + 'gd_placecategory', + 'genre', + 'genres', + 'gg_connect_hub', + 'give_log_type', + 'gn-genre', + 'gn-location-1', + 'gn-location-2', + 'gn-location-3', + 'gp_hubs', + 'gp_portfolios', + 'gp_videos', + 'group', + 'group-documents-category', + 'groups', + 'hashtags', + 'hotel_facility', + 'ia_invited_groups', + 'ia_invitees', + 'incsub_wiki_category', + 'industry', + 'ingredient', + 'insight-type', + 'issue', + 'issuem_issue', + 'issuem_issue_tags', + 'jbp_category', + 'karma-slider-category', + 'klaviyo_shop_cart_status', + 'kwlogos-carousel', + 'layout_category', + 'layout_type', + 'ld_course_category', + 'ld_course_tag', + 'ld_lesson_category', + 'ld_lesson_tag', + 'ld_topic_tag', + 'lesson-tag', + 'level', + 'lingotek_hash', + 'lingotek_profile', + 'link_library_category', + 'linkage', + 'list-tags', + 'listing-category', + 'listing_amenities', + 'listing_category', + 'liveblog', + 'llms_access_plan_visibility', + 'llms_product_visibility', + 'localisation', + 'location', + 'location-tag', + 'locations', + 'magazine', + 'map_location_categories', + 'masonry_gallery_category', + 'mc-event-category', + 'mec_category', + 'mec_location', + 'mec_organizer', + 'media-category', + 'media-tags', + 'media_category', + 'media_folder', + 'member_cat', + 'mentions', + 'mesh_template_types', + 'ml-slider', + 'module', + 'module-tag', + 'module_width', + 'movie_cat', + 'mpp-component', + 'mpp-status', + 'mpp-type', + 'muvicast', + 'muvicountry', + 'muvidirector', + 'muviindex', + 'muviquality', + 'muviyear', + 'news-category', + 'news-tag', + 'news-type', + 'news_type_cat', + 'news_category', + 'nova_menu', + 'nova_menu_item_label', + 'offer-types', + 'organization', + 'our_team_category', + 'page_category', + 'parisrestaurant', + 'parissauna', + 'partner_category', + 'partners', + 'paswdestinatari', + 'paypal_ipn_type', + 'pdf_lv_tag', + 'pec_events_category', + 'people', + 'people-department', + 'people-expertise', + 'people-location', + 'perfect_quotes_category', + 'performer', + 'person', + 'personnal-category', + 'pexcontentslider_category', + 'pexfullslider_category', + 'pexnivoslider_category', + 'pexpricing_category', + 'pexservice_category', + 'pextestimonial_category', + 'pf_feed_item_tag', + 'pg_sas_type', + 'photo_tag', + 'phototype', + 'pj-categs', + 'pj-tags', + 'pl-categs', + 'placement', + 'plan_status', + 'platform', + 'player', + 'plugins_categories', + 'podcast', + 'pojo_sidebars', + 'popup_category', + 'pornstars', + 'portada', + 'portcat', + 'portfolio-category', + 'portfolio-gallery', + 'portfolio-status', + 'portfolio-skills', + 'portfolio-tag', + 'portfolio-tags', + 'portfolio-type', + 'portfolio-types', + 'portfolio_cat', + 'portfolio_categories', + 'portfolio_category', + 'portfolio_cats', + 'portfolio_client', + 'portfolio_entries', + 'portfolio_filter', + 'portfolio_in', + 'portfolio_label', + 'portfolio_skills', + 'portfolio_tag', + 'portfolio_tags', + 'portfolio_type', + 'posicao', + 'post-type', + 'post_format', + 'post_series', + 'pp_editorial_meta', + 'pp_notify_role', + 'pp_usergroup', + 'pricingcats', + 'print_section', + 'print_status', + 'product_asset_class', + 'product_name', + 'programs', + 'project-attributes', + 'project-cat', + 'project-category', + 'project-type', + 'project_category', + 'project_tag', + 'projects_category', + 'projects_tag', + 'prominence', + 'promotion-categories', + 'property-city', + 'property-feature', + 'property-status', + 'property-type', + 'property-types', + 'property_action_category', + 'property_area', + 'property_category', + 'property_city', + 'property_feature', + 'property_status', + 'property_type', + 'province', + 'provinces', + 'publisher', + 'pwb-brand', + 'qmn_log_type', + 'qualification', + 'qualifications', + 'quality', + 'question-category', + 'question-tag', + 'question-type', + 'question_cat', + 'question_category', + 'question_tag', + 'quiz', + 'quiz-type', + 'quote_status', + 'rating', + 'reaction', + 'recipe-category', + 'recipe_category', + 'recipe_type', + 'region', + 'registrant-event', + 'related_keywords', + 'release-date', + 'resource-type', + 'resource_category', + 'resource_type', + 'resourcetype', + 'review-type', + 'review_category', + 'rodzaj', + 'role', + 'room_category', + 'room_tag', + 'roomtype', + 'rubriek_categorie', + 'savedreply', + 'schools', + 'scope', + 'scores_cat', + 'sdm_categories', + 'sdm_tags', + 'season', + 'secondary_html_features', + 'section', + 'sector', + 'series', + 'series_of_posts', + 'services_group', + 'serving', + 'shop_cart_status', + 'shop_cat', + 'shop_order_status', + 'shop_vendor', + 'shop_warranty_status', + 'shopp_category', + 'shopr_category', + 'show', + 'simple_link_category', + 'site-review-category', + 'sizes', + 'skill', + 'skill_level', + 'skills', + 'sld_cat', + 'slide-page', + 'slide-types', + 'slide_categories', + 'slide_type', + 'slider', + 'slider-locations', + 'slider_category', + 'slides_category', + 'slideshow', + 'sm-category', + 'snax_format', + 'sngg_media_tags', + 'solution_channel', + 'source_domain', + 'source_id', + 'sp_league', + 'sp_position', + 'sp_role', + 'sp_season', + 'sp_venue', + 'speaker', + 'speakers', + 'special-feature', + 'specialty', + 'spnl_log_type', + 'sponsor_categories', + 'sponsor_category', + 'sponsor_type', + 'spot_tag', + 'st_af_category', + 'st_af_tags', + 'staff', + 'staff-member-category', + 'staff-member-group', + 'staff_category', + 'staffgroups', + 'state', + 'status', + 'store', + 'stores', + 'studio', + 'study_level', + 'style', + 'style_category', + 'sub_transaction_action', + 'sub_transaction_result', + 'subcategory', + 'subject', + 'subscription_status', + 'swift-slider-category', + 'syn_sitegroup', + 'szbl-content-tag', + 'task-queue', + 'tax_feature', + 'tcb_symbols_tax', + 'tcp_product_category', + 'team', + 'team-category', + 'team_cat', + 'team_categories', + 'team_category', + 'team_cats', + 'team_department', + 'team_designation', + 'team_group', + 'team_member_position', + 'team_mfcategory', + 'teams', + 'tenant_categories', + 'tenant_location', + 'tender-category', + 'test-type', + 'testimonial-category', + 'testimonial-group', + 'testimonial-types', + 'testimonial_categories', + 'testimonial_category', + 'testimonials-category', + 'testimonials_category', + 'th_events_cat', + 'th_galleries_cat', + 'thegem_clients_sets', + 'thegem_news_sets', + 'thegem_portfolios', + 'thegem_quickfinders', + 'thegem_teams', + 'thegem_testimonials_sets', + 'theme', + 'themefusion_es_groups', + 'themes_categories', + 'themo_cpt_group', + 'themo_project_type', + 'themo_room_type', + 'thirstylink-category', + 'ticket_channel', + 'ticket_priority', + 'timeline_post_tag', + 'tipo', + 'tipologie', + 'tips', + 'tm-testimonials_category', + 'tm_testimonial_group', + 'tooltips_categories', + 'tour_category', + 'tour_destination', + 'tour_facility', + 'tour_phys', + 'tour_type', + 'tp_event_category', + 'transmission', + 'treatment-type', + 'tribe_events_cat', + 'truethemes-gallery-category', + 'tsas-category', + 'tshowcase-categories', + 'tsml_region', + 'ttshowcase_groups', + 'tvo_tags', + 'type', + 'types', + 'u_course_cat', + 'u_department', + 'u_event_cat', + 'ufaq-category', + 'ufaq-tag', + 'um_hashtag', + 'um_user_tag', + 'uncodeblock_category', + 'upg_cate', + 'urp-review-category', + 'us_portfolio_category', + 'us_testimonial_category', + 'user-group', + 'user_category', + 'user_status', + 'vendor', + 'venue', + 'video-category', + 'video-series', + 'video-tag', + 'video_category', + 'video_tag', + 'videos', + 'videos_categories', + 'voice_category', + 'vtmin_rule_category', + 'vtprd_rule_category', + 'w2dc-category', + 'w2dc-location', + 'w2dc-tag', + 'wcb_sponsor_level', + 'wcb_track', + 'wccf_checkout_field_field_type', + 'wccf_checkout_field_status', + 'wccf_order_field_field_type', + 'wccf_order_field_status', + 'wccf_product_field_field_type', + 'wccf_product_field_status', + 'wccf_product_prop_field_type', + 'wccf_product_prop_status', + 'wccf_user_field_field_type', + 'wccf_user_field_status', + 'wcfm_knowledgebase_category', + 'wcm_task_category', + 'wcpv_product_vendors', + 'wcs-instructor', + 'wcs-room', + 'wcs-type', + 'wdca_ad_categories', + 'webinar_type_cat', + 'where', + 'who', + 'wiki-category', + 'wiki_cats', + 'wl_entity_type', + 'workout_entries', + 'works-category', + 'wp-rest-api-log-method', + 'wp-rest-api-log-source', + 'wp-rest-api-log-status', + 'wp-type-activity-types', + 'wp-type-contacts-subtype', + 'wp-type-group', + 'wp_bannerize_tax', + 'wp_log_type', + 'wp_super_faq_category', + 'wpbdm-region', + 'wpbdp_category', + 'wpbdp_tag', + 'wpcm_make_model', + 'wpdmcategory', + 'wpfb_file_category', + 'wpfcas-category', + 'wpfd-category', + 'wplead_list_category', + 'wplss_logo_showcase_cat', + 'wpm-testimonial-category', + 'wpmf-category', + 'wpostahs-slider-category', + 'wprm_course', + 'wprm_cuisine', + 'wprm_ingredient', + 'wprm_keyword', + 'wprss_category', + 'wps_forum', + 'wpsc-variation', + 'wpsc_log_type', + 'wpsc_product_category', + 'wpseo_locations_category', + 'wpsisac_slider-category', + 'wpsl_store_category', + 'wpt_category', + 'wpt_result', + 'wpt_scale', + 'wpv_sermons_category', + 'wpvqgr_tag', + 'writer', + 'wyz_business_category', + 'wyz_business_rating_category', + 'wyz_business_tag', + 'wzkb_category', + 'year', + 'years', + 'yith_product_brand', + 'yith_shop_vendor', + 'yst_prominent_words', + 'zipcode', + 'zoninator_zones', + 'zrf_field_group', + + // End The Backlog @see https://wp.me/p9MPsk-X0. + 'bill-status', + 'etb-audience', + 'etb-state', + 'etb-target', + 'etb-topic', + 'etb-year', + 'foia-response-status', + 'target-type', + 'timeline-pillar', + 'timeline-type', + + // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104 + 'wpcom_marketplace_categories', + + ); // end taxonomies. + + /** + * List of options to sync + * + * @access private + * @static + * + * @var array + */ + private static $options_to_sync = array( + 'jetpack_search_color_theme', + 'jetpack_search_result_format', + 'jetpack_search_default_sort', + 'jetpack_search_overlay_trigger', + 'jetpack_search_excluded_post_types', + 'jetpack_search_highlight_color', + 'jetpack_search_enable_sort', + 'jetpack_search_inf_scroll', + 'jetpack_search_show_powered_by', + 'instant_search_enabled', + ); // end options. + + /* + * Taxonomies we know don't sync. + * See also sync/src/class-defaults.php + * + * 'network' + * 'post_status' + * 'product_cat' + * 'tags' + * + */ + + // + // Hooks into sync. + + /** + * Add Search post meta to the post meta whitelist. + * + * @param array $list Existing post meta whitelist. + * @return array Updated post meta whitelist. + */ + public function add_search_post_meta_whitelist( $list ) { + return array_merge( $list, $this->get_all_postmeta_keys() ); + } + + /** + * Add Search options to the options whitelist. + * + * @param array $list Existing options whitelist. + * @return array Updated options whitelist. + */ + public function add_search_options_whitelist( $list ) { + return array_merge( $list, $this->get_all_option_keys() ); + } + + // + // Indexing functions for wp.com. + + /** + * + * Check whether a postmeta or taxonomy 'key' is in the indexable + * list. This is called by the indexing code on wp.com to decide + * whether to include something in the index. + * + * @static + * @access public + * + * @param string $type Either 'postmeta' or 'taxonomy'. + * @param string $key The postmeta key or taxonomy name. + * @return boolean + */ + public static function is_indexable( $type, $key ) { + switch ( $type ) { + case 'postmeta': + return isset( self::$postmeta_to_sync[ $key ] ); + case 'taxonomy': + return in_array( $key, self::$taxonomies_to_sync, true ); + } + return false; + } + + /** + * + * Get the indexing spec for a postmeta key. + * + * @static + * @access public + * + * @param string $key The postmeta key. + * @return array The spec. + */ + public static function get_postmeta_spec( $key ) { + return self::$postmeta_to_sync[ $key ]; + } + + /** + * Get all post meta keys that get synced. + * + * @access public + * + * @return array List of post meta keys that get synced. + */ + public static function get_all_postmeta_keys() { + return array_keys( self::$postmeta_to_sync ); + } + + /** + * Get all option keys that get synced. + * + * @access public + * + * @return array List of option keys that get synced. + */ + public static function get_all_option_keys() { + return self::$options_to_sync; + } + + /** + * Get all unindexed postmeta. + * This is mostly for testing. + * + * @access public + * + * @return array List of postmeta that are not synced. + */ + public static function get_all_unindexed_postmeta_keys() { + return array_keys( self::$unindexed_postmeta ); + } + + /** + * Get all taxonomies that get synced. + * This is mostly for testing. + * + * @access public + * + * @return array List of taxonomies that get synced. + */ + public static function get_all_taxonomies() { + return self::$taxonomies_to_sync; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php new file mode 100644 index 00000000..83479d1d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php @@ -0,0 +1,68 @@ + self::MAX_INT, + 'term_taxonomy_id' => self::MAX_INT, + ); + + while ( $limit > 0 ) { + /* + * SELECT object_id, term_taxonomy_id + * FROM $wpdb->term_relationships + * WHERE ( object_id = 11 AND term_taxonomy_id < 14 ) OR ( object_id < 11 ) + * ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT 1000 + */ + $objects = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $last_object_enqueued['object_id'], $last_object_enqueued['term_taxonomy_id'], $last_object_enqueued['object_id'], $limit ), ARRAY_A ); + // Request term relationships in groups of N for efficiency. + $objects_count = count( $objects ); + if ( ! count( $objects ) ) { + return array( $items_enqueued_count, true ); + } + $items = array_chunk( $objects, $term_relationships_full_sync_item_size ); + $last_object_enqueued = $this->bulk_enqueue_full_sync_term_relationships( $items, $last_object_enqueued ); + $items_enqueued_count += count( $items ); + $limit = min( $limit - $objects_count, self::QUERY_LIMIT ); + } + + // We need to do this extra check in case $max_items_to_enqueue * $term_relationships_full_sync_item_size == relationships objects left. + $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $last_object_enqueued['object_id'], $last_object_enqueued['term_taxonomy_id'], $last_object_enqueued['object_id'], 1 ) ); + if ( 0 === (int) $count ) { + return array( $items_enqueued_count, true ); + } + + return array( $items_enqueued_count, $last_object_enqueued ); + } + + /** + * Return the initial last sent object. + * + * @return string|array initial status. + */ + public function get_initial_last_sent() { + return array( + 'object_id' => self::MAX_INT, + 'term_taxonomy_id' => self::MAX_INT, + ); + } + + /** + * Given the Module Full Sync Configuration and Status return the next chunk of items to send. + * + * @param array $config This module Full Sync configuration. + * @param array $status This module Full Sync status. + * @param int $chunk_size Chunk size. + * + * @return array|object|null + */ + public function get_next_chunk( $config, $status, $chunk_size ) { + global $wpdb; + + return $wpdb->get_results( + $wpdb->prepare( + "SELECT object_id, term_taxonomy_id + FROM $wpdb->term_relationships + WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) + ORDER BY object_id DESC, term_taxonomy_id + DESC LIMIT %d", + $status['last_sent']['object_id'], + $status['last_sent']['term_taxonomy_id'], + $status['last_sent']['object_id'], + $chunk_size + ), + ARRAY_A + ); + } + + /** + * + * Enqueue all $items within `jetpack_full_sync_term_relationships` actions. + * + * @param array $items Groups of objects to sync. + * @param array $previous_interval_end Last item enqueued. + * + * @return array Last enqueued object. + */ + public function bulk_enqueue_full_sync_term_relationships( $items, $previous_interval_end ) { + $listener = Listener::get_instance(); + $items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $items, $previous_interval_end ); + $listener->bulk_enqueue_full_sync_actions( 'jetpack_full_sync_term_relationships', $items_with_previous_interval_end ); + $last_item = end( $items ); + return end( $last_item ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + global $wpdb; + + $query = "SELECT COUNT(*) FROM $wpdb->term_relationships"; + + // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / Settings::get_setting( 'term_relationships_full_sync_item_size' ) ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_term_relationships' ); + } + + /** + * Expand the term relationships within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_term_relationships( $args ) { + list( $term_relationships, $previous_end ) = $args; + + return array( + 'term_relationships' => $term_relationships, + 'previous_end' => $previous_end, + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php new file mode 100644 index 00000000..6bc8c064 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php @@ -0,0 +1,314 @@ +get_error_code() === 'invalid_taxonomy' ) { + // Fetch raw term. + $columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_checksum_columns, array( 'term_group' ) ) ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->terms WHERE term_id = %d", $id ) ); + } + } + + if ( 'term_taxonomy' === $object_type ) { + $columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_taxonomy_checksum_columns, array( 'description' ) ) ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $id ) ); + } + + if ( 'term_relationships' === $object_type ) { + $columns = implode( ', ', Defaults::$default_term_relationships_checksum_columns ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $objects = $wpdb->get_results( $wpdb->prepare( "SELECT $columns FROM $wpdb->term_relationships WHERE object_id = %d", $id ) ); + $object = (object) array( + 'object_id' => $id, + 'relationships' => array_map( array( $this, 'expand_terms_for_relationship' ), $objects ), + ); + } + + return $object ? $object : false; + } + + /** + * Initialize terms action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + add_action( 'created_term', array( $this, 'save_term_handler' ), 10, 3 ); + add_action( 'edited_term', array( $this, 'save_term_handler' ), 10, 3 ); + add_action( 'jetpack_sync_save_term', $callable ); + add_action( 'jetpack_sync_add_term', $callable ); + add_action( 'delete_term', $callable, 10, 4 ); + add_action( 'set_object_terms', $callable, 10, 6 ); + add_action( 'deleted_term_relationships', $callable, 10, 2 ); + add_filter( 'jetpack_sync_before_enqueue_set_object_terms', array( $this, 'filter_set_object_terms_no_update' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_term', array( $this, 'filter_blacklisted_taxonomies' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_add_term', array( $this, 'filter_blacklisted_taxonomies' ) ); + } + + /** + * Initialize terms action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_terms', $callable, 10, 2 ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_terms', array( $this, 'expand_term_taxonomy_id' ) ); + } + + /** + * Enqueue the terms actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_terms', $wpdb->term_taxonomy, 'term_taxonomy_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + $where_sql = Settings::get_blacklisted_taxonomies_sql(); + + if ( is_array( $config ) ) { + $where_sql .= ' AND term_taxonomy_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $where_sql; + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return int Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->term_taxonomy"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_terms' ); + } + + /** + * Handler for creating and updating terms. + * + * @access public + * + * @param int $term_id Term ID. + * @param int $tt_id Term taxonomy ID. + * @param string $taxonomy Taxonomy slug. + */ + public function save_term_handler( $term_id, $tt_id, $taxonomy ) { + if ( class_exists( '\\WP_Term' ) ) { + $term_object = \WP_Term::get_instance( $term_id, $taxonomy ); + } else { + $term_object = get_term_by( 'id', $term_id, $taxonomy ); + } + + $current_filter = current_filter(); + + if ( 'created_term' === $current_filter ) { + /** + * Fires when the client needs to add a new term + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param object the Term object + */ + do_action( 'jetpack_sync_add_term', $term_object ); + return; + } + + /** + * Fires when the client needs to update a term + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param object the Term object + */ + do_action( 'jetpack_sync_save_term', $term_object ); + } + + /** + * Filter blacklisted taxonomies. + * + * @access public + * + * @param array $args Hook args. + * @return array|boolean False if not whitelisted, the original hook args otherwise. + */ + public function filter_blacklisted_taxonomies( $args ) { + $term = $args[0]; + + if ( in_array( $term->taxonomy, Settings::get_setting( 'taxonomies_blacklist' ), true ) ) { + return false; + } + + return $args; + } + + /** + * Filter out set_object_terms actions where the terms have not changed. + * + * @param array $args Hook args. + * @return array|boolean False if no change in terms, the original hook args otherwise. + */ + public function filter_set_object_terms_no_update( $args ) { + // There is potential for other plugins to modify args, therefore lets validate # of and types. + // $args[2] is $tt_ids, $args[5] is $old_tt_ids see wp-includes/taxonomy.php L2740. + if ( 6 === count( $args ) && is_array( $args[2] ) && is_array( $args[5] ) ) { + if ( empty( array_diff( $args[2], $args[5] ) ) && empty( array_diff( $args[5], $args[2] ) ) ) { + return false; + } + } + return $args; + } + + /** + * Expand the term taxonomy IDs to terms within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The expanded hook parameters. + */ + public function expand_term_taxonomy_id( $args ) { + list( $term_taxonomy_ids, $previous_end ) = $args; + + return array( + 'terms' => get_terms( + array( + 'hide_empty' => false, + 'term_taxonomy_id' => $term_taxonomy_ids, + 'orderby' => 'term_taxonomy_id', + 'order' => 'DESC', + ) + ), + 'previous_end' => $previous_end, + ); + } + + /** + * Gets a term object based on a given row from the term_relationships database table. + * + * @access public + * + * @param object $relationship A row object from the term_relationships table. + * @return object|bool A term object, or false if term taxonomy doesn't exist. + */ + public function expand_terms_for_relationship( $relationship ) { + return get_term_by( 'term_taxonomy_id', $relationship->term_taxonomy_id ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php new file mode 100644 index 00000000..7218e55d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php @@ -0,0 +1,876 @@ + $widget_object->name, + 'id' => $widget_object->id, + 'title' => isset( $new_instance['title'] ) ? $new_instance['title'] : '', + ); + /** + * Trigger action to alert $callable sync listener that a widget was edited. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $widget_name , Name of edited widget + */ + do_action( 'jetpack_widget_edited', $widget ); + + return $instance; + } + + /** + * Sync handler for network allowed themes change. + * + * @access public + * + * @param string $option Name of the network option. + * @param mixed $value Current value of the network option. + * @param mixed $old_value Old value of the network option. + * @param int $network_id ID of the network. + */ + public function sync_network_allowed_themes_change( $option, $value, $old_value, $network_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $all_enabled_theme_slugs = array_keys( $value ); + + if ( count( $old_value ) > count( $value ) ) { + + // Suppress jetpack_network_disabled_themes sync action when theme is deleted. + $delete_theme_call = $this->get_delete_theme_call(); + if ( ! empty( $delete_theme_call ) ) { + return; + } + + $newly_disabled_theme_names = array_keys( array_diff_key( $old_value, $value ) ); + $newly_disabled_themes = $this->get_theme_details_for_slugs( $newly_disabled_theme_names ); + /** + * Trigger action to alert $callable sync listener that network themes were disabled. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param mixed $newly_disabled_themes, Array of info about network disabled themes + * @param mixed $all_enabled_theme_slugs, Array of slugs of all enabled themes + */ + do_action( 'jetpack_network_disabled_themes', $newly_disabled_themes, $all_enabled_theme_slugs ); + return; + } + + $newly_enabled_theme_names = array_keys( array_diff_key( $value, $old_value ) ); + $newly_enabled_themes = $this->get_theme_details_for_slugs( $newly_enabled_theme_names ); + /** + * Trigger action to alert $callable sync listener that network themes were enabled + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param mixed $newly_enabled_themes , Array of info about network enabled themes + * @param mixed $all_enabled_theme_slugs, Array of slugs of all enabled themes + */ + do_action( 'jetpack_network_enabled_themes', $newly_enabled_themes, $all_enabled_theme_slugs ); + } + + /** + * Retrieve details for one or more themes by their slugs. + * + * @access private + * + * @param array $theme_slugs Theme slugs. + * @return array Details for the themes. + */ + private function get_theme_details_for_slugs( $theme_slugs ) { + $theme_data = array(); + foreach ( $theme_slugs as $slug ) { + $theme = wp_get_theme( $slug ); + $theme_data[ $slug ] = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'slug' => $slug, + ); + } + return $theme_data; + } + + /** + * Detect a theme edit during a redirect. + * + * @access public + * + * @param string $redirect_url Redirect URL. + * @return string Redirect URL. + */ + public function detect_theme_edit( $redirect_url ) { + $url = wp_parse_url( admin_url( $redirect_url ) ); + $theme_editor_url = wp_parse_url( admin_url( 'theme-editor.php' ) ); + + if ( $theme_editor_url['path'] !== $url['path'] ) { + return $redirect_url; + } + + $query_params = array(); + wp_parse_str( $url['query'], $query_params ); + if ( + ! isset( $_POST['newcontent'] ) || + ! isset( $query_params['file'] ) || + ! isset( $query_params['theme'] ) || + ! isset( $query_params['updated'] ) + ) { + return $redirect_url; + } + $theme = wp_get_theme( $query_params['theme'] ); + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * Trigger action to alert $callable sync listener that a theme was edited. + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $query_params['theme'], Slug of edited theme + * @param string $theme_data, Information about edited them + */ + do_action( 'jetpack_edited_theme', $query_params['theme'], $theme_data ); + + return $redirect_url; + } + + /** + * Handler for AJAX theme editing. + * + * @todo Refactor to use WP_Filesystem instead of fopen()/fclose(). + */ + public function theme_edit_ajax() { + $args = wp_unslash( $_POST ); + + if ( empty( $args['theme'] ) ) { + return; + } + + if ( empty( $args['file'] ) ) { + return; + } + $file = $args['file']; + if ( 0 !== validate_file( $file ) ) { + return; + } + + if ( ! isset( $args['newcontent'] ) ) { + return; + } + + if ( ! isset( $args['nonce'] ) ) { + return; + } + + $stylesheet = $args['theme']; + if ( 0 !== validate_file( $stylesheet ) ) { + return; + } + + if ( ! current_user_can( 'edit_themes' ) ) { + return; + } + + $theme = wp_get_theme( $stylesheet ); + if ( ! $theme->exists() ) { + return; + } + + if ( ! wp_verify_nonce( $args['nonce'], 'edit-theme_' . $stylesheet . '_' . $file ) ) { + return; + } + + if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) { + return; + } + + $editable_extensions = wp_get_theme_file_editable_extensions( $theme ); + + $allowed_files = array(); + foreach ( $editable_extensions as $type ) { + switch ( $type ) { + case 'php': + $allowed_files = array_merge( $allowed_files, $theme->get_files( 'php', -1 ) ); + break; + case 'css': + $style_files = $theme->get_files( 'css', -1 ); + $allowed_files['style.css'] = $style_files['style.css']; + $allowed_files = array_merge( $allowed_files, $style_files ); + break; + default: + $allowed_files = array_merge( $allowed_files, $theme->get_files( $type, -1 ) ); + break; + } + } + + $real_file = $theme->get_stylesheet_directory() . '/' . $file; + if ( 0 !== validate_file( $real_file, $allowed_files ) ) { + return; + } + + // Ensure file is real. + if ( ! is_file( $real_file ) ) { + return; + } + + // Ensure file extension is allowed. + $extension = null; + if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) { + $extension = strtolower( $matches[1] ); + if ( ! in_array( $extension, $editable_extensions, true ) ) { + return; + } + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_is_writeable + if ( ! is_writeable( $real_file ) ) { + return; + } + + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen + $file_pointer = fopen( $real_file, 'w+' ); + if ( false === $file_pointer ) { + return; + } + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + fclose( $file_pointer ); + + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * This action is documented already in this file. + */ + do_action( 'jetpack_edited_theme', $stylesheet, $theme_data ); + } + + /** + * Detect a theme deletion. + * + * @access public + * + * @param string $stylesheet Stylesheet of the theme to delete. + * @param bool $deleted Whether the theme deletion was successful. + */ + public function detect_theme_deletion( $stylesheet, $deleted ) { + $theme = wp_get_theme( $stylesheet ); + $theme_data = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'slug' => $stylesheet, + ); + + if ( $deleted ) { + /** + * Signals to the sync listener that a theme was deleted and a sync action + * reflecting the deletion and theme slug should be sent + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $stylesheet Theme slug + * @param array $theme_data Theme info Since 5.3 + */ + do_action( 'jetpack_deleted_theme', $stylesheet, $theme_data ); + } + } + + /** + * Handle an upgrader completion action. + * + * @access public + * + * @param \WP_Upgrader $upgrader The upgrader instance. + * @param array $details Array of bulk item update data. + */ + public function check_upgrader( $upgrader, $details ) { + if ( ! isset( $details['type'] ) || + 'theme' !== $details['type'] || + is_wp_error( $upgrader->skin->result ) || + ! method_exists( $upgrader, 'theme_info' ) + ) { + return; + } + + if ( 'install' === $details['action'] ) { + $theme = $upgrader->theme_info(); + if ( ! $theme instanceof \WP_Theme ) { + return; + } + $theme_info = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + ); + + /** + * Signals to the sync listener that a theme was installed and a sync action + * reflecting the installation and the theme info should be sent + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $theme->theme_root Text domain of the theme + * @param mixed $theme_info Array of abbreviated theme info + */ + do_action( 'jetpack_installed_theme', $theme->stylesheet, $theme_info ); + } + + if ( 'update' === $details['action'] ) { + $themes = array(); + + if ( empty( $details['themes'] ) && isset( $details['theme'] ) ) { + $details['themes'] = array( $details['theme'] ); + } + + foreach ( $details['themes'] as $theme_slug ) { + $theme = wp_get_theme( $theme_slug ); + + if ( ! $theme instanceof \WP_Theme ) { + continue; + } + + $themes[ $theme_slug ] = array( + 'name' => $theme->get( 'Name' ), + 'version' => $theme->get( 'Version' ), + 'uri' => $theme->get( 'ThemeURI' ), + 'stylesheet' => $theme->stylesheet, + ); + } + + if ( empty( $themes ) ) { + return; + } + + /** + * Signals to the sync listener that one or more themes was updated and a sync action + * reflecting the update and the theme info should be sent + * + * @since 1.6.3 + * @since-jetpack 6.2.0 + * + * @param mixed $themes Array of abbreviated theme info + */ + do_action( 'jetpack_updated_themes', $themes ); + } + } + + /** + * Initialize themes action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_theme_data', $callable ); + } + + /** + * Handle a theme switch. + * + * @access public + * + * @param string $new_name Name of the new theme. + * @param \WP_Theme $new_theme The new theme. + * @param \WP_Theme $old_theme The previous theme. + */ + public function sync_theme_support( $new_name, $new_theme = null, $old_theme = null ) { + $previous_theme = $this->get_theme_info( $old_theme ); + + /** + * Fires when the client needs to sync theme support info + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param array the theme support array + * @param array the previous theme since Jetpack 6.5.0 + */ + do_action( 'jetpack_sync_current_theme_support', $this->get_theme_info(), $previous_theme ); + } + + /** + * Enqueue the themes actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all theme data to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand theme data (should always be true) + */ + do_action( 'jetpack_full_sync_theme_data', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the themes actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_theme_data', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_theme_data', array( $this, 'expand_theme_data' ) ); + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_theme_data' ); + } + + /** + * Expand the theme within a hook before it is serialized and sent to the server. + * + * @access public + * + * @return array Theme data. + */ + public function expand_theme_data() { + return array( $this->get_theme_info() ); + } + + /** + * Retrieve the name of the widget by the widget ID. + * + * @access public + * @global $wp_registered_widgets + * + * @param string $widget_id Widget ID. + * @return string Name of the widget, or null if not found. + */ + public function get_widget_name( $widget_id ) { + global $wp_registered_widgets; + return ( isset( $wp_registered_widgets[ $widget_id ] ) ? $wp_registered_widgets[ $widget_id ]['name'] : null ); + } + + /** + * Retrieve the name of the sidebar by the sidebar ID. + * + * @access public + * @global $wp_registered_sidebars + * + * @param string $sidebar_id Sidebar ID. + * @return string Name of the sidebar, or null if not found. + */ + public function get_sidebar_name( $sidebar_id ) { + global $wp_registered_sidebars; + return ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : null ); + } + + /** + * Sync addition of widgets to a sidebar. + * + * @access public + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + * @return array All widgets that have been moved to the sidebar. + */ + public function sync_add_widgets_to_sidebar( $new_widgets, $old_widgets, $sidebar ) { + $added_widgets = array_diff( $new_widgets, $old_widgets ); + if ( empty( $added_widgets ) ) { + return array(); + } + $moved_to_sidebar = array(); + $sidebar_name = $this->get_sidebar_name( $sidebar ); + + // Don't sync jetpack_widget_added if theme was switched. + if ( $this->is_theme_switch() ) { + return array(); + } + + foreach ( $added_widgets as $added_widget ) { + $moved_to_sidebar[] = $added_widget; + $added_widget_name = $this->get_widget_name( $added_widget ); + /** + * Helps Sync log that a widget got added + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $added_widget, Widget id got added + * @param string $sidebar_name, Sidebar id got changed Since 5.0.0 + * @param string $added_widget_name, Widget id got added Since 5.0.0 + */ + do_action( 'jetpack_widget_added', $sidebar, $added_widget, $sidebar_name, $added_widget_name ); + } + return $moved_to_sidebar; + } + + /** + * Sync removal of widgets from a sidebar. + * + * @access public + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + * @param array $inactive_widgets Current inactive widgets. + * @return array All widgets that have been moved to inactive. + */ + public function sync_remove_widgets_from_sidebar( $new_widgets, $old_widgets, $sidebar, $inactive_widgets ) { + $removed_widgets = array_diff( $old_widgets, $new_widgets ); + + if ( empty( $removed_widgets ) ) { + return array(); + } + + $moved_to_inactive = array(); + $sidebar_name = $this->get_sidebar_name( $sidebar ); + + foreach ( $removed_widgets as $removed_widget ) { + // Lets check if we didn't move the widget to in_active_widgets. + if ( isset( $inactive_widgets ) && ! in_array( $removed_widget, $inactive_widgets, true ) ) { + $removed_widget_name = $this->get_widget_name( $removed_widget ); + /** + * Helps Sync log that a widgte got removed + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $removed_widget, Widget id got removed + * @param string $sidebar_name, Name of the sidebar that changed Since 5.0.0 + * @param string $removed_widget_name, Name of the widget that got removed Since 5.0.0 + */ + do_action( 'jetpack_widget_removed', $sidebar, $removed_widget, $sidebar_name, $removed_widget_name ); + } else { + $moved_to_inactive[] = $removed_widget; + } + } + return $moved_to_inactive; + } + + /** + * Sync a reorder of widgets within a sidebar. + * + * @access public + * + * @todo Refactor serialize() to a json_encode(). + * + * @param array $new_widgets New widgets. + * @param array $old_widgets Old widgets. + * @param string $sidebar Sidebar ID. + */ + public function sync_widgets_reordered( $new_widgets, $old_widgets, $sidebar ) { + $added_widgets = array_diff( $new_widgets, $old_widgets ); + if ( ! empty( $added_widgets ) ) { + return; + } + $removed_widgets = array_diff( $old_widgets, $new_widgets ); + if ( ! empty( $removed_widgets ) ) { + return; + } + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + if ( serialize( $old_widgets ) !== serialize( $new_widgets ) ) { + $sidebar_name = $this->get_sidebar_name( $sidebar ); + /** + * Helps Sync log that a sidebar id got reordered + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param string $sidebar, Sidebar id got changed + * @param string $sidebar_name, Name of the sidebar that changed Since 5.0.0 + */ + do_action( 'jetpack_widget_reordered', $sidebar, $sidebar_name ); + } + } + + /** + * Handle the update of the sidebars and widgets mapping option. + * + * @access public + * + * @param mixed $old_value The old option value. + * @param mixed $new_value The new option value. + */ + public function sync_sidebar_widgets_actions( $old_value, $new_value ) { + // Don't really know how to deal with different array_values yet. + if ( + ( isset( $old_value['array_version'] ) && 3 !== $old_value['array_version'] ) || + ( isset( $new_value['array_version'] ) && 3 !== $new_value['array_version'] ) + ) { + return; + } + + $moved_to_inactive_ids = array(); + $moved_to_sidebar = array(); + + foreach ( $new_value as $sidebar => $new_widgets ) { + if ( in_array( $sidebar, array( 'array_version', 'wp_inactive_widgets' ), true ) ) { + continue; + } + $old_widgets = isset( $old_value[ $sidebar ] ) + ? $old_value[ $sidebar ] + : array(); + + if ( ! is_array( $new_widgets ) ) { + $new_widgets = array(); + } + + $moved_to_inactive_recently = $this->sync_remove_widgets_from_sidebar( $new_widgets, $old_widgets, $sidebar, $new_value['wp_inactive_widgets'] ); + $moved_to_inactive_ids = array_merge( $moved_to_inactive_ids, $moved_to_inactive_recently ); + + $moved_to_sidebar_recently = $this->sync_add_widgets_to_sidebar( $new_widgets, $old_widgets, $sidebar ); + $moved_to_sidebar = array_merge( $moved_to_sidebar, $moved_to_sidebar_recently ); + + $this->sync_widgets_reordered( $new_widgets, $old_widgets, $sidebar ); + + } + + // Don't sync either jetpack_widget_moved_to_inactive or jetpack_cleared_inactive_widgets if theme was switched. + if ( $this->is_theme_switch() ) { + return; + } + + // Treat inactive sidebar a bit differently. + if ( ! empty( $moved_to_inactive_ids ) ) { + $moved_to_inactive_name = array_map( array( $this, 'get_widget_name' ), $moved_to_inactive_ids ); + /** + * Helps Sync log that a widgets IDs got moved to in active + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param array $moved_to_inactive_ids, Array of widgets id that moved to inactive id got changed + * @param array $moved_to_inactive_names, Array of widgets names that moved to inactive id got changed Since 5.0.0 + */ + do_action( 'jetpack_widget_moved_to_inactive', $moved_to_inactive_ids, $moved_to_inactive_name ); + } elseif ( empty( $moved_to_sidebar ) && empty( $new_value['wp_inactive_widgets'] ) && ! empty( $old_value['wp_inactive_widgets'] ) ) { + /** + * Helps Sync log that a got cleared from inactive. + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + */ + do_action( 'jetpack_cleared_inactive_widgets' ); + } + } + + /** + * Retrieve the theme data for the current or a specific theme. + * + * @access private + * + * @param \WP_Theme $theme Theme object. Optional, will default to the current theme. + * + * @return array Theme data. + */ + private function get_theme_info( $theme = null ) { + $theme_support = array(); + + // We are trying to get the current theme info. + if ( null === $theme ) { + $theme = wp_get_theme(); + } + + $theme_support['name'] = $theme->get( 'Name' ); + $theme_support['version'] = $theme->get( 'Version' ); + $theme_support['slug'] = $theme->get_stylesheet(); + $theme_support['uri'] = $theme->get( 'ThemeURI' ); + + return $theme_support; + } + + /** + * Whether we've deleted a theme in the current request. + * + * @access private + * + * @return boolean True if this is a theme deletion request, false otherwise. + */ + private function get_delete_theme_call() { + // Intentional usage of `debug_backtrace()` for production needs. + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + $backtrace = debug_backtrace(); + $delete_theme_call = null; + foreach ( $backtrace as $call ) { + if ( isset( $call['function'] ) && 'delete_theme' === $call['function'] ) { + $delete_theme_call = $call; + break; + } + } + return $delete_theme_call; + } + + /** + * Whether we've switched to another theme in the current request. + * + * @access private + * + * @return boolean True if this is a theme switch request, false otherwise. + */ + private function is_theme_switch() { + return did_action( 'after_switch_theme' ); + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve a set of constants by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( 'theme-info' !== $object_type ) { + return array(); + } + + return array( $this->get_theme_info() ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php new file mode 100644 index 00000000..5557bab4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php @@ -0,0 +1,583 @@ +updates = array(); + } + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'updates'; + } + + /** + * Initialize updates action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + global $wp_version; + $this->old_wp_version = $wp_version; + add_action( 'set_site_transient_update_plugins', array( $this, 'validate_update_change' ), 10, 3 ); + add_action( 'set_site_transient_update_themes', array( $this, 'validate_update_change' ), 10, 3 ); + add_action( 'set_site_transient_update_core', array( $this, 'validate_update_change' ), 10, 3 ); + + add_action( 'jetpack_update_plugins_change', $callable ); + add_action( 'jetpack_update_themes_change', $callable ); + add_action( 'jetpack_update_core_change', $callable ); + + add_filter( + 'jetpack_sync_before_enqueue_jetpack_update_plugins_change', + array( + $this, + 'filter_update_keys', + ), + 10, + 2 + ); + add_filter( + 'jetpack_sync_before_enqueue_upgrader_process_complete', + array( + $this, + 'filter_upgrader_process_complete', + ), + 10, + 2 + ); + + add_action( 'automatic_updates_complete', $callable ); + + if ( is_multisite() ) { + add_filter( 'pre_update_site_option_wpmu_upgrade_site', array( $this, 'update_core_network_event' ), 10, 2 ); + add_action( 'jetpack_sync_core_update_network', $callable, 10, 3 ); + } + + // Send data when update completes. + add_action( '_core_updated_successfully', array( $this, 'update_core' ) ); + add_action( 'jetpack_sync_core_reinstalled_successfully', $callable ); + add_action( 'jetpack_sync_core_autoupdated_successfully', $callable, 10, 2 ); + add_action( 'jetpack_sync_core_updated_successfully', $callable, 10, 2 ); + } + + /** + * Initialize updates action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_updates', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_updates', array( $this, 'expand_updates' ) ); + add_filter( 'jetpack_sync_before_send_jetpack_update_themes_change', array( $this, 'expand_themes' ) ); + } + + /** + * Handle a core network update. + * + * @access public + * + * @param int $wp_db_version Current version of the WordPress database. + * @param int $old_wp_db_version Old version of the WordPress database. + * @return int Current version of the WordPress database. + */ + public function update_core_network_event( $wp_db_version, $old_wp_db_version ) { + global $wp_version; + /** + * Sync event for when core wp network updates to a new db version + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param int $wp_db_version the latest wp_db_version + * @param int $old_wp_db_version previous wp_db_version + * @param string $wp_version the latest wp_version + */ + do_action( 'jetpack_sync_core_update_network', $wp_db_version, $old_wp_db_version, $wp_version ); + return $wp_db_version; + } + + /** + * Handle a core update. + * + * @access public + * + * @todo Implement nonce or refactor to use `admin_post_{$action}` hooks instead. + * + * @param string $new_wp_version The new WP core version. + */ + public function update_core( $new_wp_version ) { + global $pagenow; + + // // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['action'] ) && 'do-core-reinstall' === $_GET['action'] ) { + /** + * Sync event that fires when core reinstall was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + */ + do_action( 'jetpack_sync_core_reinstalled_successfully', $new_wp_version ); + return; + } + + // Core was autoupdated. + if ( + 'update-core.php' !== $pagenow && + ! Jetpack_Constants::is_true( 'REST_API_REQUEST' ) // WP.com rest api calls should never be marked as a core autoupdate. + ) { + /** + * Sync event that fires when core autoupdate was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + * @param string $old_wp_version the previous WordPress version + */ + do_action( 'jetpack_sync_core_autoupdated_successfully', $new_wp_version, $this->old_wp_version ); + return; + } + /** + * Sync event that fires when core update was successful + * + * @since 1.6.3 + * @since-jetpack 5.0.0 + * + * @param string $new_wp_version the updated WordPress version + * @param string $old_wp_version the previous WordPress version + */ + do_action( 'jetpack_sync_core_updated_successfully', $new_wp_version, $this->old_wp_version ); + } + + /** + * Retrieve the checksum for an update. + * + * @access public + * + * @param object $update The update object. + * @param string $transient The transient we're retrieving a checksum for. + * @return int The checksum. + */ + public function get_update_checksum( $update, $transient ) { + $updates = array(); + $no_updated = array(); + switch ( $transient ) { + case 'update_plugins': + if ( ! empty( $update->response ) && is_array( $update->response ) ) { + foreach ( $update->response as $plugin_slug => $response ) { + if ( ! empty( $plugin_slug ) && isset( $response->new_version ) ) { + $updates[] = array( $plugin_slug => $response->new_version ); + } + } + } + if ( ! empty( $update->no_update ) ) { + $no_updated = array_keys( $update->no_update ); + } + + if ( ! isset( $no_updated['jetpack/jetpack.php'] ) && isset( $updates['jetpack/jetpack.php'] ) ) { + return false; + } + + break; + case 'update_themes': + if ( ! empty( $update->response ) && is_array( $update->response ) ) { + foreach ( $update->response as $theme_slug => $response ) { + if ( ! empty( $theme_slug ) && isset( $response['new_version'] ) ) { + $updates[] = array( $theme_slug => $response['new_version'] ); + } + } + } + + if ( ! empty( $update->checked ) ) { + $no_updated = $update->checked; + } + + break; + case 'update_core': + if ( ! empty( $update->updates ) && is_array( $update->updates ) ) { + foreach ( $update->updates as $response ) { + if ( ! empty( $response->response ) && 'latest' === $response->response ) { + continue; + } + if ( ! empty( $response->response ) && isset( $response->packages->full ) ) { + $updates[] = array( $response->response => $response->packages->full ); + } + } + } + + if ( ! empty( $update->version_checked ) ) { + $no_updated = $update->version_checked; + } + + if ( empty( $updates ) ) { + return false; + } + break; + + } + if ( empty( $updates ) && empty( $no_updated ) ) { + return false; + } + return $this->get_check_sum( array( $no_updated, $updates ) ); + } + + /** + * Validate a change coming from an update before sending for sync. + * + * @access public + * + * @param mixed $value Site transient value. + * @param int $expiration Time until transient expiration in seconds. + * @param string $transient Transient name. + */ + public function validate_update_change( $value, $expiration, $transient ) { + $new_checksum = $this->get_update_checksum( $value, $transient ); + + if ( false === $new_checksum ) { + return; + } + + $checksums = get_option( self::UPDATES_CHECKSUM_OPTION_NAME, array() ); + + if ( isset( $checksums[ $transient ] ) && $checksums[ $transient ] === $new_checksum ) { + return; + } + + $checksums[ $transient ] = $new_checksum; + + update_option( self::UPDATES_CHECKSUM_OPTION_NAME, $checksums ); + if ( 'update_core' === $transient ) { + /** + * Trigger a change to core update that we want to sync. + * + * @since 1.6.3 + * @since-jetpack 5.1.0 + * + * @param array $value Contains info that tells us what needs updating. + */ + do_action( 'jetpack_update_core_change', $value ); + return; + } + if ( empty( $this->updates ) ) { + // Lets add the shutdown method once and only when the updates move from empty to filled with something. + add_action( 'shutdown', array( $this, 'sync_last_event' ), 9 ); + } + if ( ! isset( $this->updates[ $transient ] ) ) { + $this->updates[ $transient ] = array(); + } + $this->updates[ $transient ][] = $value; + } + + /** + * Sync the last update only. + * + * @access public + */ + public function sync_last_event() { + foreach ( $this->updates as $transient => $values ) { + $value = end( $values ); // Only send over the last value. + /** + * Trigger a change to a specific update that we want to sync. + * Triggers one of the following actions: + * - jetpack_{$transient}_change + * - jetpack_update_plugins_change + * - jetpack_update_themes_change + * + * @since 1.6.3 + * @since-jetpack 5.1.0 + * + * @param array $value Contains info that tells us what needs updating. + */ + do_action( "jetpack_{$transient}_change", $value ); + } + } + + /** + * Enqueue the updates actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * Tells the client to sync all updates to the server + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param boolean Whether to expand updates (should always be true) + */ + do_action( 'jetpack_full_sync_updates', true ); + + // The number of actions enqueued, and next module state (true == done). + return array( 1, true ); + } + + /** + * Send the updates actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $send_until The timestamp until the current request can send. + * @param array $state This module Full Sync status. + * + * @return array This module Full Sync status. + */ + public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // we call this instead of do_action when sending immediately. + $this->send_action( 'jetpack_full_sync_updates', array( true ) ); + + // The number of actions enqueued, and next module state (true == done). + return array( 'finished' => true ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 1; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_updates' ); + } + + /** + * Retrieve all updates that we're interested in. + * + * @access public + * + * @return array All updates. + */ + public function get_all_updates() { + return array( + 'core' => get_site_transient( 'update_core' ), + 'plugins' => get_site_transient( 'update_plugins' ), + 'themes' => get_site_transient( 'update_themes' ), + ); + } + + /** + * Remove unnecessary keys from synced updates data. + * + * @access public + * + * @param array $args Hook arguments. + * @return array $args Hook arguments. + */ + public function filter_update_keys( $args ) { + $updates = $args[0]; + + if ( isset( $updates->no_update ) ) { + unset( $updates->no_update ); + } + + return $args; + } + + /** + * Filter out upgrader object from the completed upgrader action args. + * + * @access public + * + * @param array $args Hook arguments. + * @return array $args Filtered hook arguments. + */ + public function filter_upgrader_process_complete( $args ) { + array_shift( $args ); + + return $args; + } + + /** + * Expand the updates within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_updates( $args ) { + if ( $args[0] ) { + return $this->get_all_updates(); + } + + return $args; + } + + /** + * Expand the themes within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook parameters. + * @return array $args The hook parameters. + */ + public function expand_themes( $args ) { + if ( ! isset( $args[0], $args[0]->response ) ) { + return $args; + } + if ( ! is_array( $args[0]->response ) ) { + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error + trigger_error( 'Warning: Not an Array as expected but -> ' . wp_json_encode( $args[0]->response ) . ' instead', E_USER_WARNING ); + return $args; + } + foreach ( $args[0]->response as $stylesheet => &$theme_data ) { + $theme = wp_get_theme( $stylesheet ); + $theme_data['name'] = $theme->name; + } + return $args; + } + + /** + * Perform module cleanup. + * Deletes any transients and options that this module uses. + * Usually triggered when uninstalling the plugin. + * + * @access public + */ + public function reset_data() { + delete_option( self::UPDATES_CHECKSUM_OPTION_NAME ); + } + + /** + * Return Total number of objects. + * + * @param array $config Full Sync config. + * + * @return int total + */ + public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return 3; + } + + /** + * Retrieve a set of updates by their IDs. + * + * @access public + * + * @param string $object_type Object type. + * @param array $ids Object IDs. + * @return array Array of objects. + */ + public function get_objects_by_id( $object_type, $ids ) { + if ( empty( $ids ) || empty( $object_type ) || 'update' !== $object_type ) { + return array(); + } + + $objects = array(); + foreach ( (array) $ids as $id ) { + $object = $this->get_object_by_id( $object_type, $id ); + + if ( 'all' === $id ) { + // If all was requested it contains all updates and can simply be returned. + return $object; + } + $objects[ $id ] = $object; + } + + return $objects; + } + + /** + * Retrieve a update by its id. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param string $id ID of the sync object. + * @return mixed Value of Update. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'update' === $object_type ) { + + // Only whitelisted constants can be returned. + if ( in_array( $id, array( 'core', 'plugins', 'themes' ), true ) ) { + return get_site_transient( 'update_' . $id ); + } elseif ( 'all' === $id ) { + return $this->get_all_updates(); + } + } + + return false; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php new file mode 100644 index 00000000..1bc9961a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php @@ -0,0 +1,903 @@ + 'password_changed', + 'user_email' => 'email_changed', + 'user_nicename' => 'nicename_changed', + 'user_url' => 'url_changed', + 'user_registered' => 'registration_date_changed', + 'user_activation_key' => 'activation_key_changed', + 'display_name' => 'display_name_changed', + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'users'; + } + + /** + * The table in the database. + * + * @access public + * + * @return string + */ + public function table_name() { + return 'usermeta'; + } + + /** + * The id field in the database. + * + * @access public + * + * @return string + */ + public function id_field() { + return 'user_id'; + } + + /** + * Retrieve a user by its ID. + * This is here to support the backfill API. + * + * @access public + * + * @param string $object_type Type of the sync object. + * @param int $id ID of the sync object. + * @return \WP_User|bool Filtered \WP_User object, or false if the object is not a user. + */ + public function get_object_by_id( $object_type, $id ) { + if ( 'user' === $object_type ) { + $user = get_user_by( 'id', (int) $id ); + if ( $user ) { + return $this->sanitize_user_and_expand( $user ); + } + } + + return false; + } + + /** + * Initialize users action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + // Users. + add_action( 'user_register', array( $this, 'user_register_handler' ) ); + add_action( 'profile_update', array( $this, 'save_user_handler' ), 10, 2 ); + + add_action( 'add_user_to_blog', array( $this, 'add_user_to_blog_handler' ) ); + add_action( 'jetpack_sync_add_user', $callable, 10, 2 ); + + add_action( 'jetpack_sync_register_user', $callable, 10, 2 ); + add_action( 'jetpack_sync_save_user', $callable, 10, 2 ); + + add_action( 'jetpack_sync_user_locale', $callable, 10, 2 ); + add_action( 'jetpack_sync_user_locale_delete', $callable, 10, 1 ); + + add_action( 'deleted_user', array( $this, 'deleted_user_handler' ), 10, 2 ); + add_action( 'jetpack_deleted_user', $callable, 10, 3 ); + add_action( 'remove_user_from_blog', array( $this, 'remove_user_from_blog_handler' ), 10, 2 ); + add_action( 'jetpack_removed_user_from_blog', $callable, 10, 2 ); + + // User roles. + add_action( 'add_user_role', array( $this, 'save_user_role_handler' ), 10, 2 ); + add_action( 'set_user_role', array( $this, 'save_user_role_handler' ), 10, 3 ); + add_action( 'remove_user_role', array( $this, 'save_user_role_handler' ), 10, 2 ); + + // User capabilities. + add_action( 'added_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + add_action( 'updated_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + add_action( 'deleted_user_meta', array( $this, 'maybe_save_user_meta' ), 10, 4 ); + + // User authentication. + add_filter( 'authenticate', array( $this, 'authenticate_handler' ), 1000, 3 ); + add_action( 'wp_login', array( $this, 'wp_login_handler' ), 10, 2 ); + + add_action( 'jetpack_wp_login', $callable, 10, 3 ); + + add_action( 'wp_logout', $callable, 10, 0 ); + add_action( 'wp_masterbar_logout', $callable, 10, 1 ); + + // Add on init. + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_add_user', array( $this, 'expand_action' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_register_user', array( $this, 'expand_action' ) ); + add_filter( 'jetpack_sync_before_enqueue_jetpack_sync_save_user', array( $this, 'expand_action' ) ); + } + + /** + * Initialize users action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_users', $callable ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + add_filter( 'jetpack_sync_before_send_jetpack_wp_login', array( $this, 'expand_login_username' ), 10, 1 ); + add_filter( 'jetpack_sync_before_send_wp_logout', array( $this, 'expand_logout_username' ), 10, 2 ); + + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_users', array( $this, 'expand_users' ) ); + } + + /** + * Retrieve a user by a user ID or object. + * + * @access private + * + * @param mixed $user User object or ID. + * @return \WP_User User object, or `null` if user invalid/not found. + */ + private function get_user( $user ) { + if ( is_numeric( $user ) ) { + $user = get_user_by( 'id', $user ); + } + if ( $user instanceof \WP_User ) { + return $user; + } + return null; + } + + /** + * Sanitize a user object. + * Removes the password from the user object because we don't want to sync it. + * + * @access public + * + * @todo Refactor `serialize`/`unserialize` to `wp_json_encode`/`wp_json_decode`. + * + * @param \WP_User $user User object. + * @return \WP_User Sanitized user object. + */ + public function sanitize_user( $user ) { + $user = $this->get_user( $user ); + // This creates a new user object and stops the passing of the object by reference. + // // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize, WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize + $user = unserialize( serialize( $user ) ); + + if ( is_object( $user ) && is_object( $user->data ) ) { + unset( $user->data->user_pass ); + } + return $user; + } + + /** + * Expand a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return \WP_User Expanded user object. + */ + public function expand_user( $user ) { + if ( ! is_object( $user ) ) { + return null; + } + $user->allowed_mime_types = get_allowed_mime_types( $user ); + $user->allcaps = $this->get_real_user_capabilities( $user ); + + // Only set the user locale if it is different from the site locale. + if ( get_locale() !== get_user_locale( $user->ID ) ) { + $user->locale = get_user_locale( $user->ID ); + } + + return $user; + } + + /** + * Retrieve capabilities we care about for a particular user. + * + * @access public + * + * @param \WP_User $user User object. + * @return array User capabilities. + */ + public function get_real_user_capabilities( $user ) { + $user_capabilities = array(); + if ( is_wp_error( $user ) ) { + return $user_capabilities; + } + foreach ( Defaults::get_capabilities_whitelist() as $capability ) { + if ( user_can( $user, $capability ) ) { + $user_capabilities[ $capability ] = true; + } + } + return $user_capabilities; + } + + /** + * Retrieve, expand and sanitize a user. + * Can be directly used in the sync user action handlers. + * + * @access public + * + * @param mixed $user User ID or user object. + * @return \WP_User Expanded and sanitized user object. + */ + public function sanitize_user_and_expand( $user ) { + $user = $this->get_user( $user ); + $user = $this->expand_user( $user ); + return $this->sanitize_user( $user ); + } + + /** + * Expand the user within a hook before it is serialized and sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function expand_action( $args ) { + // The first argument is always the user. + list( $user ) = $args; + if ( $user ) { + $args[0] = $this->sanitize_user_and_expand( $user ); + return $args; + } + + return false; + } + + /** + * Expand the user username at login before being sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args Expanded hook arguments. + */ + public function expand_login_username( $args ) { + list( $login, $user, $flags ) = $args; + $user = $this->sanitize_user( $user ); + + return array( $login, $user, $flags ); + } + + /** + * Expand the user username at logout before being sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @param int $user_id ID of the user. + * @return array $args Expanded hook arguments. + */ + public function expand_logout_username( $args, $user_id ) { + $user = get_userdata( $user_id ); + $user = $this->sanitize_user( $user ); + + $login = ''; + if ( is_object( $user ) && is_object( $user->data ) ) { + $login = $user->data->user_login; + } + + // If we don't have a user here lets not send anything. + if ( empty( $login ) ) { + return false; + } + + return array( $login, $user ); + } + + /** + * Additional processing is needed for wp_login so we introduce this wrapper handler. + * + * @access public + * + * @param string $user_login The user login. + * @param \WP_User $user The user object. + */ + public function wp_login_handler( $user_login, $user ) { + /** + * Fires when a user is logged into a site. + * + * @since 1.6.3 + * @since-jetpack 7.2.0 + * + * @param int $user_id The user ID. + * @param \WP_User $user The User Object of the user that currently logged in. + * @param array $params Any Flags that have been added during login. + */ + do_action( 'jetpack_wp_login', $user->ID, $user, $this->get_flags( $user->ID ) ); + $this->clear_flags( $user->ID ); + } + + /** + * A hook for the authenticate event that checks the password strength. + * + * @access public + * + * @param \WP_Error|\WP_User $user The user object, or an error. + * @param string $username The username. + * @param string $password The password used to authenticate. + * @return \WP_Error|\WP_User the same object that was passed into the function. + */ + public function authenticate_handler( $user, $username, $password ) { + // In case of cookie authentication we don't do anything here. + if ( empty( $password ) ) { + return $user; + } + + // We are only interested in successful authentication events. + if ( is_wp_error( $user ) || ! ( $user instanceof \WP_User ) ) { + return $user; + } + + $password_checker = new Password_Checker( $user->ID ); + + $test_results = $password_checker->test( $password, true ); + + // If the password passes tests, we don't do anything. + if ( empty( $test_results['test_results']['failed'] ) ) { + return $user; + } + + $this->add_flags( + $user->ID, + array( + 'warning' => 'The password failed at least one strength test.', + 'failures' => $test_results['test_results']['failed'], + ) + ); + + return $user; + } + + /** + * Handler for after the user is deleted. + * + * @access public + * + * @param int $deleted_user_id ID of the deleted user. + * @param int $reassigned_user_id ID of the user the deleted user's posts are reassigned to (if any). + */ + public function deleted_user_handler( $deleted_user_id, $reassigned_user_id = '' ) { + $is_multisite = is_multisite(); + /** + * Fires when a user is deleted on a site + * + * @since 1.6.3 + * @since-jetpack 5.4.0 + * + * @param int $deleted_user_id - ID of the deleted user. + * @param int $reassigned_user_id - ID of the user the deleted user's posts are reassigned to (if any). + * @param bool $is_multisite - Whether this site is a multisite installation. + */ + do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite ); + } + + /** + * Handler for user registration. + * + * @access public + * + * @param int $user_id ID of the deleted user. + */ + public function user_register_handler( $user_id ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { + $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); + } + /** + * Fires when a new user is registered on a site + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param object The WP_User object + */ + do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Handler for user addition to the current blog. + * + * @access public + * + * @param int $user_id ID of the user. + */ + public function add_user_to_blog_handler( $user_id ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) { + $this->add_flags( $user_id, array( 'invitation_accepted' => true ) ); + } + + /** + * Fires when a user is added on a site + * + * @since 1.6.3 + * @since-jetpack 4.9.0 + * + * @param object The WP_User object + */ + do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Handler for user save. + * + * @access public + * + * @param int $user_id ID of the user. + * @param \WP_User $old_user_data User object before the changes. + */ + public function save_user_handler( $user_id, $old_user_data = null ) { + // Ensure we only sync users who are members of the current blog. + if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) { + return; + } + + $user = get_user_by( 'id', $user_id ); + + // Older versions of WP don't pass the old_user_data in ->data. + if ( isset( $old_user_data->data ) ) { + $old_user = $old_user_data->data; + } else { + $old_user = $old_user_data; + } + + if ( ! is_object( $old_user ) ) { + return; + } + + $old_user_array = get_object_vars( $old_user ); + + foreach ( $old_user_array as $user_field => $field_value ) { + if ( false === $user->has_prop( $user_field ) ) { + continue; + } + if ( $user->$user_field !== $field_value ) { + if ( 'user_email' === $user_field ) { + /** + * The '_new_email' user meta is deleted right after the call to wp_update_user + * that got us to this point so if it's still set then this was a user confirming + * their new email address. + */ + if ( 1 === (int) get_user_meta( $user->ID, '_new_email', true ) ) { + $this->flags[ $user_id ]['email_changed'] = true; + } + continue; + } + + $flag = isset( $this->user_fields_to_flags_mapping[ $user_field ] ) ? $this->user_fields_to_flags_mapping[ $user_field ] : 'unknown_field_changed'; + + $this->flags[ $user_id ][ $flag ] = true; + } + } + + if ( isset( $this->flags[ $user_id ] ) ) { + + /** + * Fires when the client needs to sync an updated user. + * + * @since 1.6.3 + * @since-jetpack 4.2.0 + * + * @param \WP_User The WP_User object + * @param array State - New since 5.8.0 + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + } + + /** + * Handler for user role change. + * + * @access public + * + * @param int $user_id ID of the user. + * @param string $role New user role. + * @param array $old_roles Previous user roles. + */ + public function save_user_role_handler( $user_id, $role, $old_roles = null ) { + $this->add_flags( + $user_id, + array( + 'role_changed' => true, + 'previous_role' => $old_roles, + ) + ); + + // The jetpack_sync_register_user payload is identical to jetpack_sync_save_user, don't send both. + if ( $this->is_create_user() || $this->is_add_user_to_blog() ) { + return; + } + /** + * This action is documented already in this file + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + $this->clear_flags( $user_id ); + } + + /** + * Retrieve current flags for a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + * @return array Current flags of the user. + */ + public function get_flags( $user_id ) { + if ( isset( $this->flags[ $user_id ] ) ) { + return $this->flags[ $user_id ]; + } + return array(); + } + + /** + * Clear the flags of a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + */ + public function clear_flags( $user_id ) { + if ( isset( $this->flags[ $user_id ] ) ) { + unset( $this->flags[ $user_id ] ); + } + } + + /** + * Add flags to a particular user. + * + * @access public + * + * @param int $user_id ID of the user. + * @param array $flags New flags to add for the user. + */ + public function add_flags( $user_id, $flags ) { + $this->flags[ $user_id ] = wp_parse_args( $flags, $this->get_flags( $user_id ) ); + } + + /** + * Save the user meta, if we're interested in it. + * Also uses the time to add flags for the user. + * + * @access public + * + * @param int $meta_id ID of the meta object. + * @param int $user_id ID of the user. + * @param string $meta_key Meta key. + * @param mixed $value Meta value. + */ + public function maybe_save_user_meta( $meta_id, $user_id, $meta_key, $value ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( 'locale' === $meta_key ) { + $this->add_flags( $user_id, array( 'locale_changed' => true ) ); + } + + $user = get_user_by( 'id', $user_id ); + if ( isset( $user->cap_key ) && $meta_key === $user->cap_key ) { + $this->add_flags( $user_id, array( 'capabilities_changed' => true ) ); + } + + if ( $this->is_create_user() || $this->is_add_user_to_blog() || $this->is_delete_user() ) { + return; + } + + if ( isset( $this->flags[ $user_id ] ) ) { + /** + * This action is documented already in this file + */ + do_action( 'jetpack_sync_save_user', $user_id, $this->get_flags( $user_id ) ); + } + } + + /** + * Enqueue the users actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + global $wpdb; + + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_users', $wpdb->usermeta, 'user_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Refactor to prepare the SQL query before executing it. + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $wpdb->usermeta"; + + $where_sql = $this->get_where_sql( $config ); + if ( $where_sql ) { + $query .= ' WHERE ' . $where_sql; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause, or `null` if no comments are specified in the module config. + */ + public function get_where_sql( $config ) { + global $wpdb; + + $query = "meta_key = '{$wpdb->prefix}user_level' AND meta_value > 0"; + + // The $config variable is a list of user IDs to sync. + if ( is_array( $config ) ) { + $query .= ' AND user_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')'; + } + + return $query; + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_users' ); + } + + /** + * Retrieve initial sync user config. + * + * @access public + * + * @todo Refactor the SQL query to call $wpdb->prepare() before execution. + * + * @return array|boolean IDs of users to initially sync, or false if tbe number of users exceed the maximum. + */ + public function get_initial_sync_user_config() { + global $wpdb; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $user_ids = $wpdb->get_col( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '{$wpdb->prefix}user_level' AND meta_value > 0 LIMIT " . ( self::MAX_INITIAL_SYNC_USERS + 1 ) ); + + if ( count( $user_ids ) <= self::MAX_INITIAL_SYNC_USERS ) { + return $user_ids; + } else { + return false; + } + } + + /** + * Expand the users within a hook before they are serialized and sent to the server. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function expand_users( $args ) { + list( $user_ids, $previous_end ) = $args; + + return array( + 'users' => array_map( + array( $this, 'sanitize_user_and_expand' ), + get_users( + array( + 'include' => $user_ids, + 'orderby' => 'ID', + 'order' => 'DESC', + ) + ) + ), + 'previous_end' => $previous_end, + ); + } + + /** + * Handler for user removal from a particular blog. + * + * @access public + * + * @param int $user_id ID of the user. + * @param int $blog_id ID of the blog. + */ + public function remove_user_from_blog_handler( $user_id, $blog_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // User is removed on add, see https://github.com/WordPress/WordPress/blob/0401cee8b36df3def8e807dd766adc02b359dfaf/wp-includes/ms-functions.php#L2114. + if ( $this->is_add_new_user_to_blog() ) { + return; + } + + $reassigned_user_id = $this->get_reassigned_network_user_id(); + + // Note that we are in the context of the blog the user is removed from, see https://github.com/WordPress/WordPress/blob/473e1ba73bc5c18c72d7f288447503713d518790/wp-includes/ms-functions.php#L233. + /** + * Fires when a user is removed from a blog on a multisite installation + * + * @since 1.6.3 + * @since-jetpack 5.4.0 + * + * @param int $user_id - ID of the removed user + * @param int $reassigned_user_id - ID of the user the removed user's posts are reassigned to (if any). + */ + do_action( 'jetpack_removed_user_from_blog', $user_id, $reassigned_user_id ); + } + + /** + * Whether we're adding a new user to a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_add_new_user_to_blog() { + return $this->is_function_in_backtrace( 'add_new_user_to_blog' ); + } + + /** + * Whether we're adding an existing user to a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_add_user_to_blog() { + return $this->is_function_in_backtrace( 'add_user_to_blog' ); + } + + /** + * Whether we're removing a user from a blog in this request. + * + * @access protected + * + * @return boolean + */ + protected function is_delete_user() { + return $this->is_function_in_backtrace( array( 'wp_delete_user', 'remove_user_from_blog' ) ); + } + + /** + * Whether we're creating a user or adding a new user to a blog. + * + * @access protected + * + * @return boolean + */ + protected function is_create_user() { + $functions = array( + 'add_new_user_to_blog', // Used to suppress jetpack_sync_save_user in save_user_cap_handler when user registered on multi site. + 'wp_create_user', // Used to suppress jetpack_sync_save_user in save_user_role_handler when user registered on multi site. + 'wp_insert_user', // Used to suppress jetpack_sync_save_user in save_user_cap_handler and save_user_role_handler when user registered on single site. + ); + + return $this->is_function_in_backtrace( $functions ); + } + + /** + * Retrieve the ID of the user the removed user's posts are reassigned to (if any). + * + * @return int ID of the user that got reassigned as the author of the posts. + */ + protected function get_reassigned_network_user_id() { + $backtrace = debug_backtrace( false ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + foreach ( $backtrace as $call ) { + if ( + 'remove_user_from_blog' === $call['function'] && + 3 === count( $call['args'] ) + ) { + return $call['args'][2]; + } + } + + return false; + } + + /** + * Checks if one or more function names is in debug_backtrace. + * + * @access protected + * + * @param array|string $names Mixed string name of function or array of string names of functions. + * @return bool + */ + protected function is_function_in_backtrace( $names ) { + $backtrace = debug_backtrace( false ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + if ( ! is_array( $names ) ) { + $names = array( $names ); + } + $names_as_keys = array_flip( $names ); + + // Do check in constant O(1) time for PHP5.5+. + if ( function_exists( 'array_column' ) ) { + $backtrace_functions = array_column( $backtrace, 'function' ); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.array_columnFound + $backtrace_functions_as_keys = array_flip( $backtrace_functions ); + $intersection = array_intersect_key( $backtrace_functions_as_keys, $names_as_keys ); + return ! empty( $intersection ); + } + + // Do check in linear O(n) time for < PHP5.5 ( using isset at least prevents O(n^2) ). + foreach ( $backtrace as $call ) { + if ( isset( $names_as_keys[ $call['function'] ] ) ) { + return true; + } + } + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php new file mode 100644 index 00000000..c8aa26ae --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php @@ -0,0 +1,614 @@ +order_item_table_name; + } + + /** + * Constructor. + * + * @global $wpdb + * + * @todo Should we refactor this to use $this->set_defaults() instead? + */ + public function __construct() { + global $wpdb; + $this->order_item_table_name = $wpdb->prefix . 'woocommerce_order_items'; + + // Options, constants and post meta whitelists. + add_filter( 'jetpack_sync_options_whitelist', array( $this, 'add_woocommerce_options_whitelist' ), 10 ); + add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_woocommerce_constants_whitelist' ), 10 ); + add_filter( 'jetpack_sync_post_meta_whitelist', array( $this, 'add_woocommerce_post_meta_whitelist' ), 10 ); + add_filter( 'jetpack_sync_comment_meta_whitelist', array( $this, 'add_woocommerce_comment_meta_whitelist' ), 10 ); + + add_filter( 'jetpack_sync_before_enqueue_woocommerce_new_order_item', array( $this, 'filter_order_item' ) ); + add_filter( 'jetpack_sync_before_enqueue_woocommerce_update_order_item', array( $this, 'filter_order_item' ) ); + add_filter( 'jetpack_sync_whitelisted_comment_types', array( $this, 'add_review_comment_types' ) ); + + // Blacklist Action Scheduler comment types. + add_filter( 'jetpack_sync_prevent_sending_comment_data', array( $this, 'filter_action_scheduler_comments' ), 10, 2 ); + } + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'woocommerce'; + } + + /** + * Initialize WooCommerce action listeners. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_listeners( $callable ) { + // Attributes. + add_action( 'woocommerce_attribute_added', $callable, 10, 2 ); + add_action( 'woocommerce_attribute_updated', $callable, 10, 3 ); + add_action( 'woocommerce_attribute_deleted', $callable, 10, 3 ); + + // Orders. + add_action( 'woocommerce_new_order', $callable, 10, 1 ); + add_action( 'woocommerce_order_status_changed', $callable, 10, 3 ); + add_action( 'woocommerce_payment_complete', $callable, 10, 1 ); + + // Order items. + add_action( 'woocommerce_new_order_item', $callable, 10, 4 ); + add_action( 'woocommerce_update_order_item', $callable, 10, 4 ); + add_action( 'woocommerce_delete_order_item', $callable, 10, 1 ); + $this->init_listeners_for_meta_type( 'order_item', $callable ); + + // Payment tokens. + add_action( 'woocommerce_new_payment_token', $callable, 10, 1 ); + add_action( 'woocommerce_payment_token_deleted', $callable, 10, 2 ); + add_action( 'woocommerce_payment_token_updated', $callable, 10, 1 ); + $this->init_listeners_for_meta_type( 'payment_token', $callable ); + + // Product downloads. + add_action( 'woocommerce_downloadable_product_download_log_insert', $callable, 10, 1 ); + add_action( 'woocommerce_grant_product_download_access', $callable, 10, 1 ); + + // Tax rates. + add_action( 'woocommerce_tax_rate_added', $callable, 10, 2 ); + add_action( 'woocommerce_tax_rate_updated', $callable, 10, 2 ); + add_action( 'woocommerce_tax_rate_deleted', $callable, 10, 1 ); + + // Webhooks. + add_action( 'woocommerce_new_webhook', $callable, 10, 1 ); + add_action( 'woocommerce_webhook_deleted', $callable, 10, 2 ); + add_action( 'woocommerce_webhook_updated', $callable, 10, 1 ); + } + + /** + * Initialize WooCommerce action listeners for full sync. + * + * @access public + * + * @param callable $callable Action handler callable. + */ + public function init_full_sync_listeners( $callable ) { + add_action( 'jetpack_full_sync_woocommerce_order_items', $callable ); // Also sends post meta. + } + + /** + * Retrieve the actions that will be sent for this module during a full sync. + * + * @access public + * + * @return array Full sync actions of this module. + */ + public function get_full_sync_actions() { + return array( 'jetpack_full_sync_woocommerce_order_items' ); + } + + /** + * Initialize the module in the sender. + * + * @access public + */ + public function init_before_send() { + // Full sync. + add_filter( 'jetpack_sync_before_send_jetpack_full_sync_woocommerce_order_items', array( $this, 'expand_order_item_ids' ) ); + } + + /** + * Expand the order items properly. + * + * @access public + * + * @param array $args The hook arguments. + * @return array $args The hook arguments. + */ + public function filter_order_item( $args ) { + // Make sure we always have all the data - prior to WooCommerce 3.0 we only have the user supplied data in the second argument and not the full details. + $args[1] = $this->build_order_item( $args[0] ); + return $args; + } + + /** + * Expand order item IDs to order items and their meta. + * + * @access public + * + * @todo Refactor table name to use a $wpdb->prepare placeholder. + * + * @param array $args The hook arguments. + * @return array $args Expanded order items with meta. + */ + public function expand_order_item_ids( $args ) { + $order_item_ids = $args[0]; + + global $wpdb; + + $order_item_ids_sql = implode( ', ', array_map( 'intval', $order_item_ids ) ); + + $order_items = $wpdb->get_results( + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + "SELECT * FROM $this->order_item_table_name WHERE order_item_id IN ( $order_item_ids_sql )" + ); + + return array( + $order_items, + $this->get_metadata( $order_item_ids, 'order_item', static::$order_item_meta_whitelist ), + ); + } + + /** + * Extract the full order item from the database by its ID. + * + * @access public + * + * @todo Refactor table name to use a $wpdb->prepare placeholder. + * + * @param int $order_item_id Order item ID. + * @return object Order item. + */ + public function build_order_item( $order_item_id ) { + global $wpdb; + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->order_item_table_name WHERE order_item_id = %d", $order_item_id ) ); + } + + /** + * Enqueue the WooCommerce actions for full sync. + * + * @access public + * + * @param array $config Full sync configuration for this sync module. + * @param int $max_items_to_enqueue Maximum number of items to enqueue. + * @param boolean $state True if full sync has finished enqueueing this module, false otherwise. + * @return array Number of actions enqueued, and next module state. + */ + public function enqueue_full_sync_actions( $config, $max_items_to_enqueue, $state ) { + return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_woocommerce_order_items', $this->order_item_table_name, 'order_item_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state ); + } + + /** + * Retrieve an estimated number of actions that will be enqueued. + * + * @access public + * + * @todo Refactor the SQL query to use $wpdb->prepare(). + * + * @param array $config Full sync configuration for this sync module. + * @return array Number of items yet to be enqueued. + */ + public function estimate_full_sync_actions( $config ) { + global $wpdb; + + $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $count = $wpdb->get_var( $query ); + + return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); + } + + /** + * Retrieve the WHERE SQL clause based on the module config. + * + * @access private + * + * @param array $config Full sync configuration for this sync module. + * @return string WHERE SQL clause. + */ + public function get_where_sql( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return '1=1'; + } + + /** + * Add WooCommerce options to the options whitelist. + * + * @param array $list Existing options whitelist. + * @return array Updated options whitelist. + */ + public function add_woocommerce_options_whitelist( $list ) { + return array_merge( $list, self::$wc_options_whitelist ); + } + + /** + * Add WooCommerce constants to the constants whitelist. + * + * @param array $list Existing constants whitelist. + * @return array Updated constants whitelist. + */ + public function add_woocommerce_constants_whitelist( $list ) { + return array_merge( $list, self::$wc_constants_whitelist ); + } + + /** + * Add WooCommerce post meta to the post meta whitelist. + * + * @param array $list Existing post meta whitelist. + * @return array Updated post meta whitelist. + */ + public function add_woocommerce_post_meta_whitelist( $list ) { + return array_merge( $list, self::$wc_post_meta_whitelist ); + } + + /** + * Add WooCommerce comment meta to the comment meta whitelist. + * + * @param array $list Existing comment meta whitelist. + * @return array Updated comment meta whitelist. + */ + public function add_woocommerce_comment_meta_whitelist( $list ) { + return array_merge( $list, self::$wc_comment_meta_whitelist ); + } + + /** + * Adds 'revew' to the list of comment types so Sync will listen for status changes on 'reviews'. + * + * @access public + * + * @param array $comment_types The list of comment types prior to this filter. + * return array The list of comment types with 'review' added. + */ + public function add_review_comment_types( $comment_types ) { + if ( is_array( $comment_types ) ) { + $comment_types[] = 'review'; + } + return $comment_types; + } + + /** + * Stop comments from the Action Scheduler from being synced. + * https://github.com/woocommerce/woocommerce/tree/e7762627c37ec1f7590e6cac4218ba0c6a20024d/includes/libraries/action-scheduler + * + * @since 1.6.3 + * @since-jetpack 7.7.0 + * + * @param boolean $can_sync Should we prevent comment data from bing synced to WordPress.com. + * @param mixed $comment WP_COMMENT object. + * + * @return bool + */ + public function filter_action_scheduler_comments( $can_sync, $comment ) { + if ( isset( $comment->comment_agent ) && 'ActionScheduler' === $comment->comment_agent ) { + return true; + } + return $can_sync; + } + + /** + * Whitelist for options we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_options_whitelist = array( + 'woocommerce_currency', + 'woocommerce_db_version', + 'woocommerce_weight_unit', + 'woocommerce_version', + 'woocommerce_unforce_ssl_checkout', + 'woocommerce_tax_total_display', + 'woocommerce_tax_round_at_subtotal', + 'woocommerce_tax_display_shop', + 'woocommerce_tax_display_cart', + 'woocommerce_prices_include_tax', + 'woocommerce_price_thousand_sep', + 'woocommerce_price_num_decimals', + 'woocommerce_price_decimal_sep', + 'woocommerce_notify_low_stock', + 'woocommerce_notify_low_stock_amount', + 'woocommerce_notify_no_stock', + 'woocommerce_notify_no_stock_amount', + 'woocommerce_manage_stock', + 'woocommerce_force_ssl_checkout', + 'woocommerce_hide_out_of_stock_items', + 'woocommerce_file_download_method', + 'woocommerce_enable_signup_and_login_from_checkout', + 'woocommerce_enable_shipping_calc', + 'woocommerce_enable_review_rating', + 'woocommerce_enable_guest_checkout', + 'woocommerce_enable_coupons', + 'woocommerce_enable_checkout_login_reminder', + 'woocommerce_enable_ajax_add_to_cart', + 'woocommerce_dimension_unit', + 'woocommerce_default_country', + 'woocommerce_default_customer_address', + 'woocommerce_currency_pos', + 'woocommerce_api_enabled', + 'woocommerce_allow_tracking', + 'woocommerce_task_list_hidden', + 'woocommerce_onboarding_profile', + 'woocommerce_cod_settings', + ); + + /** + * Whitelist for constants we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_constants_whitelist = array( + // WooCommerce constants. + 'WC_PLUGIN_FILE', + 'WC_ABSPATH', + 'WC_PLUGIN_BASENAME', + 'WC_VERSION', + 'WOOCOMMERCE_VERSION', + 'WC_ROUNDING_PRECISION', + 'WC_DISCOUNT_ROUNDING_MODE', + 'WC_TAX_ROUNDING_MODE', + 'WC_DELIMITER', + 'WC_LOG_DIR', + 'WC_SESSION_CACHE_GROUP', + 'WC_TEMPLATE_DEBUG_MODE', + ); + + /** + * Whitelist for post meta we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_post_meta_whitelist = array( + // WooCommerce products. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-product-data-store-cpt.php#L21 . + '_visibility', + '_sku', + '_price', + '_regular_price', + '_sale_price', + '_sale_price_dates_from', + '_sale_price_dates_to', + 'total_sales', + '_tax_status', + '_tax_class', + '_manage_stock', + '_backorders', + '_sold_individually', + '_weight', + '_length', + '_width', + '_height', + '_upsell_ids', + '_crosssell_ids', + '_purchase_note', + '_default_attributes', + '_product_attributes', + '_virtual', + '_downloadable', + '_download_limit', + '_download_expiry', + '_featured', + '_downloadable_files', + '_wc_rating_count', + '_wc_average_rating', + '_wc_review_count', + '_variation_description', + '_thumbnail_id', + '_file_paths', + '_product_image_gallery', + '_product_version', + '_wp_old_slug', + + // Woocommerce orders. + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L27 . + '_order_key', + '_order_currency', + // '_billing_first_name', do not sync these as they contain personal data + // '_billing_last_name', + // '_billing_company', + // '_billing_address_1', + // '_billing_address_2', + '_billing_city', + '_billing_state', + '_billing_postcode', + '_billing_country', + // '_billing_email', do not sync these as they contain personal data. + // '_billing_phone', + // '_shipping_first_name', + // '_shipping_last_name', + // '_shipping_company', + // '_shipping_address_1', + // '_shipping_address_2', + '_shipping_city', + '_shipping_state', + '_shipping_postcode', + '_shipping_country', + '_completed_date', + '_paid_date', + '_cart_discount', + '_cart_discount_tax', + '_order_shipping', + '_order_shipping_tax', + '_order_tax', + '_order_total', + '_payment_method', + '_payment_method_title', + // '_transaction_id', do not sync these as they contain personal data. + // '_customer_ip_address', + // '_customer_user_agent', + '_created_via', + '_order_version', + '_prices_include_tax', + '_date_completed', + '_date_paid', + '_payment_tokens', + '_billing_address_index', + '_shipping_address_index', + '_recorded_sales', + '_recorded_coupon_usage_counts', + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L539 . + '_download_permissions_granted', + // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L594 . + '_order_stock_reduced', + + // Woocommerce order refunds. + // See https://github.com/woocommerce/woocommerce/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 . + '_order_currency', + '_refund_amount', + '_refunded_by', + '_refund_reason', + '_order_shipping', + '_order_shipping_tax', + '_order_tax', + '_order_total', + '_order_version', + '_prices_include_tax', + '_payment_tokens', + ); + + /** + * Whitelist for comment meta we are interested to sync. + * + * @access private + * @static + * + * @var array + */ + private static $wc_comment_meta_whitelist = array( + 'rating', + ); + + /** + * Return a list of objects by their type and IDs + * + * @param string $object_type Object type. + * @param array $ids IDs of objects to return. + * + * @access public + * + * @return array|object|WP_Error|null + */ + public function get_objects_by_id( $object_type, $ids ) { + switch ( $object_type ) { + case 'order_item': + return $this->get_order_item_by_ids( $ids ); + } + + return new WP_Error( 'unsupported_object_type', 'Unsupported object type' ); + } + + /** + * Returns a list of order_item objects by their IDs. + * + * @param array $ids List of order_item IDs to fetch. + * + * @access public + * + * @return array|object|null + */ + public function get_order_item_by_ids( $ids ) { + global $wpdb; + + if ( ! is_array( $ids ) ) { + return array(); + } + + // Make sure the IDs are numeric and are non-zero. + $ids = array_filter( array_map( 'intval', $ids ) ); + + if ( empty( $ids ) ) { + return array(); + } + + // Prepare the placeholders for the prepared query below. + $placeholders = implode( ',', array_fill( 0, count( $ids ), '%d' ) ); + + $query = "SELECT * FROM {$this->order_item_table_name} WHERE order_item_id IN ( $placeholders )"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + return $wpdb->get_results( $wpdb->prepare( $query, $ids ), ARRAY_A ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php new file mode 100644 index 00000000..af4aec41 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php @@ -0,0 +1,156 @@ +set_defaults() instead? + */ + public function __construct() { + add_filter( 'jetpack_sync_constants_whitelist', array( $this, 'add_wp_super_cache_constants_whitelist' ), 10 ); + add_filter( 'jetpack_sync_callable_whitelist', array( $this, 'add_wp_super_cache_callable_whitelist' ), 10 ); + } + + /** + * Whitelist for constants we are interested to sync. + * + * @access public + * @static + * + * @var array + */ + public static $wp_super_cache_constants = array( + 'WPLOCKDOWN', + 'WPSC_DISABLE_COMPRESSION', + 'WPSC_DISABLE_LOCKING', + 'WPSC_DISABLE_HTACCESS_UPDATE', + 'ADVANCEDCACHEPROBLEM', + ); + + /** + * Container for the whitelist for WP_Super_Cache callables we are interested to sync. + * + * @access public + * @static + * + * @var array + */ + public static $wp_super_cache_callables = array( + 'wp_super_cache_globals' => array( __CLASS__, 'get_wp_super_cache_globals' ), + ); + + /** + * Sync module name. + * + * @access public + * + * @return string + */ + public function name() { + return 'wp-super-cache'; + } + + /** + * Retrieve all WP_Super_Cache callables we are interested to sync. + * + * @access public + * + * @global $wp_cache_mod_rewrite; + * @global $cache_enabled; + * @global $super_cache_enabled; + * @global $ossdlcdn; + * @global $cache_rebuild_files; + * @global $wp_cache_mobile; + * @global $wp_super_cache_late_init; + * @global $wp_cache_anon_only; + * @global $wp_cache_not_logged_in; + * @global $wp_cache_clear_on_post_edit; + * @global $wp_cache_mobile_enabled; + * @global $wp_super_cache_debug; + * @global $cache_max_time; + * @global $wp_cache_refresh_single_only; + * @global $wp_cache_mfunc_enabled; + * @global $wp_supercache_304; + * @global $wp_cache_no_cache_for_get; + * @global $wp_cache_mutex_disabled; + * @global $cache_jetpack; + * @global $cache_domain_mapping; + * + * @return array All WP_Super_Cache callables. + */ + public static function get_wp_super_cache_globals() { + global $wp_cache_mod_rewrite; + global $cache_enabled; + global $super_cache_enabled; + global $ossdlcdn; + global $cache_rebuild_files; + global $wp_cache_mobile; + global $wp_super_cache_late_init; + global $wp_cache_anon_only; + global $wp_cache_not_logged_in; + global $wp_cache_clear_on_post_edit; + global $wp_cache_mobile_enabled; + global $wp_super_cache_debug; + global $cache_max_time; + global $wp_cache_refresh_single_only; + global $wp_cache_mfunc_enabled; + global $wp_supercache_304; + global $wp_cache_no_cache_for_get; + global $wp_cache_mutex_disabled; + global $cache_jetpack; + global $cache_domain_mapping; + + return array( + 'wp_cache_mod_rewrite' => $wp_cache_mod_rewrite, + 'cache_enabled' => $cache_enabled, + 'super_cache_enabled' => $super_cache_enabled, + 'ossdlcdn' => $ossdlcdn, + 'cache_rebuild_files' => $cache_rebuild_files, + 'wp_cache_mobile' => $wp_cache_mobile, + 'wp_super_cache_late_init' => $wp_super_cache_late_init, + 'wp_cache_anon_only' => $wp_cache_anon_only, + 'wp_cache_not_logged_in' => $wp_cache_not_logged_in, + 'wp_cache_clear_on_post_edit' => $wp_cache_clear_on_post_edit, + 'wp_cache_mobile_enabled' => $wp_cache_mobile_enabled, + 'wp_super_cache_debug' => $wp_super_cache_debug, + 'cache_max_time' => $cache_max_time, + 'wp_cache_refresh_single_only' => $wp_cache_refresh_single_only, + 'wp_cache_mfunc_enabled' => $wp_cache_mfunc_enabled, + 'wp_supercache_304' => $wp_supercache_304, + 'wp_cache_no_cache_for_get' => $wp_cache_no_cache_for_get, + 'wp_cache_mutex_disabled' => $wp_cache_mutex_disabled, + 'cache_jetpack' => $cache_jetpack, + 'cache_domain_mapping' => $cache_domain_mapping, + ); + } + + /** + * Add WP_Super_Cache constants to the constants whitelist. + * + * @param array $list Existing constants whitelist. + * @return array Updated constants whitelist. + */ + public function add_wp_super_cache_constants_whitelist( $list ) { + return array_merge( $list, self::$wp_super_cache_constants ); + } + + /** + * Add WP_Super_Cache callables to the callables whitelist. + * + * @param array $list Existing callables whitelist. + * @return array Updated callables whitelist. + */ + public function add_wp_super_cache_callable_whitelist( $list ) { + return array_merge( $list, self::$wp_super_cache_callables ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php new file mode 100644 index 00000000..20f686a6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php @@ -0,0 +1,208 @@ +build_filter_statement( $range_from, $range_to ); + + $query = " + SELECT + DISTINCT {$this->table}.{$this->range_field} + FROM + {$this->table} + JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID + WHERE + {$range_filter_statement} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $user_ids = $wpdb->get_col( $query ); + + // Chunk the array down to make sure we don't overload the database with queries that are too large. + $chunked_user_ids = array_chunk( $user_ids, 500 ); + + $checksum_entries = array(); + + foreach ( $chunked_user_ids as $user_ids_chunk ) { + $user_objects = $this->get_user_objects_by_ids( $user_ids_chunk ); + + foreach ( $user_objects as $user_object ) { + // expand and sanitize desired meta based on WP.com logic. + $user_object = $this->expand_and_sanitize_user_meta( $user_object ); + + // Generate checksum entry based on the serialized value if not empty. + $checksum_entry = 0; + if ( ! empty( $user_object->roles ) ) { + $checksum_entry = crc32( implode( '#', array( $this->salt, 'roles', maybe_serialize( $user_object->roles ) ) ) ); + } + + // Meta only persisted if user is connected to WP.com. + if ( ( new Manager( 'jetpack' ) )->is_user_connected( $user_object->ID ) ) { + if ( ! empty( $user_object->allcaps ) ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'capabilities', + maybe_serialize( $user_object->allcaps ), + ) + ) + ); + } + // Explicitly check that locale is not same as site locale. + if ( ! empty( $user_object->locale ) && get_locale() !== $user_object->locale ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'locale', + maybe_serialize( $user_object->locale ), + ) + ) + ); + } + if ( ! empty( $user_object->allowed_mime_types ) ) { + $checksum_entry += crc32( + implode( + '#', + array( + $this->salt, + 'allowed_mime_types', + maybe_serialize( $user_object->allowed_mime_types ), + ) + ) + ); + } + } + + $checksum_entries[ $user_object->ID ] = '' . $checksum_entry; + } + } + + // Non-granular results need only to sum the different entries. + if ( ! $granular_result ) { + $checksum_sum = 0; + foreach ( $checksum_entries as $entry ) { + $checksum_sum += intval( $entry ); + } + + if ( $simple_return_value ) { + return '' . $checksum_sum; + } + + return array( + 'range' => $range_from . '-' . $range_to, + 'checksum' => '' . $checksum_sum, + ); + + } + + // Granular results. + $response = $checksum_entries; + + // Sort the return value for easier comparisons and code flows further down the line. + ksort( $response ); + + return $response; + } + + /** + * Expand the User Object with additional meta santized by WP.com logic. + * + * @param mixed $user_object User Object from WP_User_Query. + * + * @return mixed $user_object expanded User Object. + */ + protected function expand_and_sanitize_user_meta( $user_object ) { + $user_module = Modules::get_module( 'users' ); + // Expand User Objects based on Sync logic. + $user_object = $user_module->expand_user( $user_object ); + + // Sanitize location. + if ( ! empty( $user_object->locale ) ) { + $user_object->locale = wp_strip_all_tags( $user_object->locale, true ); + } + + // Sanitize allcaps. + if ( ! empty( $user_object->allcaps ) ) { + $user_object->allcaps = array_map( + function ( $cap ) { + return (bool) $cap; + }, + $user_object->allcaps + ); + } + + // Sanitize allowed_mime_types. + $allowed_mime_types = $user_object->allowed_mime_types; + foreach ( $allowed_mime_types as $allowed_mime_type_short => $allowed_mime_type_long ) { + $allowed_mime_type_short = wp_strip_all_tags( (string) $allowed_mime_type_short, true ); + $allowed_mime_type_long = wp_strip_all_tags( (string) $allowed_mime_type_long, true ); + $allowed_mime_types[ $allowed_mime_type_short ] = $allowed_mime_type_long; + } + $user_object->allowed_mime_types = $allowed_mime_types; + + // Sanitize roles. + if ( is_array( $user_object->roles ) ) { + $user_object->roles = array_map( 'sanitize_text_field', $user_object->roles ); + } + return $user_object; + } + + /** + * Gets a list of `WP_User` objects by their IDs + * + * @param array $ids List of IDs to fetch. + * + * @return array + */ + protected function get_user_objects_by_ids( $ids ) { + $user_query = new WP_User_Query( array( 'include' => $ids ) ); + + return $user_query->get_results(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php new file mode 100644 index 00000000..c38ed840 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php @@ -0,0 +1,184 @@ +prepare( '%s', $this->salt ); + + // Prepare the compound key. + $key_fields = array(); + + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->key_fields as $field ) { + $key_fields[] = $this->table . '.' . $field; + } + + $key_fields = implode( ',', $key_fields ); + + // Prepare the checksum fields. + $checksum_fields = array(); + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->checksum_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + // Apply latin1 conversion if enabled. + if ( $this->perform_text_conversion ) { + // Convert text fields to allow for encoding discrepancies as WP.com is latin1. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = 'CONVERT(' . $this->table . '.' . $field . ' using latin1 )'; + } + } else { + // Conversion disabled, default to table prefixing. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + } + + $checksum_fields_string = implode( ',', array_merge( $checksum_fields, array( $salt ) ) ); + + $additional_fields = ''; + if ( $granular_result ) { + // TODO uniq the fields as sometimes(most) range_index is the key and there's no need to select the same field twice. + $additional_fields = " + {$this->table}.{$this->range_field} as range_index, + {$key_fields}, + "; + } + + $filter_stamenet = $this->build_filter_statement( $range_from, $range_to, $filter_values ); + + // usermeta join to limit on user_level. + $join_statement = "JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID"; + + $query = " + SELECT + {$additional_fields} + SUM( + CRC32( + CONCAT_WS( '#', {$salt}, {$checksum_fields_string} ) + ) + ) AS checksum + FROM + {$this->table} + {$join_statement} + WHERE + {$filter_stamenet} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + + /** + * We need the GROUP BY only for compound keys. + */ + if ( $granular_result ) { + $query .= " + GROUP BY {$key_fields} + LIMIT 9999999 + "; + } + + return $query; + } + + /** + * Obtain the min-max values (edges) of the range. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param int|null $limit How many values to return. + * + * @return array|object|void + * @throws Exception Throws an exception if validation fails on the internal function calls. + */ + public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { + global $wpdb; + + $this->validate_fields( array( $this->range_field ) ); + + // `trim()` to make sure we don't add the statement if it's empty. + $filters = trim( $this->build_filter_statement( $range_from, $range_to ) ); + + $filter_statement = ''; + if ( ! empty( $filters ) ) { + $filter_statement = " + JOIN {$wpdb->usermeta} as um_table ON um_table.user_id = {$this->table}.ID + WHERE + {$filters} + AND um_table.meta_key = '{$wpdb->prefix}user_level' + AND um_table.meta_value > 0 + "; + } + + $query = " + SELECT + MIN({$this->range_field}) as min_range, + MAX({$this->range_field}) as max_range, + COUNT( {$this->range_field} ) as item_count + FROM + "; + + /** + * If `$limit` is not specified, we can directly use the table. + */ + if ( ! $limit ) { + $query .= " + {$this->table} + {$filter_statement} + "; + } else { + /** + * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`. + * That's why we will alter the query for this case. + */ + $limit = intval( $limit ); + + $query .= " + ( + SELECT + {$this->range_field} + FROM + {$this->table} + {$filter_statement} + ORDER BY + {$this->range_field} ASC + LIMIT {$limit} + ) as ids_query + "; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! $result || ! is_array( $result ) ) { + throw new Exception( 'Unable to get range edges' ); + } + + return $result; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php new file mode 100644 index 00000000..5826911c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php @@ -0,0 +1,856 @@ +salt = $salt; + + $this->default_tables = $this->get_default_tables(); + + $this->perform_text_conversion = $perform_text_conversion; + + // TODO change filters to allow the array format. + // TODO add get_fields or similar method to get things out of the table. + // TODO extract this configuration in a better way, still make it work with `$wpdb` names. + // TODO take over the replicastore functions and move them over to this class. + // TODO make the API work. + + $this->allowed_tables = apply_filters( 'jetpack_sync_checksum_allowed_tables', $this->default_tables ); + + $this->table = $this->validate_table_name( $table ); + $this->table_configuration = $this->allowed_tables[ $table ]; + + $this->prepare_fields( $this->table_configuration ); + + // Run any callbacks to check if a table is enabled or not. + if ( + is_callable( $this->is_table_enabled_callback ) + && ! call_user_func( $this->is_table_enabled_callback, $table ) + ) { + throw new Exception( "Unable to use table name: $table" ); + } + } + + /** + * Get Default Table configurations. + * + * @return array + */ + protected function get_default_tables() { + global $wpdb; + + return array( + 'posts' => array( + 'table' => $wpdb->posts, + 'range_field' => 'ID', + 'key_fields' => array( 'ID' ), + 'checksum_fields' => array( 'post_modified_gmt' ), + 'filter_values' => Sync\Settings::get_disallowed_post_types_structured(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'posts' ); + }, + ), + 'postmeta' => array( + 'table' => $wpdb->postmeta, + 'range_field' => 'post_id', + 'key_fields' => array( 'post_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_post_meta_structured(), + 'parent_table' => 'posts', + 'parent_join_field' => 'ID', + 'table_join_field' => 'post_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'posts' ); + }, + ), + 'comments' => array( + 'table' => $wpdb->comments, + 'range_field' => 'comment_ID', + 'key_fields' => array( 'comment_ID' ), + 'checksum_fields' => array( 'comment_date_gmt' ), + 'filter_values' => array( + 'comment_type' => array( + 'operator' => 'IN', + 'values' => apply_filters( + 'jetpack_sync_whitelisted_comment_types', + array( '', 'comment', 'trackback', 'pingback', 'review' ) + ), + ), + 'comment_approved' => array( + 'operator' => 'NOT IN', + 'values' => array( 'spam' ), + ), + ), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'comments' ); + }, + ), + 'commentmeta' => array( + 'table' => $wpdb->commentmeta, + 'range_field' => 'comment_id', + 'key_fields' => array( 'comment_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_comment_meta_structured(), + 'parent_table' => 'comments', + 'parent_join_field' => 'comment_ID', + 'table_join_field' => 'comment_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'comments' ); + }, + ), + 'terms' => array( + 'table' => $wpdb->terms, + 'range_field' => 'term_id', + 'key_fields' => array( 'term_id' ), + 'checksum_fields' => array( 'term_id' ), + 'checksum_text_fields' => array( 'name', 'slug' ), + 'parent_table' => 'term_taxonomy', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'termmeta' => array( + 'table' => $wpdb->termmeta, + 'range_field' => 'term_id', + 'key_fields' => array( 'term_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'parent_table' => 'term_taxonomy', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'term_relationships' => array( + 'table' => $wpdb->term_relationships, + 'range_field' => 'object_id', + 'key_fields' => array( 'object_id' ), + 'checksum_fields' => array( 'object_id', 'term_taxonomy_id' ), + 'parent_table' => 'term_taxonomy', + 'parent_join_field' => 'term_taxonomy_id', + 'table_join_field' => 'term_taxonomy_id', + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'term_taxonomy' => array( + 'table' => $wpdb->term_taxonomy, + 'range_field' => 'term_taxonomy_id', + 'key_fields' => array( 'term_taxonomy_id' ), + 'checksum_fields' => array( 'term_taxonomy_id', 'term_id', 'parent' ), + 'checksum_text_fields' => array( 'taxonomy', 'description' ), + 'filter_values' => Sync\Settings::get_allowed_taxonomies_structured(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'terms' ); + }, + ), + 'links' => $wpdb->links, // TODO describe in the array format or add exceptions. + 'options' => $wpdb->options, // TODO describe in the array format or add exceptions. + 'woocommerce_order_items' => array( + 'table' => "{$wpdb->prefix}woocommerce_order_items", + 'range_field' => 'order_item_id', + 'key_fields' => array( 'order_item_id' ), + 'checksum_fields' => array( 'order_id' ), + 'checksum_text_fields' => array( 'order_item_name', 'order_item_type' ), + 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ), + ), + 'woocommerce_order_itemmeta' => array( + 'table' => "{$wpdb->prefix}woocommerce_order_itemmeta", + 'range_field' => 'order_item_id', + 'key_fields' => array( 'order_item_id', 'meta_key' ), + 'checksum_text_fields' => array( 'meta_key', 'meta_value' ), + 'filter_values' => Sync\Settings::get_allowed_order_itemmeta_structured(), + 'parent_table' => 'woocommerce_order_items', + 'parent_join_field' => 'order_item_id', + 'table_join_field' => 'order_item_id', + 'is_table_enabled_callback' => array( $this, 'enable_woocommerce_tables' ), + ), + 'users' => array( + 'table' => $wpdb->users, + 'range_field' => 'ID', + 'key_fields' => array( 'ID' ), + 'checksum_text_fields' => array( 'user_login', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_status', 'display_name' ), + 'filter_values' => array(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'users' ); + }, + ), + + /** + * Usermeta is a special table, as it needs to use a custom override flow, + * as the user roles, capabilities, locale, mime types can be filtered by plugins. + * This prevents us from doing a direct comparison in the database. + */ + 'usermeta' => array( + 'table' => $wpdb->users, + /** + * Range field points to ID, which in this case is the `WP_User` ID, + * since we're querying the whole WP_User objects, instead of meta entries in the DB. + */ + 'range_field' => 'ID', + 'key_fields' => array(), + 'checksum_fields' => array(), + 'is_table_enabled_callback' => function () { + return false !== Sync\Modules::get_module( 'users' ); + }, + ), + ); + } + + /** + * Prepare field params based off provided configuration. + * + * @param array $table_configuration The table configuration array. + */ + protected function prepare_fields( $table_configuration ) { + $this->key_fields = $table_configuration['key_fields']; + $this->range_field = $table_configuration['range_field']; + $this->checksum_fields = isset( $table_configuration['checksum_fields'] ) ? $table_configuration['checksum_fields'] : array(); + $this->checksum_text_fields = isset( $table_configuration['checksum_text_fields'] ) ? $table_configuration['checksum_text_fields'] : array(); + $this->filter_values = isset( $table_configuration['filter_values'] ) ? $table_configuration['filter_values'] : null; + $this->additional_filter_sql = ! empty( $table_configuration['filter_sql'] ) ? $table_configuration['filter_sql'] : ''; + $this->parent_table = isset( $table_configuration['parent_table'] ) ? $table_configuration['parent_table'] : null; + $this->parent_join_field = isset( $table_configuration['parent_join_field'] ) ? $table_configuration['parent_join_field'] : $table_configuration['range_field']; + $this->table_join_field = isset( $table_configuration['table_join_field'] ) ? $table_configuration['table_join_field'] : $table_configuration['range_field']; + $this->is_table_enabled_callback = isset( $table_configuration['is_table_enabled_callback'] ) ? $table_configuration['is_table_enabled_callback'] : false; + } + + /** + * Verify provided table name is valid for checksum processing. + * + * @param string $table Table name to validate. + * + * @return mixed|string + * @throws Exception Throw an exception on validation failure. + */ + protected function validate_table_name( $table ) { + if ( empty( $table ) ) { + throw new Exception( 'Invalid table name: empty' ); + } + + if ( ! array_key_exists( $table, $this->allowed_tables ) ) { + throw new Exception( "Invalid table name: $table not allowed" ); + } + + return $this->allowed_tables[ $table ]['table']; + } + + /** + * Verify provided fields are proper names. + * + * @param array $fields Array of field names to validate. + * + * @throws Exception Throw an exception on failure to validate. + */ + protected function validate_fields( $fields ) { + foreach ( $fields as $field ) { + if ( ! preg_match( '/^[0-9,a-z,A-Z$_]+$/i', $field ) ) { + throw new Exception( "Invalid field name: $field is not allowed" ); + } + + // TODO other verifications of the field names. + } + } + + /** + * Verify the fields exist in the table. + * + * @param array $fields Array of fields to validate. + * + * @return bool + * @throws Exception Throw an exception on failure to validate. + */ + protected function validate_fields_against_table( $fields ) { + global $wpdb; + + $valid_fields = array(); + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $result = $wpdb->get_results( "SHOW COLUMNS FROM {$this->table}", ARRAY_A ); + + foreach ( $result as $result_row ) { + $valid_fields[] = $result_row['Field']; + } + + // Check if the fields are actually contained in the table. + foreach ( $fields as $field_to_check ) { + if ( ! in_array( $field_to_check, $valid_fields, true ) ) { + throw new Exception( "Invalid field name: field '{$field_to_check}' doesn't exist in table {$this->table}" ); + } + } + + return true; + } + + /** + * Verify the configured fields. + * + * @throws Exception Throw an exception on failure to validate in the internal functions. + */ + protected function validate_input() { + $fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields, $this->checksum_text_fields ); + + $this->validate_fields( $fields ); + $this->validate_fields_against_table( $fields ); + } + + /** + * Prepare filter values as SQL statements to be added to the other filters. + * + * @param array $filter_values The filter values array. + * @param string $table_prefix If the values are going to be used in a sub-query, add a prefix with the table alias. + * + * @return array|null + */ + protected function prepare_filter_values_as_sql( $filter_values = array(), $table_prefix = '' ) { + global $wpdb; + + if ( ! is_array( $filter_values ) ) { + return null; + } + + $result = array(); + + foreach ( $filter_values as $field => $filter ) { + $key = ( ! empty( $table_prefix ) ? $table_prefix : $this->table ) . '.' . $field; + + switch ( $filter['operator'] ) { + case 'IN': + case 'NOT IN': + $values_placeholders = implode( ',', array_fill( 0, count( $filter['values'] ), '%s' ) ); + $statement = "{$key} {$filter['operator']} ( $values_placeholders )"; + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $prepared_statement = $wpdb->prepare( $statement, $filter['values'] ); + + $result[] = $prepared_statement; + break; + } + } + + return $result; + } + + /** + * Build the filter query baased off range fields and values and the additional sql. + * + * @param int|null $range_from Start of the range. + * @param int|null $range_to End of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param string $table_prefix Table name to be prefixed to the columns. Used in sub-queries where columns can clash. + * + * @return string + */ + public function build_filter_statement( $range_from = null, $range_to = null, $filter_values = null, $table_prefix = '' ) { + global $wpdb; + + // If there is a field prefix that we want to use with table aliases. + $parent_prefix = ( ! empty( $table_prefix ) ? $table_prefix : $this->table ) . '.'; + + /** + * Prepare the ranges. + */ + + $filter_array = array( '1 = 1' ); + if ( null !== $range_from ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $filter_array[] = $wpdb->prepare( "{$parent_prefix}{$this->range_field} >= %d", array( intval( $range_from ) ) ); + } + if ( null !== $range_to ) { + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $filter_array[] = $wpdb->prepare( "{$parent_prefix}{$this->range_field} <= %d", array( intval( $range_to ) ) ); + } + + /** + * End prepare the ranges. + */ + + /** + * Prepare data filters. + */ + + // Default filters. + if ( $this->filter_values ) { + $prepared_values_statements = $this->prepare_filter_values_as_sql( $this->filter_values, $table_prefix ); + if ( $prepared_values_statements ) { + $filter_array = array_merge( $filter_array, $prepared_values_statements ); + } + } + + // Additional filters. + if ( ! empty( $filter_values ) ) { + // Prepare filtering. + $prepared_values_statements = $this->prepare_filter_values_as_sql( $filter_values, $table_prefix ); + if ( $prepared_values_statements ) { + $filter_array = array_merge( $filter_array, $prepared_values_statements ); + } + } + + // Add any additional filters via direct SQL statement. + // Currently used only because we haven't converted all filtering to happen via `filter_values`. + // This SQL is NOT prefixed and column clashes can occur when used in sub-queries. + if ( $this->additional_filter_sql ) { + $filter_array[] = $this->additional_filter_sql; + } + + /** + * End prepare data filters. + */ + return implode( ' AND ', $filter_array ); + } + + /** + * Returns the checksum query. All validation of fields and configurations are expected to occur prior to usage. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param bool $granular_result If the function should return a granular result. + * + * @return string + * + * @throws Exception Throws an exception if validation fails in the internal function calls. + */ + protected function build_checksum_query( $range_from = null, $range_to = null, $filter_values = null, $granular_result = false ) { + global $wpdb; + + // Escape the salt. + $salt = $wpdb->prepare( '%s', $this->salt ); + + // Prepare the compound key. + $key_fields = array(); + + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->key_fields as $field ) { + $key_fields[] = $this->table . '.' . $field; + } + + $key_fields = implode( ',', $key_fields ); + + // Prepare the checksum fields. + $checksum_fields = array(); + // Prefix the fields with the table name, to avoid clashes in queries with sub-queries (e.g. meta tables). + foreach ( $this->checksum_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + // Apply latin1 conversion if enabled. + if ( $this->perform_text_conversion ) { + // Convert text fields to allow for encoding discrepancies as WP.com is latin1. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = 'CONVERT(' . $this->table . '.' . $field . ' using latin1 )'; + } + } else { + // Conversion disabled, default to table prefixing. + foreach ( $this->checksum_text_fields as $field ) { + $checksum_fields[] = $this->table . '.' . $field; + } + } + + $checksum_fields_string = implode( ',', array_merge( $checksum_fields, array( $salt ) ) ); + + $additional_fields = ''; + if ( $granular_result ) { + // TODO uniq the fields as sometimes(most) range_index is the key and there's no need to select the same field twice. + $additional_fields = " + {$this->table}.{$this->range_field} as range_index, + {$key_fields}, + "; + } + + $filter_stamenet = $this->build_filter_statement( $range_from, $range_to, $filter_values ); + + $join_statement = ''; + if ( $this->parent_table ) { + $parent_table_obj = new Table_Checksum( $this->parent_table ); + $parent_filter_query = $parent_table_obj->build_filter_statement( null, null, null, 'parent_table' ); + + // It is possible to have the GROUP By cause multiple rows to be returned for the same row for term_taxonomy. + // To get distinct entries we use a correlatd subquery back on the parent table using the primary key. + $additional_unique_clause = ''; + if ( 'term_taxonomy' === $this->parent_table ) { + $additional_unique_clause = " + AND parent_table.{$parent_table_obj->range_field} = ( + SELECT min( parent_table_cs.{$parent_table_obj->range_field} ) + FROM {$parent_table_obj->table} as parent_table_cs + WHERE parent_table_cs.{$this->parent_join_field} = {$this->table}.{$this->table_join_field} + ) + "; + } + + $join_statement = " + INNER JOIN {$parent_table_obj->table} as parent_table + ON ( + {$this->table}.{$this->table_join_field} = parent_table.{$this->parent_join_field} + AND {$parent_filter_query} + $additional_unique_clause + ) + "; + } + + $query = " + SELECT + {$additional_fields} + SUM( + CRC32( + CONCAT_WS( '#', {$salt}, {$checksum_fields_string} ) + ) + ) AS checksum + FROM + {$this->table} + {$join_statement} + WHERE + {$filter_stamenet} + "; + + /** + * We need the GROUP BY only for compound keys. + */ + if ( $granular_result ) { + $query .= " + GROUP BY {$key_fields} + LIMIT 9999999 + "; + } + + return $query; + } + + /** + * Obtain the min-max values (edges) of the range. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param int|null $limit How many values to return. + * + * @return array|object|void + * @throws Exception Throws an exception if validation fails on the internal function calls. + */ + public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { + global $wpdb; + + $this->validate_fields( array( $this->range_field ) ); + + // Performance :: When getting the postmeta range we do not want to filter by the whitelist. + // The reason for this is that it leads to a non-performant query that can timeout. + // Instead lets get the range based on posts regardless of meta. + $filter_values = $this->filter_values; + if ( 'postmeta' === $this->table ) { + $this->filter_values = null; + } + + // `trim()` to make sure we don't add the statement if it's empty. + $filters = trim( $this->build_filter_statement( $range_from, $range_to ) ); + + // Reset Post meta filter. + if ( 'postmeta' === $this->table ) { + $this->filter_values = $filter_values; + } + + $filter_statement = ''; + if ( ! empty( $filters ) ) { + $filter_statement = " + WHERE + {$filters} + "; + } + + // Only make the distinct count when we know there can be multiple entries for the range column. + $distinct_count = ''; + if ( count( $this->key_fields ) > 1 || $wpdb->terms === $this->table || $wpdb->term_relationships === $this->table ) { + $distinct_count = 'DISTINCT'; + } + + $query = " + SELECT + MIN({$this->range_field}) as min_range, + MAX({$this->range_field}) as max_range, + COUNT( {$distinct_count} {$this->range_field}) as item_count + FROM + "; + + /** + * If `$limit` is not specified, we can directly use the table. + */ + if ( ! $limit ) { + $query .= " + {$this->table} + {$filter_statement} + "; + } else { + /** + * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`. + * That's why we will alter the query for this case. + */ + $limit = intval( $limit ); + + $query .= " + ( + SELECT + {$distinct_count} {$this->range_field} + FROM + {$this->table} + {$filter_statement} + ORDER BY + {$this->range_field} ASC + LIMIT {$limit} + ) as ids_query + "; + } + + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! $result || ! is_array( $result ) ) { + throw new Exception( 'Unable to get range edges' ); + } + + return $result; + } + + /** + * Update the results to have key/checksum format. + * + * @param array $results Prepare the results for output of granular results. + */ + protected function prepare_results_for_output( &$results ) { + // get the compound key. + // only return range and compound key for granular results. + + $return_value = array(); + + foreach ( $results as &$result ) { + // Working on reference to save memory here. + + $key = array(); + foreach ( $this->key_fields as $field ) { + $key[] = $result[ $field ]; + } + + $return_value[ implode( '-', $key ) ] = $result['checksum']; + } + + return $return_value; + } + + /** + * Calculate the checksum based on provided range and filters. + * + * @param int|null $range_from The start of the range. + * @param int|null $range_to The end of the range. + * @param array|null $filter_values Additional filter values. Not used at the moment. + * @param bool $granular_result If the returned result should be granular or only the checksum. + * @param bool $simple_return_value If we want to use a simple return value for non-granular results (return only the checksum, without wrappers). + * + * @return array|mixed|object|WP_Error|null + */ + public function calculate_checksum( $range_from = null, $range_to = null, $filter_values = null, $granular_result = false, $simple_return_value = true ) { + + if ( ! Sync\Settings::is_checksum_enabled() ) { + return new WP_Error( 'checksum_disabled', 'Checksums are currently disabled.' ); + } + + try { + $this->validate_input(); + } catch ( Exception $ex ) { + return new WP_Error( 'invalid_input', $ex->getMessage() ); + } + + $query = $this->build_checksum_query( $range_from, $range_to, $filter_values, $granular_result ); + + global $wpdb; + + if ( ! $granular_result ) { + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_row( $query, ARRAY_A ); + + if ( ! is_array( $result ) ) { + return new WP_Error( 'invalid_query', "Result wasn't an array" ); + } + + if ( $simple_return_value ) { + return $result['checksum']; + } + + return array( + 'range' => $range_from . '-' . $range_to, + 'checksum' => $result['checksum'], + ); + } else { + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + $result = $wpdb->get_results( $query, ARRAY_A ); + return $this->prepare_results_for_output( $result ); + } + } + + /** + * Make sure the WooCommerce tables should be enabled for Checksum/Fix. + * + * @return bool + */ + protected function enable_woocommerce_tables() { + /** + * On WordPress.com, we can't directly check if the site has support for WooCommerce. + * Having the option to override the functionality here helps with syncing WooCommerce tables. + * + * @since 10.1 + * + * @param bool If we should we force-enable WooCommerce tables support. + */ + $force_woocommerce_support = apply_filters( 'jetpack_table_checksum_force_enable_woocommerce', false ); + + // If we're forcing WooCommerce tables support, there's no need to check further. + // This is used on WordPress.com. + if ( $force_woocommerce_support ) { + return true; + } + + // No need to proceed if WooCommerce is not available. + if ( ! class_exists( 'WooCommerce' ) ) { + return false; + } + + // TODO more checks if needed. Probably query the DB to make sure the tables exist. + + return true; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md new file mode 100644 index 00000000..d21fdb0a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.4] - 2023-03-07 +### Changed +- Updated package dependencies. + +## [0.1.3] - 2023-01-25 +### Changed +- Use `WP_Filesystem` more consistently in `Helper_Script_Manager`. [#28198] + +## [0.1.2] - 2022-12-05 +### Changed +- Updated package dependencies. [#27688] + +## [0.1.1] - 2022-11-30 +### Changed +- Updated package dependencies. [#27043] + +## 0.1.0 - 2022-11-01 +### Added +- Adding the initial empty package +- Duplicate helper script code to a dedicated package + +### Changed +- Updated package dependencies. + +[0.1.4]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/Automattic/jetpack-transport-helper/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php new file mode 100644 index 00000000..96ffd1af --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/actions.php @@ -0,0 +1,32 @@ + $accepted_args, + 'function' => $cb, + ); + }; + $add_action = $add_filter; +} + +// Clean up expired Jetpack Helper Scripts from a scheduled event. +$add_action( 'jetpack_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) ); + +// Register REST routes. +$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Transport_Helper\\REST_Controller', 'register_rest_routes' ) ); + +// Set up package version hook. +$add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Transport_Helper\\Package_Version::send_package_version_to_tracker' ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json new file mode 100644 index 00000000..a55c9e17 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/composer.json @@ -0,0 +1,55 @@ +{ + "name": "automattic/jetpack-transport-helper", + "description": "Package to help transport server communication", + "type": "jetpack-library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-connection": "^1.51.1" + }, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "dev-master" + }, + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "build-production": "echo 'Add your build step to composer.json, please!'", + "build-development": "echo 'Add your build step to composer.json, please!'", + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "mirror-repo": "Automattic/jetpack-transport-helper", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-transport-helper/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "textdomain": "jetpack-transport-helper" + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php new file mode 100644 index 00000000..3d17f2f3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php @@ -0,0 +1,383 @@ + self::MAX_FILESIZE ) { + return new \WP_Error( 'invalid_helper', 'Invalid Helper Script size' ); + } + + // Replace '[wp_path]' in the Helper Script with the WordPress installation location. Allows the Helper Script to find WordPress. + $script_body = str_replace( '[wp_path]', addslashes( ABSPATH ), $script_body ); + + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return new \WP_Error( 'install_failed', 'Failed to install Helper Script' ); + } + + // Create a jetpack-temp directory for the Helper Script. + $temp_directory = self::create_temp_directory(); + if ( \is_wp_error( $temp_directory ) ) { + return $temp_directory; + } + + // Generate a random filename, avoid clashes. + $max_attempts = 5; + for ( $attempt = 0; $attempt < $max_attempts; $attempt++ ) { + $file_key = wp_generate_password( 10, false ); + $file_name = 'jp-helper-' . $file_key . '.php'; + $file_path = trailingslashit( $temp_directory['path'] ) . $file_name; + + if ( ! $wp_filesystem->exists( $file_path ) ) { + // Attempt to write helper script. + if ( ! self::put_contents( $file_path, $script_body ) ) { + if ( $wp_filesystem->exists( $file_path ) ) { + $wp_filesystem->delete( $file_path ); + } + + continue; + } + + // Always schedule a cleanup run shortly after EXPIRY_TIME. + \wp_schedule_single_event( time() + self::EXPIRY_TIME + 60, 'jetpack_cleanup_helper_scripts' ); + + // Success! Figure out the URL and return the path and URL. + return array( + 'path' => $file_path, + 'url' => trailingslashit( $temp_directory['url'] ) . $file_name, + ); + } + } + + return new \WP_Error( 'install_faied', 'Failed to install Helper Script' ); + } + + /** + * Given a path, verify it looks like a helper script and then delete it if so. + * + * @access public + * @static + * + * @param string $path Path to Helper Script to delete. + * @return boolean True if the file is deleted (or does not exist). + */ + public static function delete_helper_script( $path ) { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return false; + } + + if ( ! $wp_filesystem->exists( $path ) ) { + return true; + } + + // Check this file looks like a JPR helper script. + if ( ! self::verify_file_header( $path, self::HELPER_HEADER ) ) { + return false; + } + + return $wp_filesystem->delete( $path ); + } + + /** + * Search for Helper Scripts that are suspiciously old, and clean them out. + * + * @access public + * @static + */ + public static function cleanup_expired_helper_scripts() { + self::cleanup_helper_scripts( time() - self::EXPIRY_TIME ); + } + + /** + * Search for and delete all Helper Scripts. Used during uninstallation. + * + * @access public + * @static + */ + public static function delete_all_helper_scripts() { + self::cleanup_helper_scripts( null ); + } + + /** + * Search for and delete Helper Scripts. If an $expiry_time is specified, only delete Helper Scripts + * with an mtime older than $expiry_time. Otherwise, delete them all. + * + * @access public + * @static + * + * @param int|null $expiry_time If specified, only delete scripts older than $expiry_time. + */ + public static function cleanup_helper_scripts( $expiry_time = null ) { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return; + } + + foreach ( self::get_install_locations() as $directory => $url ) { + $temp_dir = trailingslashit( $directory ) . self::TEMP_DIRECTORY; + + if ( $wp_filesystem->is_dir( $temp_dir ) ) { + // Find expired helper scripts and delete them. + $helper_scripts = $wp_filesystem->dirlist( $temp_dir ); + if ( is_array( $helper_scripts ) ) { + foreach ( $helper_scripts as $entry ) { + if ( preg_match( '/^jp-helper-*\.php$/', $entry['name'] ) && ( null === $expiry_time || $entry['lastmodunix'] < $expiry_time ) ) { + self::delete_helper_script( trailingslashit( $temp_dir ) . $entry['name'] ); + } + } + } + + // Delete the directory if it's empty now. + self::delete_empty_helper_directory( $temp_dir ); + } + } + } + + /** + * Delete a helper script directory if it's empty + * + * @access public + * @static + * + * @param string $dir Path to Helper Script directory. + * @return boolean True if the directory is deleted + */ + private static function delete_empty_helper_directory( $dir ) { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return false; + } + + if ( ! $wp_filesystem->is_dir( $dir ) ) { + return false; + } + + // Tally the files in the target directory, and reject if there are too many. + $dir_contents = $wp_filesystem->dirlist( $dir ); + if ( $dir_contents === false || count( $dir_contents ) > 2 ) { + return false; + } + + // Check that the only remaining files are a README and index.php generated by this system. + $allowed_files = array( + 'README' => self::README_LINES[0], + 'index.php' => self::INDEX_FILE, + ); + + foreach ( $dir_contents as $entry ) { + $basename = $entry['name']; + $path = trailingslashit( $dir ) . $basename; + if ( ! isset( $allowed_files[ $basename ] ) ) { + return false; + } + + // Verify the file starts with the expected contents. + if ( ! self::verify_file_header( $path, $allowed_files[ $basename ] ) ) { + return false; + } + + if ( ! $wp_filesystem->delete( $path ) ) { + return false; + } + } + + // If the directory is now empty, delete it. + $dir_contents = $wp_filesystem->dirlist( $dir ); + if ( $dir_contents === false || count( $dir_contents ) === 0 ) { + return $wp_filesystem->rmdir( $dir ); + } + + return false; + } + + /** + * Find an appropriate location for a jetpack-temp folder, and create one + * + * @access public + * @static + * + * @return WP_Error|array Array containing the url and path of the temp directory if successful, WP_Error if not. + */ + private static function create_temp_directory() { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return new \WP_Error( 'temp_directory', 'Failed to create jetpack-temp directory' ); + } + + foreach ( self::get_install_locations() as $directory => $url ) { + // Check if the install location is writeable. + if ( ! $wp_filesystem->is_writable( $directory ) ) { + continue; + } + + // Create if one doesn't already exist. + $temp_dir = trailingslashit( $directory ) . self::TEMP_DIRECTORY; + if ( ! $wp_filesystem->is_dir( $temp_dir ) ) { + if ( ! $wp_filesystem->mkdir( $temp_dir ) ) { + continue; + } + + // Temp directory created. Drop a README and index.php file in there. + self::write_supplementary_temp_files( $temp_dir ); + } + + return array( + 'path' => trailingslashit( $directory ) . self::TEMP_DIRECTORY, + 'url' => trailingslashit( $url ) . self::TEMP_DIRECTORY, + ); + } + + return new \WP_Error( 'temp_directory', 'Failed to create jetpack-temp directory' ); + } + + /** + * Write out an index.php file and a README file for a new jetpack-temp directory. + * + * @access public + * @static + * + * @param string $dir Path to Helper Script directory. + */ + private static function write_supplementary_temp_files( $dir ) { + $readme_path = trailingslashit( $dir ) . 'README'; + self::put_contents( $readme_path, implode( "\n\n", self::README_LINES ) ); + + $index_path = trailingslashit( $dir ) . 'index.php'; + self::put_contents( $index_path, self::INDEX_FILE ); + } + + /** + * Write a file to the specified location with the specified contents. + * + * @access private + * @static + * + * @param string $file_path Path to write to. + * @param string $contents File contents to write. + * @return boolean True if successfully written. + */ + private static function put_contents( $file_path, $contents ) { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return false; + } + + return $wp_filesystem->put_contents( $file_path, $contents ); + } + + /** + * Checks that a file exists, is readable, and has the expected header. + * + * @access private + * @static + * + * @param string $file_path File to verify. + * @param string $expected_header Header that the file should have. + * @return boolean True if the file exists, is readable, and the header matches. + */ + private static function verify_file_header( $file_path, $expected_header ) { + $wp_filesystem = self::get_wp_filesystem(); + if ( ! $wp_filesystem ) { + return false; + } + + // Verify the file exists and is readable. + if ( ! $wp_filesystem->exists( $file_path ) || ! $wp_filesystem->is_readable( $file_path ) ) { + return false; + } + + // Verify that the file isn't too big or small. + $file_size = $wp_filesystem->size( $file_path ); + if ( $file_size < strlen( $expected_header ) || $file_size > self::MAX_FILESIZE ) { + return false; + } + + // Read the file and verify its header. + $contents = $wp_filesystem->get_contents( $file_path ); + return ( strncmp( $contents, $expected_header, strlen( $expected_header ) ) === 0 ); + } + + /** + * Gets an associative array of possible places to install a jetpack-temp directory, along with the URL to access each. + * + * @access private + * @static + * + * @return array Array, with keys specifying the full path of install locations, and values with the equivalent URL. + */ + public static function get_install_locations() { + // Include WordPress root and wp-content. + $install_locations = array( + \ABSPATH => \get_site_url(), + \WP_CONTENT_DIR => \WP_CONTENT_URL, + ); + + // Include uploads folder. + $upload_dir_info = \wp_upload_dir(); + $install_locations[ $upload_dir_info['basedir'] ] = $upload_dir_info['baseurl']; + + return $install_locations; + } + + /** + * Get the WP_Filesystem. + * + * @return \WP_Filesystem|null + */ + private static function get_wp_filesystem() { + global $wp_filesystem; + + if ( ! $wp_filesystem ) { + if ( ! function_exists( '\\WP_Filesystem' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + if ( ! \WP_Filesystem() ) { + return null; + } + } + + return $wp_filesystem; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php new file mode 100644 index 00000000..0c82368c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php @@ -0,0 +1,31 @@ + WP_REST_Server::CREATABLE, + 'callback' => __CLASS__ . '::install_helper_script', + 'permission_callback' => __CLASS__ . '::helper_script_permissions_callback', + 'args' => array( + 'helper' => array( + 'description' => __( 'base64 encoded Helper Script body.', 'jetpack-transport-helper' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + + // Delete a Helper Script. + register_rest_route( + 'jetpack/v4', + // This route can be generalized once we no longer depend on the backup package + '/backup-helper-script', + array( + 'methods' => WP_REST_Server::DELETABLE, + 'callback' => __CLASS__ . '::delete_helper_script', + 'permission_callback' => __CLASS__ . '::helper_script_permissions_callback', + 'args' => array( + 'path' => array( + 'description' => __( 'Path to Helper Script', 'jetpack-transport-helper' ), + 'type' => 'string', + 'required' => true, + ), + ), + ) + ); + } + + /** + * The Jetpack endpoints should only be available via site-level authentication. + * This means that the corresponding endpoints can only be accessible from WPCOM. + * + * @access public + * @static + * + * @return bool|WP_Error True if a blog token was used to sign the request, WP_Error otherwise. + */ + public static function helper_script_permissions_callback() { + if ( Rest_Authentication::is_signed_with_blog_token() ) { + return true; + } + + $error_msg = esc_html__( + 'You are not allowed to perform this action.', + 'jetpack-transport-helper' + ); + + return new WP_Error( 'rest_forbidden', $error_msg, array( 'status' => rest_authorization_required_code() ) ); + } + + /** + * Install the Helper Script. + * + * @access public + * @static + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * @return array|WP_Error Returns the result of Helper Script installation. Returns one of: + * - WP_Error on failure, or + * - An array with installation info on success: + * 'path' (string) The sinstallation path. + * 'url' (string) The access url. + * 'abspath' (string) The abspath. + */ + public static function install_helper_script( $request ) { + $helper_script = $request->get_param( 'helper' ); + + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode + $helper_script = base64_decode( $helper_script ); + if ( ! $helper_script ) { + return new WP_Error( 'invalid_args', __( 'Helper Script body must be base64 encoded', 'jetpack-transport-helper' ), 400 ); + } + + $installation_info = Helper_Script_Manager::install_helper_script( $helper_script ); + Helper_Script_Manager::cleanup_expired_helper_scripts(); + + // Include ABSPATH with successful result. + if ( ! is_wp_error( $installation_info ) ) { + $installation_info['abspath'] = ABSPATH; + } + + return rest_ensure_response( $installation_info ); + } + + /** + * Delete a Helper Script. + * + * @access public + * @static + * + * @param WP_REST_Request $request The request sent to the WP REST API. + * @return array An array with 'success' key indicating the result of the delete operation. + */ + public static function delete_helper_script( $request ) { + $path_to_helper_script = $request->get_param( 'path' ); + + $deleted = Helper_Script_Manager::delete_helper_script( $path_to_helper_script ); + Helper_Script_Manager::cleanup_expired_helper_scripts(); + + return rest_ensure_response( + array( + 'success' => $deleted, + ) + ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/.phpcsignore b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/.phpcsignore new file mode 100644 index 00000000..9f4f5a0b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/.phpcsignore @@ -0,0 +1 @@ +rules/ diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md new file mode 100644 index 00000000..46c674f2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/CHANGELOG.md @@ -0,0 +1,231 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.11.4] - 2023-04-27 +### Added +- Fix hardblock issue if user only has Protect installed [#30278] + +## [0.11.3] - 2023-04-17 +### Fixed +- Fix brute force protection not initializing on atomic. [#30113] + +## [0.11.2] - 2023-04-10 +### Added +- Add Jetpack Autoloader package suggestion. [#29988] + +## [0.11.1] - 2023-04-03 +### Fixed +- Return early if we detect the older BFP implementation from the main plugin [#29794] + +## [0.11.0] - 2023-03-28 +### Added +- Added brute force protection to the WAF configuration REST API endpoints [#28401] +- Move the brute force protection module into the package. [#28401] + +### Changed +- Change "whitelist" to "allow list". [#28401] +- Move the brute force protection transient cleanup and shared functions to dedicated namespaced classes. [#28401] +- Use WAF IP allow list option in brute force protection feature. [#28401] + +## [0.10.2] - 2023-03-20 +### Changed +- Updated package dependencies. [#29480] + +## [0.10.1] - 2023-03-08 +### Changed +- Minor internal updates. + +## [0.10.0] - 2023-02-28 +### Added +- Added support for IP ranges in allow and block lists. [#29131] + +## [0.9.3] - 2023-02-20 +### Changed +- Minor internal updates. + +## [0.9.2] - 2023-02-15 +### Changed +- Minor internal updates. + +## [0.9.1] - 2023-02-13 +### Fixed +- Fix an update error that impacted sites using the WAF in standalone mode. [#28844] + +## [0.9.0] - 2023-01-25 +### Changed +- Change the web application firewall to run automatic and manual rules independently. [#27726] + +## [0.8.3] - 2023-01-11 +### Fixed +- Fixed the WAF package's PHP tests and Composer requirements [#28185] + +## [0.8.2] - 2023-01-09 +### Fixed +- Fix firewall activation hooks on first option updates. [#28234] + +## [0.8.1] - 2023-01-07 +### Changed +- Change directory location that stores firewall rules. [#28049] + +## [0.8.0] - 2022-12-27 +### Added +- Add file existance checks before requiring rule files in the WAF. [#28050] +- Disable Jetpack Firewall on unsupported environments. [#27939] + +## [0.7.2] - 2022-12-19 +### Fixed +- Fix the initialization of the firewall. [#27846] + +## [0.7.1] - 2022-12-06 +### Changed +- html_entity_decode filter now decodes single-quotes too, and uses a Unicode Replacement Character instead of returning empty string on invalid characters. [#27753] + +## [0.7.0] - 2022-12-05 +### Added +- Prepare package for use in the Jetpack Protect standalone plugin. [#27528] + +### Changed +- Updated package dependencies. [#27688] + +### Removed +- Remove has_rules_access plan check in favor of external alternatives [#27600] + +## [0.6.10] - 2022-11-28 +### Changed +- Updated package dependencies. [#27043] + +## [0.6.9] - 2022-11-01 +### Fixed +- Fix bug for cron event not generating IP rules. [#27215] + +## [0.6.8] - 2022-10-27 +### Fixed +- Fixes several invalid action callbacks. [#27106] + +## [0.6.7] - 2022-09-20 +### Changed +- Changing how we load and run the package to avoid actions.php [#24730] + +## [0.6.6] - 2022-09-08 +### Fixed +- Fixed exception namespace. [#25663] + +## [0.6.5] - 2022-07-26 +### Changed +- Updated package dependencies. [#25158] + +## [0.6.4] - 2022-07-12 +### Fixed +- Correct namespacing error. [#24993] + +## [0.6.3] - 2022-06-21 +### Changed +- Renaming master to trunk. [#24661] + +## [0.6.2] - 2022-06-06 +### Fixed +- Fix the hook we're using for run.php. + +## [0.6.1] - 2022-06-02 +### Removed +- Disable the WAF module on Atomic + +## [0.6.0] - 2022-05-18 +### Added +- Add checks for a killswitch define [#24247] +- Added endpoint to update rules on demand [#24327] +- handle share data option to decide if we should write to log file [#24218] + +### Fixed +- Allow the rules API to return 401 responses without throwing an exception. [#24153] +- fix bootstrap generation in cases file.php is not required yet [#24153] + +## [0.5.1] - 2022-05-04 +### Added +- Added a check to only run the firewall when the Jetpack module is enabled, a method to provide the bootstrap.php path, and a REST API endpoint to provide the firewall settings. [#23769] +- Connected the WAF UI to actually updating the IP block and allow lists when saving the settings. [#24124] + +### Fixed +- Fixed database logging [#24070] +- Fixed issue where code for the waf package was executed if the module was disabled [#24217] +- Fixed writing rules php files if the API request for getting up-to-date rules failes so that the internal functionality is kept in tact. [#24181] +- We now sanitize the output generated by blocked requests, and only report the rule ID in the header response. [#24058] + +## [0.5.0] - 2022-04-26 +### Added +- added cron to update rules +- Added WAF IP allow list and block list functionality. + +### Changed +- Added comment to ignore failing phpcs check +- PHPCS: Fix `WordPress.Security.ValidatedSanitizedInput` +- Updated package dependencies. + +## [0.4.0] - 2022-04-19 +### Added +- added logs when a request is blocked +- Generating rules now fetches them from the API. Also adds a few CLI commands. + +## [0.3.0] - 2022-04-12 +### Added +- Added hooks for generating the rules.php file, and improved functionality and class names. + +## [0.2.0] - 2022-04-06 +### Added +- Added Jetpack WAF standalone mode. + +### Fixed +- Fix normalizing nested array targets, like with query strings. + +## [0.1.1] - 2022-03-29 +### Fixed +- Fixed instance of normalizeHeaderName that wasn't renamed; fixed header parsing; removed unused compiler file. + +## 0.1.0 - 2022-02-16 +### Added +- Added executing the WAF as part of the Jetpack plugin. +- Added Initial version + +### Changed +- Core: do not ship .phpcs.dir.xml in production builds. + +[0.11.4]: https://github.com/Automattic/jetpack-waf/compare/v0.11.3...v0.11.4 +[0.11.3]: https://github.com/Automattic/jetpack-waf/compare/v0.11.2...v0.11.3 +[0.11.2]: https://github.com/Automattic/jetpack-waf/compare/v0.11.1...v0.11.2 +[0.11.1]: https://github.com/Automattic/jetpack-waf/compare/v0.11.0...v0.11.1 +[0.11.0]: https://github.com/Automattic/jetpack-waf/compare/v0.10.2...v0.11.0 +[0.10.2]: https://github.com/Automattic/jetpack-waf/compare/v0.10.1...v0.10.2 +[0.10.1]: https://github.com/Automattic/jetpack-waf/compare/v0.10.0...v0.10.1 +[0.10.0]: https://github.com/Automattic/jetpack-waf/compare/v0.9.3...v0.10.0 +[0.9.3]: https://github.com/Automattic/jetpack-waf/compare/v0.9.2...v0.9.3 +[0.9.2]: https://github.com/Automattic/jetpack-waf/compare/v0.9.1...v0.9.2 +[0.9.1]: https://github.com/Automattic/jetpack-waf/compare/v0.9.0...v0.9.1 +[0.9.0]: https://github.com/Automattic/jetpack-waf/compare/v0.8.3...v0.9.0 +[0.8.3]: https://github.com/Automattic/jetpack-waf/compare/v0.8.2...v0.8.3 +[0.8.2]: https://github.com/Automattic/jetpack-waf/compare/v0.8.1...v0.8.2 +[0.8.1]: https://github.com/Automattic/jetpack-waf/compare/v0.8.0...v0.8.1 +[0.8.0]: https://github.com/Automattic/jetpack-waf/compare/v0.7.2...v0.8.0 +[0.7.2]: https://github.com/Automattic/jetpack-waf/compare/v0.7.1...v0.7.2 +[0.7.1]: https://github.com/Automattic/jetpack-waf/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/Automattic/jetpack-waf/compare/v0.6.10...v0.7.0 +[0.6.10]: https://github.com/Automattic/jetpack-waf/compare/v0.6.9...v0.6.10 +[0.6.9]: https://github.com/Automattic/jetpack-waf/compare/v0.6.8...v0.6.9 +[0.6.8]: https://github.com/Automattic/jetpack-waf/compare/v0.6.7...v0.6.8 +[0.6.7]: https://github.com/Automattic/jetpack-waf/compare/v0.6.6...v0.6.7 +[0.6.6]: https://github.com/Automattic/jetpack-waf/compare/v0.6.5...v0.6.6 +[0.6.5]: https://github.com/Automattic/jetpack-waf/compare/v0.6.4...v0.6.5 +[0.6.4]: https://github.com/Automattic/jetpack-waf/compare/v0.6.3...v0.6.4 +[0.6.3]: https://github.com/Automattic/jetpack-waf/compare/v0.6.2...v0.6.3 +[0.6.2]: https://github.com/Automattic/jetpack-waf/compare/v0.6.1...v0.6.2 +[0.6.1]: https://github.com/Automattic/jetpack-waf/compare/v0.6.0...v0.6.1 +[0.6.0]: https://github.com/Automattic/jetpack-waf/compare/v0.5.1...v0.6.0 +[0.5.1]: https://github.com/Automattic/jetpack-waf/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/Automattic/jetpack-waf/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/Automattic/jetpack-waf/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/Automattic/jetpack-waf/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/Automattic/jetpack-waf/compare/v0.1.1...v0.2.0 +[0.1.1]: https://github.com/Automattic/jetpack-waf/compare/v0.1.0...v0.1.1 diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt new file mode 100644 index 00000000..e82774c1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/LICENSE.txt @@ -0,0 +1,357 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +=================================== + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +c) If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php new file mode 100644 index 00000000..c62c43f9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/cli.php @@ -0,0 +1,12 @@ +can_send_recovery_emails = apply_filters( 'jetpack_protect_can_send_recovery_emails', true ); + $this->ip_address = $ip_address; + + add_filter( 'wp_authenticate_user', array( $this, 'check_valid_blocked_user' ), 10, 1 ); + add_filter( 'site_url', array( $this, 'add_args_to_login_post_url' ), 10, 3 ); + add_filter( 'network_site_url', array( $this, 'add_args_to_login_post_url' ), 10, 3 ); + add_filter( 'lostpassword_url', array( $this, 'add_args_to_lostpassword_url' ), 10, 2 ); + add_filter( 'login_url', array( $this, 'add_args_to_login_url' ), 10, 3 ); + add_filter( 'lostpassword_redirect', array( $this, 'add_args_to_lostpassword_redirect_url' ), 10, 1 ); + } + + /** + * Gets the URL that redirects to the support page on unblocking + * + * @since 8.5.0 + * + * @return string + */ + public static function get_help_url() { + return Redirect::get_url( 'jetpack-support-protect', array( 'anchor' => 'troubleshooting' ) ); + } + + /** + * Add arguments to lost password redirect url. + * + * @param string $url - the URL. + */ + public function add_args_to_lostpassword_redirect_url( $url ) { + if ( $this->valid_blocked_user_id ) { + $url = empty( $url ) ? wp_login_url() : $url; + $url = add_query_arg( + array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'checkemail' => 'confirm', + ), + $url + ); + } + + return $url; + } + + /** + * Add arguments to lost password redirect url. + * + * @param string $url - the URL. + * @param string $redirect - where to redirect to. + */ + public function add_args_to_lostpassword_url( $url, $redirect ) { + if ( $this->valid_blocked_user_id ) { + $args = array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'action' => 'lostpassword', + ); + if ( ! empty( $redirect ) ) { + $args['redirect_to'] = $redirect; + } + $url = add_query_arg( $args, $url ); + } + + return $url; + } + + /** + * Add arguments to login post url. + * + * @param string $url - the URL. + * @param string $path - the path. + * @param string $scheme -the scheme(?). + */ + public function add_args_to_login_post_url( $url, $path, $scheme ) { + if ( $this->valid_blocked_user_id && ( 'login_post' === $scheme || 'login' === $scheme ) ) { + $url = add_query_arg( + array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + ), + $url + ); + + } + + return $url; + } + + /** + * Add arguments to login post url. + * + * @param string $url - the URL. + * @param string $redirect - where we want to redirect to. + * @param string $force_reauth -if we're forcing reauthorization. + */ + public function add_args_to_login_url( $url, $redirect, $force_reauth ) { + if ( $this->valid_blocked_user_id ) { + $args = array( + 'validate_jetpack_protect_recovery' => isset( $_GET['validate_jetpack_protect_recovery'] ) ? filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ) : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + 'user_id' => isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : null, // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + ); + + if ( ! empty( $redirect ) ) { + $args['redirect_to'] = $redirect; + } + + if ( ! empty( $force_reauth ) ) { + $args['reauth'] = '1'; + } + $url = add_query_arg( $args, $url ); + } + + return $url; + } + + /** + * Check if user is blocked. + * + * @param string $user - the user. + */ + public function check_valid_blocked_user( $user ) { + if ( $this->valid_blocked_user_id && $this->valid_blocked_user_id != $user->ID ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseNotEqual + return new WP_Error( 'invalid_recovery_token', __( 'The recovery token is not valid for this user.', 'jetpack-waf' ) ); + } + + return $user; + } + + /** + * Check if user is valid. + */ + public function is_blocked_user_valid() { + if ( ! $this->can_send_recovery_emails ) { + return false; + } + + if ( $this->valid_blocked_user_id ) { + return true; + } + + if ( ! isset( $_GET['validate_jetpack_protect_recovery'], $_GET['user_id'] ) ) { // phpcs:ignore: WordPress.Security.NonceVerification.Recommended -- no changes made if this isn't set. + return false; + } + + if ( ! $this->is_valid_protect_recovery_key( filter_var( wp_unslash( $_GET['validate_jetpack_protect_recovery'] ) ), (int) $_GET['user_id'] ) ) { // phpcs:ignore: WordPress.Security.NonceVerification.Recommended -- no changes made if this isn't set. + return false; + } + + $this->valid_blocked_user_id = (int) $_GET['user_id']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nothing on the site is changed in response to this request. + + return true; + } + + /** + * Checks if recovery key is valid. + * + * @param string $key - they recovery key. + * @param string $user_id - the User ID. + */ + public function is_valid_protect_recovery_key( $key, $user_id ) { + + $path = sprintf( '/sites/%d/protect/recovery/confirm', Jetpack_Options::get_option( 'id' ) ); + $response = Client::wpcom_json_api_request_as_blog( + $path, + '1.1', + array( + 'method' => 'post', + ), + array( + 'token' => $key, + 'user_id' => $user_id, + 'ip' => $this->ip_address, + ) + ); + + $result = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( is_wp_error( $result ) || empty( $result ) || isset( $result->error ) ) { + return false; + } + + return true; + } + + /** + * Check if we should render the recovery form. + */ + public function render_and_die() { + if ( ! $this->can_send_recovery_emails ) { + $this->render_blocked_login_message(); + + return; + } + + if ( isset( $_GET['validate_jetpack_protect_recovery'] ) && ! empty( $_GET['user_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes, just throws invalid token error. + $error = new WP_Error( 'invalid_token', __( "Oops, we couldn't validate the recovery token.", 'jetpack-waf' ) ); + $this->protect_die( $error ); + + return; + } + + if ( + isset( $_GET['jetpack-protect-recovery'] ) && + isset( $_POST['_wpnonce'] ) && + wp_verify_nonce( $_POST['_wpnonce'], 'bypass-protect' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP Core doesn't unstrip or sanitize nonces either. + ) { + $this->process_recovery_email(); + + return; + } + + if ( isset( $_GET['loggedout'] ) && 'true' === $_GET['loggedout'] ) { + $this->protect_die( __( 'You successfully logged out.', 'jetpack-waf' ) ); + } + + $this->render_recovery_form(); + } + + /** + * Render the blocked login message. + */ + public function render_blocked_login_message() { + $this->protect_die( $this->get_html_blocked_login_message() ); + } + + /** + * Process sending a recovery email. + */ + public function process_recovery_email() { + $sent = $this->send_recovery_email(); + $show_recovery_form = true; + if ( is_wp_error( $sent ) ) { + if ( 'email_already_sent' === $sent->get_error_code() ) { + $show_recovery_form = false; + } + $this->protect_die( $sent, null, true, $show_recovery_form ); + } else { + $this->render_recovery_success(); + } + } + + /** + * Send the recovery form. + */ + public function send_recovery_email() { + $email = isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only triggered after bypass-protect nonce check is done, and sanitization is checked on the next line. + if ( sanitize_email( $email ) !== $email || ! is_email( $email ) ) { + return new WP_Error( 'invalid_email', __( "Oops, looks like that's not the right email address. Please try again!", 'jetpack-waf' ) ); + } + $user = get_user_by( 'email', trim( $email ) ); + + if ( ! $user ) { + return new WP_Error( 'invalid_user', __( "Oops, we couldn't find a user with that email. Please try again!", 'jetpack-waf' ) ); + } + $this->email_address = $email; + $path = sprintf( '/sites/%d/protect/recovery/request', Jetpack_Options::get_option( 'id' ) ); + + $response = Client::wpcom_json_api_request_as_blog( + $path, + '1.1', + array( + 'method' => 'post', + ), + array( + 'user_id' => $user->ID, + 'ip' => $this->ip_address, + ) + ); + + $code = wp_remote_retrieve_response_code( $response ); + $result = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( self::HTTP_STATUS_CODE_TOO_MANY_REQUESTS === $code ) { + // translators: email address the recovery instructions were sent to. + return new WP_Error( 'email_already_sent', sprintf( __( 'Recovery instructions were sent to %s. Check your inbox!', 'jetpack-waf' ), $this->email_address ) ); + } elseif ( is_wp_error( $result ) || empty( $result ) || isset( $result->error ) ) { + return new WP_Error( 'email_send_error', __( 'Oops, we were unable to send a recovery email. Try again.', 'jetpack-waf' ) ); + } + + return true; + } + + /** + * Prevent login by locking the login page. + * + * @param string $content - the content of the page. + * @param string $title - the page title. + * @param string $back_link - the back link. + * @param string $recovery_form - the recovery form. + */ + public function protect_die( $content, $title = null, $back_link = false, $recovery_form = false ) { + if ( empty( $title ) ) { + $title = __( 'Jetpack has locked your site\'s login page.', 'jetpack-waf' ); + } + if ( is_wp_error( $content ) ) { + $svg = ''; + $content = ' ' . $svg . $content->get_error_message() . ''; + } + $content = '

        ' . $content . '

        '; + + // If for some reason the login pop up box show up in the wp-admin. + if ( isset( $_GET['interim-login'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no changes to the site itself, just rendering an error message. + $content = '' . $content; + } + $this->display_page( $title, $content, $back_link, $recovery_form ); + } + + /** + * Render the recovery form. + */ + public function render_recovery_form() { + $content = $this->get_html_blocked_login_message(); + $this->protect_die( $content, null, null, true ); + } + + /** + * Render the recovery instructions. + */ + public function render_recovery_success() { + // translators: the email address the recovery email was sent to. + $this->protect_die( sprintf( __( 'Recovery instructions were sent to %s. Check your inbox!', 'jetpack-waf' ), $this->email_address ) ); + } + + /** + * Get the HTML for the blocked login message. + */ + public function get_html_blocked_login_message() { + $icon = ''; + $ip = str_replace( 'http://', '', esc_url( 'http://' . $this->ip_address ) ); + return sprintf( + // translators: the IP address that was flagged. + __( '

        Your IP address %2$s has been flagged for potential security violations. You can unlock your login by sending yourself a special link via email. Learn More

        ', 'jetpack-waf' ), // phpcs:ignore WordPress.WP.I18n.NoHtmlWrappedStrings + $icon, + $ip, + esc_url( self::get_help_url() ) + ); + } + + /** + * Get the HTML recovery form. + */ + public function get_html_recovery_form() { + ob_start(); ?> +
        +
        + +

        + + +

        +
        +
        + + + + + > + + + + \n"; + } else { + echo "\n"; + } + ?> + <?php echo esc_html( $title ); ?> + + + > +

        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + get_html_recovery_form(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- content is escaped in the function. + } + ?> +
        + + + + get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + + if ( ! $transient || $transient < 1 ) { + self::generate_math_page(); + } + return true; + } + + $ans = isset( $_POST['jetpack_protect_num'] ) ? (int) $_POST['jetpack_protect_num'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- answers are salted. + $correct_ans = isset( $_POST['jetpack_protect_answer'] ) ? sanitize_key( $_POST['jetpack_protect_answer'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans_1 = hash_hmac( 'sha1', $ans, $salt . $time_window ); + $salted_ans_2 = hash_hmac( 'sha1', $ans, $salt . ( $time_window - 1 ) ); + + if ( ! $correct_ans || ! $ans ) { + self::generate_math_page(); + } elseif ( ! hash_equals( $salted_ans_1, $correct_ans ) && ! hash_equals( $salted_ans_2, $correct_ans ) ) { + wp_die( + wp_kses( + __( + 'You failed to correctly answer the math problem. This is used to combat spam when Jetpack’s Brute Force Attack Protection API is unavailable. Please use your browser’s back button to return to the login form, press the "refresh" button to generate a new math problem, and try to log in again.', + 'jetpack-waf' + ), + array( 'strong' => array() ) + ), + '', + array( 'response' => 401 ) + ); + } else { + return true; + } + } + + /** + * Creates an interim page to collect answers to a math captcha + * + * @param string $error - the error message. + */ + public static function generate_math_page( $error = false ) { + ob_start(); + ?> +

        + +

        + + +
        + + +

        +
        + 401 ) + ); + } + + /** + * Generates the math page. + */ + public function process_generate_math_page() { + $ans = isset( $_POST['jetpack_protect_num'] ) ? (int) $_POST['jetpack_protect_num'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- answers are salted. + $correct_ans = isset( $_POST['jetpack_protect_answer'] ) ? sanitize_key( $_POST['jetpack_protect_answer'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans_1 = hash_hmac( 'sha1', $ans, $salt . $time_window ); + $salted_ans_2 = hash_hmac( 'sha1', $ans, $salt . ( $time_window - 1 ) ); + + if ( ! hash_equals( $salted_ans_1, $correct_ans ) && ! hash_equals( $salted_ans_2, $correct_ans ) ) { + self::generate_math_page( true ); + } else { + $temp_pass = substr( hash_hmac( 'sha1', wp_rand( 1, 100000000 ), get_site_option( 'jetpack_protect_key' ) ), 5, 25 ); + + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->set_transient( 'jpp_math_pass_' . $temp_pass, 3, DAY_IN_SECONDS ); + setcookie( 'jpp_math_pass', $temp_pass, time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false, true ); + remove_action( 'login_form', array( $this, 'math_form' ) ); + return true; + } + } + + /** + * Requires a user to solve a simple equation. Added to any WordPress login form. + * + * @return VOID outputs html + */ + public static function math_form() { + // Check if jpp_math_pass cookie is set and it matches valid transient. + if ( isset( $_COOKIE['jpp_math_pass'] ) ) { + $brute_force_protection = Brute_Force_Protection::instance(); + $transient = $brute_force_protection->get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + + if ( $transient && $transient > 0 ) { + return ''; + } + } + + $num1 = wp_rand( 0, 10 ); + $num2 = wp_rand( 1, 10 ); + $ans = $num1 + $num2; + + $time_window = self::time_window(); + $salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|'; + $salted_ans = hash_hmac( 'sha1', $ans, $salt . $time_window ); + ?> +
        +

        + +

        +
        + + + +
        + array(), + ); + foreach ( $local_allow_list as $item ) { + if ( $item->range ) { + $formatted['local'][] = $item->range_low . ' - ' . $item->range_high; + } else { + $formatted['local'][] = $item->ip_address; + } + } + if ( is_multisite() && current_user_can( 'manage_network' ) ) { + $formatted['global'] = array(); + $global_allow_list = self::get_global_allow_list(); + if ( false === $global_allow_list ) { + // If the global allow list has never been set, check for a legacy option set prior to 3.6. + $global_allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } + foreach ( $global_allow_list as $item ) { + if ( $item->range ) { + $formatted['global'][] = $item->range_low . ' - ' . $item->range_high; + } else { + $formatted['global'][] = $item->ip_address; + } + } + } + return $formatted; + } + + /** + * Gets the local Brute force protection allow list. + * + * @deprecated 0.11.0 Use get_local_allow_list() + */ + public static function get_local_whitelist() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::get_local_allow_list' ); + return self::get_local_allow_list(); + } + + /** + * Gets the local Brute force protection allow list. + * + * The 'local' part of the allow list only really applies to multisite installs, + * which can have a network wide allow list, as well as a local list that applies + * only to the current site. On single site installs, there will only be a local + * allow list. + * + * @return array A list of IP Address objects or an empty array + */ + public static function get_local_allow_list() { + $allow_list = get_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ); + if ( false === $allow_list ) { + // The local allow list has never been set. + if ( is_multisite() ) { + // On a multisite, we can check for a legacy site_option that existed prior to v 3.6, or default to an empty array. + $allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } else { + // On a single site, we can just use an empty array. + $allow_list = array(); + } + } else { + $allow_list = IP_Utils::get_ip_addresses_from_string( $allow_list ); + $allow_list = array_map( + function ( $ip_address ) { + return self::create_ip_object( $ip_address ); + }, + $allow_list + ); + } + return $allow_list; + } + + /** + * Get the global, network-wide allow list. + * + * @deprecated 0.11.0 Use get_global_allow_list() + */ + public static function get_global_whitelist() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::get_global_allow_list' ); + return self::get_global_allow_list(); + } + + /** + * Get the global, network-wide allow list. + * + * It will revert to the legacy site_option if jetpack_protect_global_whitelist has never been set. + * + * @return array + */ + public static function get_global_allow_list() { + $allow_list = get_site_option( 'jetpack_protect_global_whitelist' ); + if ( false === $allow_list ) { + // The global allow list has never been set. Check for legacy site_option, or default to an empty array. + $allow_list = get_site_option( 'jetpack_protect_whitelist', array() ); + } + return $allow_list; + } + + /** + * Convert a string into an IP Address object. + * + * @param string $ip_address The IP Address to convert. + * @return object An IP Address object. + */ + private static function create_ip_object( $ip_address ) { + $range = false; + if ( strpos( $ip_address, '-' ) ) { + $ip_address = explode( '-', $ip_address ); + $range = true; + } + $new_item = new \stdClass(); + $new_item->range = $range; + if ( $range ) { + $new_item->range_low = trim( $ip_address[0] ); + $new_item->range_high = trim( $ip_address[1] ); + } else { + $new_item->ip_address = $ip_address; + } + return $new_item; + } + + /** + * Save IP allow list. + * + * @deprecated 0.11.0 Use save_allow_list() + * + * @param mixed $allow_list IP allow list. + * @param bool $global (default: false) Global. + */ + public static function save_whitelist( $allow_list, $global = false ) { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::save_allow_list' ); + return self::save_allow_list( $allow_list, $global ); + } + + /** + * Save IP allow list. + * + * @access public + * @param mixed $allow_list IP allow list. + * @param bool $global (default: false) Global. + * @return Bool. + */ + public static function save_allow_list( $allow_list, $global = false ) { + $allow_list_error = false; + $new_items = array(); + if ( ! is_array( $allow_list ) ) { + return new WP_Error( 'invalid_parameters', __( 'Expecting an array', 'jetpack-waf' ) ); + } + if ( $global && ! is_multisite() ) { + return new WP_Error( 'invalid_parameters', __( 'Cannot use global flag on non-multisites', 'jetpack-waf' ) ); + } + if ( $global && ! current_user_can( 'manage_network' ) ) { + return new WP_Error( 'permission_denied', __( 'Only super admins can edit the global allow list', 'jetpack-waf' ) ); + } + // Validate each item. + foreach ( $allow_list as $item ) { + $item = trim( $item ); + if ( empty( $item ) ) { + continue; + } + $new_item = self::create_ip_object( $item ); + if ( $new_item->range ) { + if ( ! filter_var( $new_item->range_low, FILTER_VALIDATE_IP ) || ! filter_var( $new_item->range_high, FILTER_VALIDATE_IP ) ) { + $allow_list_error = true; + break; + } + if ( ! IP_Utils::convert_ip_address( $new_item->range_low ) || ! IP_Utils::convert_ip_address( $new_item->range_high ) ) { + $allow_list_error = true; + break; + } + } else { + if ( ! filter_var( $new_item->ip_address, FILTER_VALIDATE_IP ) ) { + $allow_list_error = true; + break; + } + if ( ! IP_Utils::convert_ip_address( $new_item->ip_address ) ) { + $allow_list_error = true; + break; + } + } + $new_items[] = $new_item; + } // End item loop. + if ( ! empty( $allow_list_error ) ) { + return new WP_Error( 'invalid_ip', __( 'One of your IP addresses was not valid.', 'jetpack-waf' ) ); + } + if ( $global ) { + update_site_option( 'jetpack_protect_global_whitelist', $new_items ); + // Once a user has saved their global allow list, we can permanently remove the legacy option. + delete_site_option( 'jetpack_protect_whitelist' ); + } else { + $new_items = array_map( + function ( $item ) { + if ( $item->range ) { + return $item->range_low . '-' . $item->range_high; + } + return $item->ip_address; + }, + $new_items + ); + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME, implode( ' ', $new_items ) ); + } + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php new file mode 100644 index 00000000..ebd79e03 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php @@ -0,0 +1,63 @@ + time() || $older_than_time < 1 ) { + return false; + } + $sql = $wpdb->prepare( + // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.LikeWildcardsInQuery + "SELECT REPLACE(option_name, '_transient_timeout_jpp_', '') AS transient_name FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_timeout\_jpp\__%%' AND option_value < %d", + $older_than_time + ); + $transients = $wpdb->get_col( $sql ); // phpcs:ignore WordPress.DB -- $sql is prepared above. + $options_names = array(); + foreach ( $transients as $transient ) { + $options_names[] = '_transient_jpp_' . $transient; + $options_names[] = '_transient_timeout_jpp_' . $transient; + } + if ( $options_names ) { + $option_names_string = implode( ', ', array_fill( 0, count( $options_names ), '%s' ) ); + $result = $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery + $wpdb->prepare( + "DELETE FROM {$wpdb->options} WHERE option_name IN ($option_names_string)", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare -- the placeholders are set above. + $options_names + ) + ); + if ( ! $result ) { + return false; + } + } + } + + /** + * Jetpack Purge Transients Activation. + * + * @access public + * @return void + */ + public static function jp_purge_transients_activation() { + if ( ! wp_next_scheduled( 'jp_purge_transients_cron' ) ) { + wp_schedule_event( time(), 'daily', 'jp_purge_transients_cron' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php new file mode 100644 index 00000000..a028290f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php @@ -0,0 +1,1134 @@ +is_connected() ) { + global $pagenow; + $brute_force_protection = self::instance(); + + if ( isset( $pagenow ) && 'wp-login.php' === $pagenow ) { + $brute_force_protection->check_login_ability(); + } + } + } + + /** + * On module activation, try to get an api key + */ + public function on_activation() { + if ( is_multisite() && is_main_site() && get_site_option( 'jetpack_protect_active', 0 ) == 0 ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual + update_site_option( 'jetpack_protect_active', 1 ); + } + + update_site_option( 'jetpack_protect_activating', 'activating' ); + + // Get BruteProtect's counter number. + $this->protect_call( 'check_key' ); + } + + /** + * On module deactivation, unset protect_active + */ + public function on_deactivation() { + if ( is_multisite() && is_main_site() ) { + update_site_option( 'jetpack_protect_active', 0 ); + } + } + + /** + * Determines if the brute force protection module is enabled on the site. + * + * @return bool + */ + public static function is_enabled() { + return ( new Modules() )->is_active( 'protect' ); + } + + /** + * Enables the brute force protection module. + * + * @return bool + */ + public static function enable() { + return ( new Modules() )->activate( 'protect', false, false ); + } + + /** + * Disables the brute force protection module. + * + * @return bool + */ + public static function disable() { + return ( new Modules() )->deactivate( 'protect' ); + } + + /** + * Get the protect key, + */ + public function maybe_get_protect_key() { + if ( get_site_option( 'jetpack_protect_activating', false ) && ! get_site_option( 'jetpack_protect_key', false ) ) { + $key = $this->get_protect_key(); + delete_site_option( 'jetpack_protect_activating' ); + return $key; + } + + return get_site_option( 'jetpack_protect_key' ); + } + + /** + * Sends a "check_key" API call once a day. This call allows us to track IP-related + * headers for this server via the Protect API, in order to better identify the source + * IP for login attempts + * + * @param bool $force - if we're forcing the request. + */ + public function maybe_update_headers( $force = false ) { + $updated_recently = $this->get_transient( 'jpp_headers_updated_recently' ); + + if ( ! $force ) { + if ( isset( $_GET['protect_update_headers'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- this doesn't change anything, just forces the once-a-day check to run via force if set. + $force = true; + } + } + + // check that current user is admin so we prevent a lower level user from adding + // a trusted header, allowing them to brute force an admin account. + if ( ( $updated_recently && ! $force ) || ! current_user_can( 'update_plugins' ) ) { + return; + } + + $response = self::protect_call( 'check_key' ); + $this->set_transient( 'jpp_headers_updated_recently', 1, DAY_IN_SECONDS ); + + if ( isset( $response['msg'] ) && $response['msg'] ) { + update_site_option( 'trusted_ip_header', json_decode( $response['msg'] ) ); + } + } + + /** + * Handle displaying a security warning. + */ + public function maybe_display_security_warning() { + if ( is_multisite() && current_user_can( 'manage_network' ) ) { + if ( ! function_exists( 'is_plugin_active_for_network' ) ) { + require_once ABSPATH . '/wp-admin/includes/plugin.php'; + } + + if ( ! is_plugin_active_for_network( plugin_basename( JETPACK__PLUGIN_FILE ) ) ) { + add_action( 'load-index.php', array( $this, 'prepare_jetpack_protect_multisite_notice' ) ); + add_action( 'wp_ajax_jetpack-protect-dismiss-multisite-banner', array( $this, 'ajax_dismiss_handler' ) ); + } + } + } + + /** + * Handles preparing the multisite notice. + */ + public function prepare_jetpack_protect_multisite_notice() { + $dismissed = get_site_option( 'jetpack_dismissed_protect_multisite_banner' ); + if ( $dismissed ) { + return; + } + + add_action( 'admin_notices', array( $this, 'admin_jetpack_manage_notice' ) ); + } + + /** + * Handle dismissing the multisite banner. + */ + public function ajax_dismiss_handler() { + check_ajax_referer( 'jetpack_protect_multisite_banner_opt_out' ); + + if ( ! current_user_can( 'manage_network' ) ) { + wp_send_json_error( new WP_Error( 'insufficient_permissions' ) ); + } + + update_site_option( 'jetpack_dismissed_protect_multisite_banner', true ); + + wp_send_json_success(); + } + + /** + * Displays a warning about Brute Force Protection's network activation requirement. + * Attaches some custom JS to Core's `is-dismissible` UI to save the dismissed state. + */ + public function admin_jetpack_manage_notice() { + ?> +
        +

        + +

        + +

        + + + + + + +

        +
        + + api_key_error = __( 'Your main blog is not connected to WordPress.com. Please connect to get an API key.', 'jetpack-waf' ); + + return false; + } + + $request = array( + 'jetpack_blog_id' => $protect_blog_id, + 'bruteprotect_api_key' => get_site_option( 'bruteprotect_api_key' ), + 'multisite' => '0', + ); + + // Send the number of blogs on the network if we are on multisite. + if ( is_multisite() ) { + $request['multisite'] = get_blog_count(); + if ( ! $request['multisite'] ) { + global $wpdb; + $request['multisite'] = $wpdb->get_var( "SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery + } + } + + // Request the key. + $xml = new Jetpack_IXR_Client(); + $xml->query( 'jetpack.protect.requestKey', $request ); + + // Hmm, can't talk to wordpress.com. + if ( $xml->isError() ) { + $code = $xml->getErrorCode(); + $message = $xml->getErrorMessage(); + // Translators: The xml error code, and the xml error message. + $this->api_key_error = sprintf( __( 'Error connecting to WordPress.com. Code: %1$s, %2$s', 'jetpack-waf' ), $code, $message ); + + return false; + } + + $response = $xml->getResponse(); + + // Hmm, can't talk to the protect servers ( api.bruteprotect.com ). + if ( ! isset( $response['data'] ) ) { + $this->api_key_error = __( 'No reply from Jetpack servers', 'jetpack-waf' ); + + return false; + } + + // There was an issue generating the key. + if ( empty( $response['success'] ) ) { + $this->api_key_error = $response['data']; + + return false; + } + + // Key generation successful! + $active_plugins = self::get_active_plugins(); + + // We only want to deactivate BruteProtect if we successfully get a key. + if ( in_array( 'bruteprotect/bruteprotect.php', $active_plugins, true ) ) { + self::deactivate_plugin( 'bruteprotect/bruteprotect.php', 'BruteProtect' ); + } + + $key = $response['data']; + update_site_option( 'jetpack_protect_key', $key ); + + return $key; + } + + /** + * Called via WP action wp_login_failed to log failed attempt with the api + * + * Fires custom, plugable action jpp_log_failed_attempt with the IP + * + * @param string $login_user - the user attempting to log in. + * @return void + */ + public function log_failed_attempt( $login_user = null ) { + + /** + * Fires before every failed login attempt. + * + * @module protect + * + * @since 3.4.0 + * + * @param array Information about failed login attempt + * [ + * 'login' => (string) Username or email used in failed login attempt + * ] + */ + do_action( 'jpp_log_failed_attempt', array( 'login' => $login_user ) ); + + if ( isset( $_COOKIE['jpp_math_pass'] ) ) { + + $transient = $this->get_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + --$transient; + + if ( ! $transient || $transient < 1 ) { + $this->delete_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ) ); + setcookie( 'jpp_math_pass', 0, time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, false, true ); + } else { + $this->set_transient( 'jpp_math_pass_' . sanitize_key( $_COOKIE['jpp_math_pass'] ), $transient, DAY_IN_SECONDS ); + } + } + $this->protect_call( 'failed_attempt' ); + } + + /** + * Set up the Brute Force Protection configuration page + */ + public function modules_loaded() { + add_filter( 'jetpack_module_configurable_protect', '__return_true' ); + } + + /** + * Logs a successful login back to our servers, this allows us to make sure we're not blocking + * a busy IP that has a lot of good logins along with some forgotten passwords. Also saves current user's ip + * to the ip address allow list + * + * @param string $user_login - the user loggign in. + * @param string $user - the user. + */ + public function log_successful_login( $user_login, $user = null ) { + if ( ! $user ) { // For do_action( 'wp_login' ) calls that lacked passing the 2nd arg. + $user = get_user_by( 'login', $user_login ); + } + + $this->protect_call( 'successful_login', array( 'roles' => $user->roles ) ); + } + + /** + * Checks for loginability BEFORE authentication so that bots don't get to go around the log in form. + * + * If we are using our math fallback, authenticate via math-fallback.php + * + * @param string $user - the user. + * @param string $username - the username. + * @param string $password - the password. + * + * @return string $user + */ + public function check_preauth( $user = 'Not Used By Protect', $username = 'Not Used By Protect', $password = 'Not Used By Protect' ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $allow_login = $this->check_login_ability( true ); + $use_math = $this->get_transient( 'brute_use_math' ); + + if ( ! $allow_login ) { + $this->block_with_math(); + } + + if ( ( 1 == $use_math || 1 == $this->block_login_with_math ) && isset( $_POST['log'] ) ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual, WordPress.Security.NonceVerification.Missing -- POST request just determines if we use math authentication. + + Brute_Force_Protection_Math_Authenticate::math_authenticate(); + } + + return $user; + } + + /** + * Get all IP headers so that we can process on our server... + * + * @return array + */ + public function get_headers() { + $output = array(); + $ip_related_headers = array( + 'GD_PHP_HANDLER', + 'HTTP_AKAMAI_ORIGIN_HOP', + 'HTTP_CF_CONNECTING_IP', + 'HTTP_CLIENT_IP', + 'HTTP_FASTLY_CLIENT_IP', + 'HTTP_FORWARDED', + 'HTTP_FORWARDED_FOR', + 'HTTP_INCAP_CLIENT_IP', + 'HTTP_TRUE_CLIENT_IP', + 'HTTP_X_CLIENTIP', + 'HTTP_X_CLUSTER_CLIENT_IP', + 'HTTP_X_FORWARDED', + 'HTTP_X_FORWARDED_FOR', + 'HTTP_X_IP_TRAIL', + 'HTTP_X_REAL_IP', + 'HTTP_X_VARNISH', + 'REMOTE_ADDR', + ); + + foreach ( $ip_related_headers as $header ) { + if ( ! empty( $_SERVER[ $header ] ) ) { + $output[ $header ] = wp_unslash( $_SERVER[ $header ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + } + } + + return $output; + } + + /** + * Checks if the IP address is in the allow list. + * + * @deprecated 0.11.0 Use ip_is_allowed() + * + * @param string $ip - the IP address. + */ + public static function ip_is_whitelisted( $ip ) { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::ip_is_allowed' ); + return self::ip_is_allowed( $ip ); + } + + /** + * Checks if the IP address is in the allow list. + * + * @param string $ip - the IP address. + * + * @return bool + */ + public function ip_is_allowed( $ip ) { + // If we found an exact match in wp-config. + if ( defined( 'JETPACK_IP_ADDRESS_OK' ) && JETPACK_IP_ADDRESS_OK === $ip ) { + return true; + } + + $allow_list = Brute_Force_Protection_Shared_Functions::get_local_allow_list(); + + if ( is_multisite() ) { + $allow_list = array_merge( $allow_list, get_site_option( 'jetpack_protect_global_whitelist', array() ) ); + } + + if ( ! empty( $allow_list ) ) : + foreach ( $allow_list as $item ) : + // If the IPs are an exact match. + if ( ! $item->range && isset( $item->ip_address ) && $item->ip_address === $ip ) { + return true; + } + + if ( $item->range && isset( $item->range_low ) && isset( $item->range_high ) ) { + if ( IP_Utils::ip_address_is_in_range( $ip, $item->range_low, $item->range_high ) ) { + return true; + } + } + endforeach; + endif; + + return false; + } + + /** + * Checks the status for a given IP. API results are cached as transients + * + * @param bool $preauth - Whether or not we are checking prior to authorization. + * + * @return bool Either returns true, fires $this->kill_login, or includes a math fallback and returns false + */ + public function check_login_ability( $preauth = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + + /** + * JETPACK_ALWAYS_PROTECT_LOGIN will always disable the login page, and use a page provided by Jetpack. + */ + if ( Constants::is_true( 'JETPACK_ALWAYS_PROTECT_LOGIN' ) ) { + $this->kill_login(); + } + + if ( $this->is_current_ip_allowed() ) { + return true; + } + + $status = $this->get_cached_status(); + + if ( empty( $status ) ) { + // If we've reached this point, this means that the IP isn't cached. + // Now we check with the Protect API to see if we should allow login. + $response = $this->protect_call( $action = 'check_ip' ); // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found + + if ( isset( $response['math'] ) && ! function_exists( 'brute_math_authenticate' ) ) { + new Brute_Force_Protection_Math_Authenticate(); + + return false; + } + + $status = $response['status']; + } + + if ( 'blocked' === $status ) { + $this->block_with_math(); + } + + if ( 'blocked-hard' === $status ) { + $this->kill_login(); + } + + return true; + } + + /** + * Check if the user's IP is in the allow list. + * + * @deprecated 0.11.0 Use is_current_ip_allowed() + */ + public static function is_current_ip_whitelisted() { + _deprecated_function( __METHOD__, 'waf-0.11.0', __CLASS__ . '::is_current_ip_allowed' ); + return self::is_current_ip_allowed(); + } + + /** + * Check if the user's IP is in the allow list. + */ + public function is_current_ip_allowed() { + $ip = IP_Utils::get_ip(); + + // Server is misconfigured and we can't get an IP. + if ( ! $ip ) { + self::disable(); + ob_start(); + ( new CookieState() )->state( 'message', 'protect_misconfigured_ip' ); + ob_end_clean(); + return true; + } + + /** + * Short-circuit check_login_ability. + * + * If there is an alternate way to validate the current IP such as + * a hard-coded list of IP addresses, we can short-circuit the rest + * of the login ability checks and return true here. + * + * @module protect + * + * @since 4.4.0 + * + * @param bool false Should we allow all logins for the current ip? Default: false + */ + if ( apply_filters( 'jpp_allow_login', false, $ip ) ) { + return true; + } + + if ( IP_Utils::ip_is_private( $ip ) ) { + return true; + } + + if ( $this->ip_is_allowed( $ip ) ) { + return true; + } + } + + /** + * Check if someone is able to login based on IP. + */ + public function has_login_ability() { + if ( $this->is_current_ip_allowed() ) { + return true; + } + $status = $this->get_cached_status(); + if ( empty( $status ) || 'ok' === $status ) { + return true; + } + return false; + } + + /** + * Check the status of the cached transient. + */ + public function get_cached_status() { + $transient_name = $this->get_transient_name(); + $value = $this->get_transient( $transient_name ); + if ( isset( $value['status'] ) ) { + return $value['status']; + } + return ''; + } + + /** + * Check if we need to block with a math question to continue logging in. + */ + public function block_with_math() { + /** + * By default, Protect will allow a user who has been blocked for too + * many failed logins to start answering math questions to continue logging in + * + * For added security, you can disable this. + * + * @module protect + * + * @since 3.6.0 + * + * @param bool Whether to allow math for blocked users or not. + */ + + $this->block_login_with_math = 1; + /** + * Allow Math fallback for blocked IPs. + * + * @module protect + * + * @since 3.6.0 + * + * @param bool true Should we fallback to the Math questions when an IP is blocked. Default to true. + */ + $allow_math_fallback_on_fail = apply_filters( 'jpp_use_captcha_when_blocked', true ); + if ( ! $allow_math_fallback_on_fail ) { + $this->kill_login(); + } + + new Brute_Force_Protection_Math_Authenticate(); + + return false; + } + + /** + * Kill a login attempt + */ + public function kill_login() { + if ( + isset( $_GET['action'], $_GET['_wpnonce'] ) && + 'logout' === $_GET['action'] && + wp_verify_nonce( $_GET['_wpnonce'], 'log-out' ) && // phpcs:ignore WordPress.Security.ValidatedSanitizedInput + wp_get_current_user() + + ) { + // Allow users to logout. + return; + } + + $ip = IP_Utils::get_ip(); + /** + * Fires before every killed login. + * + * @module protect + * + * @since 3.4.0 + * + * @param string $ip IP flagged by Protect. + */ + do_action( 'jpp_kill_login', $ip ); + + if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { + // translators: variable is the IP address that was flagged. + $die_string = sprintf( __( 'Your IP (%1$s) has been flagged for potential security violations.', 'jetpack-waf' ), str_replace( 'http://', '', esc_url( 'http://' . $ip ) ) ); + wp_die( + $die_string, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_url used when forming string. + esc_html__( 'Login Blocked by Jetpack', 'jetpack-waf' ), + array( 'response' => 403 ) + ); + } + + $blocked_login_page = Brute_Force_Protection_Blocked_Login_Page::instance( $ip ); + + if ( $blocked_login_page->is_blocked_user_valid() ) { + return; + } + + $blocked_login_page->render_and_die(); + } + + /** + * Checks if the protect API call has failed, and if so initiates the math captcha fallback. + */ + public function check_use_math() { + $use_math = $this->get_transient( 'brute_use_math' ); + if ( $use_math ) { + new Brute_Force_Protection_Math_Authenticate(); + } + } + + /** + * If we're in a multisite network, return the blog ID of the primary blog + * + * @return int + */ + public function get_main_blog_id() { + if ( ! is_multisite() ) { + return false; + } + + global $current_site; + $primary_blog_id = $current_site->blog_id; + + return $primary_blog_id; + } + + /** + * Get jetpack blog id, or the jetpack blog id of the main blog in the main network + * + * @return int + */ + public function get_main_blog_jetpack_id() { + if ( ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $id = Jetpack_Options::get_option( 'id', false ); + restore_current_blog(); + } else { + $id = Jetpack_Options::get_option( 'id' ); + } + + return $id; + } + + /** + * Checks the API key. + */ + public function check_api_key() { + $response = $this->protect_call( 'check_key' ); + + if ( isset( $response['ckval'] ) ) { + return true; + } + + if ( isset( $response['error'] ) ) { + + if ( 'Invalid API Key' === $response['error'] ) { + $this->api_key_error = __( 'Your API key is invalid', 'jetpack-waf' ); + } + + if ( 'API Key Required' === $response['error'] ) { + $this->api_key_error = __( 'No API key', 'jetpack-waf' ); + } + } + + $this->api_key_error = __( 'There was an error contacting Jetpack servers.', 'jetpack-waf' ); + + return false; + } + + /** + * Calls over to the api using wp_remote_post + * + * @param string $action - 'check_ip', 'check_key', or 'failed_attempt'. + * @param array $request - Any custom data to post to the api. + * + * @return array + */ + public function protect_call( $action = 'check_ip', $request = array() ) { + global $wp_version; + + $api_key = $this->maybe_get_protect_key(); + + $user_agent = "WordPress/{$wp_version}"; + + $request['action'] = $action; + $request['ip'] = IP_Utils::get_ip(); + $request['host'] = $this->get_local_host(); + $request['headers'] = wp_json_encode( $this->get_headers() ); + $request['jetpack_version'] = null; + $request['wordpress_version'] = (string) $wp_version; + $request['api_key'] = $api_key; + $request['multisite'] = '0'; + + if ( defined( 'JETPACK__VERSION' ) ) { + $request['jetpack_version'] = constant( 'JETPACK__VERSION' ); + $user_agent .= ' | Jetpack/' . constant( 'JETPACK__VERSION' ); + } + + if ( defined( 'JETPACK_PROTECT_VERSION' ) && ! defined( 'JETPACK__VERSION' ) ) { + $request['jetpack_version'] = '12.1'; + $user_agent .= ' | JetpackProtect/' . constant( 'JETPACK_PROTECT_VERSION' ); + } + + if ( is_multisite() ) { + $request['multisite'] = get_blog_count(); + } + + /** + * Filter controls maximum timeout in waiting for reponse from Protect servers. + * + * @module protect + * + * @since 4.0.4 + * + * @param int $timeout Max time (in seconds) to wait for a response. + */ + $timeout = apply_filters( 'jetpack_protect_connect_timeout', 30 ); + + $args = array( + 'body' => $request, + 'user-agent' => $user_agent, + 'httpversion' => '1.0', + 'timeout' => absint( $timeout ), + ); + + Waf_Constants::define_brute_force_api_host(); + + $response_json = wp_remote_post( JETPACK_PROTECT__API_HOST, $args ); + $this->last_response_raw = $response_json; + + $transient_name = $this->get_transient_name(); + $this->delete_transient( $transient_name ); + + if ( is_array( $response_json ) ) { + $response = json_decode( $response_json['body'], true ); + } + + if ( isset( $response['blocked_attempts'] ) && $response['blocked_attempts'] ) { + update_site_option( 'jetpack_protect_blocked_attempts', $response['blocked_attempts'] ); + } + + if ( isset( $response['status'] ) && ! isset( $response['error'] ) ) { + $response['expire'] = time() + $response['seconds_remaining']; + $this->set_transient( $transient_name, $response, $response['seconds_remaining'] ); + $this->delete_transient( 'brute_use_math' ); + } else { // Fallback to Math Captcha if no response from API host. + $this->set_transient( 'brute_use_math', 1, 600 ); + $response['status'] = 'ok'; + $response['math'] = true; + } + + if ( isset( $response['error'] ) ) { + update_site_option( 'jetpack_protect_error', $response['error'] ); + } else { + delete_site_option( 'jetpack_protect_error' ); + } + + return $response; + } + + /** + * Gets the transient name. + */ + public function get_transient_name() { + $headers = $this->get_headers(); + $header_hash = md5( wp_json_encode( $headers ) ); + + return 'jpp_li_' . $header_hash; + } + + /** + * Wrapper for WordPress set_transient function, our version sets + * the transient on the main site in the network if this is a multisite network + * + * We do it this way (instead of set_site_transient) because of an issue where + * sitewide transients are always autoloaded + * https://core.trac.wordpress.org/ticket/22846 + * + * @param string $transient Transient name. Expected to not be SQL-escaped. Must be + * 45 characters or fewer in length. + * @param mixed $value Transient value. Must be serializable if non-scalar. + * Expected to not be SQL-escaped. + * @param int $expiration Optional. Time until expiration in seconds. Default 0. + * + * @return bool False if value was not set and true if value was set. + */ + public function set_transient( $transient, $value, $expiration ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = set_transient( $transient, $value, $expiration ); + restore_current_blog(); + + return $return; + } + + return set_transient( $transient, $value, $expiration ); + } + + /** + * Wrapper for WordPress delete_transient function, our version deletes + * the transient on the main site in the network if this is a multisite network + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * + * @return bool true if successful, false otherwise + */ + public function delete_transient( $transient ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = delete_transient( $transient ); + restore_current_blog(); + + return $return; + } + + return delete_transient( $transient ); + } + + /** + * Wrapper for WordPress get_transient function, our version gets + * the transient on the main site in the network if this is a multisite network + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * + * @return mixed Value of transient. + */ + public function get_transient( $transient ) { + if ( is_multisite() && ! is_main_site() ) { + switch_to_blog( $this->get_main_blog_id() ); + $return = get_transient( $transient ); + restore_current_blog(); + + return $return; + } + + return get_transient( $transient ); + } + + /** + * Returns the local host. + */ + public function get_local_host() { + if ( isset( $this->local_host ) ) { + return $this->local_host; + } + + $uri = 'http://' . strtolower( isset( $_SERVER['HTTP_HOST'] ) ? filter_var( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '' ); + + if ( is_multisite() ) { + $uri = network_home_url(); + } + + $uridata = wp_parse_url( $uri ); + + $domain = $uridata['host']; + + // If we still don't have the site_url, get it. + if ( ! $domain ) { + $uri = get_site_url( 1 ); + $uridata = wp_parse_url( $uri ); + $domain = $uridata['host']; + } + + $this->local_host = $domain; + + return $this->local_host; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php new file mode 100644 index 00000000..f20c619e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php @@ -0,0 +1,228 @@ +range ) ) { + return $ip_object->range_low . '-' . $ip_object->range_high; + } + + return $ip_object->ip_address; + }, + $brute_force_allow_list + ); + + $brute_force_allow_list_string = implode( "\n", $brute_force_allow_list ); + + if ( empty( $waf_allow_list ) ) { + return $brute_force_allow_list_string; + } + + // Return the lists merged into a single string. + return "$waf_allow_list\n$brute_force_allow_list_string"; + } + + /** + * Migrate the brute force protection IP allow list option to the WAF option. + * + * @since 0.11.0 + * + * @return void + */ + public static function migrate_brute_force_protection_ip_allow_list() { + // Get the allow list values directly from the database to avoid filters. + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist' ); + $waf_allow_list = Jetpack_Options::get_raw_option( 'jetpack_waf_ip_allow_list' ); + + if ( ! empty( $brute_force_allow_list ) ) { + + if ( empty( $waf_allow_list ) ) { + $waf_allow_list = ''; + } + + // Merge the two allow lists. + $merged_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + + // Update the WAF IP allow list with the merged list. + Jetpack_Options::update_raw_option( 'jetpack_waf_ip_allow_list', $merged_allow_list ); + + // Delete the old option if the update was successful. + // Check the values directly as `update_raw_option()` returns false if the value hasn't changed. + if ( Jetpack_Options::get_raw_option( 'jetpack_waf_ip_allow_list' ) === $merged_allow_list ) { + delete_option( 'jetpack_protect_whitelist' ); + } + } + } + + /** + * Filter for Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME's option value. + * Merges the deprecated IP allow list from the brute force protection module + * with the existing option value, and flags that the WAF needs to be updated. + * + * @since 0.11.0 + * + * @param array $waf_allow_list The current value of the option. + * + * @return array The merged IP allow list. + */ + public static function filter_option_waf_ip_allow_list( $waf_allow_list ) { + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist', false ); + if ( false !== $brute_force_allow_list ) { + $waf_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + update_option( Waf_Initializer::NEEDS_UPDATE_OPTION_NAME, 1 ); + } + + return $waf_allow_list; + } + + /** + * Default option for when the Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME option is not set. + * + * @param mixed $default The default value to return if the option does not exist in the database. + * @param string $option Option name. + * @param bool $passed_default Was get_option() passed a default value. + * + * @return mixed The default value to return if the option does not exist in the database. + */ + public static function default_option_waf_ip_allow_list( $default, $option, $passed_default ) { + // Allow get_option() to override this default value + if ( $passed_default ) { + return $default; + } + + $waf_allow_list = ''; + + // If the brute force option exists, use that and flag that the WAF needs to be updated. + $brute_force_allow_list = Jetpack_Options::get_raw_option( 'jetpack_protect_whitelist', false ); + if ( false !== $brute_force_allow_list ) { + $waf_allow_list = self::merge_ip_allow_lists( $waf_allow_list, $brute_force_allow_list ); + update_option( Waf_Initializer::NEEDS_UPDATE_OPTION_NAME, 1 ); + } + + return $waf_allow_list; + } + + /** + * Check if the brute force protection code is being run by an older version of Jetpack (< 12.0). + * + * @since 0.11.1 + * + * @return bool + */ + public static function is_brute_force_running_in_jetpack() { + return defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '12', '<' ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php new file mode 100644 index 00000000..9c0ca1f4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php @@ -0,0 +1,165 @@ + WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::waf', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/waf', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_waf', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + + register_rest_route( + 'jetpack/v4', + '/waf/update-rules', + array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::update_rules', + 'permission_callback' => __CLASS__ . '::waf_permissions_callback', + ) + ); + } + + /** + * Update rules endpoint + * + * @return WP_REST_Response|WP_Error + */ + public static function update_rules() { + try { + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_rules(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return rest_ensure_response( + array( + 'success' => true, + 'message' => __( 'Rules updated succesfully', 'jetpack-waf' ), + ) + ); + } + + /** + * WAF Endpoint + * + * @return WP_REST_Response + */ + public static function waf() { + return rest_ensure_response( Waf_Runner::get_config() ); + } + + /** + * Update WAF Endpoint + * + * @param WP_REST_Request $request The API request. + * + * @return WP_REST_Response|WP_Error + */ + public static function update_waf( $request ) { + // Automatic Rules Enabled + if ( isset( $request[ Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME, (bool) $request->get_param( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ) ); + } + + // IP Lists Enabled + if ( isset( $request[ Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, (bool) $request->get_param( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ) ); + } + + // IP Block List + if ( isset( $request[ Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME, $request[ Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ] ); + } + + // IP Allow List + if ( isset( $request[ Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ] ) ) { + update_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME, $request[ Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ] ); + } + + // Share Data + if ( isset( $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ) ) { + update_option( Waf_Runner::SHARE_DATA_OPTION_NAME, (bool) $request[ Waf_Runner::SHARE_DATA_OPTION_NAME ] ); + } + + // Brute Force Protection + if ( isset( $request['brute_force_protection'] ) ) { + $enable_brute_force = (bool) $request['brute_force_protection']; + $brute_force_protection_toggled = + $enable_brute_force + ? Brute_Force_Protection::enable() + : Brute_Force_Protection::disable(); + + if ( ! $brute_force_protection_toggled ) { + return new WP_Error( + $enable_brute_force + ? 'brute_force_protection_activation_failed' + : 'brute_force_protection_deactivation_failed', + $enable_brute_force + ? __( 'Brute force protection could not be activated.', 'jetpack-waf' ) + : __( 'Brute force protection could not be deactivated.', 'jetpack-waf' ), + array( 'status' => 500 ) + ); + } + } + + try { + Waf_Runner::update_waf(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return self::waf(); + } + + /** + * WAF Endpoint Permissions Callback + * + * @return bool|WP_Error True if user can view the Jetpack admin page. + */ + public static function waf_permissions_callback() { + if ( current_user_can( 'manage_options' ) ) { + return true; + } + + return new WP_Error( + 'invalid_user_permission_manage_options', + REST_Connector::get_user_permissions_error_msg(), + array( 'status' => rest_authorization_required_code() ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php new file mode 100644 index 00000000..70217b1e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php @@ -0,0 +1,166 @@ +] + * : The new mode to be set. + * --- + * options: + * - silent + * - normal + * --- + * + * @param array $args Arguments passed to CLI. + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function mode( $args ) { + if ( count( $args ) > 1 ) { + + return WP_CLI::error( __( 'Only one mode may be specified.', 'jetpack-waf' ) ); + } + if ( count( $args ) === 1 ) { + if ( ! Waf_Runner::is_allowed_mode( $args[0] ) ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the mode that was actually found. Also note that the expected "silent" and "normal" are hard-coded strings and must therefore stay the same in any translation. */ + __( 'Invalid mode: %1$s. Expected "silent" or "normal".', 'jetpack-waf' ), + $args[0] + ) + ); + } + + update_option( Waf_Runner::MODE_OPTION_NAME, $args[0] ); + + try { + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( \Exception $e ) { + WP_CLI::warning( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Unable to generate waf bootstrap - standalone mode may not work properly: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( + sprintf( + /* translators: %1$s is the name of the mode that was just switched to. */ + __( 'Jetpack WAF mode switched to "%1$s".', 'jetpack-waf' ), + get_option( Waf_Runner::MODE_OPTION_NAME ) + ) + ); + } + WP_CLI::line( + sprintf( + /* translators: %1$s is the name of the mode that the waf is currently running in. */ + __( 'Jetpack WAF is running in "%1$s" mode.', 'jetpack-waf' ), + get_option( Waf_Runner::MODE_OPTION_NAME ) + ) + ); + } + + /** + * Setup the WAF to run. + * ## OPTIONS + * + * [] + * : The new mode to be set. + * --- + * options: + * - silent + * - normal + * --- + * + * @param array $args Arguments passed to CLI. + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function setup( $args ) { + // Let is_allowed_mode know we are running from the CLI + define( 'WAF_CLI_MODE', $args[0] ); + + // Set the mode and generate the bootstrap + $this->mode( array( $args[0] ) ); + + try { + // Add relevant options and generate the rules.php file + Waf_Runner::activate(); + } catch ( \Exception $e ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( __( 'Jetpack WAF has successfully been setup.', 'jetpack-waf' ) ); + } + + /** + * Delete the WAF options. + * + * @return void|null + * @throws WP_CLI\ExitException If deactivating has failures. + */ + public function teardown() { + try { + Waf_Runner::deactivate(); + } catch ( \Exception $e ) { + WP_CLI::error( __( 'Jetpack WAF failed to fully deactivate.', 'jetpack-waf' ) ); + } + + return WP_CLI::success( __( 'Jetpack WAF has been deactivated.', 'jetpack-waf' ) ); + } + + /** + * Generate the rules.php file with latest rules for the WAF. + * + * @return void|null + * @throws WP_CLI\ExitException If there is an error switching the mode. + */ + public function generate_rules() { + try { + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_rules(); + } catch ( \Exception $e ) { + + return WP_CLI::error( + sprintf( + /* translators: %1$s is the unexpected error message. */ + __( 'Jetpack WAF rules file failed to generate: %1$s', 'jetpack-waf' ), + $e->getMessage() + ) + ); + } + + return WP_CLI::success( + sprintf( + /* translators: %1$s is the name of the mode that was just switched to. */ + __( 'Jetpack WAF rules successfully created to: "%1$s".', 'jetpack-waf' ), + Waf_Runner::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ) + ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php new file mode 100644 index 00000000..ed82ce6a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php @@ -0,0 +1,104 @@ +is_atomic_platform(); + define( 'DISABLE_JETPACK_WAF', $is_wpcom || $is_atomic ); + } + } + + /** + * Set the mode definition if it has not been set. + * + * @return void + */ + public static function define_mode() { + if ( ! defined( 'JETPACK_WAF_MODE' ) ) { + $mode_option = get_option( Waf_Runner::MODE_OPTION_NAME ); + define( 'JETPACK_WAF_MODE', $mode_option ); + } + } + + /** + * Set the share data definition if it has not been set. + * + * @return void + */ + public static function define_share_data() { + if ( ! defined( 'JETPACK_WAF_SHARE_DATA' ) ) { + $share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false ); + define( 'JETPACK_WAF_SHARE_DATA', $share_data_option ); + } + } + + /** + * Set the brute force protection's API host definition if it has not been set. + * + * @return void + */ + public static function define_brute_force_api_host() { + if ( ! defined( 'JETPACK_PROTECT__API_HOST' ) ) { + define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php new file mode 100644 index 00000000..9608dc41 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php @@ -0,0 +1,188 @@ +generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->on_activation(); + + return true; + } + + /** + * Deactivate the WAF on module deactivation. + * + * @return bool|WP_Error True if the WAF deactivation is successful, WP_Error otherwise. + */ + public static function on_deactivation() { + try { + Waf_Runner::deactivate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + $brute_force_protection = Brute_Force_Protection::instance(); + $brute_force_protection->on_deactivation(); + + return true; + } + + /** + * Updates the WAF after upgrader process is complete. + * + * @param WP_Upgrader $upgrader WP_Upgrader instance. In other contexts this might be a Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. + * @param array $hook_extra Array of bulk item update data. + * + * @return void + */ + public static function update_waf_after_plugin_upgrade( $upgrader, $hook_extra ) { + $jetpack_text_domains_with_waf = array( 'jetpack', 'jetpack-protect' ); + $jetpack_plugins_with_waf = array( 'jetpack/jetpack.php', 'jetpack-protect/jetpack-protect.php' ); + + // Only run on upgrades affecting plugins + if ( 'plugin' !== $hook_extra['type'] ) { + return; + } + + // Only run on updates and installations + if ( 'update' !== $hook_extra['action'] && 'install' !== $hook_extra['action'] ) { + return; + } + + // Only run when Jetpack plugins were affected + if ( 'update' === $hook_extra['action'] && + ! empty( $hook_extra['plugins'] ) && + empty( array_intersect( $jetpack_plugins_with_waf, $hook_extra['plugins'] ) ) + ) { + return; + } + if ( 'install' === $hook_extra['action'] && + ! empty( $upgrader->new_plugin_data['TextDomain'] ) && + empty( in_array( $upgrader->new_plugin_data['TextDomain'], $jetpack_text_domains_with_waf, true ) ) + ) { + return; + } + + update_option( self::NEEDS_UPDATE_OPTION_NAME, 1 ); + } + + /** + * Check for WAF update + * + * Updates the WAF when the "needs update" option is enabled. + * + * @return bool|WP_Error True if the WAF is up-to-date or was sucessfully updated, WP_Error if the update failed. + */ + public static function check_for_waf_update() { + if ( get_option( self::NEEDS_UPDATE_OPTION_NAME ) ) { + // Compatiblity patch for cases where an outdated WAF_Constants class has been + // autoloaded by the standalone bootstrap execution at the beginning of the current request. + if ( ! method_exists( Waf_Constants::class, 'define_mode' ) ) { + try { + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + } + + Waf_Compatibility::run_compatibility_migrations(); + + Waf_Constants::define_mode(); + if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) { + return new WP_Error( 'waf_mode_invalid', 'Invalid firewall mode.' ); + } + + try { + Waf_Rules_Manager::generate_ip_rules(); + Waf_Rules_Manager::generate_rules(); + ( new Waf_Standalone_Bootstrap() )->generate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + } + + update_option( self::NEEDS_UPDATE_OPTION_NAME, 0 ); + return true; + } + + /** + * Disables the WAF module when on an supported platform. + * + * @param array $modules Filterable value for `jetpack_get_available_modules`. + * + * @return array Array of module slugs. + */ + public static function remove_module_on_unsupported_environments( $modules ) { + if ( ! Waf_Runner::is_supported_environment() ) { + // WAF should never be available on unsupported platforms. + unset( $modules['waf'] ); + } + + return $modules; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php new file mode 100644 index 00000000..4f111c79 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php @@ -0,0 +1,286 @@ += intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is greater than the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function gt( $input, $test ) { + return intval( $input ) > intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is less than or equal to the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function le( $input, $test ) { + return intval( $input ) <= intval( $test ) + ? $input + : false; + } + + /** + * Returns true if the input value is less than the test value. + * If either value cannot be converted to an int it will be treated as 0. + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return int|false + */ + public function lt( $input, $test ) { + return intval( $input ) < intval( $test ) + ? $input + : false; + } + + /** + * Returns false. + * + * @return false + */ + public function no_match() { + return false; + } + + /** + * Uses a multi-string matching algorithm to search through $input for a number of given $words. + * + * @param string $input Input. + * @param string[] $words \AhoCorasick\MultiStringMatcher $matcher. + * @return string[]|false Returns the words that were found in $input, or FALSE if no words were found. + */ + public function pm( $input, $words ) { + $results = $this->get_multi_string_matcher( $words )->searchIn( $input ); + + return isset( $results[0] ) + ? array_map( + function ( $r ) { + return $r[1]; }, + $results + ) + : false; + } + + /** + * The last-used pattern-matching algorithm. + * + * @var array + */ + private $last_multi_string_matcher = array( null, null ); + + /** + * Creates a matcher that uses the Aho-Corasick algorithm to efficiently find a number of words in an input string. + * Caches the last-used matcher so that the same word list doesn't have to be compiled multiple times. + * + * @param string[] $words Words. + * @return \AhoCorasick\MultiStringMatcher + */ + private function get_multi_string_matcher( $words ) { + // only create a new matcher entity if we don't have one already for this word list. + if ( $this->last_multi_string_matcher[0] !== $words ) { + $this->last_multi_string_matcher = array( $words, new \AhoCorasick\MultiStringMatcher( $words ) ); + } + + return $this->last_multi_string_matcher[1]; + } + + /** + * Performs a regular expression match on the input subject using the given pattern. + * Returns false if the pattern does not match, or the substring(s) of the input + * that were matched by the pattern. + * + * @param string $subject Subject. + * @param string $pattern Pattern. + * @return string[]|false + */ + public function rx( $subject, $pattern ) { + $matched = preg_match( $pattern, $subject, $matches ); + return 1 === $matched + ? $matches + : false; + } + + /** + * Returns true if the given input string matches the test string. + * + * @param string $input Input. + * @param string $test Test. + * @return string|false + */ + public function streq( $input, $test ) { + return $input === $test + ? $test + : false; + } + + /** + * Returns true. + * + * @param string $input Input. + * @return bool + */ + public function unconditional_match( $input ) { + return $input; + } + + /** + * Checks to see if the input string only contains characters within the given byte range + * + * @param string $input Input. + * @param array $valid_range Valid range. + * @return string + */ + public function validate_byte_range( $input, $valid_range ) { + if ( '' === $input ) { + // an empty string is considered "valid". + return false; + } + $i = 0; + while ( isset( $input[ $i ] ) ) { + $n = ord( $input[ $i ] ); + if ( $n < $valid_range['min'] || $n > $valid_range['max'] ) { + return $input[ $i ]; + } + $valid = false; + foreach ( $valid_range['range'] as $b ) { + if ( $n === $b || is_array( $b ) && $n >= $b[0] && $n <= $b[1] ) { + $valid = true; + break; + } + } + if ( ! $valid ) { + return $input[ $i ]; + } + ++$i; + } + + // if there weren't any invalid bytes, return false. + return false; + } + + /** + * Returns true if the input value is found anywhere inside the test value + * (i.e. the inverse of @contains) + * + * @param mixed $input Input. + * @param mixed $test Test. + * @return string|false + */ + public function within( $input, $test ) { + if ( '' === $input || '' === $test ) { + return false; + } + + return stripos( $test, $input ) !== false + ? $input + : false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php new file mode 100644 index 00000000..9d55d479 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php @@ -0,0 +1,329 @@ +url = [ 'https://wordpress.com', '/index.php', '?myvar=red' ] + * @var array{ 0: string, 1: string, 2: string }|null + */ + protected $url = null; + + /** + * Trusted proxies. + * + * @var array List of trusted proxy IP addresses. + */ + private $trusted_proxies = array(); + + /** + * Trusted headers. + * + * @var array List of headers to trust from the trusted proxies. + */ + private $trusted_headers = array(); + + /** + * Sets the list of IP addresses for the proxies to trust. Trusted headers will only be accepted as the + * user IP address from these IP adresses. + * + * Popular choices include: + * - 192.168.0.1 + * - 10.0.0.1 + * + * @param array $proxies List of proxy IP addresses. + * @return void + */ + public function set_trusted_proxies( $proxies ) { + $this->trusted_proxies = (array) $proxies; + } + + /** + * Sets the list of headers to be trusted from the proxies. These headers will only be taken into account + * if the request comes from a trusted proxy as configured with set_trusted_proxies(). + * + * Popular choices include: + * - HTTP_CLIENT_IP + * - HTTP_X_FORWARDED_FOR + * - HTTP_X_FORWARDED + * - HTTP_X_CLUSTER_CLIENT_IP + * - HTTP_FORWARDED_FOR + * - HTTP_FORWARDED + * + * @param array $headers List of HTTP header strings. + * @return void + */ + public function set_trusted_headers( $headers ) { + $this->trusted_headers = (array) $headers; + } + + /** + * Determines the users real IP address based on the settings passed to set_trusted_proxies() and + * set_trusted_headers() before. On CLI, this will be null. + * + * @return string|null + */ + public function get_real_user_ip_address() { + $remote_addr = ! empty( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + + if ( in_array( $remote_addr, $this->trusted_proxies, true ) ) { + $ip_by_header = $this->get_ip_by_header( array_merge( $this->trusted_headers, array( 'REMOTE_ADDR' ) ) ); + if ( ! empty( $ip_by_header ) ) { + return $ip_by_header; + } + } + + return $remote_addr; + } + + /** + * Iterates through a given list of HTTP headers and attempts to get the IP address from the header that + * a proxy sends along. Make sure you trust the IP address before calling this method. + * + * @param array $headers The list of headers to check. + * @return string|null + */ + private function get_ip_by_header( $headers ) { + foreach ( $headers as $key ) { + if ( isset( $_SERVER[ $key ] ) ) { + foreach ( explode( ',', wp_unslash( $_SERVER[ $key ] ) ) as $ip ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- filter_var is applied below. + $ip = trim( $ip ); + + if ( filter_var( $ip, FILTER_VALIDATE_IP ) !== false ) { + return $ip; + } + } + } + } + + return null; + } + + /** + * Returns the headers that were sent with this request + * + * @return array{ 0: string, 1: scalar }[] + */ + public function get_headers() { + $value = array(); + $has_content_type = false; + $has_content_length = false; + foreach ( $_SERVER as $k => $v ) { + $k = strtolower( $k ); + if ( 'http_' === substr( $k, 0, 5 ) ) { + $value[] = array( $this->normalize_header_name( substr( $k, 5 ) ), $v ); + } elseif ( 'content_type' === $k && '' !== $v ) { + $has_content_type = true; + $value[] = array( 'content-type', $v ); + } elseif ( 'content_length' === $k && '' !== $v ) { + $has_content_length = true; + $value[] = array( 'content-length', $v ); + } + } + if ( ! $has_content_type ) { + // default Content-Type per RFC 7231 section 3.1.5.5. + $value[] = array( 'content-type', 'application/octet-stream' ); + } + if ( ! $has_content_length ) { + $value[] = array( 'content-length', '0' ); + } + + return $value; + } + + /** + * Change a header name to all-lowercase and replace spaces and underscores with dashes. + * + * @param string $name The header name to normalize. + * @return string + */ + public function normalize_header_name( $name ) { + return str_replace( array( ' ', '_' ), '-', strtolower( $name ) ); + } + + /** + * Get the method for this request (GET, POST, etc). + * + * @return string + */ + public function get_method() { + return isset( $_SERVER['REQUEST_METHOD'] ) + ? filter_var( wp_unslash( $_SERVER['REQUEST_METHOD'] ), FILTER_DEFAULT ) + : ''; + } + + /** + * Get the protocol for this request (HTTP, HTTPS, etc) + * + * @return string + */ + public function get_protocol() { + return isset( $_SERVER['SERVER_PROTOCOL'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_PROTOCOL'] ), FILTER_DEFAULT ) + : ''; + } + + /** + * Returns the URL parts for this request. + * + * @see $this->url + * @return array{ 0: string, 1: string, 2: string } + */ + protected function get_url() { + if ( null !== $this->url ) { + return $this->url; + } + + $uri = isset( $_SERVER['REQUEST_URI'] ) ? filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ), FILTER_DEFAULT ) : '/'; + if ( false !== strpos( $uri, '?' ) ) { + // remove the query string (we'll pull it from elsewhere later) + $uri = substr( $uri, 0, strpos( $uri, '?' ) ); + } + $query_string = isset( $_SERVER['QUERY_STRING'] ) ? '?' . filter_var( wp_unslash( $_SERVER['QUERY_STRING'] ), FILTER_DEFAULT ) : ''; + if ( 1 === preg_match( '/^https?:\/\//', $uri ) ) { + // sometimes $_SERVER[REQUEST_URI] already includes the full domain name + $uri_host = substr( $uri, 0, strpos( $uri, '/', 8 ) ); + $uri_path = substr( $uri, strlen( $uri_host ) ); + $this->url = array( $uri_host, $uri_path, $query_string ); + } else { + // otherwise build the URI manually + $uri_scheme = ( ! empty( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ) + ? 'https' + : 'http'; + $uri_host = isset( $_SERVER['HTTP_HOST'] ) + ? filter_var( wp_unslash( $_SERVER['HTTP_HOST'] ), FILTER_DEFAULT ) + : ( + isset( $_SERVER['SERVER_NAME'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_NAME'] ), FILTER_DEFAULT ) + : '' + ); + $uri_port = isset( $_SERVER['SERVER_PORT'] ) + ? filter_var( wp_unslash( $_SERVER['SERVER_PORT'] ), FILTER_SANITIZE_NUMBER_INT ) + : ''; + // we only need to include the port if it's non-standard + if ( $uri_port && ( 'http' === $uri_scheme && '80' !== $uri_port || 'https' === $uri_scheme && '443' !== $uri_port ) ) { + $uri_port = ':' . $uri_port; + } else { + $uri_port = ''; + } + $this->url = array( + $uri_scheme . '://' . $uri_host . $uri_port, + $uri, + $query_string, + ); + } + return $this->url; + } + + /** + * Get the requested URI + * + * @param boolean $include_host If true, the scheme and domain will be included in the returned string (i.e. 'https://wordpress.com/index.php). + * If false, only the requested URI path will be returned (i.e. '/index.php'). + * @return string + */ + public function get_uri( $include_host = false ) { + list( $host, $file, $query ) = $this->get_url(); + + return ( $include_host ? $host : '' ) . $file . $query; + } + + /** + * Return the filename part of the request + * + * @example for 'https://wordpress.com/some/page?id=5', return '/some/page' + * @return string + */ + public function get_filename() { + return $this->get_url()[1]; + } + + /** + * Return the query string. If present, it will be prefixed with '?'. Otherwise, it will be an empty string. + * + * @return string + */ + public function get_query_string() { + return $this->get_url()[2]; + } + + /** + * Returns the request body. + * + * @return string + */ + public function get_body() { + $body = file_get_contents( 'php://input' ); + return false === $body ? '' : $body; + } + + /** + * Returns the cookies + * + * @return array + */ + public function get_cookies() { + return flatten_array( $_COOKIE ); + } + + /** + * Returns the GET variables + * + * @return array + */ + public function get_get_vars() { + return flatten_array( $_GET ); + } + + /** + * Returns the POST variables + * + * @return array + */ + public function get_post_vars() { + return flatten_array( $_POST ); + } + + /** + * Returns the files that were uploaded with this request (i.e. what's in the $_FILES superglobal) + * + * @return RequestFile[] + */ + public function get_files() { + $files = array(); + foreach ( $_FILES as $field_name => $arr ) { + // flatten the values in case we were given inputs with brackets + foreach ( flatten_array( $arr ) as list( $arr_key, $arr_value ) ) { + if ( $arr_key === 'name' ) { + // if this file was a simple (non-nested) name and unique, then just add it. + $files[] = array( + 'name' => $field_name, + 'filename' => $arr_value, + ); + } elseif ( 'name[' === substr( $arr_key, 0, 5 ) ) { + // otherwise this was a file with a nested name and/or multiple files with the same name + $files[] = array( + 'name' => $field_name . substr( $arr_key, 4 ), + 'filename' => $arr_value, + ); + } + } + } + return $files; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php new file mode 100644 index 00000000..2c9f8901 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php @@ -0,0 +1,323 @@ +get_wp_error(); + } + + update_option( self::RULE_LAST_UPDATED_OPTION_NAME, time() ); + return true; + } + + /** + * Re-activate the WAF any time an option is added or updated. + * + * @return bool|WP_Error True if re-activation is successful, WP_Error on failure. + */ + public static function reactivate_on_rules_option_change() { + try { + Waf_Runner::activate(); + } catch ( Waf_Exception $e ) { + return $e->get_wp_error(); + } + + return true; + } + + /** + * Updates the rule set if rules version has changed + * + * @throws Waf_Exception If the firewall mode is invalid. + * @throws Waf_Exception If the rules update fails. + * + * @return void + */ + public static function update_rules_if_changed() { + Waf_Constants::define_mode(); + if ( ! Waf_Runner::is_allowed_mode( JETPACK_WAF_MODE ) ) { + throw new Waf_Exception( 'Invalid firewall mode.' ); + } + $version = get_option( self::VERSION_OPTION_NAME ); + if ( self::RULES_VERSION !== $version ) { + self::generate_automatic_rules(); + self::generate_ip_rules(); + self::generate_rules(); + + update_option( self::VERSION_OPTION_NAME, self::RULES_VERSION ); + } + } + + /** + * Retrieve rules from the API + * + * @throws Waf_Exception If site is not registered. + * @throws Rules_API_Exception If API did not respond 200. + * @throws Rules_API_Exception If data is missing from response. + * + * @return array + */ + public static function get_rules_from_api() { + $blog_id = Jetpack_Options::get_option( 'id' ); + if ( ! $blog_id ) { + throw new Waf_Exception( 'Site is not registered' ); + } + + $response = Client::wpcom_json_api_request_as_blog( + sprintf( '/sites/%s/waf-rules', $blog_id ), + '2', + array(), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( 200 !== $response_code ) { + throw new Rules_API_Exception( 'API connection failed.', (int) $response_code ); + } + + $rules_json = wp_remote_retrieve_body( $response ); + $rules = json_decode( $rules_json, true ); + + if ( empty( $rules['data'] ) ) { + throw new Rules_API_Exception( 'Data missing from response.' ); + } + + return $rules['data']; + } + + /** + * Wraps a require statement in a file_exists check. + * + * @param string $required_file The file to check if exists and require. + * @param string $return_code The PHP code to execute if the file require returns true. Defaults to 'return;'. + * + * @return string The wrapped require statement. + */ + private static function wrap_require( $required_file, $return_code = 'return;' ) { + return "if ( file_exists( '$required_file' ) ) { if ( require( '$required_file' ) ) { $return_code } }"; + } + + /** + * Generates the rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws File_System_Exception If file writing fails initializing rule files. + * @throws File_System_Exception If file writing fails writing to the rules entrypoint file. + * + * @return void + */ + public static function generate_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $rules = "is_dir( dirname( $entrypoint_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $entrypoint_file_path ) ); + } + + // Ensure all potentially required rule files exist + $rule_files = array( self::RULES_ENTRYPOINT_FILE, self::AUTOMATIC_RULES_FILE, self::IP_ALLOW_RULES_FILE, self::IP_BLOCK_RULES_FILE ); + foreach ( $rule_files as $rule_file ) { + $rule_file = Waf_Runner::get_waf_file_path( $rule_file ); + if ( ! $wp_filesystem->is_file( $rule_file ) ) { + if ( ! $wp_filesystem->put_contents( $rule_file, "block( 'block', -1, 'ip block list' );" ) . "\n"; + } + + // Add automatic rules + if ( get_option( self::AUTOMATIC_RULES_ENABLED_OPTION_NAME ) ) { + $rules .= self::wrap_require( Waf_Runner::get_waf_file_path( self::AUTOMATIC_RULES_FILE ) ) . "\n"; + } + + // Update the rules file + if ( ! $wp_filesystem->put_contents( $entrypoint_file_path, $rules ) ) { + throw new File_System_Exception( 'Failed writing rules file to: ' . $entrypoint_file_path ); + } + } + + /** + * Generates the automatic-rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws Waf_Exception If rules cannot be fetched from the API. + * @throws File_System_Exception If file writing fails. + * + * @return void + */ + public static function generate_automatic_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $automatic_rules_file_path = Waf_Runner::get_waf_file_path( self::AUTOMATIC_RULES_FILE ); + + // Ensure that the folder exists. + if ( ! $wp_filesystem->is_dir( dirname( $automatic_rules_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $automatic_rules_file_path ) ); + } + + try { + $rules = self::get_rules_from_api(); + } catch ( Waf_Exception $e ) { + // Do not throw API exceptions for users who do not have access + if ( 401 !== $e->getCode() ) { + throw $e; + } + } + + // If there are no rules available, don't overwrite the existing file. + if ( empty( $rules ) ) { + return; + } + + if ( ! $wp_filesystem->put_contents( $automatic_rules_file_path, $rules ) ) { + throw new File_System_Exception( 'Failed writing automatic rules file to: ' . $automatic_rules_file_path ); + } + + update_option( self::AUTOMATIC_RULES_LAST_UPDATED_OPTION_NAME, time() ); + } + + /** + * Generates the rules.php script + * + * @global \WP_Filesystem_Base $wp_filesystem WordPress filesystem abstraction. + * + * @throws File_System_Exception If writing to IP allow list file fails. + * @throws File_System_Exception If writing to IP block list file fails. + * + * @return void + */ + public static function generate_ip_rules() { + global $wp_filesystem; + Waf_Runner::initialize_filesystem(); + + $allow_ip_file_path = Waf_Runner::get_waf_file_path( self::IP_ALLOW_RULES_FILE ); + $block_ip_file_path = Waf_Runner::get_waf_file_path( self::IP_BLOCK_RULES_FILE ); + + // Ensure that the folders exists. + if ( ! $wp_filesystem->is_dir( dirname( $allow_ip_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $allow_ip_file_path ) ); + } + if ( ! $wp_filesystem->is_dir( dirname( $block_ip_file_path ) ) ) { + $wp_filesystem->mkdir( dirname( $block_ip_file_path ) ); + } + + $allow_list = IP_Utils::get_ip_addresses_from_string( get_option( self::IP_ALLOW_LIST_OPTION_NAME ) ); + $block_list = IP_Utils::get_ip_addresses_from_string( get_option( self::IP_BLOCK_LIST_OPTION_NAME ) ); + + $allow_rules_content = ''; + // phpcs:disable WordPress.PHP.DevelopmentFunctions + $allow_rules_content .= '$waf_allow_list = ' . var_export( $allow_list, true ) . ";\n"; + // phpcs:enable + $allow_rules_content .= 'return $waf->is_ip_in_array( $waf_allow_list );' . "\n"; + + if ( ! $wp_filesystem->put_contents( $allow_ip_file_path, "is_ip_in_array( $waf_block_list );' . "\n"; + + if ( ! $wp_filesystem->put_contents( $block_ip_file_path, "is_atomic_platform() ) { + return false; + } + + // Do not run on the VIP platform + if ( ( new Host() )->is_vip_site() ) { + return false; + } + + return true; + } + + /** + * Determines if the WAF module is enabled on the site. + * + * @return bool + */ + public static function is_enabled() { + // if ABSPATH is defined, then WordPress has already been instantiated, + // so we can check to see if the waf module is activated. + if ( defined( 'ABSPATH' ) ) { + return ( new Modules() )->is_active( self::WAF_MODULE_NAME ); + } + + return true; + } + + /** + * Enables the WAF module on the site. + * + * @return bool + */ + public static function enable() { + return ( new Modules() )->activate( self::WAF_MODULE_NAME, false, false ); + } + + /** + * Disabled the WAF module on the site. + * + * @return bool + */ + public static function disable() { + return ( new Modules() )->deactivate( self::WAF_MODULE_NAME ); + } + + /** + * Get Config + * + * @return array The WAF settings and current configuration data. + */ + public static function get_config() { + return array( + Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME => get_option( Waf_Rules_Manager::AUTOMATIC_RULES_ENABLED_OPTION_NAME ), + Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME => get_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME ), + Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_ALLOW_LIST_OPTION_NAME ), + Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME => get_option( Waf_Rules_Manager::IP_BLOCK_LIST_OPTION_NAME ), + self::SHARE_DATA_OPTION_NAME => get_option( self::SHARE_DATA_OPTION_NAME ), + 'bootstrap_path' => self::get_bootstrap_file_path(), + 'automatic_rules_available' => (bool) self::automatic_rules_available(), + 'brute_force_protection' => (bool) Brute_Force_Protection::is_enabled(), + ); + } + + /** + * Get Bootstrap File Path + * + * @return string The path to the Jetpack Firewall's bootstrap.php file. + */ + private static function get_bootstrap_file_path() { + $bootstrap = new Waf_Standalone_Bootstrap(); + return $bootstrap->get_bootstrap_file_path(); + } + + /** + * Get WAF File Path + * + * @param string $file The file path starting in the WAF directory. + * @return string The full file path to the provided file in the WAF directory. + */ + public static function get_waf_file_path( $file ) { + Waf_Constants::define_waf_directory(); + + // Ensure the file path starts with a slash. + if ( '/' !== substr( $file, 0, 1 ) ) { + $file = "/$file"; + } + + return JETPACK_WAF_DIR . $file; + } + + /** + * Runs the WAF and potentially stops the request if a problem is found. + * + * @return void + */ + public static function run() { + // Make double-sure we are only running once. + if ( self::did_run() ) { + return; + } + + Waf_Constants::initialize_constants(); + + // if ABSPATH is defined, then WordPress has already been instantiated, + // and we're running as a plugin (meh). Otherwise, we're running via something + // like PHP's prepend_file setting (yay!). + define( 'JETPACK_WAF_RUN', defined( 'ABSPATH' ) ? 'plugin' : 'preload' ); + + // if the WAF is being run before a command line script, don't try to execute rules (there's no request). + if ( PHP_SAPI === 'cli' ) { + return; + } + + // if something terrible happens during the WAF running, we don't want to interfere with the rest of the site, + // so we intercept errors ONLY while the WAF is running, then we remove our handler after the WAF finishes. + $display_errors = ini_get( 'display_errors' ); + // phpcs:ignore + ini_set( 'display_errors', 'Off' ); + // phpcs:ignore + set_error_handler( array( self::class, 'errorHandler' ) ); + + try { + + // phpcs:ignore + $waf = new Waf_Runtime( new Waf_Transforms(), new Waf_Operators() ); + + // execute waf rules. + $rules_file_path = self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ); + if ( file_exists( $rules_file_path ) ) { + // phpcs:ignore + include $rules_file_path; + } + } catch ( \Exception $err ) { // phpcs:ignore + // Intentionally doing nothing. + } + + // remove the custom error handler, so we don't interfere with the site. + restore_error_handler(); + // phpcs:ignore + ini_set( 'display_errors', $display_errors ); + } + + /** + * Error handler to be used while the WAF is being executed. + * + * @param int $code The error code. + * @param string $message The error message. + * @param string $file File with the error. + * @param string $line Line of the error. + * @return void + */ + public static function errorHandler( $code, $message, $file, $line ) { // phpcs:ignore + // Intentionally doing nothing for now. + } + + /** + * Initializes the WP filesystem and WAF directory structure. + * + * @throws File_System_Exception If filesystem is unavailable. + * + * @return void + */ + public static function initialize_filesystem() { + if ( ! function_exists( '\\WP_Filesystem' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + if ( ! \WP_Filesystem() ) { + throw new File_System_Exception( 'No filesystem available.' ); + } + + self::initialize_waf_directory(); + } + + /** + * Activates the WAF by generating the rules script and setting the version + * + * @throws Waf_Exception If the firewall mode is invalid. + * @throws Waf_Exception If the activation fails. + * + * @return void + */ + public static function activate() { + Waf_Constants::define_mode(); + if ( ! self::is_allowed_mode( JETPACK_WAF_MODE ) ) { + throw new Waf_Exception( 'Invalid firewall mode.' ); + } + + $version = get_option( Waf_Rules_Manager::VERSION_OPTION_NAME ); + if ( ! $version ) { + add_option( Waf_Rules_Manager::VERSION_OPTION_NAME, Waf_Rules_Manager::RULES_VERSION ); + } + + add_option( self::SHARE_DATA_OPTION_NAME, true ); + + self::initialize_filesystem(); + + Waf_Rules_Manager::generate_automatic_rules(); + Waf_Rules_Manager::generate_ip_rules(); + Waf_Rules_Manager::generate_rules(); + + self::create_blocklog_table(); + } + + /** + * Ensures that the waf directory is created. + * + * @throws File_System_Exception If filesystem is unavailable. + * @throws File_System_Exception If creating the directory fails. + * + * @return void + */ + public static function initialize_waf_directory() { + WP_Filesystem(); + Waf_Constants::define_waf_directory(); + + global $wp_filesystem; + if ( ! $wp_filesystem ) { + throw new File_System_Exception( 'Can not work without the file system being initialized.' ); + } + + if ( ! $wp_filesystem->is_dir( JETPACK_WAF_DIR ) ) { + if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) { + throw new File_System_Exception( 'Failed creating WAF file directory: ' . JETPACK_WAF_DIR ); + } + } + } + + /** + * Create the log table when plugin is activated. + * + * @return void + */ + public static function create_blocklog_table() { + global $wpdb; + + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + + $sql = " + CREATE TABLE {$wpdb->prefix}jetpack_waf_blocklog ( + log_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + timestamp datetime NOT NULL, + rule_id BIGINT NOT NULL, + reason longtext NOT NULL, + PRIMARY KEY (log_id), + KEY timestamp (timestamp) + ) + "; + + dbDelta( $sql ); + } + + /** + * Deactivates the WAF by deleting the relevant options and emptying rules file. + * + * @throws File_System_Exception If file writing fails. + * + * @return void + */ + public static function deactivate() { + delete_option( self::MODE_OPTION_NAME ); + delete_option( Waf_Rules_Manager::VERSION_OPTION_NAME ); + + global $wp_filesystem; + self::initialize_filesystem(); + + // If the rules file doesn't exist, there's nothing else to do. + if ( ! $wp_filesystem->exists( self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ) ) ) { + return; + } + + // Empty the rules entrypoint file. + if ( ! $wp_filesystem->put_contents( self::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE ), "generate(); + } + + /** + * Check if an automatic rules file is available + * + * @return bool False if an automatic rules file is not available, true otherwise + */ + public static function automatic_rules_available() { + $automatic_rules_last_updated = get_option( Waf_Rules_Manager::AUTOMATIC_RULES_LAST_UPDATED_OPTION_NAME ); + + // If we do not have a automatic rules last updated timestamp cached, return false. + if ( ! $automatic_rules_last_updated ) { + return false; + } + + // Validate that the automatic rules file exists and is not empty. + global $wp_filesystem; + + try { + self::initialize_filesystem(); + } catch ( Waf_Exception $e ) { + return false; + } + + $automatic_rules_file_contents = $wp_filesystem->get_contents( self::get_waf_file_path( Waf_Rules_Manager::AUTOMATIC_RULES_FILE ) ); + + // If the automatic rules file was removed or is now empty, return false. + if ( ! $automatic_rules_file_contents || " + */ +class Waf_Runtime { + /** + * If used, normalize_array_targets() will just return the number of matching values, instead of the values themselves. + */ + const NORMALIZE_ARRAY_COUNT = 1; + /** + * If used, normalize_array_targets() will apply "only" and "except" filters to the values of the source array, instead of the keys. + */ + const NORMALIZE_ARRAY_MATCH_VALUES = 2; + + /** + * Last rule. + * + * @var string + */ + public $last_rule = ''; + /** + * Matched vars. + * + * @var array + */ + public $matched_vars = array(); + /** + * Matched var. + * + * @var string + */ + public $matched_var = ''; + /** + * Matched var names. + * + * @var array + */ + public $matched_var_names = array(); + /** + * Matched var name. + * + * @var string + */ + public $matched_var_name = ''; + + /** + * State. + * + * @var array + */ + private $state = array(); + /** + * Metadata. + * + * @var array + */ + private $metadata = array(); + + /** + * Transforms. + * + * @var Waf_Transforms + */ + private $transforms; + /** + * Operators. + * + * @var Waf_Operators + */ + private $operators; + + /** + * The request + * + * @var Waf_Request + */ + private $request; + + /** + * Rules to remove. + * + * @var array[] + */ + private $rules_to_remove = array( + 'id' => array(), + 'tag' => array(), + ); + + /** + * Targets to remove. + * + * @var array[] + */ + private $targets_to_remove = array( + 'id' => array(), + 'tag' => array(), + ); + + /** + * Constructor method. + * + * @param Waf_Transforms $transforms Transforms. + * @param Waf_Operators $operators Operators. + * @param Waf_Request? $request Information about the request. + */ + public function __construct( $transforms, $operators, $request = null ) { + $this->transforms = $transforms; + $this->operators = $operators; + $this->request = null === $request + ? new Waf_Request() + : $request; + } + + /** + * Rule removed method. + * + * @param string $id Ids. + * @param string[] $tags Tags. + */ + public function rule_removed( $id, $tags ) { + if ( isset( $this->rules_to_remove['id'][ $id ] ) ) { + return true; + } + foreach ( $tags as $tag ) { + if ( isset( $this->rules_to_remove['tag'][ $tag ] ) ) { + return true; + } + } + return false; + } + + /** + * Update Targets. + * + * @param array $targets Targets. + * @param string $rule_id Rule id. + * @param string[] $rule_tags Rule tags. + */ + public function update_targets( $targets, $rule_id, $rule_tags ) { + $updates = array(); + // look for target updates based on the rule's ID. + if ( isset( $this->targets_to_remove['id'][ $rule_id ] ) ) { + foreach ( $this->targets_to_remove['id'][ $rule_id ] as $name => $props ) { + $updates[] = array( $name, $props ); + } + } + // look for target updates based on the rule's tags. + foreach ( $rule_tags as $tag ) { + if ( isset( $this->targets_to_remove['tag'][ $tag ] ) ) { + foreach ( $this->targets_to_remove['tag'][ $tag ] as $name => $props ) { + $updates[] = array( $name, $props ); + } + } + } + // apply any found target updates. + + foreach ( $updates as list( $name, $props ) ) { + if ( isset( $targets[ $name ] ) ) { + // we only need to remove targets that exist. + if ( true === $props ) { + // if the entire target is being removed, remove it. + unset( $targets[ $name ] ); + } else { + // otherwise just mark single props to ignore. + $targets[ $name ]['except'] = array_merge( + isset( $targets[ $name ]['except'] ) ? $targets[ $name ]['except'] : array(), + $props + ); + } + } + } + return $targets; + } + + /** + * Return TRUE if at least one of the targets matches the rule. + * + * @param string[] $transforms One of the transform methods defined in the Jetpack Waf_Transforms class. + * @param TargetBag $targets Targets. + * @param string $match_operator Match operator. + * @param mixed $match_value Match value. + * @param bool $match_not Match not. + * @param bool $capture Capture. + * @return bool + */ + public function match_targets( $transforms, $targets, $match_operator, $match_value, $match_not, $capture = false ) { + $this->matched_vars = array(); + $this->matched_var_names = array(); + $this->matched_var = ''; + $this->matched_var_name = ''; + $match_found = false; + + // get values. + $values = $this->normalize_targets( $targets ); + + // apply transforms. + foreach ( $transforms as $t ) { + foreach ( $values as &$v ) { + $v['value'] = $this->transforms->$t( $v['value'] ); + } + } + + // pass each target value to the operator to find any that match. + $matched = array(); + $captures = array(); + foreach ( $values as $v ) { + $match = $this->operators->{$match_operator}( $v['value'], $match_value ); + $did_match = false !== $match; + if ( $match_not !== $did_match ) { + // If either: + // - rule is negated ("not" flag set) and the target was not matched + // - rule not negated and the target was matched + // then this is considered a match. + $match_found = true; + $this->matched_var_names[] = $v['source']; + $this->matched_vars[] = $v['value']; + $this->matched_var_name = end( $this->matched_var_names ); + $this->matched_var = end( $this->matched_vars ); + $matched[] = array( $v, $match ); + // Set any captured matches into state if the rule has the "capture" flag. + if ( $capture ) { + $captures = is_array( $match ) ? $match : array( $match ); + foreach ( array_slice( $captures, 0, 10 ) as $i => $c ) { + $this->set_var( "tx.$i", $c ); + } + } + } + } + + return $match_found; + } + + /** + * Block. + * + * @param string $action Action. + * @param string $rule_id Rule id. + * @param string $reason Block reason. + * @param int $status_code Http status code. + */ + public function block( $action, $rule_id, $reason, $status_code = 403 ) { + if ( ! $reason ) { + $reason = "rule $rule_id"; + } else { + $reason = $this->sanitize_output( $reason ); + } + + $this->write_blocklog( $rule_id, $reason ); + error_log( "Jetpack WAF Blocked Request\t$action\t$rule_id\t$status_code\t$reason" ); + header( "X-JetpackWAF-Blocked: $status_code - rule $rule_id" ); + if ( defined( 'JETPACK_WAF_MODE' ) && 'normal' === JETPACK_WAF_MODE ) { + $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? wp_unslash( $_SERVER['SERVER_PROTOCOL'] ) : 'HTTP'; + header( $protocol . ' 403 Forbidden', true, $status_code ); + die( "rule $rule_id - reason $reason" ); + } + } + + /** + * Write block logs. We won't write to the file if it exceeds 100 mb. + * + * @param string $rule_id Rule id. + * @param string $reason Block reason. + */ + public function write_blocklog( $rule_id, $reason ) { + $log_data = array(); + $log_data['rule_id'] = $rule_id; + $log_data['reason'] = $reason; + $log_data['timestamp'] = gmdate( 'Y-m-d H:i:s' ); + + if ( defined( 'JETPACK_WAF_SHARE_DATA' ) && JETPACK_WAF_SHARE_DATA ) { + $file_path = JETPACK_WAF_DIR . '/waf-blocklog'; + $file_exists = file_exists( $file_path ); + + if ( ! $file_exists || filesize( $file_path ) < ( 100 * 1024 * 1024 ) ) { + $fp = fopen( $file_path, 'a+' ); + + if ( $fp ) { + try { + fwrite( $fp, json_encode( $log_data ) . "\n" ); + } finally { + fclose( $fp ); + } + } + } + } + + $this->write_blocklog_row( $log_data ); + } + + /** + * Write block logs to database. + * + * @param array $log_data Log data. + */ + private function write_blocklog_row( $log_data ) { + $conn = $this->connect_to_wordpress_db(); + + if ( ! $conn ) { + return; + } + + global $table_prefix; + + $statement = $conn->prepare( "INSERT INTO {$table_prefix}jetpack_waf_blocklog(reason,rule_id, timestamp) VALUES (?, ?, ?)" ); + if ( false !== $statement ) { + $statement->bind_param( 'sis', $log_data['reason'], $log_data['rule_id'], $log_data['timestamp'] ); + $statement->execute(); + + if ( $conn->insert_id > 100 ) { + $conn->query( "DELETE FROM {$table_prefix}jetpack_waf_blocklog ORDER BY log_id LIMIT 1" ); + } + } + } + + /** + * Connect to WordPress database. + */ + private function connect_to_wordpress_db() { + if ( ! file_exists( JETPACK_WAF_WPCONFIG ) ) { + return; + } + + require_once JETPACK_WAF_WPCONFIG; + $conn = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME ); // phpcs:ignore WordPress.DB.RestrictedClasses.mysql__mysqli + + if ( $conn->connect_error ) { + error_log( 'Could not connect to the database:' . $conn->connect_error ); + return null; + } + + return $conn; + } + + /** + * Redirect. + * + * @param string $rule_id Rule id. + * @param string $url Url. + */ + public function redirect( $rule_id, $url ) { + error_log( "Jetpack WAF Redirected Request.\tRule:$rule_id\t$url" ); + header( "Location: $url" ); + exit; + } + + /** + * Flag rule for removal. + * + * @param string $prop Prop. + * @param string $value Value. + */ + public function flag_rule_for_removal( $prop, $value ) { + if ( 'id' === $prop ) { + $this->rules_to_remove['id'][ $value ] = true; + } else { + $this->rules_to_remove['tag'][ $value ] = true; + } + } + + /** + * Flag target for removal. + * + * @param string $id_or_tag Id or tag. + * @param string $id_or_tag_value Id or tag value. + * @param string $name Name. + * @param string $prop Prop. + */ + public function flag_target_for_removal( $id_or_tag, $id_or_tag_value, $name, $prop = null ) { + if ( null === $prop ) { + $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] = true; + } elseif ( + ! isset( $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] ) + // if the entire target is already being removed then it would be redundant to remove a single property. + || true !== $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ] + ) { + $this->targets_to_remove[ $id_or_tag ][ $id_or_tag_value ][ $name ][] = $prop; + } + } + + /** + * Get variable value. + * + * @param string $key Key. + */ + public function get_var( $key ) { + return isset( $this->state[ $key ] ) + ? $this->state[ $key ] + : ''; + } + + /** + * Set variable value. + * + * @param string $key Key. + * @param string $value Value. + */ + public function set_var( $key, $value ) { + $this->state[ $key ] = $value; + } + + /** + * Increment variable. + * + * @param string $key Key. + * @param mixed $value Value. + */ + public function inc_var( $key, $value ) { + if ( ! isset( $this->state[ $key ] ) ) { + $this->state[ $key ] = 0; + } + $this->state[ $key ] += floatval( $value ); + } + + /** + * Decrement variable. + * + * @param string $key Key. + * @param mixed $value Value. + */ + public function dec_var( $key, $value ) { + if ( ! isset( $this->state[ $key ] ) ) { + $this->state[ $key ] = 0; + } + $this->state[ $key ] -= floatval( $value ); + } + + /** + * Unset variable. + * + * @param string $key Key. + */ + public function unset_var( $key ) { + unset( $this->state[ $key ] ); + } + + /** + * A cache of metadata about the incoming request. + * + * @param string $key The type of metadata to request ('headers', 'request_method', etc.). + */ + public function meta( $key ) { + if ( ! isset( $this->metadata[ $key ] ) ) { + $value = null; + switch ( $key ) { + case 'headers': + $value = $this->request->get_headers(); + break; + case 'headers_names': + $value = $this->args_names( $this->meta( 'headers' ) ); + break; + case 'request_method': + $value = $this->request->get_method(); + break; + case 'request_protocol': + $value = $this->request->get_protocol(); + break; + case 'request_uri': + $value = $this->request->get_uri( false ); + break; + case 'request_uri_raw': + $value = $this->request->get_uri( true ); + break; + case 'request_filename': + $value = $this->request->get_filename(); + break; + case 'request_line': + $value = sprintf( + '%s %s %s', + $this->request->get_method(), + $this->request->get_uri( false ), + $this->request->get_protocol() + ); + break; + case 'request_basename': + $value = basename( $this->request->get_filename() ); + break; + case 'request_body': + $value = $this->request->get_body(); + break; + case 'query_string': + $value = $this->request->get_query_string(); + break; + case 'args_get': + $value = $this->request->get_get_vars(); + break; + case 'args_get_names': + $value = $this->args_names( $this->meta( 'args_get' ) ); + break; + case 'args_post': + $value = $this->request->get_post_vars(); + break; + case 'args_post_names': + $value = $this->args_names( $this->meta( 'args_post' ) ); + break; + case 'args': + $value = array_merge( $this->meta( 'args_get' ), $this->meta( 'args_post' ) ); + break; + case 'args_names': + $value = $this->args_names( $this->meta( 'args' ) ); + break; + case 'request_cookies': + $value = $this->request->get_cookies(); + break; + case 'request_cookies_names': + $value = $this->args_names( $this->meta( 'request_cookies' ) ); + break; + case 'files': + $value = array(); + foreach ( $this->request->get_files() as $f ) { + $value[] = array( $f['name'], $f['filename'] ); + } + break; + case 'files_names': + $value = $this->args_names( $this->meta( 'files' ) ); + break; + } + $this->metadata[ $key ] = $value; + } + + return $this->metadata[ $key ]; + } + + /** + * State values. + * + * @param string $prefix Prefix. + */ + private function state_values( $prefix ) { + $output = array(); + $len = strlen( $prefix ); + foreach ( $this->state as $k => $v ) { + if ( 0 === stripos( $k, $prefix ) ) { + $output[ substr( $k, $len ) ] = $v; + } + } + + return $output; + } + + /** + * Change a string to all lowercase and replace spaces and underscores with dashes. + * + * @param string $name Name. + * @return string + */ + public function normalize_header_name( $name ) { + return str_replace( array( ' ', '_' ), '-', strtolower( $name ) ); + } + + /** + * Get match-able values from a collection of targets. + * + * This function expects an associative array of target items, and returns an array of possible values from those targets that can be used to match against. + * The key is the lowercase target name (i.e. `args`, `request_headers`, etc) - see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables + * The value is an associative array of options that define how to narrow down the returned values for that target if it's an array (ARGS, for example). The possible options are: + * count: If `true`, then the returned value will a count of how many matched targets were found, rather then the actual values of those targets. + * For example, &ARGS_GET will return the number of keys the query string. + * only: If specified, then only values in that target that match the given key will be returned. + * For example, ARGS_GET:id|ARGS_GET:/^name/ will only return the values for `$_GET['id']` and any key in `$_GET` that starts with `name` + * except: If specified, then values in that target will be left out from the returned values (even if they were included in an `only` option) + * For example, ARGS_GET|!ARGS_GET:z will return every value from `$_GET` except for `$_GET['z']`. + * + * This function will return an array of associative arrays. Each with: + * name: The target name that this value came from (i.e. the key in the input `$targets` argument ) + * source: For targets that are associative arrays (like ARGS), this will be the target name AND the key in that target (i.e. "args:z" for ARGS:z) + * value: The value that was found in the associated target. + * + * @param TargetBag $targets An assoc. array with keys that are target name(s) and values are options for how to process that target (include/exclude rules, whether to return values or counts). + * @return array{ name: string, source: string, value: mixed } + */ + public function normalize_targets( $targets ) { + $return = array(); + foreach ( $targets as $k => $v ) { + $count_only = isset( $v['count'] ) ? self::NORMALIZE_ARRAY_COUNT : 0; + $only = isset( $v['only'] ) ? $v['only'] : array(); + $except = isset( $v['except'] ) ? $v['except'] : array(); + $_k = strtolower( $k ); + switch ( $_k ) { + case 'request_headers': + $this->normalize_array_target( + // get the headers that came in with this request + $this->meta( 'headers' ), + // ensure only and exclude filters are normalized + array_map( array( $this->request, 'normalize_header_name' ), $only ), + array_map( array( $this->request, 'normalize_header_name' ), $except ), + $k, + $return, + // flags + $count_only + ); + continue 2; + case 'request_headers_names': + $this->normalize_array_target( $this->meta( 'headers_names' ), $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES ); + continue 2; + case 'request_method': + case 'request_protocol': + case 'request_uri': + case 'request_uri_raw': + case 'request_filename': + case 'request_basename': + case 'request_body': + case 'query_string': + case 'request_line': + $v = $this->meta( $_k ); + break; + case 'tx': + case 'ip': + $this->normalize_array_target( $this->state_values( "$k." ), $only, $except, $k, $return, $count_only ); + continue 2; + case 'request_cookies': + case 'args': + case 'args_get': + case 'args_post': + case 'files': + $this->normalize_array_target( $this->meta( $_k ), $only, $except, $k, $return, $count_only ); + continue 2; + case 'request_cookies_names': + case 'args_names': + case 'args_get_names': + case 'args_post_names': + case 'files_names': + // get the "full" data (for 'args_names' get data for 'args') and stripe it down to just the key names + $data = array_map( + function ( $item ) { + return $item[0]; }, + $this->meta( substr( $_k, 0, -6 ) ) + ); + $this->normalize_array_target( $data, $only, $except, $k, $return, $count_only | self::NORMALIZE_ARRAY_MATCH_VALUES ); + continue 2; + default: + var_dump( 'Unknown target', $k, $v ); + exit; + } + $return[] = array( + 'name' => $k, + 'value' => $v, + 'source' => $k, + ); + } + + return $return; + } + + /** + * Verifies if the IP from the current request is in an array. + * + * @param array $array Array of IP addresses to verify the request IP against. + * @return bool + */ + public function is_ip_in_array( $array ) { + $real_ip = $this->request->get_real_user_ip_address(); + $array_length = count( $array ); + + for ( $i = 0; $i < $array_length; $i++ ) { + // Check if the IP matches a provided range. + $range = explode( '-', $array[ $i ] ); + if ( count( $range ) === 2 ) { + if ( IP_Utils::ip_address_is_in_range( $real_ip, $range[0], $range[1] ) ) { + return true; + } + continue; + } + + // Check if the IP is an exact match. + if ( $real_ip === $array[ $i ] ) { + return true; + } + } + + return false; + } + + /** + * Extract values from an associative array, potentially applying filters and/or counting results. + * + * @param array{ 0: string, 1: scalar }|scalar[] $source The source assoc. array of values (i.e. $_GET, $_SERVER, etc.). + * @param string[] $only Only include the values for these keys in the output. + * @param string[] $excl Never include the values for these keys in the output. + * @param string $name The name of this target (see https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Variables). + * @param array $results Array to add output values to, will be modified by this method. + * @param int $flags Any of the NORMALIZE_ARRAY_* constants defined at the top of the class. + */ + private function normalize_array_target( $source, $only, $excl, $name, &$results, $flags = 0 ) { + $output = array(); + $has_only = isset( $only[0] ); + $has_excl = isset( $excl[0] ); + + foreach ( $source as $source_key => $source_val ) { + if ( is_array( $source_val ) ) { + // if $source_val looks like a tuple from flatten_array(), then use the tuple as the key and value + $source_key = $source_val[0]; + $source_val = $source_val[1]; + } + $filter_match = ( $flags & self::NORMALIZE_ARRAY_MATCH_VALUES ) > 0 ? $source_val : $source_key; + // if this key is on the "exclude" list, skip it + if ( $has_excl && $this->key_matches( $filter_match, $excl ) ) { + continue; + } + // if this key isn't in our "only" list, then skip it + if ( $has_only && ! $this->key_matches( $filter_match, $only ) ) { + continue; + } + // otherwise add this key/value to our output + $output[] = array( $source_key, $source_val ); + } + + if ( ( $flags & self::NORMALIZE_ARRAY_COUNT ) > 0 ) { + // If we've been told to just count the values, then just count them. + $results[] = array( + 'name' => (string) $name, + 'value' => count( $output ), + 'source' => '&' . $name, + ); + } else { + foreach ( $output as list( $item_name, $item_value ) ) { + $results[] = array( + 'name' => (string) $item_name, + 'value' => $item_value, + 'source' => "$name:$item_name", + ); + } + } + + return $results; + } + + /** + * Given an array of tuples - probably from flatten_array() - return a new array + * consisting of only the first value (the key name) from each tuple. + * + * @param array{0:string, 1:scalar}[] $flat_array An array of tuples. + * @return string[] + */ + private function args_names( $flat_array ) { + $names = array_map( + function ( $tuple ) { + return $tuple[0]; + }, + $flat_array + ); + return array_unique( $names ); + } + + /** + * Return whether or not a given $input key matches one of the given $patterns. + * + * @param string $input Key name to test against patterns. + * @param string[] $patterns Patterns to test key name with. + * @return bool + */ + private function key_matches( $input, $patterns ) { + foreach ( $patterns as $p ) { + if ( '/' === $p[0] ) { + if ( 1 === preg_match( $p, $input ) ) { + return true; + } + } elseif ( 0 === strcasecmp( $p, $input ) ) { + return true; + } + } + + return false; + } + + /** + * Sanitize output generated from the request that was blocked. + * + * @param string $output Output to sanitize. + */ + public function sanitize_output( $output ) { + $url_decoded_output = rawurldecode( $output ); + $html_entities_output = htmlentities( $url_decoded_output, ENT_QUOTES, 'UTF-8' ); + // @phpcs:disable Squiz.Strings.DoubleQuoteUsage.NotRequired + $escapers = array( "\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c" ); + $replacements = array( "\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b" ); + // @phpcs:enable Squiz.Strings.DoubleQuoteUsage.NotRequired + + return( str_replace( $escapers, $replacements, $html_entities_output ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php new file mode 100644 index 00000000..597e3168 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php @@ -0,0 +1,172 @@ +guard_against_missing_abspath(); + $this->initialize_constants(); + } + + /** + * Ensures that this class is not used unless we are in the right context. + * + * @throws Waf_Exception If we are outside of WordPress. + * + * @return void + */ + private function guard_against_missing_abspath() { + + if ( ! defined( 'ABSPATH' ) ) { + throw new Waf_Exception( 'Cannot generate the WAF bootstrap if we are not running in WordPress context.' ); + } + } + + /** + * Initializes the constants required for generating the bootstrap, if they have not been initialized yet. + * + * @return void + */ + private function initialize_constants() { + Waf_Constants::initialize_constants(); + } + + /** + * Initialized the WP filesystem and serves as a mocking hook for tests. + * + * Should only be implemented after the wp_loaded action hook: + * + * @link https://developer.wordpress.org/reference/functions/wp_filesystem/#more-information + * + * @return void + */ + protected function initialize_filesystem() { + if ( ! function_exists( '\\WP_Filesystem' ) ) { + require_once ABSPATH . 'wp-admin/includes/file.php'; + } + + WP_Filesystem(); + } + + /** + * Finds the path to the autoloader, which can then be used to require the autoloader in the generated boostrap file. + * + * @throws Waf_Exception In case the autoloader file can not be found. + * + * @return string|null + */ + private function locate_autoloader_file() { + global $jetpack_autoloader_loader; + + $autoload_file = null; + + // Try the Jetpack autoloader. + if ( isset( $jetpack_autoloader_loader ) ) { + $class_file = $jetpack_autoloader_loader->find_class_file( Waf_Runner::class ); + if ( $class_file ) { + $autoload_file = dirname( dirname( dirname( dirname( dirname( $class_file ) ) ) ) ) . '/vendor/autoload.php'; + } + } + + // Try Composer's autoloader. + if ( null === $autoload_file + && is_callable( array( InstalledVersions::class, 'getInstallPath' ) ) + && InstalledVersions::isInstalled( 'automattic/jetpack-waf' ) + ) { + $package_file = InstalledVersions::getInstallPath( 'automattic/jetpack-waf' ); + if ( substr( $package_file, -23 ) === '/automattic/jetpack-waf' ) { + $autoload_file = dirname( dirname( dirname( $package_file ) ) ) . '/vendor/autoload.php'; + } + } + + // Guess. First look for being in a `vendor/automattic/jetpack-waf/src/', then see if we're standalone with our own vendor dir. + if ( null === $autoload_file ) { + $autoload_file = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/vendor/autoload.php'; + if ( ! file_exists( $autoload_file ) ) { + $autoload_file = dirname( __DIR__ ) . '/vendor/autoload.php'; + } + } + + // Check that the determined file actually exists. + if ( ! file_exists( $autoload_file ) ) { + throw new Waf_Exception( 'Can not find autoloader, and the WAF standalone boostrap will not work without it.' ); + } + + return $autoload_file; + } + + /** + * Gets the path to the bootstrap.php file. + * + * @return string The bootstrap.php file path. + */ + public function get_bootstrap_file_path() { + return trailingslashit( JETPACK_WAF_DIR ) . 'bootstrap.php'; + } + + /** + * Generates the bootstrap file. + * + * @throws File_System_Exception If the filesystem is not available. + * @throws File_System_Exception If the WAF directory can not be created. + * @throws File_System_Exception If the bootstrap file can not be created. + * + * @return string Absolute path to the bootstrap file. + */ + public function generate() { + + $this->initialize_filesystem(); + + global $wp_filesystem; + if ( ! $wp_filesystem ) { + throw new File_System_Exception( 'Can not work without the file system being initialized.' ); + } + + $autoloader_file = $this->locate_autoloader_file(); + + $bootstrap_file = $this->get_bootstrap_file_path(); + $mode_option = get_option( Waf_Runner::MODE_OPTION_NAME, false ); + $share_data_option = get_option( Waf_Runner::SHARE_DATA_OPTION_NAME, false ); + + // phpcs:disable WordPress.PHP.DevelopmentFunctions + $code = "is_dir( JETPACK_WAF_DIR ) ) { + if ( ! $wp_filesystem->mkdir( JETPACK_WAF_DIR ) ) { + throw new File_System_Exception( 'Failed creating WAF standalone bootstrap file directory: ' . JETPACK_WAF_DIR ); + } + } + + if ( ! $wp_filesystem->put_contents( $bootstrap_file, $code ) ) { + throw new File_System_Exception( 'Failed writing WAF standalone bootstrap file to: ' . $bootstrap_file ); + } + + return $bootstrap_file; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php new file mode 100644 index 00000000..a0bc7bae --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php @@ -0,0 +1,68 @@ +normalize_path( str_replace( '\\', '/', $value ) ); + } + + /** + * Removes all NUL bytes from input. + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_nulls( $value ) { + return str_replace( "\x0", '', $value ); + } + + /** + * Remove all whitespace characters from input. + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_whitespace( $value ) { + return preg_replace( '/\s/', '', $value ); + } + + /** + * Replaces each occurrence of a C-style comment (/ * ... * /) with a single space. + * Unterminated comments will also be replaced with a space. However, a standalone termination of a comment (* /) will not be acted upon. + * + * @param string $value value to be filtered. + * @return string + */ + public function replace_comments( $value ) { + $value = preg_replace( '~/\*.*?\*/|/\*.*?$~Ds', ' ', $value ); + return explode( '/*', $value, 2 )[0]; + } + + /** + * Removes common comments chars (/ *, * /, --, #). + * + * @param string $value value to be filtered. + * @return string + */ + public function remove_comments_char( $value ) { + return preg_replace( '~/*|*/|--|#|//~', '', $value ); + } + + /** + * Replaces each NUL byte in input with a space. + * + * @param string $value value to be filtered. + * @return string + */ + public function replace_nulls( $value ) { + return str_replace( "\x0", ' ', $value ); + } + + /** + * Decode a URL-encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function url_decode( $value ) { + return urldecode( $value ); + } + + /** + * Decode a URL-encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function url_decode_uni( $value ) { + error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: urlDecodeUni' ); + return $value; + } + + /** + * Decode a json encoded input string. + * + * @param string $value value to be decoded. + * @return string + */ + public function js_decode( $value ) { + error_log( 'JETPACKWAF TRANSFORM NOT IMPLEMENTED: jsDecode' ); + return $value; + } + + /** + * Convert all characters to uppercase. + * + * @param string $value value to be encoded. + * @return string + */ + public function uppercase( $value ) { + return strtoupper( $value ); + } + + /** + * Calculate a SHA1 hash from the input string. + * + * @param mixed $value value to be hashed. + * @return string + */ + public function sha1( $value ) { + return sha1( $value, true ); + } + + /** + * Remove whitespace from the left side of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim_left( $value ) { + return ltrim( $value ); + } + + /** + * Remove whitespace from the right side of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim_right( $value ) { + return rtrim( $value ); + } + + /** + * Remove whitespace from both sides of the input string. + * + * @param string $value value to be trimmed. + * @return string + */ + public function trim( $value ) { + return trim( $value ); + } + + /** + * Convert utf-8 characters to unicode characters + * + * @param string $value value to be encoded. + * @return string + */ + public function utf8_to_unicode( $value ) { + return preg_replace( '/\\\u(?=[a-f0-9]{4})/', '%u', substr( json_encode( $value ), 1, -1 ) ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php new file mode 100644 index 00000000..ba59b986 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php @@ -0,0 +1,24 @@ +getMessage() ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php new file mode 100644 index 00000000..554f1053 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-waf/src/functions.php @@ -0,0 +1,70 @@ + [ "x" => [ "y" => "..." ] ] ] + * However, modsecurity (and thus our WAF rules) expect the original (non-nested) names. + * + * Therefore, this method takes an array of any depth and returns a single-depth array with nested + * keys translated back to a single string with brackets. + * + * Because there might be multiple items with the same name, this function will return an array of tuples, + * with the first item in the tuple the re-created original field name, and the second item the value. + * + * @example + * flatten_array( [ "field1" => "abc", "field2" => [ "d", "e", "f" ] ] ) + * => [ + * [ "field1", "abc" ], + * [ "field2[0]", "d" ], + * [ "field2[1]", "e" ], + * [ "field2[2]", "f" ], + * ] + * + * @param array $array An array that resembles one of the PHP superglobals like $_GET or $_POST. + * @param string $key_prefix String that should be prepended to the keys output by this function. + * Usually only used internally as part of recursion when flattening a nested array. + * @return array{ 0: string, 1: scalar }[] $key_prefix An array of key/value tuples, one for each distinct value in the input array. + */ +function flatten_array( $array, $key_prefix = '' ) { + $return = array(); + foreach ( $array as $source_key => $source_value ) { + $key = ( '' === $key_prefix ) + // if this is the first level, the key name isn't enclosed in brackets + ? $source_key + // for every level after the first, enclose the key name in brackets. + : $key_prefix . '[' . $source_key . ']'; + if ( ! is_array( $source_value ) ) { + $return[] = array( $key, $source_value ); + } else { + $return = array_merge( $return, flatten_array( $source_value, $key ) ); + } + } + return $return; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php new file mode 100644 index 00000000..747eb6dd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/i18n-map.php @@ -0,0 +1,64 @@ + 'jetpack-protect', + 'type' => 'plugins', + 'packages' => array( + 'jetpack-admin-ui' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-admin-ui', + 'ver' => '0.2.19', + ), + 'jetpack-assets' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-assets', + 'ver' => '1.17.34', + ), + 'jetpack-config' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-config', + 'ver' => '1.15.1', + ), + 'jetpack-connection' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-connection', + 'ver' => '1.51.7', + ), + 'jetpack-idc' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis', + 'ver' => '0.8.40', + ), + 'jetpack-ip' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-ip', + 'ver' => '0.1.2', + ), + 'jetpack-jitm' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-jitm', + 'ver' => '2.3.4', + ), + 'jetpack-licensing' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-licensing', + 'ver' => '1.8.2', + ), + 'jetpack-my-jetpack' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack', + 'ver' => '2.9.1', + ), + 'jetpack-password-checker' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-password-checker', + 'ver' => '0.2.13', + ), + 'jetpack-plugins-installer' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-plugins-installer', + 'ver' => '0.2.3', + ), + 'jetpack-sync' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-sync', + 'ver' => '1.47.4', + ), + 'jetpack-transport-helper' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-transport-helper', + 'ver' => '0.1.4', + ), + 'jetpack-waf' => array( + 'path' => 'jetpack_vendor/automattic/jetpack-waf', + 'ver' => '0.11.4', + ), + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt new file mode 100644 index 00000000..8b9e6574 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/readme.txt @@ -0,0 +1,169 @@ +=== Jetpack Protect === +Contributors: automattic, retrofox, leogermani, renatoagds, bjorsch, ebinnion, fgiannar, zinigor, miguelxavierpenha, dsmart, jeherve, manzoorwanijk, njweller, oskosk, samiff, siddarthan, wpkaren, arsihasi, kraftbj, kev, sermitr, kangzj, pabline, dkmyta +Tags: jetpack, protect, security, malware, scan +Requires at least: 6.0 +Requires PHP: 5.6 +Tested up to: 6.2 +Stable tag: 1.4.0 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Free daily malware scanning and WordPress site security. Jetpack Protect leverages the extensive database of WPScan, an Automattic brand, that has over 25,000 registered malware and vulnerabilities. No configuration required! + +== Description == + +== TOTAL SITE SECURITY FROM WORDPRESS EXPERTS == + +Jetpack Protect is a free and essential WordPress security plugin that scans your site and warns you about vulnerabilities, keeping your site one step ahead of security threats. It’s easy to use; setup requires just a few clicks! + +By upgrading Protect, you also unlock malware scanning with one-click fixes for most issues and instant notifications when threats are detected. Our automated Web Application Firewall (WAF) also protects your site from bad actors around the clock. + +Jetpack Protect is created by WordPress experts; our parent company Automattic is behind Jetpack, WordPress.com, WooCommerce, WPScan, and much more. There is no better company to understand the security needs of WordPress sites. + +== WHAT DOES JETPACK PROTECT (FREE) CHECK FOR? == + +Jetpack Protect scans your site on a daily basis and warns you about: +- The version of WordPress installed, and any associated vulnerabilities +- What plugins are installed, and any related vulnerabilities +- What themes are installed, and any associated vulnerabilities + += What are vulnerabilities? Why do I need to scan my site regularly? = +Site vulnerabilities are flaws in a website's code that weaken the site's overall security. These can be introduced to a site in various ways, in most cases unintentionally. + +Some of the ways vulnerabilities can be introduced to a site are: +- Poorly written site code +- Plugin and theme bugs +- WordPress version bugs +- System misconfigurations + +If a bad actor detects a vulnerability on your site, they can exploit it to access sensitive information, update your site, and more to damage your business or brand. + +That’s why it’s essential to use a reputable and reliable vulnerability & malware site scanner like Jetpack Protect to safeguard your site. + += Can I use Jetpack Scan to fix a site that is already infected? = + +Jetpack Protect (Scan) detects and prevents attacks, but is not designed to fully clean up sites infected before it was active. If your site has malware, take immediate action to clean it up and remove the malicious code. + +To clean up your site, we suggest using a malware removal tool, or if possible restore from a backup taken before the infection. We recommend using Jetpack VaultPress Backup in conjunction with Jetpack Scan to secure your website. + +[Learn more about cleaning your site](https://jetpack.com/support/scan/how-to-clean-your-hacked-wordpress-site/) + +== UPGRADE PROTECT TO REMOVE MALWARE IN ONE CLICK AND BE PROTECTED BY OUR WAF == +By upgrading Protect, you unlock total site security from WordPress experts: +- Automated daily malware scanning in addition to vulnerability checks +- One-click fixes for most issues +- Web Application Firewall (WAF) with automatic rule updates +- Instant email notifications when threats are detected +- Priority support from WordPress experts + += What is malware? Why do I need to protect against it? = +Malware is malicious code or software that has been created by bad actors to disrupt, damage, or gain access to your site. There are many ways that malware can get onto your WordPress site. The most common method is through attackers using vulnerable plugins or themes to install malware. + +Similar to the vulnerabilities listed above, bad actors can use malware to capture sensitive information, damage your site, and harm your business or brand. + +Jetpack Protect instantly notifies you of any threats detected, with one-click fixes for most issues. + += What is a Web Application Firewall (WAF)? = +A web application firewall blocks traffic and malicious requests to your site from known bad actors. + +As threats are detected, new rules are added to Jetpack Protect’s firewall, which provides around-the-clock protection for your WordPress site. + +== OVER 38,393 REGISTERED VULNERABILITIES IN OUR DATABASE == + +WordPress security is something that evolves over time. Jetpack Protect leverages the extensive database of WPScan, an Automattic brand. All vulnerabilities are entered into our database by dedicated WordPress security professionals and updated constantly as new information becomes available. + +== JETPACK PROTECT IS EASY TO SETUP AND USE == + +There’s nothing to configure – the setup process is as easy as: +1. Install and activate the plugin +2. Set up it with one click. + +After you activate the plugin, Jetpack Protect will run daily automatic malware scans on your WordPress site and update you on vulnerabilities associated with your installed plugins, themes, and WordPress core. + +== WITH 💚 BY JETPACK == + +This is just the start! + +We are working hard to bring more features and improvements to Jetpack Protect. Let us know your thoughts and ideas! + +== FURTHER READING == + +- [Jetpack: Security, performance, and growth tools made for WordPress sites by the WordPress experts.](https://jetpack.com/) +- You can follow the [Jetpack Twitter](https://twitter.com/jetpack?lang=en) account to catch up on our latest WordPress security recommendations and updates. +- [WordPress Security: How to Protect Your Site From Hackers](https://jetpack.com/blog/category/security/page/3/) +- [Should You Use Jetpack for WordPress Security?](https://jetpack.com/blog/should-you-use-jetpack-for-wordpress-security/) +- [Jetpack Acquires WordPress Vulnerability Database WPScan](https://jetpack.com/blog/jetpack-acquires-wordpress-vulnerability-database-wpscan/#more-139339) + +== FAQ == + += How does Jetpack Protect help your WordPress Site security? = + +Protect is a free WordPress security and malware scanner plugin that scans your site and lets you know possible malware and security threats on your installed plugins, themes, and core files. + +The free plan scans your site for WordPress version, plugin, and theme vulnerabilities from our extensive vulnerability database (38,393) that is powered by WPScan. + +By upgrading Protect, you gain access to WordPress malware scanning with one-click fixes, instant threat notifications, and our Web application Firewall (WAF) that protects your site around the clock. + += Does this plugin require the Jetpack plugin to work? = + +Jetpack Protect does not require the Jetpack plugin to run and secure your site. + += What are the differences between Jetpack Protect, Jetpack Scan, and WPScan plugins? = + +Jetpack Protect is a new WordPress security plugin from Jetpack containing our security features only. You can start with Jetpack Protect’s free vulnerability scanning features and upgrade Jetpack Protect to access automated malware scanning and our web application firewall. By upgrading Protect, you are enabling Jetpack Scan to the plugin. + +Jetpack Scan is a product that can be purchased for use in conjunction with the main Jetpack plugin or Jetpack Protect. Jetpack Scan includes automated malware scanning and our web application firewall but does not contain the vulnerability scanning feature from the Protect plugin. If you purchase Jetpack Security or Jetpack Complete, Jetpack Scan is also included in those bundles. + +If you are already a Jetpack Scan, Jetpack Security, or Jetpack Complete customer, you can also take advantage of Jetpack Protect’s vulnerability scanning feature by installing the Jetpack Protect plugin. + +WPScan is an enterprise vulnerability scanning solution. It is not recommended for small to medium-sized businesses. If you are an enterprise company looking for custom WordPress site protection solutions, please visit: https://wpscan.com/ + +For small to medium-sized businesses, you can access our vulnerability scanning solution in the Jetpack Protect plugin. + += Will Jetpack Protect work on my local site? + +Jetpack Protect requires a publicly accessible site to perform the vulnerability scan. + += How will I know if Jetpack Protect has found WordPress security vulnerabilities and malware? = + +You can visit Jetpack Protect dashboard in your WordPress admin panel to see the security threats and malware found by the integrated malware scanner. + += What do I do if Jetpack Protect finds a security threat? = + +When the vulnerability scanner finds a security threat, you can view the recommended actions on the Jetpack Protect dashboard to secure your sites. + +If you have upgraded Protect, your site will also be automatically scanned for malware each day, and you will be notified instantly via email if any threats are detected. You will be able to fix most issues in one click. + += Can I set the time of the daily security scan? = + +It is not possible to set a time for the automated daily scans run by the integrated malware scanner. + += Why do I need WordPress security and malware scan? = + +A hacked WordPress site can cause serious damage to your business revenue and reputation. Jetpack Protect scans your site and lets you know possible malware and security threats on your installed plugins, themes, and core files. + += Where can I learn more about WordPress security and malware threats? = + +To learn how to achieve better WordPress security, [see this guide](https://jetpack.com/blog/guide-to-wordpress-security/). On the [Jetpack Blog](https://jetpack.com/blog/category/security/), you can find many more articles written by the top WordPress security experts. + += Is Jetpack Protect the same thing as the Protect feature in the Jetpack plugin? + +The new Jetpack Protect plugin is different from the Jetpack feature formerly known as [Protect](https://jetpack.com/support/protect/) (now renamed [Brute Force Attack Protection](https://jetpack.com/support/protect/)). + +== Screenshots == + +1. Focus on running your business while Jetpack Protect automatically scans your site. +2. Keep your site one step ahead of security threats and malware. +3. View all the found vulnerabilities in your site and learn how to fix them. +4. The Jetpack Firewall is a web application firewall (known as WAF) designed to protect your WordPress site from malicious requests. + +== Changelog == +### 1.4.0 - 2023-05-05 +#### Added +- Add brute force protection. + +#### Changed +- General: indicate full compatibility with the latest version of WordPress, 6.2. +- Improve the firewall status heading to provide more information based on the current configuration. +- Updated package dependencies. + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php new file mode 100644 index 00000000..dc80e624 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-credentials.php @@ -0,0 +1,56 @@ +is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return false; + } + + $api_url = sprintf( '/sites/%d/scan', $blog_id ); + + $response = Client::wpcom_json_api_request_as_blog( + $api_url, + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + return isset( $parsed_response->credentials ) ? $parsed_response->credentials : array(); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php new file mode 100644 index 00000000..05a86825 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-jetpack-protect.php @@ -0,0 +1,452 @@ +ensure( + 'connection', + array( + 'slug' => JETPACK_PROTECT_SLUG, + 'name' => JETPACK_PROTECT_NAME, + 'url_info' => JETPACK_PROTECT_URI, + ) + ); + // Sync package. + $config->ensure( + 'sync', + array( + 'jetpack_sync_modules' => array( + 'Automattic\\Jetpack\\Sync\\Modules\\Options', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables', + 'Automattic\\Jetpack\\Sync\\Modules\\Users', + ), + 'jetpack_sync_callable_whitelist' => array( + 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), + ), + 'jetpack_sync_options_contentless' => array(), + 'jetpack_sync_options_whitelist' => array( + 'active_plugins', + 'stylesheet', + ), + ) + ); + + // Identity crisis package. + $config->ensure( 'identity_crisis' ); + + // Web application firewall package. + $config->ensure( 'waf' ); + }, + 1 + ); + + add_filter( 'jetpack_connection_user_has_license', array( $this, 'jetpack_check_user_licenses' ), 10, 3 ); + + add_filter( 'jetpack_get_available_standalone_modules', array( $this, 'protect_filter_available_modules' ), 10, 1 ); + } + + /** + * Initialize the plugin + * + * @return void + */ + public function init() { + add_action( 'admin_bar_menu', array( $this, 'admin_bar' ), 65 ); + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) ); + + REST_Controller::init(); + My_Jetpack_Initializer::init(); + Site_Health::init(); + + // Sets up JITMS. + JITM::configure(); + } + + /** + * Initialize the admin page resources. + */ + public function admin_page_init() { + $total_threats = Status::get_total_threats(); + $menu_label = _x( 'Protect', 'The Jetpack Protect product name, without the Jetpack prefix', 'jetpack-protect' ); + if ( $total_threats ) { + $menu_label .= sprintf( ' %d', $total_threats ); + } + + $page_suffix = Admin_Menu::add_menu( + __( 'Jetpack Protect', 'jetpack-protect' ), + $menu_label, + 'manage_options', + 'jetpack-protect', + array( $this, 'plugin_settings_page' ), + 99 + ); + + add_action( 'load-' . $page_suffix, array( $this, 'enqueue_admin_scripts' ) ); + } + + /** + * Enqueues the wp-admin styles (used outside the React app) + */ + public function enqueue_admin_styles() { + wp_enqueue_style( 'jetpack-protect-wpadmin', JETPACK_PROTECT_BASE_PLUGIN_URL . '/assets/jetpack-protect.css', array(), JETPACK_PROTECT_VERSION ); + } + + /** + * Enqueue plugin admin scripts and styles. + */ + public function enqueue_admin_scripts() { + + Assets::register_script( + 'jetpack-protect', + 'build/index.js', + JETPACK_PROTECT_ROOT_FILE, + array( + 'in_footer' => true, + 'textdomain' => 'jetpack-protect', + ) + ); + Assets::enqueue_script( 'jetpack-protect' ); + // Required for Analytics. + wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true ); + // Initial JS state including JP Connection data. + wp_add_inline_script( 'jetpack-protect', Connection_Initial_State::render(), 'before' ); + wp_add_inline_script( 'jetpack-protect', $this->render_initial_state(), 'before' ); + } + + /** + * Render the initial state into a JavaScript variable. + * + * @return string + */ + public function render_initial_state() { + return 'var jetpackProtectInitialState=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( $this->initial_state() ) ) . '"));'; + } + + /** + * Get the initial state data for hydrating the React UI. + * + * @return array + */ + public function initial_state() { + global $wp_version; + // phpcs:disable WordPress.Security.NonceVerification.Recommended + $refresh_status_from_wpcom = isset( $_GET['checkPlan'] ); + $initial_state = array( + 'apiRoot' => esc_url_raw( rest_url() ), + 'apiNonce' => wp_create_nonce( 'wp_rest' ), + 'registrationNonce' => wp_create_nonce( 'jetpack-registration-nonce' ), + 'status' => Status::get_status( $refresh_status_from_wpcom ), + 'installedPlugins' => Plugins_Installer::get_plugins(), + 'installedThemes' => Sync_Functions::get_themes(), + 'wpVersion' => $wp_version, + 'adminUrl' => 'admin.php?page=jetpack-protect', + 'siteSuffix' => ( new Jetpack_Status() )->get_site_suffix(), + 'jetpackScan' => My_Jetpack_Products::get_product( 'scan' ), + 'hasRequiredPlan' => Plan::has_required_plan(), + 'waf' => array( + 'isSupported' => Waf_Runner::is_supported_environment(), + 'isSeen' => self::get_waf_seen_status(), + 'upgradeIsSeen' => self::get_waf_upgrade_seen_status(), + 'displayUpgradeBadge' => self::get_waf_upgrade_badge_display_status(), + 'isEnabled' => Waf_Runner::is_enabled(), + 'isToggling' => false, + 'isUpdating' => false, + 'config' => Waf_Runner::get_config(), + 'stats' => self::get_waf_stats(), + ), + ); + + $initial_state['jetpackScan']['pricingForUi'] = Plan::get_product( 'jetpack_scan' ); + + return $initial_state; + } + /** + * Main plugin settings page. + */ + public function plugin_settings_page() { + ?> +
        + is_connected() ) { + self::activate_modules(); + } + } + + /** + * Activates the waf and brute force protection modules and disables the activation option + */ + public static function activate_modules() { + delete_option( self::JETPACK_PROTECT_ACTIVATION_OPTION ); + ( new Modules() )->activate( self::JETPACK_WAF_MODULE_SLUG, false, false ); + ( new Modules() )->activate( self::JETPACK_BRUTE_FORCE_PROTECTION_MODULE_SLUG, false, false ); + } + + /** + * Removes plugin from the connection manager + * If it's the last plugin using the connection, the site will be disconnected. + * + * @access public + * @static + */ + public static function plugin_deactivation() { + + // Clear Sync data. + Sender::get_instance()->uninstall(); + + $manager = new Connection_Manager( 'jetpack-protect' ); + $manager->remove_connection(); + + Status::delete_option(); + } + + /** + * Create a shortcut on Admin Bar to show the total of threats found. + * + * @param object $wp_admin_bar The Admin Bar object. + * @return void + */ + public function admin_bar( $wp_admin_bar ) { + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $total = Status::get_total_threats(); + + if ( $total > 0 ) { + $args = array( + 'id' => 'jetpack-protect', + 'title' => '' . $total . '', + 'href' => admin_url( 'admin.php?page=jetpack-protect' ), + 'meta' => array( + // translators: %d is the number of threats found. + 'title' => sprintf( _n( '%d threat found by Jetpack Protect', '%d threats found by Jetpack Protect', $total, 'jetpack-protect' ), $total ), + ), + ); + + $wp_admin_bar->add_node( $args ); + } + } + + /** + * Adds modules to the list of available modules + * + * @param array $modules The available modules. + * @return array + */ + public function protect_filter_available_modules( $modules ) { + return array_merge( array( self::JETPACK_WAF_MODULE_SLUG, self::JETPACK_BRUTE_FORCE_PROTECTION_MODULE_SLUG ), $modules ); + } + + /** + * Check for user licenses. + * + * @param boolean $has_license Check if user has a license. + * @param object $licenses List of licenses. + * @param string $plugin_slug The plugin that initiated the flow. + * + * @return boolean + */ + public static function jetpack_check_user_licenses( $has_license, $licenses, $plugin_slug ) { + if ( $plugin_slug !== JETPACK_PROTECT_SLUG || $has_license ) { + return $has_license; + } + + $license_found = false; + + foreach ( $licenses as $license ) { + if ( in_array( $license->product_id, self::JETPACK_SCAN_PRODUCT_IDS, true ) ) { + $license_found = true; + break; + } + } + + return $license_found; + } + + /** + * Get WAF "Seen" Status + * + * @return bool Whether the current user has viewed the WAF screen. + */ + public static function get_waf_seen_status() { + return (bool) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true ); + } + + /** + * Set WAF "Seen" Status + * + * @return bool True if seen status updated to true, false on failure. + */ + public static function set_waf_seen_status() { + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_seen', true ); + } + + /** + * Get WAF Upgrade "Seen" Status + * + * @return bool Whether the current user has dismissed the upgrade popover or enabled the automatic rules feature. + */ + public static function get_waf_upgrade_seen_status() { + return (bool) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_seen', true ); + } + + /** + * Set WAF Upgrade "Seen" Status + * + * @return bool True if upgrade seen status updated to true, false on failure. + */ + public static function set_waf_upgrade_seen_status() { + self::set_waf_upgrade_badge_timestamp(); + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_seen', true ); + } + + /** + * Get WAF Upgrade Badge Timestamp + * + * @return integer The timestamp for the when the upgrade seen status was first set to true. + */ + public static function get_waf_upgrade_badge_timestamp() { + return (int) get_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp', true ); + } + + /** + * Set WAF Upgrade Badge Timestamp + * + * @return bool True if upgrade badge timestamp to set to the current time, false on failure. + */ + public static function set_waf_upgrade_badge_timestamp() { + return (bool) update_user_meta( get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp', time() ); + } + + /** + * Get WAF Upgrade Badge Display Status + * + * @return bool True if upgrade badge timestamp is set and less than 7 days ago, otherwise false. + */ + public static function get_waf_upgrade_badge_display_status() { + $badge_timestamp_exists = metadata_exists( 'user', get_current_user_id(), 'jetpack_protect_waf_upgrade_badge_timestamp' ); + if ( ! $badge_timestamp_exists ) { + return true; + } + + $badge_timestamp = self::get_waf_upgrade_badge_timestamp(); + $seven_days = strtotime( '-7 days' ); + if ( $badge_timestamp > $seven_days ) { + return true; + } + + return false; + } + + /** + * Get WAF stats + * + * @return bool|array False if WAF is not enabled, otherwise an array of stats. + */ + public static function get_waf_stats() { + if ( ! Waf_Runner::is_enabled() ) { + return false; + } + + return array( + 'ipAllowListCount' => Waf_Stats::get_ip_allow_list_count(), + 'ipBlockListCount' => Waf_Stats::get_ip_block_list_count(), + 'rulesVersion' => Waf_Stats::get_rules_version(), + 'automaticRulesLastUpdated' => Waf_Stats::get_automatic_rules_last_updated(), + ); + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-plan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-plan.php new file mode 100644 index 00000000..936f2885 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-plan.php @@ -0,0 +1,111 @@ + ( self::CACHE_VALIDITY_PERIOD ); + } + + /** + * Gets the product list from the user cache + */ + private static function get_product_from_cache() { + return get_user_meta( get_current_user_id(), self::CACHE_META_NAME, true ); + } + + /** + * Gets the product data + * + * @param string $wpcom_product The product slug. + * @return array + */ + public static function get_product( $wpcom_product = 'jetpack_scan' ) { + if ( ! self::is_cache_old() ) { + return self::get_product_from_cache(); + } + + $request_url = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack'; + $wpcom_request = wp_remote_get( esc_url_raw( $request_url ) ); + $response_code = wp_remote_retrieve_response_code( $wpcom_request ); + + if ( 200 === $response_code ) { + $products = json_decode( wp_remote_retrieve_body( $wpcom_request ) ); + + // Pick the desired product... + $product = $products->{$wpcom_product}; + + // ... and store it into the cache. + update_user_meta( get_current_user_id(), self::CACHE_DATE_META_NAME, time() ); + update_user_meta( get_current_user_id(), self::CACHE_META_NAME, $product ); + + return $product; + } + + return new \WP_Error( + 'failed_to_fetch_data', + esc_html__( 'Unable to fetch the requested data.', 'jetpack-protect' ), + array( + 'status' => $response_code, + 'request' => $wpcom_request, + ) + ); + } + + /** + * Has Required Plan + * + * @param bool $force_refresh Refresh the local plan cache from wpcom. + * @return bool True when the site has a plan or product that supports the paid Protect tier. + */ + public static function has_required_plan( $force_refresh = false ) { + static $has_scan = null; + if ( null === $has_scan || $force_refresh ) { + $products = array_column( Current_Plan::get_products(), 'product_slug' ); + + // Check for a plan or product that enables scan. + $plan_supports_scan = Current_Plan::supports( 'scan', true ); + $has_scan_product = count( array_intersect( array( 'jetpack_scan', 'jetpack_scan_monthly' ), $products ) ) > 0; + $has_scan = $plan_supports_scan || $has_scan_product; + } + + return $has_scan; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-protect-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-protect-status.php new file mode 100644 index 00000000..060fa2d5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-protect-status.php @@ -0,0 +1,259 @@ + true, + 'error_code' => $status->get_error_code(), + 'error_message' => $status->get_error_message(), + ) + ); + } else { + $status = self::normalize_protect_report_data( $status ); + } + + self::$status = $status; + return $status; + } + + /** + * Gets the WPCOM API endpoint + * + * @return WP_Error|string + */ + public static function get_api_url() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( self::REST_API_BASE, $blog_id ); + + return $api_url; + } + + /** + * Fetches the status from WPCOM servers + * + * @return WP_Error|array + */ + public static function fetch_from_server() { + $api_url = self::get_api_url(); + if ( is_wp_error( $api_url ) ) { + return $api_url; + } + + $response = Client::wpcom_json_api_request_as_blog( + self::get_api_url(), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new WP_Error( 'failed_fetching_status', 'Failed to fetch Protect Status data from server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + self::update_status_option( $body ); + return $body; + } + + /** + * Normalize data from the Protect Report data source. + * + * @param object $report_data Data from the Protect Report. + * @return Status_Model + */ + protected static function normalize_protect_report_data( $report_data ) { + $status = new Status_Model(); + $status->data_source = 'protect_report'; + + // map report data properties directly into the Status_Model + $status->status = isset( $report_data->status ) ? $report_data->status : null; + $status->last_checked = isset( $report_data->last_checked ) ? $report_data->last_checked : null; + $status->num_threats = isset( $report_data->num_vulnerabilities ) ? $report_data->num_vulnerabilities : null; + $status->num_themes_threats = isset( $report_data->num_themes_vulnerabilities ) ? $report_data->num_themes_vulnerabilities : null; + $status->num_plugins_threats = isset( $report_data->num_plugins_vulnerabilities ) ? $report_data->num_plugins_vulnerabilities : null; + + // merge plugins from report with all installed plugins before mapping into the Status_Model + $installed_plugins = Plugins_Installer::get_plugins(); + $last_report_plugins = isset( $report_data->plugins ) ? $report_data->plugins : new \stdClass(); + $status->plugins = self::merge_installed_and_checked_lists( $installed_plugins, $last_report_plugins, array( 'type' => 'plugins' ) ); + + // merge themes from report with all installed plugins before mapping into the Status_Model + $installed_themes = Sync_Functions::get_themes(); + $last_report_themes = isset( $report_data->themes ) ? $report_data->themes : new \stdClass(); + $status->themes = self::merge_installed_and_checked_lists( $installed_themes, $last_report_themes, array( 'type' => 'themes' ) ); + + // normalize WordPress core report data and map into Status_Model + $status->core = self::normalize_core_information( isset( $report_data->core ) ? $report_data->core : new \stdClass() ); + + // check if any installed items (themes, plugins, or core) have not been checked in the report + $all_items = array_merge( $status->plugins, $status->themes, array( $status->core ) ); + $unchecked_items = array_filter( + $all_items, + function ( $item ) { + return ! isset( $item->checked ) || ! $item->checked; + } + ); + $status->has_unchecked_items = ! empty( $unchecked_items ); + + return $status; + } + + /** + * Merges the list of installed extensions with the list of extensions that were checked for known vulnerabilities and return a normalized list to be used in the UI + * + * @param array $installed The list of installed extensions, where each attribute key is the extension slug. + * @param object $checked The list of checked extensions. + * @param array $append Additional data to append to each result in the list. + * @return array Normalized list of extensions. + */ + protected static function merge_installed_and_checked_lists( $installed, $checked, $append ) { + $new_list = array(); + foreach ( array_keys( $installed ) as $slug ) { + + $checked = (object) $checked; + + $extension = new Extension_Model( + array_merge( + array( + 'name' => $installed[ $slug ]['Name'], + 'version' => $installed[ $slug ]['Version'], + 'slug' => $slug, + 'threats' => array(), + 'checked' => false, + ), + $append + ) + ); + + if ( isset( $checked->{ $slug } ) && $checked->{ $slug }->version === $installed[ $slug ]['Version'] ) { + $extension->version = $checked->{ $slug }->version; + $extension->checked = true; + + if ( is_array( $checked->{ $slug }->vulnerabilities ) ) { + foreach ( $checked->{ $slug }->vulnerabilities as $threat ) { + $extension->threats[] = new Threat_Model( + array( + 'id' => $threat->id, + 'title' => $threat->title, + 'fixed_in' => $threat->fixed_in, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'source' => isset( $threat->id ) ? Redirect::get_url( 'jetpack-protect-vul-info', array( 'path' => $threat->id ) ) : null, + ) + ); + } + } + } + + $new_list[] = $extension; + + } + + $new_list = parent::sort_threats( $new_list ); + + return $new_list; + } + + /** + * Check if the WordPress version that was checked matches the current installed version. + * + * @param object $core_check The object returned by Protect wpcom endpoint. + * @return object The object representing the current status of core checks. + */ + protected static function normalize_core_information( $core_check ) { + global $wp_version; + + $core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => false, + ) + ); + + if ( isset( $core_check->version ) && $core_check->version === $wp_version ) { + if ( is_array( $core_check->vulnerabilities ) ) { + $core->checked = true; + $core->set_threats( + array_map( + function ( $vulnerability ) { + $vulnerability->source = isset( $vulnerability->id ) ? Redirect::get_url( 'jetpack-protect-vul-info', array( 'path' => $vulnerability->id ) ) : null; + return $vulnerability; + }, + $core_check->vulnerabilities + ) + ); + } + } + + return $core; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php new file mode 100644 index 00000000..465f679d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-rest-controller.php @@ -0,0 +1,426 @@ + \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_check_plan', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'status', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'clear-scan-cache', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_clear_scan_cache', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'ignore-threat', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_ignore_threat', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'fix-threats', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_fix_threats', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'fix-threats-status', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_fix_threats_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'check-credentials', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_check_credentials', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'scan', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_scan', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'toggle-waf', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_toggle_waf', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-seen', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-seen', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_set_waf_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-upgrade-seen', + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => __CLASS__ . '::api_get_waf_upgrade_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'jetpack-protect/v1', + 'waf-upgrade-seen', + array( + 'methods' => \WP_REST_Server::EDITABLE, + 'callback' => __CLASS__ . '::api_set_waf_upgrade_seen_status', + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + } + + /** + * Return site plan data for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_check_plan() { + $has_required_plan = Plan::has_required_plan(); + + return rest_ensure_response( $has_required_plan, 200 ); + } + + /** + * Return Protect Status for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_get_status( $request ) { + $status = Status::get_status( $request['hard_refresh'] ); + return rest_ensure_response( $status, 200 ); + } + + /** + * Clear the Scan_Status cache for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_clear_scan_cache() { + $cache_cleared = Scan_Status::delete_option(); + + if ( ! $cache_cleared ) { + return new WP_REST_Response( 'An error occured while attempting to clear the Jetpack Scan cache.', 500 ); + } + + return new WP_REST_Response( 'Jetpack Scan cache cleared.' ); + } + + /** + * Ignores a threat for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_ignore_threat( $request ) { + if ( ! $request['threat_id'] ) { + return new WP_REST_Response( 'Missing threat ID.', 400 ); + } + + $threat_ignored = Threats::ignore_threat( $request['threat_id'] ); + + if ( ! $threat_ignored ) { + return new WP_REST_Response( 'An error occured while attempting to ignore the threat.', 500 ); + } + + return new WP_REST_Response( 'Threat ignored.' ); + } + + /** + * Fixes threats for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_fix_threats( $request ) { + if ( empty( $request['threat_ids'] ) ) { + return new WP_REST_Response( 'Missing threat IDs.', 400 ); + } + + $threats_fixed = Threats::fix_threats( $request['threat_ids'] ); + + if ( ! $threats_fixed ) { + return new WP_REST_Response( 'An error occured while attempting to fix the threat.', 500 ); + } + + return new WP_REST_Response( $threats_fixed ); + } + + /** + * Fixes threats for the API endpoint + * + * @param WP_REST_Request $request The request object. + * + * @return WP_REST_Response + */ + public static function api_fix_threats_status( $request ) { + if ( empty( $request['threat_ids'] ) ) { + return new WP_REST_Response( 'Missing threat IDs.', 400 ); + } + + $threats_fixed = Threats::fix_threats_status( $request['threat_ids'] ); + + if ( ! $threats_fixed ) { + return new WP_REST_Response( 'An error occured while attempting to get the fixer status of the threats.', 500 ); + } + + return new WP_REST_Response( $threats_fixed ); + } + + /** + * Checks if the site has credentials configured + * + * @return WP_REST_Response + */ + public static function api_check_credentials() { + $credential_array = Credentials::get_credential_array(); + + if ( ! isset( $credential_array ) ) { + return new WP_REST_Response( 'An error occured while attempting to fetch the credentials array', 500 ); + } + + return new WP_REST_Response( $credential_array ); + } + + /** + * Enqueues a scan for the API endpoint + * + * @return WP_REST_Response + */ + public static function api_scan() { + $scan_enqueued = Threats::scan(); + + if ( ! $scan_enqueued ) { + return new WP_REST_Response( 'An error occured while attempting to enqueue the scan.', 500 ); + } + + return new WP_REST_Response( 'Scan enqueued.' ); + } + + /** + * Toggles the WAF module on or off for the API endpoint + * + * @return WP_REST_Response|WP_Error + */ + public static function api_toggle_waf() { + if ( Waf_Runner::is_enabled() ) { + $disabled = Waf_Runner::disable(); + if ( ! $disabled ) { + return new WP_Error( + 'waf_disable_failed', + __( 'An error occured disabling the firewall.', 'jetpack-protect' ), + array( 'status' => 500 ) + ); + } + + return rest_ensure_response( true ); + } + + $enabled = Waf_Runner::enable(); + if ( ! $enabled ) { + return new WP_Error( + 'waf_enable_failed', + __( 'An error occured enabling the firewall.', 'jetpack-protect' ), + array( 'status' => 500 ) + ); + } + + return rest_ensure_response( true ); + } + + /** + * Get WAF data for the API endpoint + * + * @return WP_Rest_Response + */ + public static function api_get_waf() { + // Ensure plugin activation has been performed so WAF module is available. + Jetpack_Protect::do_plugin_activation_activities(); + + return new WP_REST_Response( + array( + 'is_seen' => Jetpack_Protect::get_waf_seen_status(), + 'is_enabled' => Waf_Runner::is_enabled(), + 'config' => Waf_Runner::get_config(), + 'stats' => Jetpack_Protect::get_waf_stats(), + ) + ); + } + + /** + * Get WAF "Seen" status for the API endpoint + * + * @return bool Whether the current user has viewed the WAF screen. + */ + public static function api_get_waf_seen_status() { + return Jetpack_Protect::get_waf_seen_status(); + } + + /** + * Set WAF "Seen" status for the API endpoint + * + * @return bool True if seen status updated to true, false on failure. + */ + public static function api_set_waf_seen_status() { + return Jetpack_Protect::set_waf_seen_status(); + } + + /** + * Get WAF Upgrade "Seen" Status for the API endpoint + * + * @return bool Whether the current user has dismissed the upgrade popover or enabled the automatic rules feature. + */ + public static function api_get_waf_upgrade_seen_status() { + return Jetpack_Protect::get_waf_upgrade_seen_status(); + } + + /** + * Set WAF Upgrade "Seen" Status for the API endpoint + * + * @return bool True if upgrade seen status updated to true, false on failure. + */ + public static function api_set_waf_upgrade_seen_status() { + return Jetpack_Protect::set_waf_upgrade_seen_status(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php new file mode 100644 index 00000000..89fb66a3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-scan-status.php @@ -0,0 +1,360 @@ + true, + 'error_code' => $status->get_error_code(), + 'error_message' => $status->get_error_message(), + ) + ); + } else { + $status = self::normalize_api_data( $status ); + } + + self::$status = $status; + return $status; + } + + /** + * Gets the Scan API endpoint + * + * @return WP_Error|string + */ + public static function get_api_url() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( self::SCAN_API_BASE, $blog_id ); + + return $api_url; + } + + /** + * Fetches the status data from the Scan API + * + * @return WP_Error|array + */ + public static function fetch_from_api() { + $api_url = self::get_api_url(); + if ( is_wp_error( $api_url ) ) { + return $api_url; + } + + $response = Client::wpcom_json_api_request_as_blog( + self::get_api_url(), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code || empty( $response['body'] ) ) { + return new WP_Error( 'failed_fetching_status', 'Failed to fetch Scan data from the server', array( 'status' => $response_code ) ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + self::update_status_option( $body ); + return $body; + } + + /** + * Normalize API Data + * Formats the payload from the Scan API into an instance of Status_Model. + * + * @param object $scan_data The data returned by the scan API. + * + * @return Status_Model + */ + private static function normalize_api_data( $scan_data ) { + global $wp_version; + + $status = new Status_Model(); + $status->data_source = 'scan_api'; + $status->status = isset( $scan_data->state ) ? $scan_data->state : null; + $status->num_threats = 0; + $status->num_themes_threats = 0; + $status->num_plugins_threats = 0; + $status->has_unchecked_items = false; + $status->current_progress = isset( $scan_data->current->progress ) ? $scan_data->current->progress : null; + + if ( ! empty( $scan_data->most_recent->timestamp ) ) { + $date = new \DateTime( $scan_data->most_recent->timestamp ); + if ( $date ) { + $status->last_checked = $date->format( 'Y-m-d H:i:s' ); + } + } + + $status->core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => true, // to do: default to false once Scan API has manifest + ) + ); + + if ( isset( $scan_data->threats ) && is_array( $scan_data->threats ) ) { + foreach ( $scan_data->threats as $threat ) { + if ( isset( $threat->extension->type ) ) { + if ( 'plugin' === $threat->extension->type ) { + // add the extension if it does not yet exist in the status + if ( ! isset( $status->plugins[ $threat->extension->slug ] ) ) { + $status->plugins[ $threat->extension->slug ] = new Extension_Model( + array( + 'name' => isset( $threat->extension->name ) ? $threat->extension->name : null, + 'slug' => isset( $threat->extension->slug ) ? $threat->extension->slug : null, + 'version' => isset( $threat->extension->version ) ? $threat->extension->version : null, + 'type' => 'plugin', + 'checked' => true, + 'threats' => array(), + ) + ); + } + + $status->plugins[ $threat->extension->slug ]->threats[] = new Threat_Model( + array( + 'id' => isset( $threat->id ) ? $threat->id : null, + 'signature' => isset( $threat->signature ) ? $threat->signature : null, + 'title' => isset( $threat->title ) ? $threat->title : null, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'vulnerability_description' => isset( $threat->vulnerability_description ) ? $threat->vulnerability_description : null, + 'fix_description' => isset( $threat->fix_description ) ? $threat->fix_description : null, + 'payload_subtitle' => isset( $threat->payload_subtitle ) ? $threat->payload_subtitle : null, + 'payload_description' => isset( $threat->payload_description ) ? $threat->payload_description : null, + 'first_detected' => isset( $threat->first_detected ) ? $threat->first_detected : null, + 'fixed_in' => isset( $threat->fixer->fixer ) && 'update' === $threat->fixer->fixer ? $threat->fixer->target : null, + 'severity' => isset( $threat->severity ) ? $threat->severity : null, + 'fixable' => isset( $threat->fixer ) ? $threat->fixer : null, + 'status' => isset( $threat->status ) ? $threat->status : null, + 'filename' => isset( $threat->filename ) ? $threat->filename : null, + 'context' => isset( $threat->context ) ? $threat->context : null, + 'source' => isset( $threat->source ) ? $threat->source : null, + ) + ); + ++$status->num_threats; + ++$status->num_plugins_threats; + continue; + } + + if ( 'theme' === $threat->extension->type ) { + // add the extension if it does not yet exist in the status + if ( ! isset( $status->themes[ $threat->extension->slug ] ) ) { + $status->themes[ $threat->extension->slug ] = new Extension_Model( + array( + 'name' => isset( $threat->extension->name ) ? $threat->extension->name : null, + 'slug' => isset( $threat->extension->slug ) ? $threat->extension->slug : null, + 'version' => isset( $threat->extension->version ) ? $threat->extension->version : null, + 'type' => 'theme', + 'checked' => true, + 'threats' => array(), + ) + ); + } + + $status->themes[ $threat->extension->slug ]->threats[] = new Threat_Model( + array( + 'id' => isset( $threat->id ) ? $threat->id : null, + 'signature' => isset( $threat->signature ) ? $threat->signature : null, + 'title' => isset( $threat->title ) ? $threat->title : null, + 'description' => isset( $threat->description ) ? $threat->description : null, + 'vulnerability_description' => isset( $threat->vulnerability_description ) ? $threat->vulnerability_description : null, + 'fix_description' => isset( $threat->fix_description ) ? $threat->fix_description : null, + 'payload_subtitle' => isset( $threat->payload_subtitle ) ? $threat->payload_subtitle : null, + 'payload_description' => isset( $threat->payload_description ) ? $threat->payload_description : null, + 'first_detected' => isset( $threat->first_detected ) ? $threat->first_detected : null, + 'fixed_in' => isset( $threat->fixer->fixer ) && 'update' === $threat->fixer->fixer ? $threat->fixer->target : null, + 'severity' => isset( $threat->severity ) ? $threat->severity : null, + 'fixable' => isset( $threat->fixer ) ? $threat->fixer : null, + 'status' => isset( $threat->status ) ? $threat->status : null, + 'filename' => isset( $threat->filename ) ? $threat->filename : null, + 'context' => isset( $threat->context ) ? $threat->context : null, + 'source' => isset( $threat->source ) ? $threat->source : null, + ) + ); + ++$status->num_threats; + ++$status->num_themes_threats; + continue; + } + } + + if ( isset( $threat->signature ) && 'Vulnerable.WP.Core' === $threat->signature ) { + if ( $threat->version !== $wp_version ) { + continue; + } + + $status->core->threats[] = new Threat_Model( + array( + 'id' => $threat->id, + 'signature' => $threat->signature, + 'title' => $threat->title, + 'description' => $threat->description, + 'first_detected' => $threat->first_detected, + 'severity' => $threat->severity, + ) + ); + ++$status->num_threats; + + continue; + } + + if ( ! empty( $threat->filename ) ) { + $status->files[] = new Threat_Model( $threat ); + ++$status->num_threats; + continue; + } + + if ( ! empty( $threat->table ) ) { + $status->database[] = new Threat_Model( $threat ); + ++$status->num_threats; + continue; + } + } + } + + $installed_plugins = Plugins_Installer::get_plugins(); + $status->plugins = self::merge_installed_and_checked_lists( $installed_plugins, $status->plugins, array( 'type' => 'plugins' ), true ); + + $installed_themes = Sync_Functions::get_themes(); + $status->themes = self::merge_installed_and_checked_lists( $installed_themes, $status->themes, array( 'type' => 'themes' ), true ); + + foreach ( array_merge( $status->themes, $status->plugins ) as $extension ) { + if ( ! $extension->checked ) { + $status->has_unchecked_items = true; + break; + } + } + + return $status; + } + + /** + * Merges the list of installed extensions with the list of extensions that were checked for known vulnerabilities and return a normalized list to be used in the UI + * + * @param array $installed The list of installed extensions, where each attribute key is the extension slug. + * @param object $checked The list of checked extensions. + * @param array $append Additional data to append to each result in the list. + * @return array Normalized list of extensions. + */ + protected static function merge_installed_and_checked_lists( $installed, $checked, $append ) { + $new_list = array(); + $checked = (object) $checked; + + foreach ( array_keys( $installed ) as $slug ) { + /** + * Extension Type Map + * + * @var array $extension_type_map Key value pairs of extension types and their corresponding + * identifier used by the Scan API data source. + */ + $extension_type_map = array( + 'themes' => 'r1', + 'plugins' => 'r2', + ); + + $version = $installed[ $slug ]['Version']; + $short_slug = str_replace( '.php', '', explode( '/', $slug )[0] ); + $scanifest_slug = $extension_type_map[ $append['type'] ] . ":$short_slug@$version"; + + $extension = new Extension_Model( + array_merge( + array( + 'name' => $installed[ $slug ]['Name'], + 'version' => $version, + 'slug' => $slug, + 'threats' => array(), + 'checked' => false, + ), + $append + ) + ); + + if ( ! isset( $checked->extensions ) // no extension data available from Scan API + || is_array( $checked->extensions ) && in_array( $scanifest_slug, $checked->extensions, true ) // extension data matches Scan API + ) { + $extension->checked = true; + if ( isset( $checked->{ $short_slug }->threats ) ) { + $extension->threats = $checked->{ $short_slug }->threats; + } + } + + $new_list[] = $extension; + + } + + $new_list = parent::sort_threats( $new_list ); + + return $new_list; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php new file mode 100644 index 00000000..9c62ea01 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-site-health.php @@ -0,0 +1,111 @@ + __( 'Jetpack Protect checks', 'jetpack-protect' ), + 'test' => array( __CLASS__, 'do_checks' ), + ); + + return $checks; + } + + /** + * Do site-health page checks + * + * @access public + * @return array + */ + public static function do_checks() { + $total_threats = Status::get_total_threats(); + $threats = Status::get_all_threats(); + $threats = array_map( + function ( $v ) { + return $v->title; + }, + $threats + ); + + /** + * Default, no threats found + */ + $result = array( + 'label' => __( 'No known threats found', 'jetpack-protect' ), + 'status' => 'good', + 'badge' => array( + 'label' => __( 'Security', 'jetpack-protect' ), + 'color' => 'gray', + ), + 'description' => sprintf( + '

        %s

        ', + __( 'Jetpack Protect did not find any known threats in your site. Threats can be exploited by hackers and cause harm to your website.', 'jetpack-protect' ) + ), + 'actions' => '', + 'test' => 'jetpack_protect_checks', + ); + + /** + * If threats found. + */ + if ( $total_threats ) { + $result['status'] = 'critical'; + /* translators: $d is the number of threats found. */ + $result['label'] = sprintf( _n( 'Your site is affected by %d security threat', 'Your site is affected by %d security threats', $total_threats, 'jetpack-protect' ), $total_threats ); + $result['description'] = __( 'Jetpack Protect detected the following security threats in your site:', 'jetpack-protect' ); + + foreach ( $threats as $threat ) { + $result['description'] .= '

        '; + $result['description'] .= "  "; + $result['description'] .= wp_kses( $threat, array( 'a' => array( 'href' => array() ) ) ); // Only allow a href HTML tags. + $result['description'] .= '

        '; + } + $result['description'] .= '

        '; + $result['description'] .= sprintf( + wp_kses( + /* translators: Link to Jetpack Protect. */ + __( 'See Protect overview page for more information.', 'jetpack-protect' ), + array( + 'a' => array( 'href' => array() ), + ) + ), + esc_url( admin_url( 'admin.php?page=jetpack-protect' ) ) + ); + $result['description'] .= '

        '; + } + + return $result; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-status.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-status.php new file mode 100644 index 00000000..4bf1a2e0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-status.php @@ -0,0 +1,314 @@ + (int) $option_timestamp; + } + + /** + * Checks if we should consider the stored cache or bypass it + * + * @return boolean + */ + public static function should_use_cache() { + return defined( 'JETPACK_PROTECT_DEV__BYPASS_CACHE' ) && JETPACK_PROTECT_DEV__BYPASS_CACHE ? false : true; + } + + /** + * Gets the current cached status + * + * @return bool|array False if value is not found. Array with values if cache is found. + */ + public static function get_from_options() { + return maybe_unserialize( get_option( static::OPTION_NAME ) ); + } + + /** + * Updated the cached status and its timestamp + * + * @param array $status The new status to be cached. + * @return void + */ + public static function update_status_option( $status ) { + // TODO: Sanitize $status. + update_option( static::OPTION_NAME, maybe_serialize( $status ) ); + $end_date = self::get_cache_end_date_by_status( $status ); + update_option( static::OPTION_TIMESTAMP_NAME, $end_date ); + } + + /** + * Returns the timestamp the cache should expire depending on the current status + * + * Initial empty status, which are returned before the first check was performed, should be cache for less time + * + * @param object $status The response from the server being cached. + * @return int The timestamp when the cache should expire. + */ + public static function get_cache_end_date_by_status( $status ) { + if ( ! is_object( $status ) || empty( $status->last_checked ) ) { + return time() + static::INITIAL_OPTION_EXPIRES_AFTER; + } + return time() + static::OPTION_EXPIRES_AFTER; + } + + /** + * Delete the cached status and its timestamp + * + * @return bool Whether all related status options were successfully deleted. + */ + public static function delete_option() { + $option_deleted = delete_option( static::OPTION_NAME ); + $option_timestamp_deleted = delete_option( static::OPTION_TIMESTAMP_NAME ); + + return $option_deleted && $option_timestamp_deleted; + } + + /** + * Checks the current status to see if there are any threats found + * + * @return boolean + */ + public static function has_threats() { + return 0 < self::get_total_threats(); + } + + /** + * Gets the total number of threats found + * + * @return integer + */ + public static function get_total_threats() { + $status = static::get_status(); + return isset( $status->num_threats ) && is_int( $status->num_threats ) ? $status->num_threats : 0; + } + + /** + * Get all threats combined + * + * @return array + */ + public static function get_all_threats() { + return array_merge( + self::get_wordpress_threats(), + self::get_themes_threats(), + self::get_plugins_threats(), + self::get_files_threats(), + self::get_database_threats() + ); + } + + /** + * Get threats found for WordPress core + * + * @return array + */ + public static function get_wordpress_threats() { + return self::get_threats( 'core' ); + } + + /** + * Get threats found for themes + * + * @return array + */ + public static function get_themes_threats() { + return self::get_threats( 'themes' ); + } + + /** + * Get threats found for plugins + * + * @return array + */ + public static function get_plugins_threats() { + return self::get_threats( 'plugins' ); + } + + /** + * Get threats found for files + * + * @return array + */ + public static function get_files_threats() { + return self::get_threats( 'files' ); + } + + /** + * Get threats found for plugins + * + * @return array + */ + public static function get_database_threats() { + return self::get_threats( 'database' ); + } + + /** + * Get the threats for one type of extension or core + * + * @param string $type What threats you want to get. Possible values are 'core', 'themes' and 'plugins'. + * + * @return array + */ + public static function get_threats( $type ) { + $status = static::get_status(); + + if ( 'core' === $type ) { + return isset( $status->$type ) && ! empty( $status->$type->threats ) ? $status->$type->threats : array(); + } + + if ( 'files' === $type || 'database' === $type ) { + return isset( $status->$type ) && ! empty( $status->$type ) ? $status->$type : array(); + } + + $threats = array(); + if ( isset( $status->$type ) ) { + foreach ( (array) $status->$type as $item ) { + if ( ! empty( $item->threats ) ) { + $threats = array_merge( $threats, $item->threats ); + } + } + } + return $threats; + } + + /** + * Check if the WordPress version that was checked matches the current installed version. + * + * @param object $core_check The object returned by Protect wpcom endpoint. + * @return object The object representing the current status of core checks. + */ + protected static function normalize_core_information( $core_check ) { + global $wp_version; + + $core = new Extension_Model( + array( + 'type' => 'core', + 'name' => 'WordPress', + 'version' => $wp_version, + 'checked' => false, + ) + ); + + if ( isset( $core_check->version ) && $core_check->version === $wp_version ) { + if ( is_array( $core_check->vulnerabilities ) ) { + $core->checked = true; + $core->set_threats( $core_check->vulnerabilities ); + } + } + + return $core; + } + + /** + * Sort By Threats + * + * @param array $threats Array of threats to sort. + * + * @return array The sorted $threats array. + */ + protected static function sort_threats( $threats ) { + usort( + $threats, + function ( $a, $b ) { + // sort primarily based on the presence of threats + if ( ! empty( $a->threats ) && empty( $b->threats ) ) { + return -1; + } + if ( empty( $a->threats ) && ! empty( $b->threats ) ) { + return 1; + } + // sort secondarily on whether the item has been checked + if ( $a->checked && ! $b->checked ) { + return 1; + } + if ( ! $a->checked && $b->checked ) { + return -1; + } + + return 0; + } + ); + + return $threats; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php new file mode 100644 index 00000000..c4b66e38 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/class-threats.php @@ -0,0 +1,203 @@ +is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return new WP_Error( 'site_not_connected' ); + } + + $api_url = sprintf( '/sites/%d/alerts', $blog_id ); + + return $api_url; + } + + /** + * Update Threat + * + * @param string $threat_id The threat ID. + * @param array $updates The keys/values to update. + * + * @return bool + */ + public static function update_threat( $threat_id, $updates ) { + $api_base = self::get_api_base( $threat_id ); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + "$api_base/$threat_id", + '2', + array( 'method' => 'POST' ), + wp_json_encode( $updates ), + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + + return true; + } + + /** + * Ignore Threat + * + * @param string $threat_id The threat ID. + * + * @return bool + */ + public static function ignore_threat( $threat_id ) { + return self::update_threat( $threat_id, array( 'ignore' => true ) ); + } + + /** + * Fix Threats + * + * @param array $threat_ids Threat IDs. + * + * @return bool|array + */ + public static function fix_threats( $threat_ids ) { + $api_base = self::get_api_base(); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + "$api_base/fix", + '2', + array( 'method' => 'POST' ), + wp_json_encode( + array( + 'threat_ids' => $threat_ids, + ) + ), + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + return $parsed_response; + } + + /** + * Fix Threats Status + * + * @param array $threat_ids Threat IDs. + * + * @return bool|array + */ + public static function fix_threats_status( $threat_ids ) { + $api_base = self::get_api_base(); + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_user( + add_query_arg( 'threat_ids', $threat_ids, "$api_base/fix" ), + '2', + array( 'method' => 'GET' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + $parsed_response = json_decode( $response['body'] ); + + if ( ! $parsed_response ) { + return false; + } + + // clear the potentially out-of-date cache + Scan_Status::delete_option(); + + return $parsed_response; + } + + /** + * Scan enqueue + * + * @return bool + */ + public static function scan() { + $blog_id = Jetpack_Options::get_option( 'id' ); + $is_connected = ( new Connection_Manager() )->is_connected(); + + if ( ! $blog_id || ! $is_connected ) { + return false; + } + + $api_base = sprintf( '/sites/%d/scan', $blog_id ); + + if ( is_wp_error( $api_base ) ) { + return false; + } + + $response = Client::wpcom_json_api_request_as_blog( + "$api_base/enqueue", + '2', + array( 'method' => 'POST' ), + null, + 'wpcom' + ); + + $response_code = wp_remote_retrieve_response_code( $response ); + + if ( is_wp_error( $response ) || 200 !== $response_code ) { + return false; + } + + // clear the now out-of-date cache + Scan_Status::delete_option(); + + return true; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php new file mode 100644 index 00000000..4a1fb3b4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-extension-model.php @@ -0,0 +1,111 @@ + + */ + public $threats = array(); + + /** + * Whether the extension has been checked for threats. + * + * @var null|bool + */ + public $checked; + + /** + * The type of extension ("plugins", "themes", or "core"). + * + * @var null|string + */ + public $type; + + /** + * Extension Model Constructor + * + * @param array|object $extension Extension data to load into the model instance. + */ + public function __construct( $extension = array() ) { + if ( is_object( $extension ) ) { + $extension = (array) $extension; + } + + foreach ( $extension as $property => $value ) { + if ( property_exists( $this, $property ) ) { + // use the property's setter method when possible + if ( method_exists( $this, "set_$property" ) ) { + $this->{ "set_$property" }( $value ); + continue; + } + + // otherwise, map the value directly into the class property + $this->$property = $value; + } + } + } + + /** + * Set Threats + * + * @param array $threats An array of threat data to add to the extension. + */ + public function set_threats( $threats ) { + if ( ! is_array( $threats ) ) { + $this->threats = array(); + return; + } + + // convert each provided threat item into an instance of Threat_Model + $threats = array_map( + function ( $threat ) { + if ( is_a( $threat, 'Threat_Model' ) ) { + return $threat; + } + + if ( is_object( $threat ) ) { + $threat = (array) $threat; + } + + return new Threat_Model( $threat ); + }, + $threats + ); + + $this->threats = $threats; + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-status-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-status-model.php new file mode 100644 index 00000000..2ac4af68 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-status-model.php @@ -0,0 +1,142 @@ + + */ + public $themes = array(); + + /** + * Status plugins. + * + * @var array + */ + public $plugins = array(); + + /** + * File threats. + * + * @var array + */ + public $files = array(); + + /** + * Database threats. + * + * @var array + */ + public $database = array(); + + /** + * Whether the site includes items that have not been checked. + * + * @var boolean + */ + public $has_unchecked_items; + + /** + * The estimated percentage of the current scan. + * + * @var int + */ + public $current_progress; + + /** + * Whether there was an error loading the status. + * + * @var bool + */ + public $error = false; + + /** + * The error code thrown when loading the status. + * + * @var string + */ + public $error_code; + + /** + * The error message thrown when loading the status. + * + * @var string + */ + public $error_message; + + /** + * Status constructor. + * + * @param array $status The status data to load into the class instance. + */ + public function __construct( $status = array() ) { + // set status defaults + $this->core = new \stdClass(); + + foreach ( $status as $property => $value ) { + if ( property_exists( $this, $property ) ) { + $this->$property = $value; + } + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-threat-model.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-threat-model.php new file mode 100644 index 00000000..c45226d6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/src/models/class-threat-model.php @@ -0,0 +1,116 @@ + $value ) { + if ( property_exists( $this, $property ) ) { + $this->$property = $value; + } + } + } + +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php new file mode 100644 index 00000000..e51f3f03 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/autoload.php @@ -0,0 +1,25 @@ + +Copyright (C) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md new file mode 100644 index 00000000..b4b46c0e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/SECURITY.md @@ -0,0 +1,38 @@ +# Security Policy + +Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/). + +## Supported Versions + +Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions. + +## Reporting a Vulnerability + +[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure. + +**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.** + +Our most critical targets are: + +* Jetpack and the Jetpack composer packages (all within this repo) +* Jetpack.com -- the primary marketing site. +* cloud.jetpack.com -- a management site. +* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites. + +For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic). + +_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._ + +## Guidelines + +We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines: + +* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines). +* Pen-testing Production: + * Please **setup a local environment** instead whenever possible. Most of our code is open source (see above). + * If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC. + * **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels. + * To be eligible for a bounty, all of these guidelines must be followed. +* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability. + +We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json new file mode 100644 index 00000000..50f094b4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/composer.json @@ -0,0 +1,49 @@ +{ + "name": "automattic/jetpack-plans", + "description": "Fetch information about Jetpack Plans from wpcom", + "type": "library", + "license": "GPL-2.0-or-later", + "require": { + "automattic/jetpack-connection": "^1.51.0" + }, + "require-dev": { + "yoast/phpunit-polyfills": "1.0.4", + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-status": "^1.16.2", + "automattic/wordbless": "@dev" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-php": [ + "@composer phpunit" + ], + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "build-production": "echo 'Add your build step to composer.json, please!'", + "build-development": "echo 'Add your build step to composer.json, please!'" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-plans", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plans/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + } + }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php new file mode 100644 index 00000000..b9679f24 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-current-plan.php @@ -0,0 +1,367 @@ + array( + 'plans' => array( + 'jetpack_free', + ), + 'supports' => array( + 'opentable', + 'calendly', + 'send-a-message', + 'whatsapp-button', + 'social-previews', + 'videopress', + + 'core/video', + 'core/cover', + 'core/audio', + ), + ), + 'personal' => array( + 'plans' => array( + 'jetpack_personal', + 'jetpack_personal_monthly', + 'personal-bundle', + 'personal-bundle-monthly', + 'personal-bundle-2y', + 'starter-plan', + ), + 'supports' => array( + 'akismet', + 'payments', + 'recurring-payments', + 'premium-content/container', + 'videopress', + ), + ), + 'premium' => array( + 'plans' => array( + 'jetpack_premium', + 'jetpack_premium_monthly', + 'value_bundle', + 'value_bundle-monthly', + 'value_bundle-2y', + ), + 'supports' => array( + 'donations', + 'simple-payments', + 'vaultpress', + 'videopress', + 'republicize', + ), + ), + 'security' => array( + 'plans' => array( + 'jetpack_security_daily', + 'jetpack_security_daily_monthly', + 'jetpack_security_realtime', + 'jetpack_security_realtime_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', + ), + 'supports' => array(), + ), + 'business' => array( + 'plans' => array( + 'jetpack_business', + 'jetpack_business_monthly', + 'business-bundle', + 'business-bundle-monthly', + 'business-bundle-2y', + 'ecommerce-bundle', + 'ecommerce-bundle-monthly', + 'ecommerce-bundle-2y', + 'pro-plan', + ), + 'supports' => array(), + ), + + 'complete' => array( + 'plans' => array( + 'jetpack_complete', + 'jetpack_complete_monthly', + 'vip', + ), + 'supports' => array(), + ), + ); + + /** + * Given a response to the `/sites/%d` endpoint, will parse the response and attempt to set the + * site's plan and products from the response. + * + * @param array $response The response from `/sites/%d`. + * @return bool Was the plan successfully updated? + */ + public static function update_from_sites_response( $response ) { + // Bail if there was an error or malformed response. + if ( is_wp_error( $response ) || ! is_array( $response ) || ! isset( $response['body'] ) ) { + return false; + } + + $body = wp_remote_retrieve_body( $response ); + if ( is_wp_error( $body ) ) { + return false; + } + + // Decode the results. + $results = json_decode( $body, true ); + + if ( ! is_array( $results ) ) { + return false; + } + + if ( isset( $results['products'] ) ) { + // Store the site's products in an option and return true if updated. + self::store_data_in_option( self::SITE_PRODUCTS_OPTION, $results['products'] ); + } + + if ( ! isset( $results['plan'] ) ) { + return false; + } + + $current_plan = get_option( self::PLAN_OPTION, array() ); + + if ( ! empty( $current_plan ) && $current_plan === $results['plan'] ) { + // Bail if the plans array hasn't changed. + return false; + } + + // Store the new plan in an option and return true if updated. + $result = self::store_data_in_option( self::PLAN_OPTION, $results['plan'] ); + + if ( $result ) { + // Reset the cache since we've just updated the plan. + self::$active_plan_cache = null; + } + + return $result; + } + + /** + * Store data in an option. + * + * @param string $option The name of the option that will store the data. + * @param array $data Data to be store in an option. + * @return bool Were the subscriptions successfully updated? + */ + private static function store_data_in_option( $option, $data ) { + $result = update_option( $option, $data, true ); + + // If something goes wrong with the update, so delete the current option and then update it. + if ( ! $result ) { + delete_option( $option ); + $result = update_option( $option, $data, true ); + } + + return $result; + } + + /** + * Make an API call to WordPress.com for plan status + * + * @uses Jetpack_Options::get_option() + * @uses Client::wpcom_json_api_request_as_blog() + * @uses update_option() + * + * @access public + * @static + * + * @return bool True if plan is updated, false if no update + */ + public static function refresh_from_wpcom() { + // Make the API request. + + $response = Client::wpcom_json_api_request_as_blog( sprintf( '/sites/%d', Jetpack_Options::get_option( 'id' ) ) . '?force=wpcom', '1.1' ); + return self::update_from_sites_response( $response ); + } + + /** + * Get the plan that this Jetpack site is currently using. + * + * @uses get_option() + * + * @access public + * @static + * + * @return array Active Jetpack plan details + */ + public static function get() { + // this can be expensive to compute so we cache for the duration of a request. + if ( is_array( self::$active_plan_cache ) && ! empty( self::$active_plan_cache ) ) { + return self::$active_plan_cache; + } + + $plan = get_option( self::PLAN_OPTION, array() ); + + // Set the default options. + $plan = wp_parse_args( + $plan, + array( + 'product_slug' => 'jetpack_free', + 'class' => 'free', + 'features' => array( + 'active' => array(), + ), + ) + ); + + list( $plan['class'], $supports ) = self::get_class_and_features( $plan['product_slug'] ); + + // get available features if Jetpack is active. + if ( class_exists( 'Jetpack' ) ) { + foreach ( \Jetpack::get_available_modules() as $module_slug ) { + $module = \Jetpack::get_module( $module_slug ); + if ( ! isset( $module ) || ! is_array( $module ) ) { + continue; + } + if ( in_array( 'free', $module['plan_classes'], true ) || in_array( $plan['class'], $module['plan_classes'], true ) ) { + $supports[] = $module_slug; + } + } + } + + $plan['supports'] = $supports; + + self::$active_plan_cache = $plan; + + return $plan; + } + + /** + * Get the site's products. + * + * @uses get_option() + * + * @access public + * @static + * + * @return array Active Jetpack products + */ + public static function get_products() { + return get_option( self::SITE_PRODUCTS_OPTION, array() ); + } + + /** + * Get the class of plan and a list of features it supports + * + * @param string $plan_slug The plan that we're interested in. + * @return array Two item array, the plan class and the an array of features. + */ + private static function get_class_and_features( $plan_slug ) { + $features = array(); + foreach ( self::PLAN_DATA as $class => $details ) { + $features = array_merge( $features, $details['supports'] ); + if ( in_array( $plan_slug, $details['plans'], true ) ) { + return array( $class, $features ); + } + } + return array( 'free', self::PLAN_DATA['free']['supports'] ); + } + + /** + * Gets the minimum plan slug that supports the given feature + * + * @param string $feature The name of the feature. + * @return string|bool The slug for the minimum plan that supports. + * the feature or false if not found + */ + public static function get_minimum_plan_for_feature( $feature ) { + foreach ( self::PLAN_DATA as $details ) { + if ( in_array( $feature, $details['supports'], true ) ) { + return $details['plans'][0]; + } + } + return false; + } + + /** + * Determine whether the active plan supports a particular feature + * + * @uses Jetpack_Plan::get() + * + * @access public + * @static + * + * @param string $feature The module or feature to check. + * @param bool $refresh_from_wpcom Refresh the local plan cache from wpcom. + * + * @return bool True if plan supports feature, false if not + */ + public static function supports( $feature, $refresh_from_wpcom = false ) { + if ( $refresh_from_wpcom ) { + self::refresh_from_wpcom(); + } + + // Hijack the feature eligibility check on WordPress.com sites since they are gated differently. + $should_wpcom_gate_feature = ( + function_exists( 'wpcom_site_has_feature' ) && + function_exists( 'wpcom_feature_exists' ) && + wpcom_feature_exists( $feature ) + ); + if ( $should_wpcom_gate_feature ) { + return wpcom_site_has_feature( $feature ); + } + + // Search product bypasses plan feature check. + if ( 'search' === $feature && (bool) get_option( 'has_jetpack_search_product' ) ) { + return true; + } + + // As of Q3 2021 - a videopress free tier is available to all plans. + if ( 'videopress' === $feature ) { + return true; + } + + $plan = self::get(); + + if ( + in_array( $feature, $plan['supports'], true ) + || in_array( $feature, $plan['features']['active'], true ) + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php new file mode 100644 index 00000000..a62a95a1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/automattic/jetpack-plans/src/class-plans.php @@ -0,0 +1,80 @@ + 'GET', + 'headers' => array( + 'X-Forwarded-For' => ( new Automattic\Jetpack\Status\Visitor() )->get_ip( true ), + ), + ), + null, + 'rest' + ); + + $body = wp_remote_retrieve_body( $request ); + if ( 200 === wp_remote_retrieve_response_code( $request ) ) { + return json_decode( $body ); + } else { + return $body; + } + } + + /** + * Get plan information for a plan given its slug + * + * @since-jetpack 7.7.0 + * + * @param string $plan_slug Plan slug. + * + * @return object The plan object + */ + public static function get_plan( $plan_slug ) { + $plans = self::get_plans(); + if ( ! is_array( $plans ) ) { + return; + } + + foreach ( $plans as $plan ) { + if ( $plan_slug === $plan->product_slug ) { + return $plan; + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php new file mode 100644 index 00000000..afef3fa2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/ClassLoader.php @@ -0,0 +1,572 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-return array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..c6b54af7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/InstalledVersions.php @@ -0,0 +1,352 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..71dad34f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_classmap.php @@ -0,0 +1,197 @@ + $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php', + 'AhoCorasick\\MultiStringReplacer' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php', + 'Automattic\\Jetpack\\A8c_Mc_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php', + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php', + 'Automattic\\Jetpack\\Assets' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php', + 'Automattic\\Jetpack\\Assets\\Logo' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php', + 'Automattic\\Jetpack\\Assets\\Semver' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php', + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php', + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php', + 'Automattic\\Jetpack\\Automatic_Install_Skin' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php', + 'Automattic\\Jetpack\\Composer\\Manager' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php', + 'Automattic\\Jetpack\\Composer\\Plugin' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php', + 'Automattic\\Jetpack\\Config' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php', + 'Automattic\\Jetpack\\Connection\\Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php', + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php', + 'Automattic\\Jetpack\\Connection\\Error_Handler' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php', + 'Automattic\\Jetpack\\Connection\\Initial_State' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php', + 'Automattic\\Jetpack\\Connection\\Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php', + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php', + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php', + 'Automattic\\Jetpack\\Connection\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php', + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php', + 'Automattic\\Jetpack\\Connection\\Plugin' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php', + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php', + 'Automattic\\Jetpack\\Connection\\REST_Connector' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php', + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php', + 'Automattic\\Jetpack\\Connection\\Secrets' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php', + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php', + 'Automattic\\Jetpack\\Connection\\Tokens' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php', + 'Automattic\\Jetpack\\Connection\\Urls' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php', + 'Automattic\\Jetpack\\Connection\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php', + 'Automattic\\Jetpack\\Connection\\Webhooks' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php', + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php', + 'Automattic\\Jetpack\\Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php', + 'Automattic\\Jetpack\\CookieState' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php', + 'Automattic\\Jetpack\\Current_Plan' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php', + 'Automattic\\Jetpack\\Device_Detection' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php', + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php', + 'Automattic\\Jetpack\\Errors' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php', + 'Automattic\\Jetpack\\Files' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php', + 'Automattic\\Jetpack\\Heartbeat' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php', + 'Automattic\\Jetpack\\IP\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php', + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php', + 'Automattic\\Jetpack\\Identity_Crisis' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php', + 'Automattic\\Jetpack\\JITMS\\JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php', + 'Automattic\\Jetpack\\Licensing' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php', + 'Automattic\\Jetpack\\Licensing\\Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php', + 'Automattic\\Jetpack\\Modules' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php', + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php', + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Product' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php', + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php', + 'Automattic\\Jetpack\\Partner' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php', + 'Automattic\\Jetpack\\Partner_Coupon' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php', + 'Automattic\\Jetpack\\Password_Checker' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php', + 'Automattic\\Jetpack\\Paths' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php', + 'Automattic\\Jetpack\\Plans' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php', + 'Automattic\\Jetpack\\Plugins_Installer' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php', + 'Automattic\\Jetpack\\Protect\\Credentials' => $baseDir . '/src/class-credentials.php', + 'Automattic\\Jetpack\\Protect\\Extension_Model' => $baseDir . '/src/models/class-extension-model.php', + 'Automattic\\Jetpack\\Protect\\Plan' => $baseDir . '/src/class-plan.php', + 'Automattic\\Jetpack\\Protect\\Protect_Status' => $baseDir . '/src/class-protect-status.php', + 'Automattic\\Jetpack\\Protect\\REST_Controller' => $baseDir . '/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect\\Scan_Status' => $baseDir . '/src/class-scan-status.php', + 'Automattic\\Jetpack\\Protect\\Site_Health' => $baseDir . '/src/class-site-health.php', + 'Automattic\\Jetpack\\Protect\\Status' => $baseDir . '/src/class-status.php', + 'Automattic\\Jetpack\\Protect\\Status_Model' => $baseDir . '/src/models/class-status-model.php', + 'Automattic\\Jetpack\\Protect\\Threat_Model' => $baseDir . '/src/models/class-threat-model.php', + 'Automattic\\Jetpack\\Protect\\Threats' => $baseDir . '/src/class-threats.php', + 'Automattic\\Jetpack\\Redirect' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php', + 'Automattic\\Jetpack\\Roles' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php', + 'Automattic\\Jetpack\\Status' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php', + 'Automattic\\Jetpack\\Status\\Cache' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php', + 'Automattic\\Jetpack\\Status\\Host' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php', + 'Automattic\\Jetpack\\Status\\Visitor' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php', + 'Automattic\\Jetpack\\Sync\\Actions' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php', + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php', + 'Automattic\\Jetpack\\Sync\\Data_Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php', + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php', + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php', + 'Automattic\\Jetpack\\Sync\\Defaults' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php', + 'Automattic\\Jetpack\\Sync\\Functions' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php', + 'Automattic\\Jetpack\\Sync\\Health' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php', + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php', + 'Automattic\\Jetpack\\Sync\\Listener' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php', + 'Automattic\\Jetpack\\Sync\\Lock' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php', + 'Automattic\\Jetpack\\Sync\\Main' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php', + 'Automattic\\Jetpack\\Sync\\Modules' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php', + 'Automattic\\Jetpack\\Sync\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php', + 'Automattic\\Jetpack\\Sync\\Queue' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php', + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php', + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\Sync\\REST_Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php', + 'Automattic\\Jetpack\\Sync\\Replicastore' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php', + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Sender' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php', + 'Automattic\\Jetpack\\Sync\\Server' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php', + 'Automattic\\Jetpack\\Sync\\Settings' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php', + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php', + 'Automattic\\Jetpack\\Sync\\Users' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php', + 'Automattic\\Jetpack\\Sync\\Utils' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php', + 'Automattic\\Jetpack\\Terms_Of_Service' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php', + 'Automattic\\Jetpack\\Tracking' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php', + 'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php', + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php', + 'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php', + 'Automattic\\Jetpack\\Waf\\CLI' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php', + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php', + 'Automattic\\Jetpack\\Waf\\REST_Controller' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php', + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php', + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php', + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php', + 'Automattic\\Jetpack\\Waf\\Waf_Request' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php', + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php', + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php', + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php', + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Jetpack_IXR_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php', + 'Jetpack_IXR_ClientMulticall' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php', + 'Jetpack_Options' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php', + 'Jetpack_Protect' => $baseDir . '/src/class-jetpack-protect.php', + 'Jetpack_Signature' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php', + 'Jetpack_Tracks_Client' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php', + 'Jetpack_Tracks_Event' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php', + 'Jetpack_XMLRPC_Server' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php', +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php new file mode 100644 index 00000000..190ac33c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_files.php @@ -0,0 +1,12 @@ + $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php', + '590147edb63acb03b2852d5c4db13ce8' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php', + '3d45c7e6a7f0e71849e33afe4b3b3ede' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php', +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/automattic/jetpack-autoloader/src'), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php new file mode 100644 index 00000000..fc7a0691 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_real.php @@ -0,0 +1,58 @@ +setClassMapAuthoritative(true); + $loader->register(true); + + $includeFiles = \Composer\Autoload\ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0::$files; + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0($fileIdentifier, $file); + } + + return $loader; + } +} + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequirec4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php new file mode 100644 index 00000000..f57795bb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/autoload_static.php @@ -0,0 +1,229 @@ + __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/actions.php', + '590147edb63acb03b2852d5c4db13ce8' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php', + '3d45c7e6a7f0e71849e33afe4b3b3ede' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/cli.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'A' => + array ( + 'Automattic\\Jetpack\\Autoloader\\' => 30, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Automattic\\Jetpack\\Autoloader\\' => + array ( + 0 => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src', + ), + ); + + public static $classMap = array ( + 'AhoCorasick\\MultiStringMatcher' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringMatcher.php', + 'AhoCorasick\\MultiStringReplacer' => __DIR__ . '/..' . '/wikimedia/aho-corasick/src/MultiStringReplacer.php', + 'Automattic\\Jetpack\\A8c_Mc_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php', + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php', + 'Automattic\\Jetpack\\Assets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php', + 'Automattic\\Jetpack\\Assets\\Logo' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php', + 'Automattic\\Jetpack\\Assets\\Semver' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php', + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php', + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php', + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => __DIR__ . '/..' . '/automattic/jetpack-autoloader/src/ManifestGenerator.php', + 'Automattic\\Jetpack\\Automatic_Install_Skin' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php', + 'Automattic\\Jetpack\\Composer\\Manager' => __DIR__ . '/..' . '/automattic/jetpack-composer-plugin/src/class-manager.php', + 'Automattic\\Jetpack\\Composer\\Plugin' => __DIR__ . '/..' . '/automattic/jetpack-composer-plugin/src/class-plugin.php', + 'Automattic\\Jetpack\\Config' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php', + 'Automattic\\Jetpack\\Connection\\Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php', + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php', + 'Automattic\\Jetpack\\Connection\\Error_Handler' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php', + 'Automattic\\Jetpack\\Connection\\Initial_State' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php', + 'Automattic\\Jetpack\\Connection\\Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php', + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php', + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php', + 'Automattic\\Jetpack\\Connection\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php', + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php', + 'Automattic\\Jetpack\\Connection\\Plugin' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php', + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php', + 'Automattic\\Jetpack\\Connection\\REST_Connector' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php', + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php', + 'Automattic\\Jetpack\\Connection\\Secrets' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php', + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php', + 'Automattic\\Jetpack\\Connection\\Tokens' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php', + 'Automattic\\Jetpack\\Connection\\Urls' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php', + 'Automattic\\Jetpack\\Connection\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php', + 'Automattic\\Jetpack\\Connection\\Webhooks' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php', + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php', + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php', + 'Automattic\\Jetpack\\Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php', + 'Automattic\\Jetpack\\CookieState' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php', + 'Automattic\\Jetpack\\Current_Plan' => __DIR__ . '/..' . '/automattic/jetpack-plans/src/class-current-plan.php', + 'Automattic\\Jetpack\\Device_Detection' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php', + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php', + 'Automattic\\Jetpack\\Errors' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php', + 'Automattic\\Jetpack\\Files' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php', + 'Automattic\\Jetpack\\Heartbeat' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php', + 'Automattic\\Jetpack\\IP\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php', + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php', + 'Automattic\\Jetpack\\Identity_Crisis' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php', + 'Automattic\\Jetpack\\JITMS\\JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php', + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php', + 'Automattic\\Jetpack\\Licensing' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php', + 'Automattic\\Jetpack\\Licensing\\Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php', + 'Automattic\\Jetpack\\Modules' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php', + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php', + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Product' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php', + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php', + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php', + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php', + 'Automattic\\Jetpack\\Partner' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php', + 'Automattic\\Jetpack\\Partner_Coupon' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php', + 'Automattic\\Jetpack\\Password_Checker' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php', + 'Automattic\\Jetpack\\Paths' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php', + 'Automattic\\Jetpack\\Plans' => __DIR__ . '/..' . '/automattic/jetpack-plans/src/class-plans.php', + 'Automattic\\Jetpack\\Plugins_Installer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php', + 'Automattic\\Jetpack\\Protect\\Credentials' => __DIR__ . '/../..' . '/src/class-credentials.php', + 'Automattic\\Jetpack\\Protect\\Extension_Model' => __DIR__ . '/../..' . '/src/models/class-extension-model.php', + 'Automattic\\Jetpack\\Protect\\Plan' => __DIR__ . '/../..' . '/src/class-plan.php', + 'Automattic\\Jetpack\\Protect\\Protect_Status' => __DIR__ . '/../..' . '/src/class-protect-status.php', + 'Automattic\\Jetpack\\Protect\\REST_Controller' => __DIR__ . '/../..' . '/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Protect\\Scan_Status' => __DIR__ . '/../..' . '/src/class-scan-status.php', + 'Automattic\\Jetpack\\Protect\\Site_Health' => __DIR__ . '/../..' . '/src/class-site-health.php', + 'Automattic\\Jetpack\\Protect\\Status' => __DIR__ . '/../..' . '/src/class-status.php', + 'Automattic\\Jetpack\\Protect\\Status_Model' => __DIR__ . '/../..' . '/src/models/class-status-model.php', + 'Automattic\\Jetpack\\Protect\\Threat_Model' => __DIR__ . '/../..' . '/src/models/class-threat-model.php', + 'Automattic\\Jetpack\\Protect\\Threats' => __DIR__ . '/../..' . '/src/class-threats.php', + 'Automattic\\Jetpack\\Redirect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php', + 'Automattic\\Jetpack\\Roles' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php', + 'Automattic\\Jetpack\\Status' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php', + 'Automattic\\Jetpack\\Status\\Cache' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php', + 'Automattic\\Jetpack\\Status\\Host' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php', + 'Automattic\\Jetpack\\Status\\Visitor' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php', + 'Automattic\\Jetpack\\Sync\\Actions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php', + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php', + 'Automattic\\Jetpack\\Sync\\Data_Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php', + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php', + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php', + 'Automattic\\Jetpack\\Sync\\Defaults' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php', + 'Automattic\\Jetpack\\Sync\\Functions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php', + 'Automattic\\Jetpack\\Sync\\Health' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php', + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php', + 'Automattic\\Jetpack\\Sync\\Listener' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php', + 'Automattic\\Jetpack\\Sync\\Lock' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php', + 'Automattic\\Jetpack\\Sync\\Main' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php', + 'Automattic\\Jetpack\\Sync\\Modules' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php', + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php', + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php', + 'Automattic\\Jetpack\\Sync\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php', + 'Automattic\\Jetpack\\Sync\\Queue' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php', + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php', + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php', + 'Automattic\\Jetpack\\Sync\\REST_Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php', + 'Automattic\\Jetpack\\Sync\\Replicastore' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php', + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php', + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php', + 'Automattic\\Jetpack\\Sync\\Sender' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php', + 'Automattic\\Jetpack\\Sync\\Server' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php', + 'Automattic\\Jetpack\\Sync\\Settings' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php', + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php', + 'Automattic\\Jetpack\\Sync\\Users' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php', + 'Automattic\\Jetpack\\Sync\\Utils' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php', + 'Automattic\\Jetpack\\Terms_Of_Service' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php', + 'Automattic\\Jetpack\\Tracking' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php', + 'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php', + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php', + 'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php', + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php', + 'Automattic\\Jetpack\\Waf\\CLI' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php', + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php', + 'Automattic\\Jetpack\\Waf\\REST_Controller' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php', + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php', + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php', + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php', + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php', + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php', + 'Automattic\\Jetpack\\Waf\\Waf_Request' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php', + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php', + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php', + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php', + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php', + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Jetpack_IXR_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php', + 'Jetpack_IXR_ClientMulticall' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php', + 'Jetpack_Options' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php', + 'Jetpack_Protect' => __DIR__ . '/../..' . '/src/class-jetpack-protect.php', + 'Jetpack_Signature' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php', + 'Jetpack_Tracks_Client' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php', + 'Jetpack_Tracks_Event' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php', + 'Jetpack_XMLRPC_Server' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ1_4_0::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json new file mode 100644 index 00000000..0682851d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.json @@ -0,0 +1,1440 @@ +{ + "packages": [ + { + "name": "automattic/jetpack-a8c-mc-stats", + "version": "v1.4.20", + "version_normalized": "1.4.20.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-a8c-mc-stats.git", + "reference": "6743d34fe7556455e17cbe1b7c90ed39a1f69089" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-a8c-mc-stats/zipball/6743d34fe7556455e17cbe1b7c90ed39a1f69089", + "reference": "6743d34fe7556455e17cbe1b7c90ed39a1f69089", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:38+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-a8c-mc-stats", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-a8c-mc-stats/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Used to record internal usage stats for Automattic. Not visible to site owners.", + "support": { + "source": "https://github.com/Automattic/jetpack-a8c-mc-stats/tree/v1.4.20" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-a8c-mc-stats" + }, + { + "name": "automattic/jetpack-admin-ui", + "version": "v0.2.19", + "version_normalized": "0.2.19.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-admin-ui.git", + "reference": "ae3c7f7a3bd564172ce48f72447ecea2c7508a5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-admin-ui/zipball/ae3c7f7a3bd564172ce48f72447ecea2c7508a5a", + "reference": "ae3c7f7a3bd564172ce48f72447ecea2c7508a5a", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-logo": "^1.6.1", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:44:03+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-admin-ui", + "textdomain": "jetpack-admin-ui", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-admin-ui/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-admin-menu.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Generic Jetpack wp-admin UI elements", + "support": { + "source": "https://github.com/Automattic/jetpack-admin-ui/tree/v0.2.19" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-admin-ui" + }, + { + "name": "automattic/jetpack-assets", + "version": "v1.17.34", + "version_normalized": "1.17.34.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-assets.git", + "reference": "73ec392493a1364dcc9e57c878136bf5c91e24af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-assets/zipball/73ec392493a1364dcc9e57c878136bf5c91e24af", + "reference": "73ec392493a1364dcc9e57c878136bf5c91e24af", + "shasum": "" + }, + "require": { + "automattic/jetpack-constants": "^1.6.21" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "wikimedia/testing-access-wrapper": "^1.0 || ^2.0", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-20T19:06:49+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-assets", + "textdomain": "jetpack-assets", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-assets/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.17.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Asset management utilities for Jetpack ecosystem packages", + "support": { + "source": "https://github.com/Automattic/jetpack-assets/tree/v1.17.34" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-assets" + }, + { + "name": "automattic/jetpack-autoloader", + "version": "v2.11.18", + "version_normalized": "2.11.18.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-autoloader.git", + "reference": "53cbf0528fa6931c4fa6465bccd37514f9eda720" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/53cbf0528fa6931c4fa6465bccd37514f9eda720", + "reference": "53cbf0528fa6931c4fa6465bccd37514f9eda720", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-29T12:51:59+00:00", + "type": "composer-plugin", + "extra": { + "autotagger": true, + "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin", + "mirror-repo": "Automattic/jetpack-autoloader", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.11.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Automattic\\Jetpack\\Autoloader\\": "src" + }, + "classmap": [ + "src/AutoloadGenerator.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Creates a custom autoloader for a plugin or theme.", + "support": { + "source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.11.18" + }, + "install-path": "../automattic/jetpack-autoloader" + }, + { + "name": "automattic/jetpack-composer-plugin", + "version": "v1.1.10", + "version_normalized": "1.1.10.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-composer-plugin.git", + "reference": "c6298f3efd8a1ca76182f685d0075080e2681aa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-composer-plugin/zipball/c6298f3efd8a1ca76182f685d0075080e2681aa3", + "reference": "c6298f3efd8a1ca76182f685d0075080e2681aa3", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.1.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "composer/composer": "^2.2 || ^2.4", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-02-20T19:47:32+00:00", + "type": "composer-plugin", + "extra": { + "plugin-modifies-install-path": true, + "class": "Automattic\\Jetpack\\Composer\\Plugin", + "mirror-repo": "Automattic/jetpack-composer-plugin", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-composer-plugin/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A custom installer plugin for Composer to move Jetpack packages out of `vendor/` so WordPress's translation infrastructure will find their strings.", + "support": { + "source": "https://github.com/Automattic/jetpack-composer-plugin/tree/v1.1.10" + }, + "install-path": "../automattic/jetpack-composer-plugin" + }, + { + "name": "automattic/jetpack-config", + "version": "v1.15.1", + "version_normalized": "1.15.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-config.git", + "reference": "e4985903fb40dbc7c03bdaf58f4a80ac72c50570" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-config/zipball/e4985903fb40dbc7c03bdaf58f4a80ac72c50570", + "reference": "e4985903fb40dbc7c03bdaf58f4a80ac72c50570", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2" + }, + "time": "2023-03-29T12:51:51+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-config", + "textdomain": "jetpack-config", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-config/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.15.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Jetpack configuration package that initializes other packages and configures Jetpack's functionality. Can be used as a base for all variants of Jetpack package usage.", + "support": { + "source": "https://github.com/Automattic/jetpack-config/tree/v1.15.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-config" + }, + { + "name": "automattic/jetpack-connection", + "version": "v1.51.7", + "version_normalized": "1.51.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-connection.git", + "reference": "4c4bae836858957d9aaf6854cf4e24c3261242c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-connection/zipball/4c4bae836858957d9aaf6854cf4e24c3261242c4", + "reference": "4c4bae836858957d9aaf6854cf4e24c3261242c4", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^1.4.20", + "automattic/jetpack-admin-ui": "^0.2.19", + "automattic/jetpack-constants": "^1.6.22", + "automattic/jetpack-redirect": "^1.7.25", + "automattic/jetpack-roles": "^1.4.23", + "automattic/jetpack-status": "^1.16.4" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:44:13+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-connection", + "textdomain": "jetpack-connection", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.51.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "legacy", + "src/", + "src/webhooks" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to connect to the Jetpack infrastructure", + "support": { + "source": "https://github.com/Automattic/jetpack-connection/tree/v1.51.7" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-connection" + }, + { + "name": "automattic/jetpack-constants", + "version": "v1.6.22", + "version_normalized": "1.6.22.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-constants.git", + "reference": "7b5c44d763c7b0dd7498be2b41a89bfefe84834c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/7b5c44d763c7b0dd7498be2b41a89bfefe84834c", + "reference": "7b5c44d763c7b0dd7498be2b41a89bfefe84834c", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:45+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-constants", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-constants/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A wrapper for defining constants in a more testable way.", + "support": { + "source": "https://github.com/Automattic/jetpack-constants/tree/v1.6.22" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-constants" + }, + { + "name": "automattic/jetpack-device-detection", + "version": "v1.4.25", + "version_normalized": "1.4.25.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-device-detection.git", + "reference": "cf6297f71412dce19522193c2d517cd230a0bee9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-device-detection/zipball/cf6297f71412dce19522193c2d517cd230a0bee9", + "reference": "cf6297f71412dce19522193c2d517cd230a0bee9", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:41+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-device-detection", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-device-detection/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A way to detect device types based on User-Agent header.", + "support": { + "source": "https://github.com/Automattic/jetpack-device-detection/tree/v1.4.25" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-device-detection" + }, + { + "name": "automattic/jetpack-identity-crisis", + "version": "v0.8.40", + "version_normalized": "0.8.40.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-identity-crisis.git", + "reference": "9c52db5e021d6792084e1d225347b82acae2ce86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-identity-crisis/zipball/9c52db5e021d6792084e1d225347b82acae2ce86", + "reference": "9c52db5e021d6792084e1d225347b82acae2ce86", + "shasum": "" + }, + "require": { + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-connection": "^1.51.2", + "automattic/jetpack-constants": "^1.6.21", + "automattic/jetpack-logo": "^1.5.22", + "automattic/jetpack-status": "^1.16.2" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-20T19:07:29+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-identity-crisis", + "textdomain": "jetpack-idc", + "version-constants": { + "::PACKAGE_VERSION": "src/class-identity-crisis.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-identity-crisis/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Identity Crisis.", + "support": { + "source": "https://github.com/Automattic/jetpack-identity-crisis/tree/v0.8.40" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-identity-crisis" + }, + { + "name": "automattic/jetpack-ip", + "version": "v0.1.2", + "version_normalized": "0.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-ip.git", + "reference": "8cc665d68ef5230de78e2701b61b91af64d8dfe6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-ip/zipball/8cc665d68ef5230de78e2701b61b91af64d8dfe6", + "reference": "8cc665d68ef5230de78e2701b61b91af64d8dfe6", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:44+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-ip", + "changelogger": { + "link-template": "https://github.com/automattic/jetpack-ip/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "textdomain": "jetpack-ip", + "version-constants": { + "::PACKAGE_VERSION": "src/class-utils.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities for working with IP addresses.", + "support": { + "source": "https://github.com/Automattic/jetpack-ip/tree/v0.1.2" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-ip" + }, + { + "name": "automattic/jetpack-jitm", + "version": "v2.3.4", + "version_normalized": "2.3.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-jitm.git", + "reference": "950d01008784d9c360ceb92bc4b67dcced76ff8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-jitm/zipball/950d01008784d9c360ceb92bc4b67dcced76ff8c", + "reference": "950d01008784d9c360ceb92bc4b67dcced76ff8c", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^1.4.19", + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-connection": "^1.51.4", + "automattic/jetpack-device-detection": "^1.4.24", + "automattic/jetpack-logo": "^1.5.22", + "automattic/jetpack-partner": "^1.7.22", + "automattic/jetpack-redirect": "^1.7.24", + "automattic/jetpack-status": "^1.16.3" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-29T12:52:57+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-jitm", + "textdomain": "jetpack-jitm", + "version-constants": { + "::PACKAGE_VERSION": "src/class-jitm.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-jitm/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "2.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Just in time messages for Jetpack", + "support": { + "source": "https://github.com/Automattic/jetpack-jitm/tree/v2.3.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-jitm" + }, + { + "name": "automattic/jetpack-licensing", + "version": "v1.8.2", + "version_normalized": "1.8.2.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-licensing.git", + "reference": "46ff51c6f1f8ab5206d8bc93ec5bb23e1c174def" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-licensing/zipball/46ff51c6f1f8ab5206d8bc93ec5bb23e1c174def", + "reference": "46ff51c6f1f8ab5206d8bc93ec5bb23e1c174def", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.7" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:44:26+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-licensing", + "textdomain": "jetpack-licensing", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-licensing/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to manage Jetpack licenses client-side.", + "support": { + "source": "https://github.com/Automattic/jetpack-licensing/tree/v1.8.2" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-licensing" + }, + { + "name": "automattic/jetpack-logo", + "version": "v1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-logo.git", + "reference": "6a7b9e5602ca81c207e573dfed9e4fc1dd6a279b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-logo/zipball/6a7b9e5602ca81c207e573dfed9e4fc1dd6a279b", + "reference": "6a7b9e5602ca81c207e573dfed9e4fc1dd6a279b", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:42+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-logo", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-logo/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "A logo for Jetpack", + "support": { + "source": "https://github.com/Automattic/jetpack-logo/tree/v1.6.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-logo" + }, + { + "name": "automattic/jetpack-my-jetpack", + "version": "v2.9.1", + "version_normalized": "2.9.1.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-my-jetpack.git", + "reference": "7b04d4767e18e06521d66863124579cbcabb2366" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-my-jetpack/zipball/7b04d4767e18e06521d66863124579cbcabb2366", + "reference": "7b04d4767e18e06521d66863124579cbcabb2366", + "shasum": "" + }, + "require": { + "automattic/jetpack-admin-ui": "^0.2.17", + "automattic/jetpack-assets": "^1.17.34", + "automattic/jetpack-connection": "^1.51.4", + "automattic/jetpack-constants": "^1.6.21", + "automattic/jetpack-jitm": "^2.3.4", + "automattic/jetpack-licensing": "^1.8.1", + "automattic/jetpack-plugins-installer": "^0.2.3", + "automattic/jetpack-redirect": "^1.7.24" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-videopress": "^0.13.4-alpha", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-29T12:53:10+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-my-jetpack", + "textdomain": "jetpack-my-jetpack", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-my-jetpack/compare/${old}...${new}" + }, + "branch-alias": { + "dev-trunk": "2.9.x-dev" + }, + "version-constants": { + "::PACKAGE_VERSION": "src/class-initializer.php" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/", + "src/products" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", + "support": { + "source": "https://github.com/Automattic/jetpack-my-jetpack/tree/v2.9.1" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-my-jetpack" + }, + { + "name": "automattic/jetpack-partner", + "version": "v1.7.23", + "version_normalized": "1.7.23.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-partner.git", + "reference": "6b179bff7c0863015aa699939e1dfe2bd4c97974" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-partner/zipball/6b179bff7c0863015aa699939e1dfe2bd4c97974", + "reference": "6b179bff7c0863015aa699939e1dfe2bd4c97974", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.7", + "automattic/jetpack-status": "^1.16.4" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:44:29+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-partner", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-partner/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Support functions for Jetpack hosting partners.", + "support": { + "source": "https://github.com/Automattic/jetpack-partner/tree/v1.7.23" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-partner" + }, + { + "name": "automattic/jetpack-password-checker", + "version": "v0.2.13", + "version_normalized": "0.2.13.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-password-checker.git", + "reference": "16b88d370ca2f59b38e6c44bc37fc43e72090dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-password-checker/zipball/16b88d370ca2f59b38e6c44bc37fc43e72090dad", + "reference": "16b88d370ca2f59b38e6c44bc37fc43e72090dad", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:53+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-password-checker", + "textdomain": "jetpack-password-checker", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-password-checker/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Password Checker.", + "support": { + "source": "https://github.com/Automattic/jetpack-password-checker/tree/v0.2.13" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-password-checker" + }, + { + "name": "automattic/jetpack-plans", + "version": "v0.2.10", + "version_normalized": "0.2.10.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-plans.git", + "reference": "262dd36d110723f2fc940aabf88c510afaf537fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-plans/zipball/262dd36d110723f2fc940aabf88c510afaf537fc", + "reference": "262dd36d110723f2fc940aabf88c510afaf537fc", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-status": "^1.16.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-02-20T19:48:24+00:00", + "type": "library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-plans", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plans/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Fetch information about Jetpack Plans from wpcom", + "support": { + "source": "https://github.com/Automattic/jetpack-plans/tree/v0.2.10" + }, + "install-path": "../automattic/jetpack-plans" + }, + { + "name": "automattic/jetpack-plugins-installer", + "version": "v0.2.3", + "version_normalized": "0.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-plugins-installer.git", + "reference": "ec0e3b888ef33d4bd879de9a014ba20d771aca31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-plugins-installer/zipball/ec0e3b888ef33d4bd879de9a014ba20d771aca31", + "reference": "ec0e3b888ef33d4bd879de9a014ba20d771aca31", + "shasum": "" + }, + "require": { + "automattic/jetpack-a8c-mc-stats": "^1.4.19" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-02-20T19:47:45+00:00", + "type": "jetpack-library", + "extra": { + "branch-alias": { + "dev-trunk": "0.2.x-dev" + }, + "mirror-repo": "Automattic/jetpack-plugins-installer", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-plugins-installer/compare/v${old}...v${new}" + }, + "autotagger": true, + "textdomain": "jetpack-plugins-installer" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Handle installation of plugins from WP.org", + "support": { + "source": "https://github.com/Automattic/jetpack-plugins-installer/tree/v0.2.3" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-plugins-installer" + }, + { + "name": "automattic/jetpack-redirect", + "version": "v1.7.25", + "version_normalized": "1.7.25.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-redirect.git", + "reference": "67d7dce123d4af4fec4b4fe15e99aaad85308314" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-redirect/zipball/67d7dce123d4af4fec4b4fe15e99aaad85308314", + "reference": "67d7dce123d4af4fec4b4fe15e99aaad85308314", + "shasum": "" + }, + "require": { + "automattic/jetpack-status": "^1.16.4" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:44:05+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-redirect", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-redirect/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities to build URLs to the jetpack.com/redirect/ service", + "support": { + "source": "https://github.com/Automattic/jetpack-redirect/tree/v1.7.25" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-redirect" + }, + { + "name": "automattic/jetpack-roles", + "version": "v1.4.23", + "version_normalized": "1.4.23.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-roles.git", + "reference": "f147b3e8061fc0de2a892ddc4f4156eb995545f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-roles/zipball/f147b3e8061fc0de2a892ddc4f4156eb995545f9", + "reference": "f147b3e8061fc0de2a892ddc4f4156eb995545f9", + "shasum": "" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-10T11:43:48+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-roles", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-roles/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Utilities, related with user roles and capabilities.", + "support": { + "source": "https://github.com/Automattic/jetpack-roles/tree/v1.4.23" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-roles" + }, + { + "name": "automattic/jetpack-status", + "version": "v1.17.0", + "version_normalized": "1.17.0.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-status.git", + "reference": "a16c59bb54cac04c579621efffa1ca1d5738c5cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-status/zipball/a16c59bb54cac04c579621efffa1ca1d5738c5cc", + "reference": "a16c59bb54cac04c579621efffa1ca1d5738c5cc", + "shasum": "" + }, + "require": { + "automattic/jetpack-constants": "^1.6.22" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/jetpack-ip": "^0.1.2", + "brain/monkey": "2.6.1", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-17T13:43:20+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-status", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.17.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Used to retrieve information about the current status of Jetpack and the site overall.", + "support": { + "source": "https://github.com/Automattic/jetpack-status/tree/v1.17.0" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-status" + }, + { + "name": "automattic/jetpack-sync", + "version": "v1.47.4", + "version_normalized": "1.47.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-sync.git", + "reference": "9c7f25eb8e63a9fbaa1639eaf2f68f46739e5cde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-sync/zipball/9c7f25eb8e63a9fbaa1639eaf2f68f46739e5cde", + "reference": "9c7f25eb8e63a9fbaa1639eaf2f68f46739e5cde", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.3", + "automattic/jetpack-constants": "^1.6.21", + "automattic/jetpack-identity-crisis": "^0.8.40", + "automattic/jetpack-ip": "^0.1.1", + "automattic/jetpack-password-checker": "^0.2.12", + "automattic/jetpack-roles": "^1.4.22", + "automattic/jetpack-status": "^1.16.3" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-28T18:48:42+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-sync", + "textdomain": "jetpack-sync", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-sync/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "1.47.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Everything needed to allow syncing to the WP.com infrastructure.", + "support": { + "source": "https://github.com/Automattic/jetpack-sync/tree/v1.47.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-sync" + }, + { + "name": "automattic/jetpack-transport-helper", + "version": "v0.1.4", + "version_normalized": "0.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-transport-helper.git", + "reference": "379cd4477b9b43f3765d2e8872e6610fd5126a01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-transport-helper/zipball/379cd4477b9b43f3765d2e8872e6610fd5126a01", + "reference": "379cd4477b9b43f3765d2e8872e6610fd5126a01", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.1" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "dev-master", + "yoast/phpunit-polyfills": "1.0.4" + }, + "time": "2023-03-07T22:00:19+00:00", + "type": "jetpack-library", + "extra": { + "mirror-repo": "Automattic/jetpack-transport-helper", + "version-constants": { + "::PACKAGE_VERSION": "src/class-package-version.php" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-transport-helper/compare/v${old}...v${new}" + }, + "autotagger": true, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + }, + "textdomain": "jetpack-transport-helper" + }, + "installation-source": "dist", + "autoload": { + "files": [ + "actions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Package to help transport server communication", + "support": { + "source": "https://github.com/Automattic/jetpack-transport-helper/tree/v0.1.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-transport-helper" + }, + { + "name": "automattic/jetpack-waf", + "version": "v0.11.4", + "version_normalized": "0.11.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/jetpack-waf.git", + "reference": "ec68a1429a7bb0ff8c5c4b51186319b86818d0b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/jetpack-waf/zipball/ec68a1429a7bb0ff8c5c4b51186319b86818d0b1", + "reference": "ec68a1429a7bb0ff8c5c4b51186319b86818d0b1", + "shasum": "" + }, + "require": { + "automattic/jetpack-connection": "^1.51.7", + "automattic/jetpack-constants": "^1.6.22", + "automattic/jetpack-ip": "^0.1.2", + "automattic/jetpack-status": "^1.17.0", + "wikimedia/aho-corasick": "^1.0" + }, + "require-dev": { + "automattic/jetpack-changelogger": "^3.3.2", + "automattic/wordbless": "@dev", + "yoast/phpunit-polyfills": "1.0.4" + }, + "suggest": { + "automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package." + }, + "time": "2023-04-27T18:11:36+00:00", + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-waf", + "textdomain": "jetpack-waf", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-waf/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.11.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "cli.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Tools to assist with the Jetpack Web Application Firewall", + "support": { + "source": "https://github.com/Automattic/jetpack-waf/tree/v0.11.4" + }, + "install-path": "../../jetpack_vendor/automattic/jetpack-waf" + }, + { + "name": "wikimedia/aho-corasick", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/AhoCorasick.git", + "reference": "2f3a1bd765913637a66eade658d11d82f0e551be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/AhoCorasick/zipball/2f3a1bd765913637a66eade658d11d82f0e551be", + "reference": "2f3a1bd765913637a66eade658d11d82f0e551be", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "0.3.2", + "jakub-onderka/php-parallel-lint": "1.0.0", + "mediawiki/mediawiki-codesniffer": "18.0.0", + "mediawiki/minus-x": "0.3.1", + "phpunit/phpunit": "4.8.36 || ^6.5" + }, + "time": "2018-05-01T18:13:32+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ori Livneh", + "email": "ori@wikimedia.org" + } + ], + "description": "An implementation of the Aho-Corasick string matching algorithm.", + "homepage": "https://gerrit.wikimedia.org/g/AhoCorasick", + "keywords": [ + "ahocorasick", + "matcher" + ], + "support": { + "source": "https://github.com/wikimedia/AhoCorasick/tree/v1.0.1" + }, + "install-path": "../wikimedia/aho-corasick" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php new file mode 100644 index 00000000..418d7169 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/installed.php @@ -0,0 +1,257 @@ + array( + 'name' => 'automattic/jetpack-protect', + 'pretty_version' => 'dev-trunk', + 'version' => 'dev-trunk', + 'reference' => NULL, + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => false, + ), + 'versions' => array( + 'automattic/jetpack-a8c-mc-stats' => array( + 'pretty_version' => 'v1.4.20', + 'version' => '1.4.20.0', + 'reference' => '6743d34fe7556455e17cbe1b7c90ed39a1f69089', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-a8c-mc-stats', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-admin-ui' => array( + 'pretty_version' => 'v0.2.19', + 'version' => '0.2.19.0', + 'reference' => 'ae3c7f7a3bd564172ce48f72447ecea2c7508a5a', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-admin-ui', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-assets' => array( + 'pretty_version' => 'v1.17.34', + 'version' => '1.17.34.0', + 'reference' => '73ec392493a1364dcc9e57c878136bf5c91e24af', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-assets', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-autoloader' => array( + 'pretty_version' => 'v2.11.18', + 'version' => '2.11.18.0', + 'reference' => '53cbf0528fa6931c4fa6465bccd37514f9eda720', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../automattic/jetpack-autoloader', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-composer-plugin' => array( + 'pretty_version' => 'v1.1.10', + 'version' => '1.1.10.0', + 'reference' => 'c6298f3efd8a1ca76182f685d0075080e2681aa3', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../automattic/jetpack-composer-plugin', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-config' => array( + 'pretty_version' => 'v1.15.1', + 'version' => '1.15.1.0', + 'reference' => 'e4985903fb40dbc7c03bdaf58f4a80ac72c50570', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-config', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-connection' => array( + 'pretty_version' => 'v1.51.7', + 'version' => '1.51.7.0', + 'reference' => '4c4bae836858957d9aaf6854cf4e24c3261242c4', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-connection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-constants' => array( + 'pretty_version' => 'v1.6.22', + 'version' => '1.6.22.0', + 'reference' => '7b5c44d763c7b0dd7498be2b41a89bfefe84834c', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-constants', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-device-detection' => array( + 'pretty_version' => 'v1.4.25', + 'version' => '1.4.25.0', + 'reference' => 'cf6297f71412dce19522193c2d517cd230a0bee9', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-device-detection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-identity-crisis' => array( + 'pretty_version' => 'v0.8.40', + 'version' => '0.8.40.0', + 'reference' => '9c52db5e021d6792084e1d225347b82acae2ce86', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-identity-crisis', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-ip' => array( + 'pretty_version' => 'v0.1.2', + 'version' => '0.1.2.0', + 'reference' => '8cc665d68ef5230de78e2701b61b91af64d8dfe6', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-ip', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-jitm' => array( + 'pretty_version' => 'v2.3.4', + 'version' => '2.3.4.0', + 'reference' => '950d01008784d9c360ceb92bc4b67dcced76ff8c', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-jitm', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-licensing' => array( + 'pretty_version' => 'v1.8.2', + 'version' => '1.8.2.0', + 'reference' => '46ff51c6f1f8ab5206d8bc93ec5bb23e1c174def', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-licensing', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-logo' => array( + 'pretty_version' => 'v1.6.1', + 'version' => '1.6.1.0', + 'reference' => '6a7b9e5602ca81c207e573dfed9e4fc1dd6a279b', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-logo', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-my-jetpack' => array( + 'pretty_version' => 'v2.9.1', + 'version' => '2.9.1.0', + 'reference' => '7b04d4767e18e06521d66863124579cbcabb2366', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-my-jetpack', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-partner' => array( + 'pretty_version' => 'v1.7.23', + 'version' => '1.7.23.0', + 'reference' => '6b179bff7c0863015aa699939e1dfe2bd4c97974', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-partner', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-password-checker' => array( + 'pretty_version' => 'v0.2.13', + 'version' => '0.2.13.0', + 'reference' => '16b88d370ca2f59b38e6c44bc37fc43e72090dad', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-password-checker', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-plans' => array( + 'pretty_version' => 'v0.2.10', + 'version' => '0.2.10.0', + 'reference' => '262dd36d110723f2fc940aabf88c510afaf537fc', + 'type' => 'library', + 'install_path' => __DIR__ . '/../automattic/jetpack-plans', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-plugins-installer' => array( + 'pretty_version' => 'v0.2.3', + 'version' => '0.2.3.0', + 'reference' => 'ec0e3b888ef33d4bd879de9a014ba20d771aca31', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-plugins-installer', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-protect' => array( + 'pretty_version' => 'dev-trunk', + 'version' => 'dev-trunk', + 'reference' => NULL, + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-redirect' => array( + 'pretty_version' => 'v1.7.25', + 'version' => '1.7.25.0', + 'reference' => '67d7dce123d4af4fec4b4fe15e99aaad85308314', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-redirect', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-roles' => array( + 'pretty_version' => 'v1.4.23', + 'version' => '1.4.23.0', + 'reference' => 'f147b3e8061fc0de2a892ddc4f4156eb995545f9', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-roles', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-status' => array( + 'pretty_version' => 'v1.17.0', + 'version' => '1.17.0.0', + 'reference' => 'a16c59bb54cac04c579621efffa1ca1d5738c5cc', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-status', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-sync' => array( + 'pretty_version' => 'v1.47.4', + 'version' => '1.47.4.0', + 'reference' => '9c7f25eb8e63a9fbaa1639eaf2f68f46739e5cde', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-sync', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-transport-helper' => array( + 'pretty_version' => 'v0.1.4', + 'version' => '0.1.4.0', + 'reference' => '379cd4477b9b43f3765d2e8872e6610fd5126a01', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-transport-helper', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'automattic/jetpack-waf' => array( + 'pretty_version' => 'v0.11.4', + 'version' => '0.11.4.0', + 'reference' => 'ec68a1429a7bb0ff8c5c4b51186319b86818d0b1', + 'type' => 'jetpack-library', + 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-waf', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wikimedia/aho-corasick' => array( + 'pretty_version' => 'v1.0.1', + 'version' => '1.0.1.0', + 'reference' => '2f3a1bd765913637a66eade658d11d82f0e551be', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wikimedia/aho-corasick', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php new file mode 100644 index 00000000..41da0a1f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_classmap.php @@ -0,0 +1,813 @@ + array( + 'version' => '1.0.1.0', + 'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringMatcher.php' + ), + 'AhoCorasick\\MultiStringReplacer' => array( + 'version' => '1.0.1.0', + 'path' => $vendorDir . '/wikimedia/aho-corasick/src/MultiStringReplacer.php' + ), + 'Autoloader' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader.php' + ), + 'Autoloader_Handler' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-handler.php' + ), + 'Autoloader_Locator' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-locator.php' + ), + 'Automattic\\Jetpack\\A8c_Mc_Stats' => array( + 'version' => '1.4.20.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-a8c-mc-stats/src/class-a8c-mc-stats.php' + ), + 'Automattic\\Jetpack\\Admin_UI\\Admin_Menu' => array( + 'version' => '0.2.19.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-admin-ui/src/class-admin-menu.php' + ), + 'Automattic\\Jetpack\\Assets' => array( + 'version' => '1.17.34.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-assets.php' + ), + 'Automattic\\Jetpack\\Assets\\Logo' => array( + 'version' => '1.6.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-logo/src/class-logo.php' + ), + 'Automattic\\Jetpack\\Assets\\Semver' => array( + 'version' => '1.17.34.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/src/class-semver.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php' + ), + 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php' + ), + 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php' + ), + 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php' + ), + 'Automattic\\Jetpack\\Automatic_Install_Skin' => array( + 'version' => '0.2.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php' + ), + 'Automattic\\Jetpack\\Composer\\Manager' => array( + 'version' => '1.1.10.0', + 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-manager.php' + ), + 'Automattic\\Jetpack\\Composer\\Plugin' => array( + 'version' => '1.1.10.0', + 'path' => $vendorDir . '/automattic/jetpack-composer-plugin/src/class-plugin.php' + ), + 'Automattic\\Jetpack\\Config' => array( + 'version' => '1.15.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php' + ), + 'Automattic\\Jetpack\\Connection\\Client' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php' + ), + 'Automattic\\Jetpack\\Connection\\Connection_Notice' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php' + ), + 'Automattic\\Jetpack\\Connection\\Error_Handler' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php' + ), + 'Automattic\\Jetpack\\Connection\\Initial_State' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php' + ), + 'Automattic\\Jetpack\\Connection\\Manager' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php' + ), + 'Automattic\\Jetpack\\Connection\\Manager_Interface' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php' + ), + 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php' + ), + 'Automattic\\Jetpack\\Connection\\Package_Version' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php' + ), + 'Automattic\\Jetpack\\Connection\\Plugin' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php' + ), + 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php' + ), + 'Automattic\\Jetpack\\Connection\\REST_Connector' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php' + ), + 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php' + ), + 'Automattic\\Jetpack\\Connection\\Secrets' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php' + ), + 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php' + ), + 'Automattic\\Jetpack\\Connection\\Tokens' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php' + ), + 'Automattic\\Jetpack\\Connection\\Urls' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php' + ), + 'Automattic\\Jetpack\\Connection\\Utils' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php' + ), + 'Automattic\\Jetpack\\Connection\\Webhooks' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php' + ), + 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php' + ), + 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php' + ), + 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php' + ), + 'Automattic\\Jetpack\\Constants' => array( + 'version' => '1.6.22.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-constants/src/class-constants.php' + ), + 'Automattic\\Jetpack\\CookieState' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cookiestate.php' + ), + 'Automattic\\Jetpack\\Current_Plan' => array( + 'version' => '0.2.10.0', + 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-current-plan.php' + ), + 'Automattic\\Jetpack\\Device_Detection' => array( + 'version' => '1.4.25.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-device-detection.php' + ), + 'Automattic\\Jetpack\\Device_Detection\\User_Agent_Info' => array( + 'version' => '1.4.25.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-device-detection/src/class-user-agent-info.php' + ), + 'Automattic\\Jetpack\\Errors' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-errors.php' + ), + 'Automattic\\Jetpack\\Files' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-files.php' + ), + 'Automattic\\Jetpack\\Heartbeat' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php' + ), + 'Automattic\\Jetpack\\IP\\Utils' => array( + 'version' => '0.1.2.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-ip/src/class-utils.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\REST_Endpoints' => array( + 'version' => '0.8.40.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-rest-endpoints.php' + ), + 'Automattic\\Jetpack\\IdentityCrisis\\UI' => array( + 'version' => '0.8.40.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-ui.php' + ), + 'Automattic\\Jetpack\\Identity_Crisis' => array( + 'version' => '0.8.40.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-identity-crisis/src/class-identity-crisis.php' + ), + 'Automattic\\Jetpack\\JITMS\\JITM' => array( + 'version' => '2.3.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Post_Connection_JITM' => array( + 'version' => '2.3.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Pre_Connection_JITM' => array( + 'version' => '2.3.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-pre-connection-jitm.php' + ), + 'Automattic\\Jetpack\\JITMS\\Rest_Api_Endpoints' => array( + 'version' => '2.3.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-jitm/src/class-rest-api-endpoints.php' + ), + 'Automattic\\Jetpack\\Licensing' => array( + 'version' => '1.8.2.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-licensing.php' + ), + 'Automattic\\Jetpack\\Licensing\\Endpoints' => array( + 'version' => '1.8.2.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-licensing/src/class-endpoints.php' + ), + 'Automattic\\Jetpack\\Modules' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-modules.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Initializer' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Product' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-product.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Anti_Spam' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-anti-spam.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Backup' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Boost' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Crm' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Extras' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Protect' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-protect.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Scan' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Search_Stats' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-search-stats.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Security' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Social' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-social.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Products\\Videopress' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-videopress.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Products' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-products.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\REST_Purchases' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-rest-purchases.php' + ), + 'Automattic\\Jetpack\\My_Jetpack\\Wpcom_Products' => array( + 'version' => '2.9.1.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php' + ), + 'Automattic\\Jetpack\\Partner' => array( + 'version' => '1.7.23.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner.php' + ), + 'Automattic\\Jetpack\\Partner_Coupon' => array( + 'version' => '1.7.23.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-partner/src/class-partner-coupon.php' + ), + 'Automattic\\Jetpack\\Password_Checker' => array( + 'version' => '0.2.13.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-password-checker/src/class-password-checker.php' + ), + 'Automattic\\Jetpack\\Paths' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-paths.php' + ), + 'Automattic\\Jetpack\\Plans' => array( + 'version' => '0.2.10.0', + 'path' => $vendorDir . '/automattic/jetpack-plans/src/class-plans.php' + ), + 'Automattic\\Jetpack\\Plugins_Installer' => array( + 'version' => '0.2.3.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-plugins-installer.php' + ), + 'Automattic\\Jetpack\\Protect\\Credentials' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-credentials.php' + ), + 'Automattic\\Jetpack\\Protect\\Extension_Model' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/models/class-extension-model.php' + ), + 'Automattic\\Jetpack\\Protect\\Plan' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-plan.php' + ), + 'Automattic\\Jetpack\\Protect\\Protect_Status' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-protect-status.php' + ), + 'Automattic\\Jetpack\\Protect\\REST_Controller' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Protect\\Scan_Status' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-scan-status.php' + ), + 'Automattic\\Jetpack\\Protect\\Site_Health' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-site-health.php' + ), + 'Automattic\\Jetpack\\Protect\\Status' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-status.php' + ), + 'Automattic\\Jetpack\\Protect\\Status_Model' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/models/class-status-model.php' + ), + 'Automattic\\Jetpack\\Protect\\Threat_Model' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/models/class-threat-model.php' + ), + 'Automattic\\Jetpack\\Protect\\Threats' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-threats.php' + ), + 'Automattic\\Jetpack\\Redirect' => array( + 'version' => '1.7.25.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-redirect/src/class-redirect.php' + ), + 'Automattic\\Jetpack\\Roles' => array( + 'version' => '1.4.23.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-roles/src/class-roles.php' + ), + 'Automattic\\Jetpack\\Status' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-status.php' + ), + 'Automattic\\Jetpack\\Status\\Cache' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-cache.php' + ), + 'Automattic\\Jetpack\\Status\\Host' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-host.php' + ), + 'Automattic\\Jetpack\\Status\\Visitor' => array( + 'version' => '1.17.0.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-status/src/class-visitor.php' + ), + 'Automattic\\Jetpack\\Sync\\Actions' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php' + ), + 'Automattic\\Jetpack\\Sync\\Codec_Interface' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Data_Settings' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-data-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Dedicated_Sender' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-dedicated-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Default_Filter_Settings' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-default-filter-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Defaults' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php' + ), + 'Automattic\\Jetpack\\Sync\\Functions' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-functions.php' + ), + 'Automattic\\Jetpack\\Sync\\Health' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-health.php' + ), + 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-json-deflate-array-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Listener' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php' + ), + 'Automattic\\Jetpack\\Sync\\Lock' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-lock.php' + ), + 'Automattic\\Jetpack\\Sync\\Main' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-main.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Attachments' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-attachments.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Callables' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Comments' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Constants' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-constants.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Import' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Menus' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Meta' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-meta.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Module' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-module.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Network_Options' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Options' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-options.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Plugins' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-plugins.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Posts' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Protect' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-protect.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Search' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-search.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Stats' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-stats.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Terms' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-terms.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Themes' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-themes.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Updates' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-updates.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\Users' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\WP_Super_Cache' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-wp-super-cache.php' + ), + 'Automattic\\Jetpack\\Sync\\Modules\\WooCommerce' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php' + ), + 'Automattic\\Jetpack\\Sync\\Package_Version' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue.php' + ), + 'Automattic\\Jetpack\\Sync\\Queue_Buffer' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-queue-buffer.php' + ), + 'Automattic\\Jetpack\\Sync\\REST_Endpoints' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-endpoints.php' + ), + 'Automattic\\Jetpack\\Sync\\REST_Sender' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-rest-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Usermeta' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-usermeta.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum_Users' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/interface-replicastore.php' + ), + 'Automattic\\Jetpack\\Sync\\Sender' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php' + ), + 'Automattic\\Jetpack\\Sync\\Server' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-server.php' + ), + 'Automattic\\Jetpack\\Sync\\Settings' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-settings.php' + ), + 'Automattic\\Jetpack\\Sync\\Simple_Codec' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php' + ), + 'Automattic\\Jetpack\\Sync\\Users' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-users.php' + ), + 'Automattic\\Jetpack\\Sync\\Utils' => array( + 'version' => '1.47.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php' + ), + 'Automattic\\Jetpack\\Terms_Of_Service' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php' + ), + 'Automattic\\Jetpack\\Tracking' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\Helper_Script_Manager' => array( + 'version' => '0.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-helper-script-manager.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\Package_Version' => array( + 'version' => '0.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-package-version.php' + ), + 'Automattic\\Jetpack\\Transport_Helper\\REST_Controller' => array( + 'version' => '0.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-brute-force-protection.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Blocked_Login_Page' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-blocked-login-page.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Math_Authenticate' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-math-fallback.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Shared_Functions' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-shared-functions.php' + ), + 'Automattic\\Jetpack\\Waf\\Brute_Force_Protection\\Brute_Force_Protection_Transient_Cleanup' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/brute-force-protection/class-transient-cleanup.php' + ), + 'Automattic\\Jetpack\\Waf\\CLI' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php' + ), + 'Automattic\\Jetpack\\Waf\\File_System_Exception' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-file-system-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\REST_Controller' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-rest-controller.php' + ), + 'Automattic\\Jetpack\\Waf\\Rules_API_Exception' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-rules-api-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Compatibility' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-compatibility.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Constants' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-constants.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Exception' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Initializer' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Operators' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-operators.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Request' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-request.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Rules_Manager' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-rules-manager.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Runner' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runner.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Runtime' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-runtime.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Standalone_Bootstrap' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-standalone-bootstrap.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Stats' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-stats.php' + ), + 'Automattic\\Jetpack\\Waf\\Waf_Transforms' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/src/class-waf-transforms.php' + ), + 'Container' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-container.php' + ), + 'Hook_Manager' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-hook-manager.php' + ), + 'Jetpack_IXR_Client' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php' + ), + 'Jetpack_IXR_ClientMulticall' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php' + ), + 'Jetpack_Options' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php' + ), + 'Jetpack_Protect' => array( + 'version' => 'dev-trunk', + 'path' => $baseDir . '/src/class-jetpack-protect.php' + ), + 'Jetpack_Signature' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php' + ), + 'Jetpack_Tracks_Client' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php' + ), + 'Jetpack_Tracks_Event' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php' + ), + 'Jetpack_XMLRPC_Server' => array( + 'version' => '1.51.7.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php' + ), + 'Latest_Autoloader_Guard' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php' + ), + 'Manifest_Reader' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-manifest-reader.php' + ), + 'PHP_Autoloader' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-php-autoloader.php' + ), + 'Path_Processor' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-path-processor.php' + ), + 'Plugin_Locator' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugin-locator.php' + ), + 'Plugins_Handler' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php' + ), + 'Shutdown_Handler' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-shutdown-handler.php' + ), + 'Version_Loader' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-loader.php' + ), + 'Version_Selector' => array( + 'version' => '2.11.18.0', + 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-selector.php' + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php new file mode 100644 index 00000000..b8c225a9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/jetpack_autoload_filemap.php @@ -0,0 +1,21 @@ + array( + 'version' => '1.17.34.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-assets/actions.php' + ), + '590147edb63acb03b2852d5c4db13ce8' => array( + 'version' => '0.1.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-transport-helper/actions.php' + ), + '3d45c7e6a7f0e71849e33afe4b3b3ede' => array( + 'version' => '0.11.4.0', + 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-waf/cli.php' + ), +); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php new file mode 100644 index 00000000..d673084e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 50509)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.9". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php new file mode 100644 index 00000000..c197e59c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-handler.php @@ -0,0 +1,147 @@ +php_autoloader = $php_autoloader; + $this->hook_manager = $hook_manager; + $this->manifest_reader = $manifest_reader; + $this->version_selector = $version_selector; + } + + /** + * Checks to see whether or not an autoloader is currently in the process of initializing. + * + * @return bool + */ + public function is_initializing() { + // If no version has been set it means that no autoloader has started initializing yet. + global $jetpack_autoloader_latest_version; + if ( ! isset( $jetpack_autoloader_latest_version ) ) { + return false; + } + + // When the version is set but the classmap is not it ALWAYS means that this is the + // latest autoloader and is being included by an older one. + global $jetpack_packages_classmap; + if ( empty( $jetpack_packages_classmap ) ) { + return true; + } + + // Version 2.4.0 added a new global and altered the reset semantics. We need to check + // the other global as well since it may also point at initialization. + // Note: We don't need to check for the class first because every autoloader that + // will set the latest version global requires this class in the classmap. + $replacing_version = $jetpack_packages_classmap[ AutoloadGenerator::class ]['version']; + if ( $this->version_selector->is_dev_version( $replacing_version ) || version_compare( $replacing_version, '2.4.0.0', '>=' ) ) { + global $jetpack_autoloader_loader; + if ( ! isset( $jetpack_autoloader_loader ) ) { + return true; + } + } + + return false; + } + + /** + * Activates an autoloader using the given plugins and activates it. + * + * @param string[] $plugins The plugins to initialize the autoloader for. + */ + public function activate_autoloader( $plugins ) { + global $jetpack_packages_psr4; + $jetpack_packages_psr4 = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_psr4.php', $jetpack_packages_psr4 ); + + global $jetpack_packages_classmap; + $jetpack_packages_classmap = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_classmap.php', $jetpack_packages_classmap ); + + global $jetpack_packages_filemap; + $jetpack_packages_filemap = array(); + $this->manifest_reader->read_manifests( $plugins, 'vendor/composer/jetpack_autoload_filemap.php', $jetpack_packages_filemap ); + + $loader = new Version_Loader( + $this->version_selector, + $jetpack_packages_classmap, + $jetpack_packages_psr4, + $jetpack_packages_filemap + ); + + $this->php_autoloader->register_autoloader( $loader ); + + // Now that the autoloader is active we can load the filemap. + $loader->load_filemap(); + } + + /** + * Resets the active autoloader and all related global state. + */ + public function reset_autoloader() { + $this->php_autoloader->unregister_autoloader(); + $this->hook_manager->reset(); + + // Clear all of the autoloader globals so that older autoloaders don't do anything strange. + global $jetpack_autoloader_latest_version; + $jetpack_autoloader_latest_version = null; + + global $jetpack_packages_classmap; + $jetpack_packages_classmap = array(); // Must be array to avoid exceptions in old autoloaders! + + global $jetpack_packages_psr4; + $jetpack_packages_psr4 = array(); // Must be array to avoid exceptions in old autoloaders! + + global $jetpack_packages_filemap; + $jetpack_packages_filemap = array(); // Must be array to avoid exceptions in old autoloaders! + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php new file mode 100644 index 00000000..867582b3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader-locator.php @@ -0,0 +1,90 @@ +version_selector = $version_selector; + } + + /** + * Finds the path to the plugin with the latest autoloader. + * + * @param array $plugin_paths An array of plugin paths. + * @param string $latest_version The latest version reference. + * + * @return string|null + */ + public function find_latest_autoloader( $plugin_paths, &$latest_version ) { + $latest_plugin = null; + + foreach ( $plugin_paths as $plugin_path ) { + $version = $this->get_autoloader_version( $plugin_path ); + if ( ! $this->version_selector->is_version_update_required( $latest_version, $version ) ) { + continue; + } + + $latest_version = $version; + $latest_plugin = $plugin_path; + } + + return $latest_plugin; + } + + /** + * Gets the path to the autoloader. + * + * @param string $plugin_path The path to the plugin. + * + * @return string + */ + public function get_autoloader_path( $plugin_path ) { + return trailingslashit( $plugin_path ) . 'vendor/autoload_packages.php'; + } + + /** + * Gets the version for the autoloader. + * + * @param string $plugin_path The path to the plugin. + * + * @return string|null + */ + public function get_autoloader_version( $plugin_path ) { + $classmap = trailingslashit( $plugin_path ) . 'vendor/composer/jetpack_autoload_classmap.php'; + if ( ! file_exists( $classmap ) ) { + return null; + } + + $classmap = require $classmap; + if ( isset( $classmap[ AutoloadGenerator::class ] ) ) { + return $classmap[ AutoloadGenerator::class ]['version']; + } + + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php new file mode 100644 index 00000000..a2f569aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-autoloader.php @@ -0,0 +1,90 @@ +get( Autoloader_Handler::class ); + + // If the autoloader is already initializing it means that it has included us as the latest. + $was_included_by_autoloader = $autoloader_handler->is_initializing(); + + /** @var Plugin_Locator $plugin_locator */ + $plugin_locator = $container->get( Plugin_Locator::class ); + + /** @var Plugins_Handler $plugins_handler */ + $plugins_handler = $container->get( Plugins_Handler::class ); + + // The current plugin is the one that we are attempting to initialize here. + $current_plugin = $plugin_locator->find_current_plugin(); + + // The active plugins are those that we were able to discover on the site. This list will not + // include mu-plugins, those activated by code, or those who are hidden by filtering. We also + // want to take care to not consider the current plugin unknown if it was included by an + // autoloader. This avoids the case where a plugin will be marked "active" while deactivated + // due to it having the latest autoloader. + $active_plugins = $plugins_handler->get_active_plugins( true, ! $was_included_by_autoloader ); + + // The cached plugins are all of those that were active or discovered by the autoloader during a previous request. + // Note that it's possible this list will include plugins that have since been deactivated, but after a request + // the cache should be updated and the deactivated plugins will be removed. + $cached_plugins = $plugins_handler->get_cached_plugins(); + + // We combine the active list and cached list to preemptively load classes for plugins that are + // presently unknown but will be loaded during the request. While this may result in us considering packages in + // deactivated plugins there shouldn't be any problems as a result and the eventual consistency is sufficient. + $all_plugins = array_merge( $active_plugins, $cached_plugins ); + + // In particular we also include the current plugin to address the case where it is the latest autoloader + // but also unknown (and not cached). We don't want it in the active list because we don't know that it + // is active but we need it in the all plugins list so that it is considered by the autoloader. + $all_plugins[] = $current_plugin; + + // We require uniqueness in the array to avoid processing the same plugin more than once. + $all_plugins = array_values( array_unique( $all_plugins ) ); + + /** @var Latest_Autoloader_Guard $guard */ + $guard = $container->get( Latest_Autoloader_Guard::class ); + if ( $guard->should_stop_init( $current_plugin, $all_plugins, $was_included_by_autoloader ) ) { + return; + } + + // Initialize the autoloader using the handler now that we're ready. + $autoloader_handler->activate_autoloader( $all_plugins ); + + /** @var Hook_Manager $hook_manager */ + $hook_manager = $container->get( Hook_Manager::class ); + + // Register a shutdown handler to clean up the autoloader. + $hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) ); + + // phpcs:enable Generic.Commenting.DocComment.MissingShort + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php new file mode 100644 index 00000000..4aba6d96 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-container.php @@ -0,0 +1,150 @@ + 'Hook_Manager', + ); + + /** + * A map of all the dependencies we've registered with the container and created. + * + * @var array + */ + protected $dependencies; + + /** + * The constructor. + */ + public function __construct() { + $this->dependencies = array(); + + $this->register_shared_dependencies(); + $this->register_dependencies(); + $this->initialize_globals(); + } + + /** + * Gets a dependency out of the container. + * + * @param string $class The class to fetch. + * + * @return mixed + * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched. + */ + public function get( $class ) { + if ( ! isset( $this->dependencies[ $class ] ) ) { + throw new \InvalidArgumentException( "Class '$class' is not registered with the container." ); + } + + return $this->dependencies[ $class ]; + } + + /** + * Registers all of the dependencies that are shared between all instances of the autoloader. + */ + private function register_shared_dependencies() { + global $jetpack_autoloader_container_shared; + if ( ! isset( $jetpack_autoloader_container_shared ) ) { + $jetpack_autoloader_container_shared = array(); + } + + $key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ]; + if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) { + require_once __DIR__ . '/class-hook-manager.php'; + $jetpack_autoloader_container_shared[ $key ] = new Hook_Manager(); + } + $this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ]; + } + + /** + * Registers all of the dependencies with the container. + */ + private function register_dependencies() { + require_once __DIR__ . '/class-path-processor.php'; + $this->dependencies[ Path_Processor::class ] = new Path_Processor(); + + require_once __DIR__ . '/class-plugin-locator.php'; + $this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator( + $this->get( Path_Processor::class ) + ); + + require_once __DIR__ . '/class-version-selector.php'; + $this->dependencies[ Version_Selector::class ] = new Version_Selector(); + + require_once __DIR__ . '/class-autoloader-locator.php'; + $this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator( + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-php-autoloader.php'; + $this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader(); + + require_once __DIR__ . '/class-manifest-reader.php'; + $this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader( + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-plugins-handler.php'; + $this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler( + $this->get( Plugin_Locator::class ), + $this->get( Path_Processor::class ) + ); + + require_once __DIR__ . '/class-autoloader-handler.php'; + $this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler( + $this->get( PHP_Autoloader::class ), + $this->get( Hook_Manager::class ), + $this->get( Manifest_Reader::class ), + $this->get( Version_Selector::class ) + ); + + require_once __DIR__ . '/class-latest-autoloader-guard.php'; + $this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard( + $this->get( Plugins_Handler::class ), + $this->get( Autoloader_Handler::class ), + $this->get( Autoloader_Locator::class ) + ); + + // Register any classes that we will use elsewhere. + require_once __DIR__ . '/class-version-loader.php'; + require_once __DIR__ . '/class-shutdown-handler.php'; + } + + /** + * Initializes any of the globals needed by the autoloader. + */ + private function initialize_globals() { + /* + * This global was retired in version 2.9. The value is set to 'false' to maintain + * compatibility with older versions of the autoloader. + */ + global $jetpack_autoloader_including_latest; + $jetpack_autoloader_including_latest = false; + + // Not all plugins can be found using the locator. In cases where a plugin loads the autoloader + // but was not discoverable, we will record them in this array to track them as "active". + global $jetpack_autoloader_activating_plugins_paths; + if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) { + $jetpack_autoloader_activating_plugins_paths = array(); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php new file mode 100644 index 00000000..6aa091be --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-hook-manager.php @@ -0,0 +1,76 @@ +registered_hooks = array(); + } + + /** + * Adds an action to WordPress and registers it internally. + * + * @param string $tag The name of the action which is hooked. + * @param callable $callable The function to call. + * @param int $priority Used to specify the priority of the action. + * @param int $accepted_args Used to specify the number of arguments the callable accepts. + */ + public function add_action( $tag, $callable, $priority = 10, $accepted_args = 1 ) { + $this->registered_hooks[ $tag ][] = array( + 'priority' => $priority, + 'callable' => $callable, + ); + + add_action( $tag, $callable, $priority, $accepted_args ); + } + + /** + * Adds a filter to WordPress and registers it internally. + * + * @param string $tag The name of the filter which is hooked. + * @param callable $callable The function to call. + * @param int $priority Used to specify the priority of the filter. + * @param int $accepted_args Used to specify the number of arguments the callable accepts. + */ + public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) { + $this->registered_hooks[ $tag ][] = array( + 'priority' => $priority, + 'callable' => $callable, + ); + + add_filter( $tag, $callable, $priority, $accepted_args ); + } + + /** + * Removes all of the registered hooks. + */ + public function reset() { + foreach ( $this->registered_hooks as $tag => $hooks ) { + foreach ( $hooks as $hook ) { + remove_filter( $tag, $hook['callable'], $hook['priority'] ); + } + } + $this->registered_hooks = array(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php new file mode 100644 index 00000000..403163cd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-latest-autoloader-guard.php @@ -0,0 +1,86 @@ +plugins_handler = $plugins_handler; + $this->autoloader_handler = $autoloader_handler; + $this->autoloader_locator = $autoloader_locator; + } + + /** + * Indicates whether or not the autoloader should be initialized. Note that this function + * has the side-effect of actually loading the latest autoloader in the event that this + * is not it. + * + * @param string $current_plugin The current plugin we're checking. + * @param string[] $plugins The active plugins to check for autoloaders in. + * @param bool $was_included_by_autoloader Indicates whether or not this autoloader was included by another. + * + * @return bool True if we should stop initialization, otherwise false. + */ + public function should_stop_init( $current_plugin, $plugins, $was_included_by_autoloader ) { + global $jetpack_autoloader_latest_version; + + // We need to reset the autoloader when the plugins change because + // that means the autoloader was generated with a different list. + if ( $this->plugins_handler->have_plugins_changed( $plugins ) ) { + $this->autoloader_handler->reset_autoloader(); + } + + // When the latest autoloader has already been found we don't need to search for it again. + // We should take care however because this will also trigger if the autoloader has been + // included by an older one. + if ( isset( $jetpack_autoloader_latest_version ) && ! $was_included_by_autoloader ) { + return true; + } + + $latest_plugin = $this->autoloader_locator->find_latest_autoloader( $plugins, $jetpack_autoloader_latest_version ); + if ( isset( $latest_plugin ) && $latest_plugin !== $current_plugin ) { + require $this->autoloader_locator->get_autoloader_path( $latest_plugin ); + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php new file mode 100644 index 00000000..afb7a3ae --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-manifest-reader.php @@ -0,0 +1,99 @@ +version_selector = $version_selector; + } + + /** + * Reads all of the manifests in the given plugin paths. + * + * @param array $plugin_paths The paths to the plugins we're loading the manifest in. + * @param string $manifest_path The path that we're loading the manifest from in each plugin. + * @param array $path_map The path map to add the contents of the manifests to. + * + * @return array $path_map The path map we've built using the manifests in each plugin. + */ + public function read_manifests( $plugin_paths, $manifest_path, &$path_map ) { + $file_paths = array_map( + function ( $path ) use ( $manifest_path ) { + return trailingslashit( $path ) . $manifest_path; + }, + $plugin_paths + ); + + foreach ( $file_paths as $path ) { + $this->register_manifest( $path, $path_map ); + } + + return $path_map; + } + + /** + * Registers a plugin's manifest file with the path map. + * + * @param string $manifest_path The absolute path to the manifest that we're loading. + * @param array $path_map The path map to add the contents of the manifest to. + */ + protected function register_manifest( $manifest_path, &$path_map ) { + if ( ! is_readable( $manifest_path ) ) { + return; + } + + $manifest = require $manifest_path; + if ( ! is_array( $manifest ) ) { + return; + } + + foreach ( $manifest as $key => $data ) { + $this->register_record( $key, $data, $path_map ); + } + } + + /** + * Registers an entry from the manifest in the path map. + * + * @param string $key The identifier for the entry we're registering. + * @param array $data The data for the entry we're registering. + * @param array $path_map The path map to add the contents of the manifest to. + */ + protected function register_record( $key, $data, &$path_map ) { + if ( isset( $path_map[ $key ]['version'] ) ) { + $selected_version = $path_map[ $key ]['version']; + } else { + $selected_version = null; + } + + if ( $this->version_selector->is_version_update_required( $selected_version, $data['version'] ) ) { + $path_map[ $key ] = array( + 'version' => $data['version'], + 'path' => $data['path'], + ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php new file mode 100644 index 00000000..4f825f38 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-path-processor.php @@ -0,0 +1,194 @@ +get_normalized_constants(); + foreach ( $constants as $constant => $constant_path ) { + $len = strlen( $constant_path ); + if ( substr( $path, 0, $len ) !== $constant_path ) { + continue; + } + + return substr_replace( $path, '{{' . $constant . '}}', 0, $len ); + } + + return $path; + } + + /** + * Given a path this will replace any of the path constant tokens with the expanded path. + * + * @param string $tokenized_path The path we want to process. + * + * @return string The expanded path. + */ + public function untokenize_path_constants( $tokenized_path ) { + $tokenized_path = wp_normalize_path( $tokenized_path ); + + $constants = $this->get_normalized_constants(); + foreach ( $constants as $constant => $constant_path ) { + $constant = '{{' . $constant . '}}'; + + $len = strlen( $constant ); + if ( substr( $tokenized_path, 0, $len ) !== $constant ) { + continue; + } + + return $this->get_real_path( substr_replace( $tokenized_path, $constant_path, 0, $len ) ); + } + + return $tokenized_path; + } + + /** + * Given a file and an array of places it might be, this will find the absolute path and return it. + * + * @param string $file The plugin or theme file to resolve. + * @param array $directories_to_check The directories we should check for the file if it isn't an absolute path. + * + * @return string|false Returns the absolute path to the directory, otherwise false. + */ + public function find_directory_with_autoloader( $file, $directories_to_check ) { + $file = wp_normalize_path( $file ); + + if ( ! $this->is_absolute_path( $file ) ) { + $file = $this->find_absolute_plugin_path( $file, $directories_to_check ); + if ( ! isset( $file ) ) { + return false; + } + } + + // We need the real path for consistency with __DIR__ paths. + $file = $this->get_real_path( $file ); + + // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged + $directory = @is_file( $file ) ? dirname( $file ) : $file; + if ( ! @is_file( $directory . '/vendor/composer/jetpack_autoload_classmap.php' ) ) { + return false; + } + // phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged + + return $directory; + } + + /** + * Fetches an array of normalized paths keyed by the constant they came from. + * + * @return string[] The normalized paths keyed by the constant. + */ + private function get_normalized_constants() { + $raw_constants = array( + // Order the constants from most-specific to least-specific. + 'WP_PLUGIN_DIR', + 'WPMU_PLUGIN_DIR', + 'WP_CONTENT_DIR', + 'ABSPATH', + ); + + $constants = array(); + foreach ( $raw_constants as $raw ) { + if ( ! defined( $raw ) ) { + continue; + } + + $path = wp_normalize_path( constant( $raw ) ); + if ( isset( $path ) ) { + $constants[ $raw ] = $path; + } + } + + return $constants; + } + + /** + * Indicates whether or not a path is absolute. + * + * @param string $path The path to check. + * + * @return bool True if the path is absolute, otherwise false. + */ + private function is_absolute_path( $path ) { + if ( 0 === strlen( $path ) || '.' === $path[0] ) { + return false; + } + + // Absolute paths on Windows may begin with a drive letter. + if ( preg_match( '/^[a-zA-Z]:[\/\\\\]/', $path ) ) { + return true; + } + + // A path starting with / or \ is absolute; anything else is relative. + return ( '/' === $path[0] || '\\' === $path[0] ); + } + + /** + * Given a file and a list of directories to check, this method will try to figure out + * the absolute path to the file in question. + * + * @param string $normalized_path The normalized path to the plugin or theme file to resolve. + * @param array $directories_to_check The directories we should check for the file if it isn't an absolute path. + * + * @return string|null The absolute path to the plugin file, otherwise null. + */ + private function find_absolute_plugin_path( $normalized_path, $directories_to_check ) { + // We're only able to find the absolute path for plugin/theme PHP files. + if ( ! is_string( $normalized_path ) || '.php' !== substr( $normalized_path, -4 ) ) { + return null; + } + + foreach ( $directories_to_check as $directory ) { + $normalized_check = wp_normalize_path( trailingslashit( $directory ) ) . $normalized_path; + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + if ( @is_file( $normalized_check ) ) { + return $normalized_check; + } + } + + return null; + } + + /** + * Given a path this will figure out the real path that we should be using. + * + * @param string $path The path to resolve. + * + * @return string The resolved path. + */ + private function get_real_path( $path ) { + // We want to resolve symbolic links for consistency with __DIR__ paths. + // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged + $real_path = @realpath( $path ); + if ( false === $real_path ) { + // Let the autoloader deal with paths that don't exist. + $real_path = $path; + } + + // Using realpath will make it platform-specific so we must normalize it after. + if ( $path !== $real_path ) { + $real_path = wp_normalize_path( $real_path ); + } + + return $real_path; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php new file mode 100644 index 00000000..a710929c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-php-autoloader.php @@ -0,0 +1,93 @@ +unregister_autoloader(); + + // Set the global so that it can be used to load classes. + global $jetpack_autoloader_loader; + $jetpack_autoloader_loader = $version_loader; + + // Ensure that the autoloader is first to avoid contention with others. + spl_autoload_register( array( self::class, 'load_class' ), true, true ); + } + + /** + * Unregisters the active autoloader so that it will no longer autoload classes. + */ + public function unregister_autoloader() { + // Remove any v2 autoloader that we've already registered. + $autoload_chain = spl_autoload_functions(); + if ( ! $autoload_chain ) { + return; + } + foreach ( $autoload_chain as $autoloader ) { + // We can identify a v2 autoloader using the namespace. + $namespace_check = null; + + // Functions are recorded as strings. + if ( is_string( $autoloader ) ) { + $namespace_check = $autoloader; + } elseif ( is_array( $autoloader ) && is_string( $autoloader[0] ) ) { + // Static method calls have the class as the first array element. + $namespace_check = $autoloader[0]; + } else { + // Since the autoloader has only ever been a function or a static method we don't currently need to check anything else. + continue; + } + + // Check for the namespace without the generated suffix. + if ( 'Automattic\\Jetpack\\Autoloader\\jp' === substr( $namespace_check, 0, 32 ) ) { + spl_autoload_unregister( $autoloader ); + } + } + + // Clear the global now that the autoloader has been unregistered. + global $jetpack_autoloader_loader; + $jetpack_autoloader_loader = null; + } + + /** + * Loads a class file if one could be found. + * + * Note: This function is static so that the autoloader can be easily unregistered. If + * it was a class method we would have to unwrap the object to check the namespace. + * + * @param string $class_name The name of the class to autoload. + * + * @return bool Indicates whether or not a class file was loaded. + */ + public static function load_class( $class_name ) { + global $jetpack_autoloader_loader; + if ( ! isset( $jetpack_autoloader_loader ) ) { + return; + } + + $file = $jetpack_autoloader_loader->find_class_file( $class_name ); + if ( ! isset( $file ) ) { + return false; + } + + require $file; + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php new file mode 100644 index 00000000..0fd4a278 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugin-locator.php @@ -0,0 +1,156 @@ +path_processor = $path_processor; + } + + /** + * Finds the path to the current plugin. + * + * @return string $path The path to the current plugin. + * + * @throws \RuntimeException If the current plugin does not have an autoloader. + */ + public function find_current_plugin() { + // Escape from `vendor/__DIR__` to root plugin directory. + $plugin_directory = dirname( dirname( __DIR__ ) ); + + // Use the path processor to ensure that this is an autoloader we're referencing. + $path = $this->path_processor->find_directory_with_autoloader( $plugin_directory, array() ); + if ( false === $path ) { + throw new \RuntimeException( 'Failed to locate plugin ' . $plugin_directory ); + } + + return $path; + } + + /** + * Checks a given option for plugin paths. + * + * @param string $option_name The option that we want to check for plugin information. + * @param bool $site_option Indicates whether or not we want to check the site option. + * + * @return array $plugin_paths The list of absolute paths we've found. + */ + public function find_using_option( $option_name, $site_option = false ) { + $raw = $site_option ? get_site_option( $option_name ) : get_option( $option_name ); + if ( false === $raw ) { + return array(); + } + + return $this->convert_plugins_to_paths( $raw ); + } + + /** + * Checks for plugins in the `action` request parameter. + * + * @param string[] $allowed_actions The actions that we're allowed to return plugins for. + * + * @return array $plugin_paths The list of absolute paths we've found. + */ + public function find_using_request_action( $allowed_actions ) { + // phpcs:disable WordPress.Security.NonceVerification.Recommended + + /** + * Note: we're not actually checking the nonce here because it's too early + * in the execution. The pluggable functions are not yet loaded to give + * plugins a chance to plug their versions. Therefore we're doing the bare + * minimum: checking whether the nonce exists and it's in the right place. + * The request will fail later if the nonce doesn't pass the check. + */ + if ( empty( $_REQUEST['_wpnonce'] ) ) { + return array(); + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated just below. + $action = isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : false; + if ( ! in_array( $action, $allowed_actions, true ) ) { + return array(); + } + + $plugin_slugs = array(); + switch ( $action ) { + case 'activate': + case 'deactivate': + if ( empty( $_REQUEST['plugin'] ) ) { + break; + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths. + $plugin_slugs[] = wp_unslash( $_REQUEST['plugin'] ); + break; + + case 'activate-selected': + case 'deactivate-selected': + if ( empty( $_REQUEST['checked'] ) ) { + break; + } + + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Validated by convert_plugins_to_paths. + $plugin_slugs = wp_unslash( $_REQUEST['checked'] ); + break; + } + + // phpcs:enable WordPress.Security.NonceVerification.Recommended + return $this->convert_plugins_to_paths( $plugin_slugs ); + } + + /** + * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter + * out the plugins that are not directory plugins. Note that array keys will also be included + * if they are plugin paths! + * + * @param string[] $plugins Plugin paths or slugs to filter. + * + * @return string[] + */ + private function convert_plugins_to_paths( $plugins ) { + if ( ! is_array( $plugins ) || empty( $plugins ) ) { + return array(); + } + + // We're going to look for plugins in the standard directories. + $path_constants = array( WP_PLUGIN_DIR, WPMU_PLUGIN_DIR ); + + $plugin_paths = array(); + foreach ( $plugins as $key => $value ) { + $path = $this->path_processor->find_directory_with_autoloader( $key, $path_constants ); + if ( $path ) { + $plugin_paths[] = $path; + } + + $path = $this->path_processor->find_directory_with_autoloader( $value, $path_constants ); + if ( $path ) { + $plugin_paths[] = $path; + } + } + + return $plugin_paths; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php new file mode 100644 index 00000000..e46547b3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-plugins-handler.php @@ -0,0 +1,164 @@ +plugin_locator = $plugin_locator; + $this->path_processor = $path_processor; + } + + /** + * Gets all of the active plugins we can find. + * + * @param bool $include_deactivating When true, plugins deactivating this request will be considered active. + * @param bool $record_unknown When true, the current plugin will be marked as active and recorded when unknown. + * + * @return string[] + */ + public function get_active_plugins( $include_deactivating, $record_unknown ) { + global $jetpack_autoloader_activating_plugins_paths; + + // We're going to build a unique list of plugins from a few different sources + // to find all of our "active" plugins. While we need to return an integer + // array, we're going to use an associative array internally to reduce + // the amount of time that we're going to spend checking uniqueness + // and merging different arrays together to form the output. + $active_plugins = array(); + + // Make sure that plugins which have activated this request are considered as "active" even though + // they probably won't be present in any option. + if ( is_array( $jetpack_autoloader_activating_plugins_paths ) ) { + foreach ( $jetpack_autoloader_activating_plugins_paths as $path ) { + $active_plugins[ $path ] = $path; + } + } + + // This option contains all of the plugins that have been activated. + $plugins = $this->plugin_locator->find_using_option( 'active_plugins' ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + + // This option contains all of the multisite plugins that have been activated. + if ( is_multisite() ) { + $plugins = $this->plugin_locator->find_using_option( 'active_sitewide_plugins', true ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + } + + // These actions contain plugins that are being activated/deactivated during this request. + $plugins = $this->plugin_locator->find_using_request_action( array( 'activate', 'activate-selected', 'deactivate', 'deactivate-selected' ) ); + foreach ( $plugins as $path ) { + $active_plugins[ $path ] = $path; + } + + // When the current plugin isn't considered "active" there's a problem. + // Since we're here, the plugin is active and currently being loaded. + // We can support this case (mu-plugins and non-standard activation) + // by adding the current plugin to the active list and marking it + // as an unknown (activating) plugin. This also has the benefit + // of causing a reset because the active plugins list has + // been changed since it was saved in the global. + $current_plugin = $this->plugin_locator->find_current_plugin(); + if ( $record_unknown && ! in_array( $current_plugin, $active_plugins, true ) ) { + $active_plugins[ $current_plugin ] = $current_plugin; + $jetpack_autoloader_activating_plugins_paths[] = $current_plugin; + } + + // When deactivating plugins aren't desired we should entirely remove them from the active list. + if ( ! $include_deactivating ) { + // These actions contain plugins that are being deactivated during this request. + $plugins = $this->plugin_locator->find_using_request_action( array( 'deactivate', 'deactivate-selected' ) ); + foreach ( $plugins as $path ) { + unset( $active_plugins[ $path ] ); + } + } + + // Transform the array so that we don't have to worry about the keys interacting with other array types later. + return array_values( $active_plugins ); + } + + /** + * Gets all of the cached plugins if there are any. + * + * @return string[] + */ + public function get_cached_plugins() { + $cached = get_transient( self::TRANSIENT_KEY ); + if ( ! is_array( $cached ) || empty( $cached ) ) { + return array(); + } + + // We need to expand the tokens to an absolute path for this webserver. + return array_map( array( $this->path_processor, 'untokenize_path_constants' ), $cached ); + } + + /** + * Saves the plugin list to the cache. + * + * @param array $plugins The plugin list to save to the cache. + */ + public function cache_plugins( $plugins ) { + // We store the paths in a tokenized form so that that webservers with different absolute paths don't break. + $plugins = array_map( array( $this->path_processor, 'tokenize_path_constants' ), $plugins ); + + set_transient( self::TRANSIENT_KEY, $plugins ); + } + + /** + * Checks to see whether or not the plugin list given has changed when compared to the + * shared `$jetpack_autoloader_cached_plugin_paths` global. This allows us to deal + * with cases where the active list may change due to filtering.. + * + * @param string[] $plugins The plugins list to check against the global cache. + * + * @return bool True if the plugins have changed, otherwise false. + */ + public function have_plugins_changed( $plugins ) { + global $jetpack_autoloader_cached_plugin_paths; + + if ( $jetpack_autoloader_cached_plugin_paths !== $plugins ) { + $jetpack_autoloader_cached_plugin_paths = $plugins; + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php new file mode 100644 index 00000000..4bd9dfb6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-shutdown-handler.php @@ -0,0 +1,92 @@ +plugins_handler = $plugins_handler; + $this->cached_plugins = $cached_plugins; + $this->was_included_by_autoloader = $was_included_by_autoloader; + } + + /** + * Handles the shutdown of the autoloader. + */ + public function __invoke() { + // Don't save a broken cache if an error happens during some plugin's initialization. + if ( ! did_action( 'plugins_loaded' ) ) { + // Ensure that the cache is emptied to prevent consecutive failures if the cache is to blame. + if ( ! empty( $this->cached_plugins ) ) { + $this->plugins_handler->cache_plugins( array() ); + } + + return; + } + + // Load the active plugins fresh since the list we pulled earlier might not contain + // plugins that were activated but did not reset the autoloader. This happens + // when a plugin is in the cache but not "active" when the autoloader loads. + // We also want to make sure that plugins which are deactivating are not + // considered "active" so that they will be removed from the cache now. + try { + $active_plugins = $this->plugins_handler->get_active_plugins( false, ! $this->was_included_by_autoloader ); + } catch ( \Exception $ex ) { + // When the package is deleted before shutdown it will throw an exception. + // In the event this happens we should erase the cache. + if ( ! empty( $this->cached_plugins ) ) { + $this->plugins_handler->cache_plugins( array() ); + } + return; + } + + // The paths should be sorted for easy comparisons with those loaded from the cache. + // Note we don't need to sort the cached entries because they're already sorted. + sort( $active_plugins ); + + // We don't want to waste time saving a cache that hasn't changed. + if ( $this->cached_plugins === $active_plugins ) { + return; + } + + $this->plugins_handler->cache_plugins( $active_plugins ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php new file mode 100644 index 00000000..42f60237 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-loader.php @@ -0,0 +1,164 @@ +version_selector = $version_selector; + $this->classmap = $classmap; + $this->psr4_map = $psr4_map; + $this->filemap = $filemap; + } + + /** + * Finds the file path for the given class. + * + * @param string $class_name The class to find. + * + * @return string|null $file_path The path to the file if found, null if no class was found. + */ + public function find_class_file( $class_name ) { + $data = $this->select_newest_file( + isset( $this->classmap[ $class_name ] ) ? $this->classmap[ $class_name ] : null, + $this->find_psr4_file( $class_name ) + ); + if ( ! isset( $data ) ) { + return null; + } + + return $data['path']; + } + + /** + * Load all of the files in the filemap. + */ + public function load_filemap() { + if ( empty( $this->filemap ) ) { + return; + } + + foreach ( $this->filemap as $file_identifier => $file_data ) { + if ( empty( $GLOBALS['__composer_autoload_files'][ $file_identifier ] ) ) { + require_once $file_data['path']; + + $GLOBALS['__composer_autoload_files'][ $file_identifier ] = true; + } + } + } + + /** + * Compares different class sources and returns the newest. + * + * @param array|null $classmap_data The classmap class data. + * @param array|null $psr4_data The PSR-4 class data. + * + * @return array|null $data + */ + private function select_newest_file( $classmap_data, $psr4_data ) { + if ( ! isset( $classmap_data ) ) { + return $psr4_data; + } elseif ( ! isset( $psr4_data ) ) { + return $classmap_data; + } + + if ( $this->version_selector->is_version_update_required( $classmap_data['version'], $psr4_data['version'] ) ) { + return $psr4_data; + } + + return $classmap_data; + } + + /** + * Finds the file for a given class in a PSR-4 namespace. + * + * @param string $class_name The class to find. + * + * @return array|null $data The version and path path to the file if found, null otherwise. + */ + private function find_psr4_file( $class_name ) { + if ( ! isset( $this->psr4_map ) ) { + return null; + } + + // Don't bother with classes that have no namespace. + $class_index = strrpos( $class_name, '\\' ); + if ( ! $class_index ) { + return null; + } + $class_for_path = str_replace( '\\', '/', $class_name ); + + // Search for the namespace by iteratively cutting off the last segment until + // we find a match. This allows us to check the most-specific namespaces + // first as well as minimize the amount of time spent looking. + for ( + $class_namespace = substr( $class_name, 0, $class_index ); + ! empty( $class_namespace ); + $class_namespace = substr( $class_namespace, 0, strrpos( $class_namespace, '\\' ) ) + ) { + $namespace = $class_namespace . '\\'; + if ( ! isset( $this->psr4_map[ $namespace ] ) ) { + continue; + } + $data = $this->psr4_map[ $namespace ]; + + foreach ( $data['path'] as $path ) { + $path .= '/' . substr( $class_for_path, strlen( $namespace ) ) . '.php'; + if ( file_exists( $path ) ) { + return array( + 'version' => $data['version'], + 'path' => $path, + ); + } + } + } + + return null; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php new file mode 100644 index 00000000..9621ddd2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/jetpack-autoloader/class-version-selector.php @@ -0,0 +1,69 @@ +is_dev_version( $selected_version ) ) { + return false; + } + + if ( $this->is_dev_version( $compare_version ) ) { + if ( $use_dev_versions ) { + return true; + } else { + return false; + } + } + + if ( version_compare( $selected_version, $compare_version, '<' ) ) { + return true; + } + + return false; + } + + /** + * Checks whether the given package version is a development version. + * + * @param String $version The package version. + * + * @return bool True if the version is a dev version, else false. + */ + public function is_dev_version( $version ) { + if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) { + return true; + } + + return false; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE new file mode 100644 index 00000000..344d6275 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/NOTICE @@ -0,0 +1,2 @@ +AhoCorasick PHP Library +Copyright 2015 Ori Livneh diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php new file mode 100644 index 00000000..499899a8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/bench.php @@ -0,0 +1,75 @@ +searchAndReplace( $text ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'MultiStringRepeater::searchAndReplace(): ', $wallTime ); + if ( $profile ) { + $profile = xhprof_disable(); + foreach ( $profile as $func => $data ) { + printf( "%s: %.2f\n", $func, $data['cpu'] / $data['ct'] ); + } + } +} + +if ( function_exists( 'fss_prep_replace' ) && isset( $options['fss'] ) ) { + $fss = fss_prep_replace( $zh2Hant ); + $startTime = microtime( true ); + for ( $i = 0; $i < $loops; $i++ ) { + fss_exec_replace( $fss, $text ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'fss_exec_replace(): ', $wallTime ); +} + +if ( isset( $options['strtr'] ) ) { + $startTime = microtime( true ); + for ( $i = 0; $i < $loops; $i++ ) { + strtr( $text, $zh2Hant ); + } + $endTime = microtime( true ); + $wallTime = 1000 * ( ( $endTime - $startTime ) / $loops ); + printf( "%-'.40s %.2fms\n", 'strtr(): ', $wallTime ); +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php new file mode 100644 index 00000000..1cb6384e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/bench/check.php @@ -0,0 +1,42 @@ +searchAndReplace( $text ) !== $expected ) { + echo "ERROR\n"; + $status = 1; +} else { + echo "OK\n"; +} + +if ( function_exists( 'fss_exec_replace' ) ) { + echo "fss_exec_replace(): "; + $fss = fss_prep_replace( $zh2Hant ); + if ( fss_exec_replace( $fss, $text ) !== $expected ) { + echo "ERROR\n"; + $status = 1; + } else { + echo "OK\n"; + } +} + +exit( $status ); diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php new file mode 100644 index 00000000..b2953c4d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringMatcher.php @@ -0,0 +1,230 @@ + + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @file + * @author Ori Livneh + */ + +namespace AhoCorasick; + +/** + * Represents a finite state machine that can find all occurrences + * of a set of search keywords in a body of text. + * + * The time it takes to construct the finite state machine is + * proportional to the sum of the lengths of the search keywords. + * Once constructed, the machine can locate all occurences of all + * search keywords in a body of text in a single pass, making exactly + * one state transition per input character. + * + * This is an implementation of the Aho-Corasick string matching + * algorithm. + * + * Alfred V. Aho and Margaret J. Corasick, "Efficient string matching: + * an aid to bibliographic search", CACM, 18(6):333-340, June 1975. + * + * @link http://xlinux.nist.gov/dads//HTML/ahoCorasick.html + */ +class MultiStringMatcher { + + /** @var string[] The set of keywords to be searched for. **/ + protected $searchKeywords = []; + + /** @var int The number of possible states of the string-matching finite state machine. **/ + protected $numStates = 1; + + /** @var array Mapping of states to outputs. **/ + protected $outputs = []; + + /** @var array Mapping of failure transitions. **/ + protected $noTransitions = []; + + /** @var array Mapping of success transitions. **/ + protected $yesTransitions = []; + + /** + * Constructor. + * + * @param string[] $searchKeywords The set of keywords to be matched. + */ + public function __construct( array $searchKeywords ) { + foreach ( $searchKeywords as $keyword ) { + if ( $keyword !== '' ) { + $this->searchKeywords[$keyword] = strlen( $keyword ); + } + } + + if ( !$this->searchKeywords ) { + trigger_error( __METHOD__ . ': The set of search keywords is empty.', E_USER_WARNING ); + // Unreachable 'return' when PHPUnit detects trigger_error + return; // @codeCoverageIgnore + } + + $this->computeYesTransitions(); + $this->computeNoTransitions(); + } + + /** + * Accessor for the search keywords. + * + * @return string[] Search keywords. + */ + public function getKeywords() { + return array_keys( $this->searchKeywords ); + } + + /** + * Map the current state and input character to the next state. + * + * @param int $currentState The current state of the string-matching + * automaton. + * @param string $inputChar The character the string-matching + * automaton is currently processing. + * @return int The state the automaton should transition to. + */ + public function nextState( $currentState, $inputChar ) { + $initialState = $currentState; + while ( true ) { + $transitions =& $this->yesTransitions[$currentState]; + if ( isset( $transitions[$inputChar] ) ) { + $nextState = $transitions[$inputChar]; + // Avoid failure transitions next time. + if ( $currentState !== $initialState ) { + $this->yesTransitions[$initialState][$inputChar] = $nextState; + } + return $nextState; + } + if ( $currentState === 0 ) { + return 0; + } + $currentState = $this->noTransitions[$currentState]; + } + // Unreachable outside 'while' + } // @codeCoverageIgnore + + /** + * Locate the search keywords in some text. + * + * @param string $text The string to search in. + * @return array[] An array of matches. Each match is a vector + * containing an integer offset and the matched keyword. + * + * @par Example: + * @code + * $keywords = new MultiStringMatcher( array( 'ore', 'hell' ) ); + * $keywords->searchIn( 'She sells sea shells by the sea shore.' ); + * // result: array( array( 15, 'hell' ), array( 34, 'ore' ) ) + * @endcode + */ + public function searchIn( $text ) { + if ( !$this->searchKeywords || $text === '' ) { + return []; // fast path + } + + $state = 0; + $results = []; + $length = strlen( $text ); + + for ( $i = 0; $i < $length; $i++ ) { + $ch = $text[$i]; + $state = $this->nextState( $state, $ch ); + foreach ( $this->outputs[$state] as $match ) { + $offset = $i - $this->searchKeywords[$match] + 1; + $results[] = [ $offset, $match ]; + } + } + + return $results; + } + + /** + * Get the state transitions which the string-matching automaton + * shall make as it advances through input text. + * + * Constructs a directed tree with a root node which represents the + * initial state of the string-matching automaton and from which a + * path exists which spells out each search keyword. + */ + protected function computeYesTransitions() { + $this->yesTransitions = [ [] ]; + $this->outputs = [ [] ]; + foreach ( $this->searchKeywords as $keyword => $length ) { + $state = 0; + for ( $i = 0; $i < $length; $i++ ) { + $ch = $keyword[$i]; + if ( !empty( $this->yesTransitions[$state][$ch] ) ) { + $state = $this->yesTransitions[$state][$ch]; + } else { + $this->yesTransitions[$state][$ch] = $this->numStates; + $this->yesTransitions[] = []; + $this->outputs[] = []; + $state = $this->numStates++; + } + } + + $this->outputs[$state][] = $keyword; + } + } + + /** + * Get the state transitions which the string-matching automaton + * shall make when a partial match proves false. + */ + protected function computeNoTransitions() { + $queue = []; + $this->noTransitions = []; + + foreach ( $this->yesTransitions[0] as $ch => $toState ) { + $queue[] = $toState; + $this->noTransitions[$toState] = 0; + } + + while ( true ) { + $fromState = array_shift( $queue ); + if ( $fromState === null ) { + break; + } + foreach ( $this->yesTransitions[$fromState] as $ch => $toState ) { + $queue[] = $toState; + $state = $this->noTransitions[$fromState]; + + while ( $state !== 0 && empty( $this->yesTransitions[$state][$ch] ) ) { + $state = $this->noTransitions[$state]; + } + + if ( isset( $this->yesTransitions[$state][$ch] ) ) { + $noState = $this->yesTransitions[$state][$ch]; + } else { + $noState = 0; + } + + $this->noTransitions[$toState] = $noState; + $this->outputs[$toState] = array_merge( + $this->outputs[$toState], $this->outputs[$noState] ); + } + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php new file mode 100644 index 00000000..6b7891f6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/jetpack-protect/vendor/wikimedia/aho-corasick/src/MultiStringReplacer.php @@ -0,0 +1,96 @@ + + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @file + * @author Ori Livneh + */ + +namespace AhoCorasick; + +/** + * This class extends MultiStringMatcher, adding search and replace + * functionality. + */ +class MultiStringReplacer extends MultiStringMatcher { + + /** @var array Mapping of states to outputs. **/ + protected $replacePairs = []; + + /** + * Constructor. + * + * @param array $replacePairs array of ( 'from' => 'to' ) replacement pairs. + */ + public function __construct( array $replacePairs ) { + foreach ( $replacePairs as $keyword => $replacement ) { + if ( $keyword !== '' ) { + $this->replacePairs[$keyword] = $replacement; + } + } + parent::__construct( array_keys( $this->replacePairs ) ); + } + + /** + * Search and replace a set of keywords in some text. + * + * @param string $text The string to search in. + * @return string The input text with replacements. + * + * @par Example: + * @code + * $replacer = new MultiStringReplacer( array( 'csh' => 'sea shells' ) ); + * $replacer->searchAndReplace( 'She sells csh by the sea shore.' ); + * // result: 'She sells sea shells by the sea shore.' + * @endcode + */ + public function searchAndReplace( $text ) { + $state = 0; + $length = strlen( $text ); + $matches = []; + for ( $i = 0; $i < $length; $i++ ) { + $ch = $text[$i]; + $state = $this->nextState( $state, $ch ); + foreach ( $this->outputs[$state] as $match ) { + $offset = $i - $this->searchKeywords[$match] + 1; + $matches[$offset] = $match; + } + } + ksort( $matches ); + + $buf = ''; + $lastInsert = 0; + foreach ( $matches as $offset => $match ) { + if ( $offset >= $lastInsert ) { + $buf .= substr( $text, $lastInsert, $offset - $lastInsert ); + $buf .= $this->replacePairs[$match]; + $lastInsert = $offset + $this->searchKeywords[$match]; + } + } + $buf .= substr( $text, $lastInsert ); + + return $buf; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md b/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md new file mode 100644 index 00000000..7886218d --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/CHANGELOG.md @@ -0,0 +1,111 @@ +##### [Version 0.13.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.5...v0.13.6) (2023-07-07) + +- Updated composer dependencies to address warning in the widgets section + +##### [Version 0.13.5](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.4...v0.13.5) (2023-03-30) + +- Updated Dependencies and WordPress core tested up to version 6.2 + +##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01) + +Update dependencies + +##### [Version 0.13.3](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.2...v0.13.3) (2023-02-25) + +- Fix img width/height value, props @Htbaa +- Update dependencies + +##### [Version 0.13.2](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.1...v0.13.2) (2022-11-24) + +* Fix - update dependencies + +##### [Version 0.13.1](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.0...v0.13.1) (2022-11-04) + +Tested with the WordPress 6.1 version + +#### [Version 0.13.0](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.12...v0.13.0) (2022-08-23) + +* Fix Neve upsells showing up inconsistently on edge cases +* Fix inconsistency with Font Awesome 5 and adds compatibility with 6th version +* Fix compatibility with JupiterX +* Update dependencies + +##### [Version 0.12.12](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.11...v0.12.12) (2022-05-27) + +- Fix the style handler conflict issue which breaks the arrow icon of the submenus on some themes +- Fix dismiss dashboard notice issue on some edge cases +- Fix compatibility with the Max Mega Menu plugin + +##### [Version 0.12.11](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.10...v0.12.11) (2022-03-16) + +Add font awesome 5 support +Enhance compatibility with Otter/Neve + +##### [Version 0.12.10](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.9...v0.12.10) (2022-02-07) + +- [Fix] Add support for alt attribute for SVG icons +- Tested up with WordPress 5.9 + +##### [Version 0.12.9](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.8...v0.12.9) (2021-08-04) + +* Tested compatibility with WordPress 5.8 + +##### [Version 0.12.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.7...v0.12.8) (2021-05-12) + +* Fix issue when the image is not accessible to fetch the width/height metadata. + +##### [Version 0.12.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.6...v0.12.7) (2021-05-07) + +Fix PHP fatal error when uploading SVG with the image uploader + +##### [Version 0.12.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.5...v0.12.6) (2021-05-05) + +* Adds explicit width/height to icons to prevent layout shifts issues + +### v0.12.5 - 2020-08-18 + **Changes:** + + ### v0.12.4 - 2020-07-13 + **Changes:** + * Fix Font Awesome not loading + + ### v0.12.3 - 2020-07-13 + **Changes:** + * Fixed Menu Icons in Block Editor not working +* Fixed CWP links. + + ### v0.12.2 - 2019-11-15 + **Changes:** + + ### v0.12.1 - 2019-11-15 + **Changes:** + * Improve legacy compatibility + + ### v0.12.0 - 2019-11-15 + **Changes:** + * Fix issues with WordPress 5.3. + + ### v0.11.5 - 2019-05-23 + **Changes:** + * Sync composer dependencies with the latest version + + ### v0.11.4 - 2018-12-10 + **Changes:** + * fix issue with composer libraries. + + ### v0.11.3 - 2018-12-10 + **Changes:** + * Tested with WP 5.0 + + ### v0.11.2 - 2018-03-05 + **Changes:** + * Improve popup sidebar layout. + + ### v0.11.1 - 2018-02-24 + **Changes:** + * Add recommendation boxes in the menu icon popup. + + ### v0.11.0 - 2018-01-05 + **Changes:** + * Change ownership to ThemeIsle. +* Improves compatibility with various ThemeIsle products. diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/CONTRIBUTING.md b/wp-content/upgrade-temp-backup/plugins/menu-icons/CONTRIBUTING.md new file mode 100644 index 00000000..36b5b5b1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/CONTRIBUTING.md @@ -0,0 +1,13 @@ +## Releasing + +This repository uses conventional [changelog commit](https://github.com/Codeinwp/conventional-changelog-simple-preset) messages to trigger release + +How to release a new version: + +- Clone the master branch +- Do your changes +- Send a PR to master and merge it using the following subject message + - `release: ` - for patch release + - `release(minor): ` - for minor release + - `release(major): ` - for major release + The release notes will inherit the body of the commit message which triggered the release. For more details check the [simple-preset](https://github.com/Codeinwp/conventional-changelog-simple-preset) that we use. \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE b/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE new file mode 100644 index 00000000..d7f10513 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/LICENSE @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css new file mode 100644 index 00000000..288acd71 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.css @@ -0,0 +1,246 @@ +.menu-icons-wrap { + margin-top: 5px; + margin-bottom: 5px; +} + +.menu-icons-wrap p { + min-height: 2.2em; + margin-bottom: 0; +} + +.menu-icons-wrap p a, +.menu-icons-wrap p label { + display: inline-block; + height: 100%; + line-height: 2.2em; + vertical-align: middle; +} + +.menu-icons-wrap a { + text-decoration: none; + cursor: pointer; +} + +.menu-icons-wrap .submitdelete { + display: inline-block; + float: none; + height: 100%; + margin: 0; + padding: 0; + line-height: 2.2em; +} + +.menu-icons-wrap .hidden { + display: none; +} + +.menu-icons-wrap ._icon { + width: auto; + height: auto; + margin: -0.1em 0.2em 0 0.2em; + color: #666; + font-size: 1.9em; + vertical-align: middle; +} + +.menu-icons-wrap img._icon { + max-width: 24px; +} + +.menu-icons-wrap a._select:focus ._icon, +.menu-icons-wrap a._select:hover ._icon { + color: #101010; +} + +.mi-preview.menu-item { + min-height: 0; + font-size: 1.2em; +} + +.mi-preview.menu-item a { + text-decoration: none; +} + +.mi-preview.menu-item a > * { + display: inline-block; + height: 100%; + line-height: 100%; + vertical-align: middle; +} + +.mi-preview.menu-item ._icon { + margin-right: 0.25em; +} + +.rtl .mi-preview.menu-item ._icon { + margin-right: 0; +} + +.media-sidebar .mi-settings .setting input[type="number"], +.menu-icons-settings input[type="number"] { + float: none; + width: auto; + max-width: 5em; +} + +.media-sidebar .mi-settings .setting input, +.media-sidebar .mi-settings span.description { + float: none; +} + +/** Settings Meta Box **/ +.menu-icons-settings ._field { + padding: 0.5em 0; +} + +.menu-icons-settings ._field ._main { + display: block; + margin-bottom: 0.25em; + font-weight: bold; +} + +#menu-settings-column .menu-icons-settings .inside { + margin-top: 0; +} + +.menu-icons-settings .taxonomydiv .tabs-panel { + max-height: none; + margin-bottom: 0.75em; + padding-top: 0.3em; + padding-bottom: 0.4em; +} + +.js .menu-icons-settings .taxonomydiv .tabs-panel { + margin-bottom: 0; +} + +.menu-icons-settings h4 { + margin: 0; +} + +.menu-icons-settings ._menu span.description { + margin-left: 0.5em; +} + +.menu-icons-settings ._extensions ul { + margin-top: 0.75em; + padding-left: 1.5em; + list-style: disc; +} + +.menu-icons-settings ._extensions ul a { + text-decoration: none; +} + +.menu-icons-settings .spinner { + float: none; + margin: 0 5px 0 0; + vertical-align: middle; +} + +.attachment .svg-icon img { + max-width: 100%; +} + +.nv-upgrade-notice { + width: 90%; + margin-top: 0; + padding: 15px; +} + +#menu-icons-sidebar div.new-card { + width: auto; + min-width: initial; + max-width: initial; + margin: 10px auto; +} + +.menu-icons-subscribe { + padding: 15px; +} + +.menu-icons-submit-mail { + width: auto; +} + +#success { + display: none; +} + +#failure { + display: none; +} + +.attachments-browser.iconpicker-fonts-browser .media-toolbar { + width: 62%; +} + +.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items { + width: 64%; +} + +.attachments-browser.iconpicker-fonts-browser .media-sidebar { + width: 32%; +} + +.nv-upgrade-notice { + background: #FFFFFF; + border: 1px solid #E1E1E1; + box-sizing: border-box; + padding: 20px; + display: flex; + flex-wrap: wrap; +} + +.nv-upgrade-notice .menu-icon-notice-popup-img { + width: 115px; + height: 100px; + background-color: #f1f1f1; + margin-right: 20px; + margin-bottom: 20px; +} + +.nv-upgrade-notice .menu-icon-notice-popup-img img{ + width: 100%; + height: 100%; + object-fit: cover; +} + +.nv-upgrade-notice .menu-icon-notice-popup { + flex: 1; +} + +.nv-upgrade-notice .menu-icon-notice-popup h4{ + padding: 0; + margin: 0 0 8px; + font-weight: 590; + font-size: 14px; + line-height: 1.2; + color: #000000; + display: block; + width: 100%; +} + +.nv-upgrade-notice .menu-icon-notice-popup p { + font-size: 13px; + line-height: 1.2; + color: #000000; + margin: 0 0 16px; + display: block; + padding: 0; +} + +.nv-upgrade-notice .menu-icon-notice-popup .button { + width: auto; + height: 30px; + background: #0071AE; + border-radius: 4px; + padding: 5px 12px; + font-size: 13px; + line-height: 1.5; + color: #fff; +} + +.nv-upgrade-notice .menu-icon-notice-popup .button:hover { + color: #fff; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css new file mode 100644 index 00000000..2d4fd049 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/admin.min.css @@ -0,0 +1 @@ +.menu-icons-wrap{margin-top:5px;margin-bottom:5px}.menu-icons-wrap p{min-height:2.2em;margin-bottom:0}.menu-icons-wrap p a,.menu-icons-wrap p label{display:inline-block;height:100%;line-height:2.2em;vertical-align:middle}.menu-icons-wrap a{text-decoration:none;cursor:pointer}.menu-icons-wrap .submitdelete{display:inline-block;float:none;height:100%;margin:0;padding:0;line-height:2.2em}.menu-icons-wrap .hidden{display:none}.menu-icons-wrap ._icon{width:auto;height:auto;margin:-.1em .2em 0 .2em;color:#666;font-size:1.9em;vertical-align:middle}.menu-icons-wrap img._icon{max-width:24px}.menu-icons-wrap a._select:focus ._icon,.menu-icons-wrap a._select:hover ._icon{color:#101010}.mi-preview.menu-item{min-height:0;font-size:1.2em}.mi-preview.menu-item a{text-decoration:none}.mi-preview.menu-item a>*{display:inline-block;height:100%;line-height:100%;vertical-align:middle}.mi-preview.menu-item ._icon{margin-right:.25em}.rtl .mi-preview.menu-item ._icon{margin-right:0}.media-sidebar .mi-settings .setting input[type=number],.menu-icons-settings input[type=number]{float:none;width:auto;max-width:5em}.media-sidebar .mi-settings .setting input,.media-sidebar .mi-settings span.description{float:none}.menu-icons-settings ._field{padding:.5em 0}.menu-icons-settings ._field ._main{display:block;margin-bottom:.25em;font-weight:700}#menu-settings-column .menu-icons-settings .inside{margin-top:0}.menu-icons-settings .taxonomydiv .tabs-panel{max-height:none;margin-bottom:.75em;padding-top:.3em;padding-bottom:.4em}.js .menu-icons-settings .taxonomydiv .tabs-panel{margin-bottom:0}.menu-icons-settings h4{margin:0}.menu-icons-settings ._menu span.description{margin-left:.5em}.menu-icons-settings ._extensions ul{margin-top:.75em;padding-left:1.5em;list-style:disc}.menu-icons-settings ._extensions ul a{text-decoration:none}.menu-icons-settings .spinner{float:none;margin:0 5px 0 0;vertical-align:middle}.attachment .svg-icon img{max-width:100%}.nv-upgrade-notice{width:90%;margin-top:0;padding:15px}#menu-icons-sidebar div.new-card{width:auto;min-width:initial;max-width:initial;margin:10px auto}.menu-icons-subscribe{padding:15px}.menu-icons-submit-mail{width:auto}#success{display:none}#failure{display:none}.attachments-browser.iconpicker-fonts-browser .media-toolbar{width:62%}.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items{width:64%}.attachments-browser.iconpicker-fonts-browser .media-sidebar{width:32%}.nv-upgrade-notice{background:#fff;border:1px solid #e1e1e1;box-sizing:border-box;padding:20px;display:flex;flex-wrap:wrap}.nv-upgrade-notice .menu-icon-notice-popup-img{width:115px;height:100px;background-color:#f1f1f1;margin-right:20px;margin-bottom:20px}.nv-upgrade-notice .menu-icon-notice-popup-img img{width:100%;height:100%;object-fit:cover}.nv-upgrade-notice .menu-icon-notice-popup{flex:1}.nv-upgrade-notice .menu-icon-notice-popup h4{padding:0;margin:0 0 8px;font-weight:590;font-size:14px;line-height:1.2;color:#000;display:block;width:100%}.nv-upgrade-notice .menu-icon-notice-popup p{font-size:13px;line-height:1.2;color:#000;margin:0 0 16px;display:block;padding:0}.nv-upgrade-notice .menu-icon-notice-popup .button{width:auto;height:30px;background:#0071ae;border-radius:4px;padding:5px 12px;font-size:13px;line-height:1.5;color:#fff}.nv-upgrade-notice .menu-icon-notice-popup .button:hover{color:#fff} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css new file mode 100644 index 00000000..da1c6c2b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.css @@ -0,0 +1,44 @@ +.menu-icon-dashboard-notice { + position: relative; + background: #FFFFFF; + border: 1px solid #E1E1E1; + box-sizing: border-box; + padding: 24px; + border-left: 4px solid #72AEE6; + margin: 0 0 30px; +} + +.menu-icon-dashboard-notice h2 { + padding: 0; + margin: 0 0 8px; + font-weight: bold; + font-size: 18px; + line-height: 1.2; + color: #000000; +} + +.menu-icon-dashboard-notice p { + font-size: 12px; + line-height: 1.2; + color: #000000; + display: block; + margin-bottom: 16px; +} + +.menu-icon-dashboard-notice .button { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 5px 12px; + background: #0071AE; + border-radius: 4px; + width: 105px; + height: 30px; + color: #FFFFFF; + font-size: 13px; + line-height: 1.5; +} +.menu-icon-dashboard-notice .notice-dismiss { + text-decoration: none; +} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css new file mode 100644 index 00000000..cc3d61b8 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/dashboard-notice.min.css @@ -0,0 +1 @@ +.menu-icon-dashboard-notice{position:relative;background:#fff;border:1px solid #e1e1e1;box-sizing:border-box;padding:24px;border-left:4px solid #72aee6;margin:0 0 30px}.menu-icon-dashboard-notice h2{padding:0;margin:0 0 8px;font-weight:700;font-size:18px;line-height:1.2;color:#000}.menu-icon-dashboard-notice p{font-size:12px;line-height:1.2;color:#000;display:block;margin-bottom:16px}.menu-icon-dashboard-notice .button{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:5px 12px;background:#0071ae;border-radius:4px;width:105px;height:30px;color:#fff;font-size:13px;line-height:1.5}.menu-icon-dashboard-notice .notice-dismiss{text-decoration:none} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css new file mode 100644 index 00000000..ec8b2a60 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.css @@ -0,0 +1,74 @@ +.menu-item i._mi, +.menu-item img._mi { + display: inline-block; + vertical-align: middle; +} + +.menu-item i._mi { + width: auto; + height: auto; + margin-top: -0.265em; + font-size: 1.2em; + line-height: 1; +} + +.menu-item i._before, +.rtl .menu-item i._after { + margin-right: 0.25em; +} + +.menu-item i._after, +.rtl .menu-item i._before { + margin-left: 0.25em; +} + +.menu-item img._before, +.rtl .menu-item img._after { + margin-right: 0.5em; +} + +.menu-item img._after, +.rtl .menu-item img._before { + margin-left: 0.5em; +} + +.menu-item ._svg { + width: 1em; +} + +.rtl .menu-item i._before { + margin-right: 0; +} + +.rtl .menu-item i._after { + margin-left: 0; +} + +.visuallyhidden { + overflow: hidden; + clip: rect(0 0 0 0); + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + border: 0; +} + +.menu-item i.elusive { + margin-top: -0.3em; +} + +/** + * Force the icons' styles + * + * Some themes -- notably 2014 -- has nasty rules that + * could override the icons' styles so we need to force them here. + */ +.dashicons-admin-site:before { + content: "\f319" !important; +} + +.dashicons-welcome-view-site:before { + content: "\f115" !important; +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css new file mode 100644 index 00000000..7ff02d86 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/extra.min.css @@ -0,0 +1 @@ +.menu-item i._mi,.menu-item img._mi{display:inline-block;vertical-align:middle}.menu-item i._mi{width:auto;height:auto;margin-top:-.265em;font-size:1.2em;line-height:1}.menu-item i._before,.rtl .menu-item i._after{margin-right:.25em}.menu-item i._after,.rtl .menu-item i._before{margin-left:.25em}.menu-item img._before,.rtl .menu-item img._after{margin-right:.5em}.menu-item img._after,.rtl .menu-item img._before{margin-left:.5em}.menu-item ._svg{width:1em}.rtl .menu-item i._before{margin-right:0}.rtl .menu-item i._after{margin-left:0}.visuallyhidden{overflow:hidden;clip:rect(0 0 0 0);position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0}.menu-item i.elusive{margin-top:-.3em}.dashicons-admin-site:before{content:"\f319"!important}.dashicons-welcome-view-site:before{content:"\f115"!important} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt new file mode 100644 index 00000000..f31bef92 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/LICENSE.txt @@ -0,0 +1,34 @@ +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css new file mode 100644 index 00000000..b9a01fbb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/css/all.min.css @@ -0,0 +1,6 @@ +/*! + * Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2022 Fonticons, Inc. + */ +.fa{font-family:var(--fa-style-family,"Font Awesome 6 Free");font-weight:var(--fa-style,900)}.fa,.fa-brands,.fa-duotone,.fa-light,.fa-regular,.fa-solid,.fa-thin,.fab,.fad,.fal,.far,.fas,.fat{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display,inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em)*-1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-radius:var(--fa-border-radius,.1em);border:var(--fa-border-width,.08em) var(--fa-border-style,solid) var(--fa-border-color,#eee);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade,.fa-fade{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s)}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake,.fa-spin{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index,auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-0:before{content:"\30"}.fa-1:before{content:"\31"}.fa-2:before{content:"\32"}.fa-3:before{content:"\33"}.fa-4:before{content:"\34"}.fa-5:before{content:"\35"}.fa-6:before{content:"\36"}.fa-7:before{content:"\37"}.fa-8:before{content:"\38"}.fa-9:before{content:"\39"}.fa-a:before{content:"\41"}.fa-address-book:before,.fa-contact-book:before{content:"\f2b9"}.fa-address-card:before,.fa-contact-card:before,.fa-vcard:before{content:"\f2bb"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-anchor:before{content:"\f13d"}.fa-anchor-circle-check:before{content:"\e4aa"}.fa-anchor-circle-exclamation:before{content:"\e4ab"}.fa-anchor-circle-xmark:before{content:"\e4ac"}.fa-anchor-lock:before{content:"\e4ad"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-double-down:before,.fa-angles-down:before{content:"\f103"}.fa-angle-double-left:before,.fa-angles-left:before{content:"\f100"}.fa-angle-double-right:before,.fa-angles-right:before{content:"\f101"}.fa-angle-double-up:before,.fa-angles-up:before{content:"\f102"}.fa-ankh:before{content:"\f644"}.fa-apple-alt:before,.fa-apple-whole:before{content:"\f5d1"}.fa-archway:before{content:"\f557"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-down-1-9:before,.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:"\f162"}.fa-arrow-down-9-1:before,.fa-sort-numeric-desc:before,.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-arrow-down-a-z:before,.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:"\f15d"}.fa-arrow-down-long:before,.fa-long-arrow-down:before{content:"\f175"}.fa-arrow-down-short-wide:before,.fa-sort-amount-desc:before,.fa-sort-amount-down-alt:before{content:"\f884"}.fa-arrow-down-up-across-line:before{content:"\e4af"}.fa-arrow-down-up-lock:before{content:"\e4b0"}.fa-arrow-down-wide-short:before,.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:"\f160"}.fa-arrow-down-z-a:before,.fa-sort-alpha-desc:before,.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-left-long:before,.fa-long-arrow-left:before{content:"\f177"}.fa-arrow-pointer:before,.fa-mouse-pointer:before{content:"\f245"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-right-arrow-left:before,.fa-exchange:before{content:"\f0ec"}.fa-arrow-right-from-bracket:before,.fa-sign-out:before{content:"\f08b"}.fa-arrow-right-long:before,.fa-long-arrow-right:before{content:"\f178"}.fa-arrow-right-to-bracket:before,.fa-sign-in:before{content:"\f090"}.fa-arrow-right-to-city:before{content:"\e4b3"}.fa-arrow-left-rotate:before,.fa-arrow-rotate-back:before,.fa-arrow-rotate-backward:before,.fa-arrow-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-arrow-right-rotate:before,.fa-arrow-rotate-forward:before,.fa-arrow-rotate-right:before,.fa-redo:before{content:"\f01e"}.fa-arrow-trend-down:before{content:"\e097"}.fa-arrow-trend-up:before{content:"\e098"}.fa-arrow-turn-down:before,.fa-level-down:before{content:"\f149"}.fa-arrow-turn-up:before,.fa-level-up:before{content:"\f148"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-up-1-9:before,.fa-sort-numeric-up:before{content:"\f163"}.fa-arrow-up-9-1:before,.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-arrow-up-a-z:before,.fa-sort-alpha-up:before{content:"\f15e"}.fa-arrow-up-from-bracket:before{content:"\e09a"}.fa-arrow-up-from-ground-water:before{content:"\e4b5"}.fa-arrow-up-from-water-pump:before{content:"\e4b6"}.fa-arrow-up-long:before,.fa-long-arrow-up:before{content:"\f176"}.fa-arrow-up-right-dots:before{content:"\e4b7"}.fa-arrow-up-right-from-square:before,.fa-external-link:before{content:"\f08e"}.fa-arrow-up-short-wide:before,.fa-sort-amount-up-alt:before{content:"\f885"}.fa-arrow-up-wide-short:before,.fa-sort-amount-up:before{content:"\f161"}.fa-arrow-up-z-a:before,.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-arrows-down-to-line:before{content:"\e4b8"}.fa-arrows-down-to-people:before{content:"\e4b9"}.fa-arrows-h:before,.fa-arrows-left-right:before{content:"\f07e"}.fa-arrows-left-right-to-line:before{content:"\e4ba"}.fa-arrows-rotate:before,.fa-refresh:before,.fa-sync:before{content:"\f021"}.fa-arrows-spin:before{content:"\e4bb"}.fa-arrows-split-up-and-left:before{content:"\e4bc"}.fa-arrows-to-circle:before{content:"\e4bd"}.fa-arrows-to-dot:before{content:"\e4be"}.fa-arrows-to-eye:before{content:"\e4bf"}.fa-arrows-turn-right:before{content:"\e4c0"}.fa-arrows-turn-to-dots:before{content:"\e4c1"}.fa-arrows-up-down:before,.fa-arrows-v:before{content:"\f07d"}.fa-arrows-up-down-left-right:before,.fa-arrows:before{content:"\f047"}.fa-arrows-up-to-line:before{content:"\e4c2"}.fa-asterisk:before{content:"\2a"}.fa-at:before{content:"\40"}.fa-atom:before{content:"\f5d2"}.fa-audio-description:before{content:"\f29e"}.fa-austral-sign:before{content:"\e0a9"}.fa-award:before{content:"\f559"}.fa-b:before{content:"\42"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before,.fa-carriage-baby:before{content:"\f77d"}.fa-backward:before{content:"\f04a"}.fa-backward-fast:before,.fa-fast-backward:before{content:"\f049"}.fa-backward-step:before,.fa-step-backward:before{content:"\f048"}.fa-bacon:before{content:"\f7e5"}.fa-bacteria:before{content:"\e059"}.fa-bacterium:before{content:"\e05a"}.fa-bag-shopping:before,.fa-shopping-bag:before{content:"\f290"}.fa-bahai:before,.fa-haykal:before{content:"\f666"}.fa-baht-sign:before{content:"\e0ac"}.fa-ban:before,.fa-cancel:before{content:"\f05e"}.fa-ban-smoking:before,.fa-smoking-ban:before{content:"\f54d"}.fa-band-aid:before,.fa-bandage:before{content:"\f462"}.fa-barcode:before{content:"\f02a"}.fa-bars:before,.fa-navicon:before{content:"\f0c9"}.fa-bars-progress:before,.fa-tasks-alt:before{content:"\f828"}.fa-bars-staggered:before,.fa-reorder:before,.fa-stream:before{content:"\f550"}.fa-baseball-ball:before,.fa-baseball:before{content:"\f433"}.fa-baseball-bat-ball:before{content:"\f432"}.fa-basket-shopping:before,.fa-shopping-basket:before{content:"\f291"}.fa-basketball-ball:before,.fa-basketball:before{content:"\f434"}.fa-bath:before,.fa-bathtub:before{content:"\f2cd"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-battery-5:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-half:before{content:"\f242"}.fa-battery-2:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-4:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-bed-pulse:before,.fa-procedures:before{content:"\f487"}.fa-beer-mug-empty:before,.fa-beer:before{content:"\f0fc"}.fa-bell:before{content:"\f0f3"}.fa-bell-concierge:before,.fa-concierge-bell:before{content:"\f562"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bicycle:before{content:"\f206"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-bitcoin-sign:before{content:"\e0b4"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blog:before{content:"\f781"}.fa-bold:before{content:"\f032"}.fa-bolt:before,.fa-zap:before{content:"\f0e7"}.fa-bolt-lightning:before{content:"\e0b7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-atlas:before,.fa-book-atlas:before{content:"\f558"}.fa-bible:before,.fa-book-bible:before{content:"\f647"}.fa-book-bookmark:before{content:"\e0bb"}.fa-book-journal-whills:before,.fa-journal-whills:before{content:"\f66a"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-open-reader:before,.fa-book-reader:before{content:"\f5da"}.fa-book-quran:before,.fa-quran:before{content:"\f687"}.fa-book-dead:before,.fa-book-skull:before{content:"\f6b7"}.fa-book-tanakh:before,.fa-tanakh:before{content:"\f827"}.fa-bookmark:before{content:"\f02e"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before,.fa-border-top-left:before{content:"\f853"}.fa-bore-hole:before{content:"\e4c3"}.fa-bottle-droplet:before{content:"\e4c4"}.fa-bottle-water:before{content:"\e4c5"}.fa-bowl-food:before{content:"\e4c6"}.fa-bowl-rice:before{content:"\e2eb"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-archive:before,.fa-box-archive:before{content:"\f187"}.fa-box-open:before{content:"\f49e"}.fa-box-tissue:before{content:"\e05b"}.fa-boxes-packing:before{content:"\e4c7"}.fa-boxes-alt:before,.fa-boxes-stacked:before,.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-brazilian-real-sign:before{content:"\e46c"}.fa-bread-slice:before{content:"\f7ec"}.fa-bridge:before{content:"\e4c8"}.fa-bridge-circle-check:before{content:"\e4c9"}.fa-bridge-circle-exclamation:before{content:"\e4ca"}.fa-bridge-circle-xmark:before{content:"\e4cb"}.fa-bridge-lock:before{content:"\e4cc"}.fa-bridge-water:before{content:"\e4ce"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broom:before{content:"\f51a"}.fa-broom-ball:before,.fa-quidditch-broom-ball:before,.fa-quidditch:before{content:"\f458"}.fa-brush:before{content:"\f55d"}.fa-bucket:before{content:"\e4cf"}.fa-bug:before{content:"\f188"}.fa-bug-slash:before{content:"\e490"}.fa-bugs:before{content:"\e4d0"}.fa-building:before{content:"\f1ad"}.fa-building-circle-arrow-right:before{content:"\e4d1"}.fa-building-circle-check:before{content:"\e4d2"}.fa-building-circle-exclamation:before{content:"\e4d3"}.fa-building-circle-xmark:before{content:"\e4d4"}.fa-bank:before,.fa-building-columns:before,.fa-institution:before,.fa-museum:before,.fa-university:before{content:"\f19c"}.fa-building-flag:before{content:"\e4d5"}.fa-building-lock:before{content:"\e4d6"}.fa-building-ngo:before{content:"\e4d7"}.fa-building-shield:before{content:"\e4d8"}.fa-building-un:before{content:"\e4d9"}.fa-building-user:before{content:"\e4da"}.fa-building-wheat:before{content:"\e4db"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burger:before,.fa-hamburger:before{content:"\f805"}.fa-burst:before{content:"\e4dc"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before,.fa-bus-simple:before{content:"\f55e"}.fa-briefcase-clock:before,.fa-business-time:before{content:"\f64a"}.fa-c:before{content:"\43"}.fa-cable-car:before,.fa-tram:before{content:"\f7da"}.fa-birthday-cake:before,.fa-cake-candles:before,.fa-cake:before{content:"\f1fd"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-alt:before,.fa-calendar-days:before{content:"\f073"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-week:before{content:"\f784"}.fa-calendar-times:before,.fa-calendar-xmark:before{content:"\f273"}.fa-camera-alt:before,.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-camera-rotate:before{content:"\e0d8"}.fa-campground:before{content:"\f6bb"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-battery-car:before,.fa-car-battery:before{content:"\f5df"}.fa-car-burst:before,.fa-car-crash:before{content:"\f5e1"}.fa-car-on:before{content:"\e4dd"}.fa-car-alt:before,.fa-car-rear:before{content:"\f5de"}.fa-car-side:before{content:"\f5e4"}.fa-car-tunnel:before{content:"\e4de"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-flatbed:before,.fa-dolly-flatbed:before{content:"\f474"}.fa-cart-flatbed-suitcase:before,.fa-luggage-cart:before{content:"\f59d"}.fa-cart-plus:before{content:"\f217"}.fa-cart-shopping:before,.fa-shopping-cart:before{content:"\f07a"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cedi-sign:before{content:"\e0df"}.fa-cent-sign:before{content:"\e3f5"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-blackboard:before,.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before,.fa-chalkboard-user:before{content:"\f51c"}.fa-champagne-glasses:before,.fa-glass-cheers:before{content:"\f79f"}.fa-charging-station:before{content:"\f5e7"}.fa-area-chart:before,.fa-chart-area:before{content:"\f1fe"}.fa-bar-chart:before,.fa-chart-bar:before{content:"\f080"}.fa-chart-column:before{content:"\e0e3"}.fa-chart-gantt:before{content:"\e0e4"}.fa-chart-line:before,.fa-line-chart:before{content:"\f201"}.fa-chart-pie:before,.fa-pie-chart:before{content:"\f200"}.fa-chart-simple:before{content:"\e473"}.fa-check:before{content:"\f00c"}.fa-check-double:before{content:"\f560"}.fa-check-to-slot:before,.fa-vote-yea:before{content:"\f772"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-child-dress:before{content:"\e59c"}.fa-child-reaching:before{content:"\e59d"}.fa-child-rifle:before{content:"\e4e0"}.fa-children:before{content:"\e4e1"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-arrow-circle-down:before,.fa-circle-arrow-down:before{content:"\f0ab"}.fa-arrow-circle-left:before,.fa-circle-arrow-left:before{content:"\f0a8"}.fa-arrow-circle-right:before,.fa-circle-arrow-right:before{content:"\f0a9"}.fa-arrow-circle-up:before,.fa-circle-arrow-up:before{content:"\f0aa"}.fa-check-circle:before,.fa-circle-check:before{content:"\f058"}.fa-chevron-circle-down:before,.fa-circle-chevron-down:before{content:"\f13a"}.fa-chevron-circle-left:before,.fa-circle-chevron-left:before{content:"\f137"}.fa-chevron-circle-right:before,.fa-circle-chevron-right:before{content:"\f138"}.fa-chevron-circle-up:before,.fa-circle-chevron-up:before{content:"\f139"}.fa-circle-dollar-to-slot:before,.fa-donate:before{content:"\f4b9"}.fa-circle-dot:before,.fa-dot-circle:before{content:"\f192"}.fa-arrow-alt-circle-down:before,.fa-circle-down:before{content:"\f358"}.fa-circle-exclamation:before,.fa-exclamation-circle:before{content:"\f06a"}.fa-circle-h:before,.fa-hospital-symbol:before{content:"\f47e"}.fa-adjust:before,.fa-circle-half-stroke:before{content:"\f042"}.fa-circle-info:before,.fa-info-circle:before{content:"\f05a"}.fa-arrow-alt-circle-left:before,.fa-circle-left:before{content:"\f359"}.fa-circle-minus:before,.fa-minus-circle:before{content:"\f056"}.fa-circle-nodes:before{content:"\e4e2"}.fa-circle-notch:before{content:"\f1ce"}.fa-circle-pause:before,.fa-pause-circle:before{content:"\f28b"}.fa-circle-play:before,.fa-play-circle:before{content:"\f144"}.fa-circle-plus:before,.fa-plus-circle:before{content:"\f055"}.fa-circle-question:before,.fa-question-circle:before{content:"\f059"}.fa-circle-radiation:before,.fa-radiation-alt:before{content:"\f7ba"}.fa-arrow-alt-circle-right:before,.fa-circle-right:before{content:"\f35a"}.fa-circle-stop:before,.fa-stop-circle:before{content:"\f28d"}.fa-arrow-alt-circle-up:before,.fa-circle-up:before{content:"\f35b"}.fa-circle-user:before,.fa-user-circle:before{content:"\f2bd"}.fa-circle-xmark:before,.fa-times-circle:before,.fa-xmark-circle:before{content:"\f057"}.fa-city:before{content:"\f64f"}.fa-clapperboard:before{content:"\e131"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clipboard-question:before{content:"\e4e3"}.fa-clipboard-user:before{content:"\f7f3"}.fa-clock-four:before,.fa-clock:before{content:"\f017"}.fa-clock-rotate-left:before,.fa-history:before{content:"\f1da"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-arrow-down:before,.fa-cloud-download-alt:before,.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-arrow-up:before,.fa-cloud-upload-alt:before,.fa-cloud-upload:before{content:"\f0ee"}.fa-cloud-bolt:before,.fa-thunderstorm:before{content:"\f76c"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-showers-water:before{content:"\e4e4"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-clover:before{content:"\e139"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-code-commit:before{content:"\f386"}.fa-code-compare:before{content:"\e13a"}.fa-code-fork:before{content:"\e13b"}.fa-code-merge:before{content:"\f387"}.fa-code-pull-request:before{content:"\e13c"}.fa-coins:before{content:"\f51e"}.fa-colon-sign:before{content:"\e140"}.fa-comment:before{content:"\f075"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before,.fa-commenting:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comment-sms:before,.fa-sms:before{content:"\f7cd"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compass-drafting:before,.fa-drafting-compass:before{content:"\f568"}.fa-compress:before{content:"\f066"}.fa-computer:before{content:"\e4e5"}.fa-computer-mouse:before,.fa-mouse:before{content:"\f8cc"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cow:before{content:"\f6c8"}.fa-credit-card-alt:before,.fa-credit-card:before{content:"\f09d"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before,.fa-crop-simple:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-cruzeiro-sign:before{content:"\e152"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cubes-stacked:before{content:"\e4e6"}.fa-d:before{content:"\44"}.fa-database:before{content:"\f1c0"}.fa-backspace:before,.fa-delete-left:before{content:"\f55a"}.fa-democrat:before{content:"\f747"}.fa-desktop-alt:before,.fa-desktop:before{content:"\f390"}.fa-dharmachakra:before{content:"\f655"}.fa-diagram-next:before{content:"\e476"}.fa-diagram-predecessor:before{content:"\e477"}.fa-diagram-project:before,.fa-project-diagram:before{content:"\f542"}.fa-diagram-successor:before{content:"\e47a"}.fa-diamond:before{content:"\f219"}.fa-diamond-turn-right:before,.fa-directions:before{content:"\f5eb"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-disease:before{content:"\f7fa"}.fa-display:before{content:"\e163"}.fa-divide:before{content:"\f529"}.fa-dna:before{content:"\f471"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before,.fa-dollar:before,.fa-usd:before{content:"\24"}.fa-dolly-box:before,.fa-dolly:before{content:"\f472"}.fa-dong-sign:before{content:"\e169"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dove:before{content:"\f4ba"}.fa-compress-alt:before,.fa-down-left-and-up-right-to-center:before{content:"\f422"}.fa-down-long:before,.fa-long-arrow-alt-down:before{content:"\f309"}.fa-download:before{content:"\f019"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-droplet:before,.fa-tint:before{content:"\f043"}.fa-droplet-slash:before,.fa-tint-slash:before{content:"\f5c7"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-e:before{content:"\45"}.fa-deaf:before,.fa-deafness:before,.fa-ear-deaf:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-assistive-listening-systems:before,.fa-ear-listen:before{content:"\f2a2"}.fa-earth-africa:before,.fa-globe-africa:before{content:"\f57c"}.fa-earth-america:before,.fa-earth-americas:before,.fa-earth:before,.fa-globe-americas:before{content:"\f57d"}.fa-earth-asia:before,.fa-globe-asia:before{content:"\f57e"}.fa-earth-europe:before,.fa-globe-europe:before{content:"\f7a2"}.fa-earth-oceania:before,.fa-globe-oceania:before{content:"\e47b"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elevator:before{content:"\e16d"}.fa-ellipsis-h:before,.fa-ellipsis:before{content:"\f141"}.fa-ellipsis-v:before,.fa-ellipsis-vertical:before{content:"\f142"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-circle-check:before{content:"\e4e8"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelopes-bulk:before,.fa-mail-bulk:before{content:"\f674"}.fa-equals:before{content:"\3d"}.fa-eraser:before{content:"\f12d"}.fa-ethernet:before{content:"\f796"}.fa-eur:before,.fa-euro-sign:before,.fa-euro:before{content:"\f153"}.fa-exclamation:before{content:"\21"}.fa-expand:before{content:"\f065"}.fa-explosion:before{content:"\e4e9"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper-empty:before,.fa-eye-dropper:before,.fa-eyedropper:before{content:"\f1fb"}.fa-eye-low-vision:before,.fa-low-vision:before{content:"\f2a8"}.fa-eye-slash:before{content:"\f070"}.fa-f:before{content:"\46"}.fa-angry:before,.fa-face-angry:before{content:"\f556"}.fa-dizzy:before,.fa-face-dizzy:before{content:"\f567"}.fa-face-flushed:before,.fa-flushed:before{content:"\f579"}.fa-face-frown:before,.fa-frown:before{content:"\f119"}.fa-face-frown-open:before,.fa-frown-open:before{content:"\f57a"}.fa-face-grimace:before,.fa-grimace:before{content:"\f57f"}.fa-face-grin:before,.fa-grin:before{content:"\f580"}.fa-face-grin-beam:before,.fa-grin-beam:before{content:"\f582"}.fa-face-grin-beam-sweat:before,.fa-grin-beam-sweat:before{content:"\f583"}.fa-face-grin-hearts:before,.fa-grin-hearts:before{content:"\f584"}.fa-face-grin-squint:before,.fa-grin-squint:before{content:"\f585"}.fa-face-grin-squint-tears:before,.fa-grin-squint-tears:before{content:"\f586"}.fa-face-grin-stars:before,.fa-grin-stars:before{content:"\f587"}.fa-face-grin-tears:before,.fa-grin-tears:before{content:"\f588"}.fa-face-grin-tongue:before,.fa-grin-tongue:before{content:"\f589"}.fa-face-grin-tongue-squint:before,.fa-grin-tongue-squint:before{content:"\f58a"}.fa-face-grin-tongue-wink:before,.fa-grin-tongue-wink:before{content:"\f58b"}.fa-face-grin-wide:before,.fa-grin-alt:before{content:"\f581"}.fa-face-grin-wink:before,.fa-grin-wink:before{content:"\f58c"}.fa-face-kiss:before,.fa-kiss:before{content:"\f596"}.fa-face-kiss-beam:before,.fa-kiss-beam:before{content:"\f597"}.fa-face-kiss-wink-heart:before,.fa-kiss-wink-heart:before{content:"\f598"}.fa-face-laugh:before,.fa-laugh:before{content:"\f599"}.fa-face-laugh-beam:before,.fa-laugh-beam:before{content:"\f59a"}.fa-face-laugh-squint:before,.fa-laugh-squint:before{content:"\f59b"}.fa-face-laugh-wink:before,.fa-laugh-wink:before{content:"\f59c"}.fa-face-meh:before,.fa-meh:before{content:"\f11a"}.fa-face-meh-blank:before,.fa-meh-blank:before{content:"\f5a4"}.fa-face-rolling-eyes:before,.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-face-sad-cry:before,.fa-sad-cry:before{content:"\f5b3"}.fa-face-sad-tear:before,.fa-sad-tear:before{content:"\f5b4"}.fa-face-smile:before,.fa-smile:before{content:"\f118"}.fa-face-smile-beam:before,.fa-smile-beam:before{content:"\f5b8"}.fa-face-smile-wink:before,.fa-smile-wink:before{content:"\f4da"}.fa-face-surprise:before,.fa-surprise:before{content:"\f5c2"}.fa-face-tired:before,.fa-tired:before{content:"\f5c8"}.fa-fan:before{content:"\f863"}.fa-faucet:before{content:"\e005"}.fa-faucet-drip:before{content:"\e006"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before,.fa-feather-pointed:before{content:"\f56b"}.fa-ferry:before{content:"\e4ea"}.fa-file:before{content:"\f15b"}.fa-file-arrow-down:before,.fa-file-download:before{content:"\f56d"}.fa-file-arrow-up:before,.fa-file-upload:before{content:"\f574"}.fa-file-audio:before{content:"\f1c7"}.fa-file-circle-check:before{content:"\e5a0"}.fa-file-circle-exclamation:before{content:"\e4eb"}.fa-file-circle-minus:before{content:"\e4ed"}.fa-file-circle-plus:before{content:"\e494"}.fa-file-circle-question:before{content:"\e4ef"}.fa-file-circle-xmark:before{content:"\e5a1"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-excel:before{content:"\f1c3"}.fa-arrow-right-from-file:before,.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-arrow-right-to-file:before,.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-alt:before,.fa-file-lines:before,.fa-file-text:before{content:"\f15c"}.fa-file-medical:before{content:"\f477"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-edit:before,.fa-file-pen:before{content:"\f31c"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-shield:before{content:"\e4f0"}.fa-file-signature:before{content:"\f573"}.fa-file-video:before{content:"\f1c8"}.fa-file-medical-alt:before,.fa-file-waveform:before{content:"\f478"}.fa-file-word:before{content:"\f1c2"}.fa-file-archive:before,.fa-file-zipper:before{content:"\f1c6"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-filter-circle-dollar:before,.fa-funnel-dollar:before{content:"\f662"}.fa-filter-circle-xmark:before{content:"\e17b"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-burner:before{content:"\e4f1"}.fa-fire-extinguisher:before{content:"\f134"}.fa-fire-alt:before,.fa-fire-flame-curved:before{content:"\f7e4"}.fa-burn:before,.fa-fire-flame-simple:before{content:"\f46a"}.fa-fish:before{content:"\f578"}.fa-fish-fins:before{content:"\e4f2"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flask-vial:before{content:"\e4f3"}.fa-floppy-disk:before,.fa-save:before{content:"\f0c7"}.fa-florin-sign:before{content:"\e184"}.fa-folder-blank:before,.fa-folder:before{content:"\f07b"}.fa-folder-closed:before{content:"\e185"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-folder-tree:before{content:"\f802"}.fa-font:before{content:"\f031"}.fa-football-ball:before,.fa-football:before{content:"\f44e"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before,.fa-forward-fast:before{content:"\f050"}.fa-forward-step:before,.fa-step-forward:before{content:"\f051"}.fa-franc-sign:before{content:"\e18f"}.fa-frog:before{content:"\f52e"}.fa-futbol-ball:before,.fa-futbol:before,.fa-soccer-ball:before{content:"\f1e3"}.fa-g:before{content:"\47"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-dashboard:before,.fa-gauge-med:before,.fa-gauge:before,.fa-tachometer-alt-average:before{content:"\f624"}.fa-gauge-high:before,.fa-tachometer-alt-fast:before,.fa-tachometer-alt:before{content:"\f625"}.fa-gauge-simple-med:before,.fa-gauge-simple:before,.fa-tachometer-average:before{content:"\f629"}.fa-gauge-simple-high:before,.fa-tachometer-fast:before,.fa-tachometer:before{content:"\f62a"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-glass-water:before{content:"\e4f4"}.fa-glass-water-droplet:before{content:"\e4f5"}.fa-glasses:before{content:"\f530"}.fa-globe:before{content:"\f0ac"}.fa-golf-ball-tee:before,.fa-golf-ball:before{content:"\f450"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-greater-than:before{content:"\3e"}.fa-greater-than-equal:before{content:"\f532"}.fa-grip-horizontal:before,.fa-grip:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-group-arrows-rotate:before{content:"\e4f6"}.fa-guarani-sign:before{content:"\e19a"}.fa-guitar:before{content:"\f7a6"}.fa-gun:before{content:"\e19b"}.fa-h:before{content:"\48"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-paper:before,.fa-hand:before{content:"\f256"}.fa-hand-back-fist:before,.fa-hand-rock:before{content:"\f255"}.fa-allergies:before,.fa-hand-dots:before{content:"\f461"}.fa-fist-raised:before,.fa-hand-fist:before{content:"\f6de"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-dollar:before,.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-holding-droplet:before,.fa-hand-holding-water:before{content:"\f4c1"}.fa-hand-holding-hand:before{content:"\e4f7"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-medical:before{content:"\e05c"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-sparkles:before{content:"\e05d"}.fa-hand-spock:before{content:"\f259"}.fa-handcuffs:before{content:"\e4f8"}.fa-hands:before,.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before,.fa-hands-american-sign-language-interpreting:before,.fa-hands-asl-interpreting:before{content:"\f2a3"}.fa-hands-bound:before{content:"\e4f9"}.fa-hands-bubbles:before,.fa-hands-wash:before{content:"\e05e"}.fa-hands-clapping:before{content:"\e1a8"}.fa-hands-holding:before{content:"\f4c2"}.fa-hands-holding-child:before{content:"\e4fa"}.fa-hands-holding-circle:before{content:"\e4fb"}.fa-hands-praying:before,.fa-praying-hands:before{content:"\f684"}.fa-handshake:before{content:"\f2b5"}.fa-hands-helping:before,.fa-handshake-angle:before{content:"\f4c4"}.fa-handshake-alt:before,.fa-handshake-simple:before{content:"\f4c6"}.fa-handshake-alt-slash:before,.fa-handshake-simple-slash:before{content:"\e05f"}.fa-handshake-slash:before{content:"\e060"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-drive:before,.fa-hdd:before{content:"\f0a0"}.fa-hashtag:before{content:"\23"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-head-side-cough:before{content:"\e061"}.fa-head-side-cough-slash:before{content:"\e062"}.fa-head-side-mask:before{content:"\e063"}.fa-head-side-virus:before{content:"\e064"}.fa-header:before,.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before,.fa-headphones-simple:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-circle-bolt:before{content:"\e4fc"}.fa-heart-circle-check:before{content:"\e4fd"}.fa-heart-circle-exclamation:before{content:"\e4fe"}.fa-heart-circle-minus:before{content:"\e4ff"}.fa-heart-circle-plus:before{content:"\e500"}.fa-heart-circle-xmark:before{content:"\e501"}.fa-heart-broken:before,.fa-heart-crack:before{content:"\f7a9"}.fa-heart-pulse:before,.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-helicopter-symbol:before{content:"\e502"}.fa-hard-hat:before,.fa-hat-hard:before,.fa-helmet-safety:before{content:"\f807"}.fa-helmet-un:before{content:"\e503"}.fa-highlighter:before{content:"\f591"}.fa-hill-avalanche:before{content:"\e507"}.fa-hill-rockslide:before{content:"\e508"}.fa-hippo:before{content:"\f6ed"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital-alt:before,.fa-hospital-wide:before,.fa-hospital:before{content:"\f0f8"}.fa-hospital-user:before{content:"\f80d"}.fa-hot-tub-person:before,.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hourglass-empty:before,.fa-hourglass:before{content:"\f254"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-home-alt:before,.fa-home-lg-alt:before,.fa-home:before,.fa-house:before{content:"\f015"}.fa-home-lg:before,.fa-house-chimney:before{content:"\e3af"}.fa-house-chimney-crack:before,.fa-house-damage:before{content:"\f6f1"}.fa-clinic-medical:before,.fa-house-chimney-medical:before{content:"\f7f2"}.fa-house-chimney-user:before{content:"\e065"}.fa-house-chimney-window:before{content:"\e00d"}.fa-house-circle-check:before{content:"\e509"}.fa-house-circle-exclamation:before{content:"\e50a"}.fa-house-circle-xmark:before{content:"\e50b"}.fa-house-crack:before{content:"\e3b1"}.fa-house-fire:before{content:"\e50c"}.fa-house-flag:before{content:"\e50d"}.fa-house-flood-water:before{content:"\e50e"}.fa-house-flood-water-circle-arrow-right:before{content:"\e50f"}.fa-house-laptop:before,.fa-laptop-house:before{content:"\e066"}.fa-house-lock:before{content:"\e510"}.fa-house-medical:before{content:"\e3b2"}.fa-house-medical-circle-check:before{content:"\e511"}.fa-house-medical-circle-exclamation:before{content:"\e512"}.fa-house-medical-circle-xmark:before{content:"\e513"}.fa-house-medical-flag:before{content:"\e514"}.fa-house-signal:before{content:"\e012"}.fa-house-tsunami:before{content:"\e515"}.fa-home-user:before,.fa-house-user:before{content:"\e1b0"}.fa-hryvnia-sign:before,.fa-hryvnia:before{content:"\f6f2"}.fa-hurricane:before{content:"\f751"}.fa-i:before{content:"\49"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-heart-music-camera-bolt:before,.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before,.fa-id-card-clip:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-image-portrait:before,.fa-portrait:before{content:"\f3e0"}.fa-images:before{content:"\f302"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-indian-rupee-sign:before,.fa-indian-rupee:before,.fa-inr:before{content:"\e1bc"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-italic:before{content:"\f033"}.fa-j:before{content:"\4a"}.fa-jar:before{content:"\e516"}.fa-jar-wheat:before{content:"\e517"}.fa-jedi:before{content:"\f669"}.fa-fighter-jet:before,.fa-jet-fighter:before{content:"\f0fb"}.fa-jet-fighter-up:before{content:"\e518"}.fa-joint:before{content:"\f595"}.fa-jug-detergent:before{content:"\e519"}.fa-k:before{content:"\4b"}.fa-kaaba:before{content:"\f66b"}.fa-key:before{content:"\f084"}.fa-keyboard:before{content:"\f11c"}.fa-khanda:before{content:"\f66d"}.fa-kip-sign:before{content:"\e1c4"}.fa-first-aid:before,.fa-kit-medical:before{content:"\f479"}.fa-kitchen-set:before{content:"\e51a"}.fa-kiwi-bird:before{content:"\f535"}.fa-l:before{content:"\4c"}.fa-land-mine-on:before{content:"\e51b"}.fa-landmark:before{content:"\f66f"}.fa-landmark-alt:before,.fa-landmark-dome:before{content:"\f752"}.fa-landmark-flag:before{content:"\e51c"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-file:before{content:"\e51d"}.fa-laptop-medical:before{content:"\f812"}.fa-lari-sign:before{content:"\e1c8"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-left-long:before,.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-arrows-alt-h:before,.fa-left-right:before{content:"\f337"}.fa-lemon:before{content:"\f094"}.fa-less-than:before{content:"\3c"}.fa-less-than-equal:before{content:"\f537"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-lines-leaning:before{content:"\e51e"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-chain-broken:before,.fa-chain-slash:before,.fa-link-slash:before,.fa-unlink:before{content:"\f127"}.fa-lira-sign:before{content:"\f195"}.fa-list-squares:before,.fa-list:before{content:"\f03a"}.fa-list-check:before,.fa-tasks:before{content:"\f0ae"}.fa-list-1-2:before,.fa-list-numeric:before,.fa-list-ol:before{content:"\f0cb"}.fa-list-dots:before,.fa-list-ul:before{content:"\f0ca"}.fa-litecoin-sign:before{content:"\e1d3"}.fa-location-arrow:before{content:"\f124"}.fa-location-crosshairs:before,.fa-location:before{content:"\f601"}.fa-location-dot:before,.fa-map-marker-alt:before{content:"\f3c5"}.fa-location-pin:before,.fa-map-marker:before{content:"\f041"}.fa-location-pin-lock:before{content:"\e51f"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-locust:before{content:"\e520"}.fa-lungs:before{content:"\f604"}.fa-lungs-virus:before{content:"\e067"}.fa-m:before{content:"\4d"}.fa-magnet:before{content:"\f076"}.fa-magnifying-glass:before,.fa-search:before{content:"\f002"}.fa-magnifying-glass-arrow-right:before{content:"\e521"}.fa-magnifying-glass-chart:before{content:"\e522"}.fa-magnifying-glass-dollar:before,.fa-search-dollar:before{content:"\f688"}.fa-magnifying-glass-location:before,.fa-search-location:before{content:"\f689"}.fa-magnifying-glass-minus:before,.fa-search-minus:before{content:"\f010"}.fa-magnifying-glass-plus:before,.fa-search-plus:before{content:"\f00e"}.fa-manat-sign:before{content:"\e1d5"}.fa-map:before{content:"\f279"}.fa-map-location:before,.fa-map-marked:before{content:"\f59f"}.fa-map-location-dot:before,.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-pin:before{content:"\f276"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-and-venus:before{content:"\f224"}.fa-mars-and-venus-burst:before{content:"\e523"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before,.fa-mars-stroke-right:before{content:"\f22b"}.fa-mars-stroke-up:before,.fa-mars-stroke-v:before{content:"\f22a"}.fa-glass-martini-alt:before,.fa-martini-glass:before{content:"\f57b"}.fa-cocktail:before,.fa-martini-glass-citrus:before{content:"\f561"}.fa-glass-martini:before,.fa-martini-glass-empty:before{content:"\f000"}.fa-mask:before{content:"\f6fa"}.fa-mask-face:before{content:"\e1d7"}.fa-mask-ventilator:before{content:"\e524"}.fa-masks-theater:before,.fa-theater-masks:before{content:"\f630"}.fa-mattress-pillow:before{content:"\e525"}.fa-expand-arrows-alt:before,.fa-maximize:before{content:"\f31e"}.fa-medal:before{content:"\f5a2"}.fa-memory:before{content:"\f538"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-comment-alt:before,.fa-message:before{content:"\f27a"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before,.fa-microphone-lines:before{content:"\f3c9"}.fa-microphone-alt-slash:before,.fa-microphone-lines-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-mill-sign:before{content:"\e1ed"}.fa-compress-arrows-alt:before,.fa-minimize:before{content:"\f78c"}.fa-minus:before,.fa-subtract:before{content:"\f068"}.fa-mitten:before{content:"\f7b5"}.fa-mobile-android:before,.fa-mobile-phone:before,.fa-mobile:before{content:"\f3ce"}.fa-mobile-button:before{content:"\f10b"}.fa-mobile-retro:before{content:"\e527"}.fa-mobile-android-alt:before,.fa-mobile-screen:before{content:"\f3cf"}.fa-mobile-alt:before,.fa-mobile-screen-button:before{content:"\f3cd"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-1:before,.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-1-wave:before,.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-bill-transfer:before{content:"\e528"}.fa-money-bill-trend-up:before{content:"\e529"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wheat:before{content:"\e52a"}.fa-money-bills:before{content:"\e1f3"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before,.fa-money-check-dollar:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-mosquito:before{content:"\e52b"}.fa-mosquito-net:before{content:"\e52c"}.fa-motorcycle:before{content:"\f21c"}.fa-mound:before{content:"\e52d"}.fa-mountain:before{content:"\f6fc"}.fa-mountain-city:before{content:"\e52e"}.fa-mountain-sun:before{content:"\e52f"}.fa-mug-hot:before{content:"\f7b6"}.fa-coffee:before,.fa-mug-saucer:before{content:"\f0f4"}.fa-music:before{content:"\f001"}.fa-n:before{content:"\4e"}.fa-naira-sign:before{content:"\e1f6"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-not-equal:before{content:"\f53e"}.fa-notdef:before{content:"\e1fe"}.fa-note-sticky:before,.fa-sticky-note:before{content:"\f249"}.fa-notes-medical:before{content:"\f481"}.fa-o:before{content:"\4f"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-oil-can:before{content:"\f613"}.fa-oil-well:before{content:"\e532"}.fa-om:before{content:"\f679"}.fa-otter:before{content:"\f700"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-p:before{content:"\50"}.fa-pager:before{content:"\f815"}.fa-paint-roller:before{content:"\f5aa"}.fa-paint-brush:before,.fa-paintbrush:before{content:"\f1fc"}.fa-palette:before{content:"\f53f"}.fa-pallet:before{content:"\f482"}.fa-panorama:before{content:"\e209"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-passport:before{content:"\f5ab"}.fa-file-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-pause:before{content:"\f04c"}.fa-paw:before{content:"\f1b0"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before,.fa-pen-clip:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-ruler:before,.fa-pencil-ruler:before{content:"\f5ae"}.fa-edit:before,.fa-pen-to-square:before{content:"\f044"}.fa-pencil-alt:before,.fa-pencil:before{content:"\f303"}.fa-people-arrows-left-right:before,.fa-people-arrows:before{content:"\e068"}.fa-people-carry-box:before,.fa-people-carry:before{content:"\f4ce"}.fa-people-group:before{content:"\e533"}.fa-people-line:before{content:"\e534"}.fa-people-pulling:before{content:"\e535"}.fa-people-robbery:before{content:"\e536"}.fa-people-roof:before{content:"\e537"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before,.fa-percentage:before{content:"\25"}.fa-male:before,.fa-person:before{content:"\f183"}.fa-person-arrow-down-to-line:before{content:"\e538"}.fa-person-arrow-up-from-line:before{content:"\e539"}.fa-biking:before,.fa-person-biking:before{content:"\f84a"}.fa-person-booth:before{content:"\f756"}.fa-person-breastfeeding:before{content:"\e53a"}.fa-person-burst:before{content:"\e53b"}.fa-person-cane:before{content:"\e53c"}.fa-person-chalkboard:before{content:"\e53d"}.fa-person-circle-check:before{content:"\e53e"}.fa-person-circle-exclamation:before{content:"\e53f"}.fa-person-circle-minus:before{content:"\e540"}.fa-person-circle-plus:before{content:"\e541"}.fa-person-circle-question:before{content:"\e542"}.fa-person-circle-xmark:before{content:"\e543"}.fa-digging:before,.fa-person-digging:before{content:"\f85e"}.fa-diagnoses:before,.fa-person-dots-from-line:before{content:"\f470"}.fa-female:before,.fa-person-dress:before{content:"\f182"}.fa-person-dress-burst:before{content:"\e544"}.fa-person-drowning:before{content:"\e545"}.fa-person-falling:before{content:"\e546"}.fa-person-falling-burst:before{content:"\e547"}.fa-person-half-dress:before{content:"\e548"}.fa-person-harassing:before{content:"\e549"}.fa-hiking:before,.fa-person-hiking:before{content:"\f6ec"}.fa-person-military-pointing:before{content:"\e54a"}.fa-person-military-rifle:before{content:"\e54b"}.fa-person-military-to-person:before{content:"\e54c"}.fa-person-praying:before,.fa-pray:before{content:"\f683"}.fa-person-pregnant:before{content:"\e31e"}.fa-person-rays:before{content:"\e54d"}.fa-person-rifle:before{content:"\e54e"}.fa-person-running:before,.fa-running:before{content:"\f70c"}.fa-person-shelter:before{content:"\e54f"}.fa-person-skating:before,.fa-skating:before{content:"\f7c5"}.fa-person-skiing:before,.fa-skiing:before{content:"\f7c9"}.fa-person-skiing-nordic:before,.fa-skiing-nordic:before{content:"\f7ca"}.fa-person-snowboarding:before,.fa-snowboarding:before{content:"\f7ce"}.fa-person-swimming:before,.fa-swimmer:before{content:"\f5c4"}.fa-person-through-window:before{content:"\e5a9"}.fa-person-walking:before,.fa-walking:before{content:"\f554"}.fa-person-walking-arrow-loop-left:before{content:"\e551"}.fa-person-walking-arrow-right:before{content:"\e552"}.fa-person-walking-dashed-line-arrow-right:before{content:"\e553"}.fa-person-walking-luggage:before{content:"\e554"}.fa-blind:before,.fa-person-walking-with-cane:before{content:"\f29d"}.fa-peseta-sign:before{content:"\e221"}.fa-peso-sign:before{content:"\e222"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before,.fa-phone-flip:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-volume:before,.fa-volume-control-phone:before{content:"\f2a0"}.fa-photo-film:before,.fa-photo-video:before{content:"\f87c"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-circle-check:before{content:"\e555"}.fa-plane-circle-exclamation:before{content:"\e556"}.fa-plane-circle-xmark:before{content:"\e557"}.fa-plane-departure:before{content:"\f5b0"}.fa-plane-lock:before{content:"\e558"}.fa-plane-slash:before{content:"\e069"}.fa-plane-up:before{content:"\e22d"}.fa-plant-wilt:before{content:"\e5aa"}.fa-plate-wheat:before{content:"\e55a"}.fa-play:before{content:"\f04b"}.fa-plug:before{content:"\f1e6"}.fa-plug-circle-bolt:before{content:"\e55b"}.fa-plug-circle-check:before{content:"\e55c"}.fa-plug-circle-exclamation:before{content:"\e55d"}.fa-plug-circle-minus:before{content:"\e55e"}.fa-plug-circle-plus:before{content:"\e55f"}.fa-plug-circle-xmark:before{content:"\e560"}.fa-add:before,.fa-plus:before{content:"\2b"}.fa-plus-minus:before{content:"\e43c"}.fa-podcast:before{content:"\f2ce"}.fa-poo:before{content:"\f2fe"}.fa-poo-bolt:before,.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-power-off:before{content:"\f011"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before,.fa-prescription-bottle-medical:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-pump-medical:before{content:"\e06a"}.fa-pump-soap:before{content:"\e06b"}.fa-puzzle-piece:before{content:"\f12e"}.fa-q:before{content:"\51"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\3f"}.fa-quote-left-alt:before,.fa-quote-left:before{content:"\f10d"}.fa-quote-right-alt:before,.fa-quote-right:before{content:"\f10e"}.fa-r:before{content:"\52"}.fa-radiation:before{content:"\f7b9"}.fa-radio:before{content:"\f8d7"}.fa-rainbow:before{content:"\f75b"}.fa-ranking-star:before{content:"\e561"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-ad:before,.fa-rectangle-ad:before{content:"\f641"}.fa-list-alt:before,.fa-rectangle-list:before{content:"\f022"}.fa-rectangle-times:before,.fa-rectangle-xmark:before,.fa-times-rectangle:before,.fa-window-close:before{content:"\f410"}.fa-recycle:before{content:"\f1b8"}.fa-registered:before{content:"\f25d"}.fa-repeat:before{content:"\f363"}.fa-mail-reply:before,.fa-reply:before{content:"\f3e5"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-republican:before{content:"\f75e"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-ribbon:before{content:"\f4d6"}.fa-right-from-bracket:before,.fa-sign-out-alt:before{content:"\f2f5"}.fa-exchange-alt:before,.fa-right-left:before{content:"\f362"}.fa-long-arrow-alt-right:before,.fa-right-long:before{content:"\f30b"}.fa-right-to-bracket:before,.fa-sign-in-alt:before{content:"\f2f6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-road-barrier:before{content:"\e562"}.fa-road-bridge:before{content:"\e563"}.fa-road-circle-check:before{content:"\e564"}.fa-road-circle-exclamation:before{content:"\e565"}.fa-road-circle-xmark:before{content:"\e566"}.fa-road-lock:before{content:"\e567"}.fa-road-spikes:before{content:"\e568"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rotate:before,.fa-sync-alt:before{content:"\f2f1"}.fa-rotate-back:before,.fa-rotate-backward:before,.fa-rotate-left:before,.fa-undo-alt:before{content:"\f2ea"}.fa-redo-alt:before,.fa-rotate-forward:before,.fa-rotate-right:before{content:"\f2f9"}.fa-route:before{content:"\f4d7"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-rouble:before,.fa-rub:before,.fa-ruble-sign:before,.fa-ruble:before{content:"\f158"}.fa-rug:before{content:"\e569"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-rupee-sign:before,.fa-rupee:before{content:"\f156"}.fa-rupiah-sign:before{content:"\e23d"}.fa-s:before{content:"\53"}.fa-sack-dollar:before{content:"\f81d"}.fa-sack-xmark:before{content:"\e56a"}.fa-sailboat:before{content:"\e445"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-balance-scale:before,.fa-scale-balanced:before{content:"\f24e"}.fa-balance-scale-left:before,.fa-scale-unbalanced:before{content:"\f515"}.fa-balance-scale-right:before,.fa-scale-unbalanced-flip:before{content:"\f516"}.fa-school:before{content:"\f549"}.fa-school-circle-check:before{content:"\e56b"}.fa-school-circle-exclamation:before{content:"\e56c"}.fa-school-circle-xmark:before{content:"\e56d"}.fa-school-flag:before{content:"\e56e"}.fa-school-lock:before{content:"\e56f"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-screwdriver:before{content:"\f54a"}.fa-screwdriver-wrench:before,.fa-tools:before{content:"\f7d9"}.fa-scroll:before{content:"\f70e"}.fa-scroll-torah:before,.fa-torah:before{content:"\f6a0"}.fa-sd-card:before{content:"\f7c2"}.fa-section:before{content:"\e447"}.fa-seedling:before,.fa-sprout:before{content:"\f4d8"}.fa-server:before{content:"\f233"}.fa-shapes:before,.fa-triangle-circle-square:before{content:"\f61f"}.fa-arrow-turn-right:before,.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-share-from-square:before,.fa-share-square:before{content:"\f14d"}.fa-share-alt:before,.fa-share-nodes:before{content:"\f1e0"}.fa-sheet-plastic:before{content:"\e571"}.fa-ils:before,.fa-shekel-sign:before,.fa-shekel:before,.fa-sheqel-sign:before,.fa-sheqel:before{content:"\f20b"}.fa-shield-blank:before,.fa-shield:before{content:"\f132"}.fa-shield-cat:before{content:"\e572"}.fa-shield-dog:before{content:"\e573"}.fa-shield-alt:before,.fa-shield-halved:before{content:"\f3ed"}.fa-shield-heart:before{content:"\e574"}.fa-shield-virus:before{content:"\e06c"}.fa-ship:before{content:"\f21a"}.fa-shirt:before,.fa-t-shirt:before,.fa-tshirt:before{content:"\f553"}.fa-shoe-prints:before{content:"\f54b"}.fa-shop:before,.fa-store-alt:before{content:"\f54f"}.fa-shop-lock:before{content:"\e4a5"}.fa-shop-slash:before,.fa-store-alt-slash:before{content:"\e070"}.fa-shower:before{content:"\f2cc"}.fa-shrimp:before{content:"\e448"}.fa-random:before,.fa-shuffle:before{content:"\f074"}.fa-shuttle-space:before,.fa-space-shuttle:before{content:"\f197"}.fa-sign-hanging:before,.fa-sign:before{content:"\f4d9"}.fa-signal-5:before,.fa-signal-perfect:before,.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-map-signs:before,.fa-signs-post:before{content:"\f277"}.fa-sim-card:before{content:"\f7c4"}.fa-sink:before{content:"\e06d"}.fa-sitemap:before{content:"\f0e8"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before,.fa-sliders:before{content:"\f1de"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-soap:before{content:"\e06e"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-spa:before{content:"\f5bb"}.fa-pastafarianism:before,.fa-spaghetti-monster-flying:before{content:"\f67b"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spoon:before,.fa-utensil-spoon:before{content:"\f2e5"}.fa-spray-can:before{content:"\f5bd"}.fa-air-freshener:before,.fa-spray-can-sparkles:before{content:"\f5d0"}.fa-square:before{content:"\f0c8"}.fa-external-link-square:before,.fa-square-arrow-up-right:before{content:"\f14c"}.fa-caret-square-down:before,.fa-square-caret-down:before{content:"\f150"}.fa-caret-square-left:before,.fa-square-caret-left:before{content:"\f191"}.fa-caret-square-right:before,.fa-square-caret-right:before{content:"\f152"}.fa-caret-square-up:before,.fa-square-caret-up:before{content:"\f151"}.fa-check-square:before,.fa-square-check:before{content:"\f14a"}.fa-envelope-square:before,.fa-square-envelope:before{content:"\f199"}.fa-square-full:before{content:"\f45c"}.fa-h-square:before,.fa-square-h:before{content:"\f0fd"}.fa-minus-square:before,.fa-square-minus:before{content:"\f146"}.fa-square-nfi:before{content:"\e576"}.fa-parking:before,.fa-square-parking:before{content:"\f540"}.fa-pen-square:before,.fa-pencil-square:before,.fa-square-pen:before{content:"\f14b"}.fa-square-person-confined:before{content:"\e577"}.fa-phone-square:before,.fa-square-phone:before{content:"\f098"}.fa-phone-square-alt:before,.fa-square-phone-flip:before{content:"\f87b"}.fa-plus-square:before,.fa-square-plus:before{content:"\f0fe"}.fa-poll-h:before,.fa-square-poll-horizontal:before{content:"\f682"}.fa-poll:before,.fa-square-poll-vertical:before{content:"\f681"}.fa-square-root-alt:before,.fa-square-root-variable:before{content:"\f698"}.fa-rss-square:before,.fa-square-rss:before{content:"\f143"}.fa-share-alt-square:before,.fa-square-share-nodes:before{content:"\f1e1"}.fa-external-link-square-alt:before,.fa-square-up-right:before{content:"\f360"}.fa-square-virus:before{content:"\e578"}.fa-square-xmark:before,.fa-times-square:before,.fa-xmark-square:before{content:"\f2d3"}.fa-rod-asclepius:before,.fa-rod-snake:before,.fa-staff-aesculapius:before,.fa-staff-snake:before{content:"\e579"}.fa-stairs:before{content:"\e289"}.fa-stamp:before{content:"\f5bf"}.fa-stapler:before{content:"\e5af"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before,.fa-star-half-stroke:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-gbp:before,.fa-pound-sign:before,.fa-sterling-sign:before{content:"\f154"}.fa-stethoscope:before{content:"\f0f1"}.fa-stop:before{content:"\f04d"}.fa-stopwatch:before{content:"\f2f2"}.fa-stopwatch-20:before{content:"\e06f"}.fa-store:before{content:"\f54e"}.fa-store-slash:before{content:"\e071"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stroopwafel:before{content:"\f551"}.fa-subscript:before{content:"\f12c"}.fa-suitcase:before{content:"\f0f2"}.fa-medkit:before,.fa-suitcase-medical:before{content:"\f0fa"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-sun-plant-wilt:before{content:"\e57a"}.fa-superscript:before{content:"\f12b"}.fa-swatchbook:before{content:"\f5c3"}.fa-synagogue:before{content:"\f69b"}.fa-syringe:before{content:"\f48e"}.fa-t:before{content:"\54"}.fa-table:before{content:"\f0ce"}.fa-table-cells:before,.fa-th:before{content:"\f00a"}.fa-table-cells-large:before,.fa-th-large:before{content:"\f009"}.fa-columns:before,.fa-table-columns:before{content:"\f0db"}.fa-table-list:before,.fa-th-list:before{content:"\f00b"}.fa-ping-pong-paddle-ball:before,.fa-table-tennis-paddle-ball:before,.fa-table-tennis:before{content:"\f45d"}.fa-tablet-android:before,.fa-tablet:before{content:"\f3fb"}.fa-tablet-button:before{content:"\f10a"}.fa-tablet-alt:before,.fa-tablet-screen-button:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-digital-tachograph:before,.fa-tachograph-digital:before{content:"\f566"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tarp:before{content:"\e57b"}.fa-tarp-droplet:before{content:"\e57c"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-temperature-arrow-down:before,.fa-temperature-down:before{content:"\e03f"}.fa-temperature-arrow-up:before,.fa-temperature-up:before{content:"\e040"}.fa-temperature-0:before,.fa-temperature-empty:before,.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-temperature-4:before,.fa-temperature-full:before,.fa-thermometer-4:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-temperature-2:before,.fa-temperature-half:before,.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-temperature-1:before,.fa-temperature-quarter:before,.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-temperature-3:before,.fa-temperature-three-quarters:before,.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-tenge-sign:before,.fa-tenge:before{content:"\f7d7"}.fa-tent:before{content:"\e57d"}.fa-tent-arrow-down-to-line:before{content:"\e57e"}.fa-tent-arrow-left-right:before{content:"\e57f"}.fa-tent-arrow-turn-left:before{content:"\e580"}.fa-tent-arrows-down:before{content:"\e581"}.fa-tents:before{content:"\e582"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-remove-format:before,.fa-text-slash:before{content:"\f87d"}.fa-text-width:before{content:"\f035"}.fa-thermometer:before{content:"\f491"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumb-tack:before,.fa-thumbtack:before{content:"\f08d"}.fa-ticket:before{content:"\f145"}.fa-ticket-alt:before,.fa-ticket-simple:before{content:"\f3ff"}.fa-timeline:before{content:"\e29c"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toilet-paper-slash:before{content:"\e072"}.fa-toilet-portable:before{content:"\e583"}.fa-toilets-portable:before{content:"\e584"}.fa-toolbox:before{content:"\f552"}.fa-tooth:before{content:"\f5c9"}.fa-torii-gate:before{content:"\f6a1"}.fa-tornado:before{content:"\f76f"}.fa-broadcast-tower:before,.fa-tower-broadcast:before{content:"\f519"}.fa-tower-cell:before{content:"\e585"}.fa-tower-observation:before{content:"\e586"}.fa-tractor:before{content:"\f722"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\e041"}.fa-train:before{content:"\f238"}.fa-subway:before,.fa-train-subway:before{content:"\f239"}.fa-train-tram:before{content:"\e5b4"}.fa-transgender-alt:before,.fa-transgender:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-arrow-up:before,.fa-trash-restore:before{content:"\f829"}.fa-trash-alt:before,.fa-trash-can:before{content:"\f2ed"}.fa-trash-can-arrow-up:before,.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-tree-city:before{content:"\e587"}.fa-exclamation-triangle:before,.fa-triangle-exclamation:before,.fa-warning:before{content:"\f071"}.fa-trophy:before{content:"\f091"}.fa-trowel:before{content:"\e589"}.fa-trowel-bricks:before{content:"\e58a"}.fa-truck:before{content:"\f0d1"}.fa-truck-arrow-right:before{content:"\e58b"}.fa-truck-droplet:before{content:"\e58c"}.fa-shipping-fast:before,.fa-truck-fast:before{content:"\f48b"}.fa-truck-field:before{content:"\e58d"}.fa-truck-field-un:before{content:"\e58e"}.fa-truck-front:before{content:"\e2b7"}.fa-ambulance:before,.fa-truck-medical:before{content:"\f0f9"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-truck-plane:before{content:"\e58f"}.fa-truck-loading:before,.fa-truck-ramp-box:before{content:"\f4de"}.fa-teletype:before,.fa-tty:before{content:"\f1e4"}.fa-try:before,.fa-turkish-lira-sign:before,.fa-turkish-lira:before{content:"\e2bb"}.fa-level-down-alt:before,.fa-turn-down:before{content:"\f3be"}.fa-level-up-alt:before,.fa-turn-up:before{content:"\f3bf"}.fa-television:before,.fa-tv-alt:before,.fa-tv:before{content:"\f26c"}.fa-u:before{content:"\55"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-universal-access:before{content:"\f29a"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before,.fa-unlock-keyhole:before{content:"\f13e"}.fa-arrows-alt-v:before,.fa-up-down:before{content:"\f338"}.fa-arrows-alt:before,.fa-up-down-left-right:before{content:"\f0b2"}.fa-long-arrow-alt-up:before,.fa-up-long:before{content:"\f30c"}.fa-expand-alt:before,.fa-up-right-and-down-left-from-center:before{content:"\f424"}.fa-external-link-alt:before,.fa-up-right-from-square:before{content:"\f35d"}.fa-upload:before{content:"\f093"}.fa-user:before{content:"\f007"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-clock:before{content:"\f4fd"}.fa-user-doctor:before,.fa-user-md:before{content:"\f0f0"}.fa-user-cog:before,.fa-user-gear:before{content:"\f4fe"}.fa-user-graduate:before{content:"\f501"}.fa-user-friends:before,.fa-user-group:before{content:"\f500"}.fa-user-injured:before{content:"\f728"}.fa-user-alt:before,.fa-user-large:before{content:"\f406"}.fa-user-alt-slash:before,.fa-user-large-slash:before{content:"\f4fa"}.fa-user-lock:before{content:"\f502"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-edit:before,.fa-user-pen:before{content:"\f4ff"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before,.fa-user-xmark:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-between-lines:before{content:"\e591"}.fa-users-cog:before,.fa-users-gear:before{content:"\f509"}.fa-users-line:before{content:"\e592"}.fa-users-rays:before{content:"\e593"}.fa-users-rectangle:before{content:"\e594"}.fa-users-slash:before{content:"\e073"}.fa-users-viewfinder:before{content:"\e595"}.fa-cutlery:before,.fa-utensils:before{content:"\f2e7"}.fa-v:before{content:"\56"}.fa-shuttle-van:before,.fa-van-shuttle:before{content:"\f5b6"}.fa-vault:before{content:"\e2c5"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-vest:before{content:"\e085"}.fa-vest-patches:before{content:"\e086"}.fa-vial:before{content:"\f492"}.fa-vial-circle-check:before{content:"\e596"}.fa-vial-virus:before{content:"\e597"}.fa-vials:before{content:"\f493"}.fa-video-camera:before,.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-virus:before{content:"\e074"}.fa-virus-covid:before{content:"\e4a8"}.fa-virus-covid-slash:before{content:"\e4a9"}.fa-virus-slash:before{content:"\e075"}.fa-viruses:before{content:"\e076"}.fa-voicemail:before{content:"\f897"}.fa-volcano:before{content:"\f770"}.fa-volleyball-ball:before,.fa-volleyball:before{content:"\f45f"}.fa-volume-high:before,.fa-volume-up:before{content:"\f028"}.fa-volume-down:before,.fa-volume-low:before{content:"\f027"}.fa-volume-off:before{content:"\f026"}.fa-volume-mute:before,.fa-volume-times:before,.fa-volume-xmark:before{content:"\f6a9"}.fa-vr-cardboard:before{content:"\f729"}.fa-w:before{content:"\57"}.fa-walkie-talkie:before{content:"\f8ef"}.fa-wallet:before{content:"\f555"}.fa-magic:before,.fa-wand-magic:before{content:"\f0d0"}.fa-magic-wand-sparkles:before,.fa-wand-magic-sparkles:before{content:"\e2ca"}.fa-wand-sparkles:before{content:"\f72b"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-ladder-water:before,.fa-swimming-pool:before,.fa-water-ladder:before{content:"\f5c5"}.fa-wave-square:before{content:"\f83e"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weight-scale:before,.fa-weight:before{content:"\f496"}.fa-wheat-alt:before,.fa-wheat-awn:before{content:"\e2cd"}.fa-wheat-awn-circle-exclamation:before{content:"\e598"}.fa-wheelchair:before{content:"\f193"}.fa-wheelchair-alt:before,.fa-wheelchair-move:before{content:"\e2ce"}.fa-glass-whiskey:before,.fa-whiskey-glass:before{content:"\f7a0"}.fa-wifi-3:before,.fa-wifi-strong:before,.fa-wifi:before{content:"\f1eb"}.fa-wind:before{content:"\f72e"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before,.fa-wine-glass-empty:before{content:"\f5ce"}.fa-krw:before,.fa-won-sign:before,.fa-won:before{content:"\f159"}.fa-worm:before{content:"\e599"}.fa-wrench:before{content:"\f0ad"}.fa-x:before{content:"\58"}.fa-x-ray:before{content:"\f497"}.fa-close:before,.fa-multiply:before,.fa-remove:before,.fa-times:before,.fa-xmark:before{content:"\f00d"}.fa-xmarks-lines:before{content:"\e59a"}.fa-y:before{content:"\59"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen-sign:before,.fa-yen:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-z:before{content:"\5a"}.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host,:root{--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}@font-face{font-family:"Font Awesome 6 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}.fa-brands,.fab{font-family:"Font Awesome 6 Brands";font-weight:400}.fa-42-group:before,.fa-innosoft:before{content:"\e080"}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-alipay:before{content:"\f642"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-amilia:before{content:"\f36d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-pay:before{content:"\f415"}.fa-artstation:before{content:"\f77a"}.fa-asymmetrik:before{content:"\f372"}.fa-atlassian:before{content:"\f77b"}.fa-audible:before{content:"\f373"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-aws:before{content:"\f375"}.fa-bandcamp:before{content:"\f2d5"}.fa-battle-net:before{content:"\f835"}.fa-behance:before{content:"\f1b4"}.fa-bilibili:before{content:"\e3d9"}.fa-bimobject:before{content:"\f378"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bootstrap:before{content:"\f836"}.fa-bots:before{content:"\e340"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-buromobelexperte:before{content:"\f37f"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-cloudflare:before{content:"\e07d"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cmplid:before{content:"\e360"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cotton-bureau:before{content:"\f89e"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-critical-role:before{content:"\f6c9"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\e052"}.fa-dashcube:before{content:"\f210"}.fa-deezer:before{content:"\e077"}.fa-delicious:before{content:"\f1a5"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dhl:before{content:"\f790"}.fa-diaspora:before{content:"\f791"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-draft2digital:before{content:"\f396"}.fa-dribbble:before{content:"\f17d"}.fa-dropbox:before{content:"\f16b"}.fa-drupal:before{content:"\f1a9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edge-legacy:before{content:"\e078"}.fa-elementor:before{content:"\f430"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envira:before{content:"\f299"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-etsy:before{content:"\f2d7"}.fa-evernote:before{content:"\f839"}.fa-expeditedssl:before{content:"\f23e"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-figma:before{content:"\f799"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\e007"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-fly:before{content:"\f417"}.fa-font-awesome-flag:before,.fa-font-awesome-logo-full:before,.fa-font-awesome:before{content:"\f2b4"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-fulcrum:before{content:"\f50b"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-gofore:before{content:"\f3a7"}.fa-golang:before{content:"\e40f"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-pay:before{content:"\e079"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-wallet:before{content:"\f1ee"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guilded:before{content:"\e07e"}.fa-gulp:before{content:"\f3ae"}.fa-hacker-news:before{content:"\f1d4"}.fa-hackerrank:before{content:"\f5f7"}.fa-hashnode:before{content:"\e499"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-hive:before{content:"\e07f"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-hotjar:before{content:"\f3b1"}.fa-houzz:before{content:"\f27c"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-ideal:before{content:"\e013"}.fa-imdb:before{content:"\f2d8"}.fa-instagram:before{content:"\f16d"}.fa-instalod:before{content:"\e081"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joomla:before{content:"\f1aa"}.fa-js:before{content:"\f3b8"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaggle:before{content:"\f5fa"}.fa-keybase:before{content:"\f4f5"}.fa-keycdn:before{content:"\f3ba"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-korvue:before{content:"\f42f"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-leanpub:before{content:"\f212"}.fa-less:before{content:"\f41d"}.fa-line:before{content:"\f3c0"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-mailchimp:before{content:"\f59e"}.fa-mandalorian:before{content:"\f50f"}.fa-markdown:before{content:"\f60f"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medapps:before{content:"\f3c6"}.fa-medium-m:before,.fa-medium:before{content:"\f23a"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-mendeley:before{content:"\f7b3"}.fa-meta:before{content:"\e49b"}.fa-microblog:before{content:"\e01a"}.fa-microsoft:before{content:"\f3ca"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\e056"}.fa-mizuni:before{content:"\f3cc"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-nfc-directional:before{content:"\e530"}.fa-nfc-symbol:before{content:"\e531"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-octopus-deploy:before{content:"\e082"}.fa-odnoklassniki:before{content:"\f263"}.fa-old-republic:before{content:"\f510"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-padlet:before{content:"\e4a0"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-palfed:before{content:"\f3d8"}.fa-patreon:before{content:"\f3d9"}.fa-paypal:before{content:"\f1ed"}.fa-perbyte:before{content:"\e083"}.fa-periscope:before{content:"\f3da"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pix:before{content:"\e43a"}.fa-playstation:before{content:"\f3df"}.fa-product-hunt:before{content:"\f288"}.fa-pushed:before{content:"\f3e1"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-r-project:before{content:"\f4f7"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-redhat:before{content:"\f7bc"}.fa-renren:before{content:"\f18b"}.fa-replyd:before{content:"\f3e6"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-rev:before{content:"\f5b2"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-rust:before{content:"\e07a"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-schlix:before{content:"\f3ea"}.fa-screenpal:before{content:"\e570"}.fa-scribd:before{content:"\f28a"}.fa-searchengin:before{content:"\f3eb"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-servicestack:before{content:"\f3ec"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shopify:before{content:"\e057"}.fa-shopware:before{content:"\f5b5"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sith:before{content:"\f512"}.fa-sitrox:before{content:"\e44a"}.fa-sketch:before{content:"\f7c6"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack-hash:before,.fa-slack:before{content:"\f198"}.fa-slideshare:before{content:"\f1e7"}.fa-snapchat-ghost:before,.fa-snapchat:before{content:"\f2ab"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-space-awesome:before{content:"\e5ac"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spotify:before{content:"\f1bc"}.fa-behance-square:before,.fa-square-behance:before{content:"\f1b5"}.fa-dribbble-square:before,.fa-square-dribbble:before{content:"\f397"}.fa-facebook-square:before,.fa-square-facebook:before{content:"\f082"}.fa-square-font-awesome:before{content:"\e5ad"}.fa-font-awesome-alt:before,.fa-square-font-awesome-stroke:before{content:"\f35c"}.fa-git-square:before,.fa-square-git:before{content:"\f1d2"}.fa-github-square:before,.fa-square-github:before{content:"\f092"}.fa-gitlab-square:before,.fa-square-gitlab:before{content:"\e5ae"}.fa-google-plus-square:before,.fa-square-google-plus:before{content:"\f0d4"}.fa-hacker-news-square:before,.fa-square-hacker-news:before{content:"\f3af"}.fa-instagram-square:before,.fa-square-instagram:before{content:"\e055"}.fa-js-square:before,.fa-square-js:before{content:"\f3b9"}.fa-lastfm-square:before,.fa-square-lastfm:before{content:"\f203"}.fa-odnoklassniki-square:before,.fa-square-odnoklassniki:before{content:"\f264"}.fa-pied-piper-square:before,.fa-square-pied-piper:before{content:"\e01e"}.fa-pinterest-square:before,.fa-square-pinterest:before{content:"\f0d3"}.fa-reddit-square:before,.fa-square-reddit:before{content:"\f1a2"}.fa-snapchat-square:before,.fa-square-snapchat:before{content:"\f2ad"}.fa-square-steam:before,.fa-steam-square:before{content:"\f1b7"}.fa-square-tumblr:before,.fa-tumblr-square:before{content:"\f174"}.fa-square-twitter:before,.fa-twitter-square:before{content:"\f081"}.fa-square-viadeo:before,.fa-viadeo-square:before{content:"\f2aa"}.fa-square-vimeo:before,.fa-vimeo-square:before{content:"\f194"}.fa-square-whatsapp:before,.fa-whatsapp-square:before{content:"\f40c"}.fa-square-xing:before,.fa-xing-square:before{content:"\f169"}.fa-square-youtube:before,.fa-youtube-square:before{content:"\f431"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-symbol:before{content:"\f3f6"}.fa-sticker-mule:before{content:"\f3f7"}.fa-strava:before{content:"\f428"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-superpowers:before{content:"\f2dd"}.fa-supple:before{content:"\f3f9"}.fa-suse:before{content:"\f7d6"}.fa-swift:before{content:"\f8e1"}.fa-symfony:before{content:"\f83d"}.fa-teamspeak:before{content:"\f4f9"}.fa-telegram-plane:before,.fa-telegram:before{content:"\f2c6"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-the-red-yeti:before{content:"\f69d"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-think-peaks:before{content:"\f731"}.fa-tiktok:before{content:"\e07b"}.fa-trade-federation:before{content:"\f513"}.fa-trello:before{content:"\f181"}.fa-tumblr:before{content:"\f173"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-uncharted:before{content:"\e084"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\e049"}.fa-unsplash:before{content:"\e07c"}.fa-untappd:before{content:"\f405"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-vaadin:before{content:"\f408"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viber:before{content:"\f409"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-vuejs:before{content:"\f41f"}.fa-watchman-monitoring:before{content:"\e087"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whmcs:before{content:"\f40d"}.fa-wikipedia-w:before{content:"\f266"}.fa-windows:before{content:"\f17a"}.fa-wirsindhandwerk:before,.fa-wsh:before{content:"\e2d0"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wodu:before{content:"\e088"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-rendact:before,.fa-wpressr:before{content:"\f3e4"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-zhihu:before{content:"\f63f"}:host,:root{--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}.fa-regular,.far{font-family:"Font Awesome 6 Free";font-weight:400}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-family:"Font Awesome 6 Free";font-weight:900}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");unicode-range:u+f003,u+f006,u+f014,u+f016-f017,u+f01a-f01b,u+f01d,u+f022,u+f03e,u+f044,u+f046,u+f05c-f05d,u+f06e,u+f070,u+f087-f088,u+f08a,u+f094,u+f096-f097,u+f09d,u+f0a0,u+f0a2,u+f0a4-f0a7,u+f0c5,u+f0c7,u+f0e5-f0e6,u+f0eb,u+f0f6-f0f8,u+f10c,u+f114-f115,u+f118-f11a,u+f11c-f11d,u+f133,u+f147,u+f14e,u+f150-f152,u+f185-f186,u+f18e,u+f190-f192,u+f196,u+f1c1-f1c9,u+f1d9,u+f1db,u+f1e3,u+f1ea,u+f1f7,u+f1f9,u+f20a,u+f247-f248,u+f24a,u+f24d,u+f255-f25b,u+f25d,u+f271-f274,u+f278,u+f27b,u+f28c,u+f28e,u+f29c,u+f2b5,u+f2b7,u+f2ba,u+f2bc,u+f2be,u+f2c0-f2c1,u+f2c3,u+f2d0,u+f2d2,u+f2d4,u+f2dc}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");unicode-range:u+f041,u+f047,u+f065-f066,u+f07d-f07e,u+f080,u+f08b,u+f08e,u+f090,u+f09a,u+f0ac,u+f0ae,u+f0b2,u+f0d0,u+f0d6,u+f0e4,u+f0ec,u+f10a-f10b,u+f123,u+f13e,u+f148-f149,u+f14c,u+f156,u+f15e,u+f160-f161,u+f163,u+f175-f178,u+f195,u+f1f8,u+f219,u+f27a} \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf new file mode 100644 index 00000000..24ca8b17 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 new file mode 100644 index 00000000..e67e5cd5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-brands-400.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf new file mode 100644 index 00000000..c5ac0095 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 new file mode 100644 index 00000000..7dca1d90 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-regular-400.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf new file mode 100644 index 00000000..43ba1cc7 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 new file mode 100644 index 00000000..4a7f9665 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-solid-900.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf new file mode 100644 index 00000000..243bc25b Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.ttf differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 new file mode 100644 index 00000000..e18a16d5 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/css/fontawesome/webfonts/fa-v4compatibility.woff2 differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg new file mode 100644 index 00000000..2e1c1c56 Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/neve-theme.jpg differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png new file mode 100644 index 00000000..dec4b8cd Binary files /dev/null and b/wp-content/upgrade-temp-backup/plugins/menu-icons/images/otter-block.png differ diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php new file mode 100644 index 00000000..7bfb0952 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/front.php @@ -0,0 +1,514 @@ + + */ +final class Menu_Icons_Front_End { + + /** + * Icon types + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $icon_types = array(); + + /** + * Default icon style + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $default_style = array( + 'font_size' => array( + 'property' => 'font-size', + 'value' => '1.2', + 'unit' => 'em', + ), + 'vertical_align' => array( + 'property' => 'vertical-align', + 'value' => 'middle', + 'unit' => null, + ), + 'svg_width' => array( + 'property' => 'width', + 'value' => '1', + 'unit' => 'em', + ), + ); + + /** + * Hidden label class + * + * @since 0.9.0 + * @access protected + * @var string + */ + protected static $hidden_label_class = 'visuallyhidden'; + + + /** + * Add hooks for front-end functionalities + * + * @since 0.9.0 + */ + public static function init() { + $active_types = Menu_Icons_Settings::get( 'global', 'icon_types' ); + + if ( empty( $active_types ) ) { + return; + } + + foreach ( Menu_Icons::get( 'types' ) as $type ) { + if ( in_array( $type->id, $active_types, true ) ) { + self::$icon_types[ $type->id ] = $type; + } + } + + /** + * Allow themes/plugins to override the hidden label class + * + * @since 0.8.0 + * @param string $hidden_label_class Hidden label class. + * @return string + */ + self::$hidden_label_class = apply_filters( 'menu_icons_hidden_label_class', self::$hidden_label_class ); + + /** + * Allow themes/plugins to override default inline style + * + * @since 0.9.0 + * @param array $default_style Default inline style. + * @return array + */ + self::$default_style = apply_filters( 'menu_icons_default_style', self::$default_style ); + + add_action( 'wp_enqueue_scripts', array( __CLASS__, '_enqueue_styles' ), 4 ); + add_filter( 'wp_nav_menu_args', array( __CLASS__, '_add_menu_item_title_filter' ) ); + add_filter( 'wp_nav_menu', array( __CLASS__, '_remove_menu_item_title_filter' ) ); + } + + + /** + * Get nav menu ID based on arguments passed to wp_nav_menu() + * + * @since 0.3.0 + * @param array $args wp_nav_menu() Arguments + * @return mixed Nav menu ID or FALSE on failure + */ + public static function get_nav_menu_id( $args ) { + $args = (object) $args; + $menu = wp_get_nav_menu_object( $args->menu ); + + // Get the nav menu based on the theme_location + if ( ! $menu + && $args->theme_location + && ( $locations = get_nav_menu_locations() ) + && isset( $locations[ $args->theme_location ] ) + ) { + $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); + } + + // get the first menu that has items if we still can't find a menu + if ( ! $menu && ! $args->theme_location ) { + $menus = wp_get_nav_menus(); + foreach ( $menus as $menu_maybe ) { + if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) { + $menu = $menu_maybe; + break; + } + } + } + + if ( is_object( $menu ) && ! is_wp_error( $menu ) ) { + return $menu->term_id; + } else { + return false; + } + } + + + /** + * Enqueue stylesheets + * + * @since 0.1.0 + * @wp_hook action wp_enqueue_scripts + * @link http://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts + */ + public static function _enqueue_styles() { + // Deregister icon picker plugin font-awesome style and re-register with the new handler to avoid other plugin/theme style handler conflict. + $wp_styles = wp_styles(); + if ( $wp_styles && isset( $wp_styles->registered['font-awesome'] ) ) { + $registered = $wp_styles->registered['font-awesome']; + if ( strpos( $registered->src, Menu_Icons::get( 'url' ) ) !== false ) { + $wp_styles->remove( 'font-awesome' ); + $registered->ver = Menu_Icons_Font_Awesome::$version; + $wp_styles->add( 'menu-icon-' . $registered->handle, $registered->src, $registered->deps, $registered->ver, $registered->args ); + } + } + + foreach ( self::$icon_types as $type ) { + $stylesheet_id = $type->stylesheet_id; + if ( 'font-awesome' === $stylesheet_id ) { + $stylesheet_id = 'menu-icon-' . $stylesheet_id; + } + if ( wp_style_is( $stylesheet_id, 'registered' ) ) { + wp_enqueue_style( $stylesheet_id ); + } + } + + /** + * Allow plugins/themes to override the extra stylesheet location + * + * @since 0.9.0 + * @param string $extra_stylesheet_uri Extra stylesheet URI. + */ + $extra_stylesheet_uri = apply_filters( + 'menu_icons_extra_stylesheet_uri', + sprintf( '%scss/extra%s.css', Menu_Icons::get( 'url' ), kucrut_get_script_suffix() ) + ); + + wp_enqueue_style( + 'menu-icons-extra', + $extra_stylesheet_uri, + false, + Menu_Icons::VERSION + ); + } + + + /** + * Add filter to 'the_title' hook + * + * We need to filter the menu item title but **not** regular post titles. + * Thus, we're adding the filter when `wp_nav_menu()` is called. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu_args + * @param array $args Not used. + * + * @return array + */ + public static function _add_menu_item_title_filter( $args ) { + add_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + add_filter( 'megamenu_the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + add_filter( 'megamenu_nav_menu_css_class', array( __CLASS__, '_add_menu_item_class' ), 10, 3 ); + + return $args; + } + + + /** + * Remove filter from 'the_title' hook + * + * Because we don't want to filter post titles, we need to remove our + * filter when `wp_nav_menu()` exits. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu + * @param array $nav_menu Not used. + * @return array + */ + public static function _remove_menu_item_title_filter( $nav_menu ) { + remove_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + remove_filter( 'megamenu_the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + remove_filter( 'megamenu_nav_menu_css_class', array( __CLASS__, '_add_menu_item_class' ), 10, 3 ); + return $nav_menu; + } + + + /** + * Add icon to menu item title + * + * @since 0.1.0 + * @since 0.9.0 Renamed the method to `add_icon()`. + * @wp_hook filter the_title + * @param string $title Menu item title. + * @param int $id Menu item ID. + * + * @return string + */ + public static function _add_icon( $title, $id ) { + $meta = Menu_Icons_Meta::get( $id ); + $icon = self::get_icon( $meta ); + + if ( empty( $icon ) ) { + return $title; + } + + $title_class = ! empty( $meta['hide_label'] ) ? self::$hidden_label_class : ''; + $title_wrapped = sprintf( + '%s', + ( ! empty( $title_class ) ) ? sprintf( ' class="%s"', esc_attr( $title_class ) ) : '', + $title + ); + + if ( 'after' === $meta['position'] ) { + $title_with_icon = "{$title_wrapped}{$icon}"; + } else { + $title_with_icon = "{$icon}{$title_wrapped}"; + } + + /** + * Allow plugins/themes to override menu item markup + * + * @since 0.8.0 + * + * @param string $title_with_icon Menu item markup after the icon is added. + * @param integer $id Menu item ID. + * @param array $meta Menu item metadata values. + * @param string $title Original menu item title. + * + * @return string + */ + $title_with_icon = apply_filters( 'menu_icons_item_title', $title_with_icon, $id, $meta, $title ); + + return $title_with_icon; + } + + + /** + * Get icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_icon( $meta ) { + $icon = ''; + + // Icon type is not set. + if ( empty( $meta['type'] ) ) { + return $icon; + } + + // Icon is not set. + if ( empty( $meta['icon'] ) ) { + return $icon; + } + + // Icon type is not registered/enabled. + if ( ! isset( self::$icon_types[ $meta['type'] ] ) ) { + return $icon; + } + + $type = self::$icon_types[ $meta['type'] ]; + + $callbacks = array( + array( $type, 'get_icon' ), + array( __CLASS__, "get_{$type->id}_icon" ), + array( __CLASS__, "get_{$type->template_id}_icon" ), + ); + + foreach ( $callbacks as $callback ) { + if ( is_callable( $callback ) ) { + $icon = call_user_func( $callback, $meta ); + break; + } + } + + return $icon; + } + + + /** + * Get icon style + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param array $keys Style properties. + * @param bool $as_attribute Optional. Whether to output the style as HTML attribute or value only. + * Defaults to TRUE. + * @return string + */ + public static function get_icon_style( $meta, $keys, $as_attribute = true ) { + $style_a = array(); + $style_s = ''; + + foreach ( $keys as $key ) { + if ( ! isset( self::$default_style[ $key ] ) ) { + continue; + } + + $rule = self::$default_style[ $key ]; + + if ( ! isset( $meta[ $key ] ) || $meta[ $key ] === $rule['value'] ) { + continue; + } + + $value = $meta[ $key ]; + if ( ! empty( $rule['unit'] ) ) { + $value .= $rule['unit']; + } + + $style_a[ $rule['property'] ] = $value; + } + + if ( empty( $style_a ) ) { + return $style_s; + } + + foreach ( $style_a as $key => $value ) { + $style_s .= "{$key}:{$value};"; + } + + $style_s = esc_attr( $style_s ); + + if ( $as_attribute ) { + $style_s = sprintf( ' style="%s"', $style_s ); + } + + return $style_s; + } + + + /** + * Get icon classes + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param string $output Whether to output the classes as string or array. Defaults to string. + * @return string|array + */ + public static function get_icon_classes( $meta, $output = 'string' ) { + $classes = array( '_mi' ); + + if ( empty( $meta['hide_label'] ) ) { + $classes[] = "_{$meta['position']}"; + } + + if ( 'string' === $output ) { + $classes = implode( ' ', $classes ); + } + + return $classes; + } + + + /** + * Get font icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_font_icon( $meta ) { + $type = $meta['type']; + $icon = $meta['icon']; + + $font_awesome5 = font_awesome_backward_compatible(); + if ( ! empty( $type ) && 'fa' === $type ) { + $icon = explode( ' ', $icon ); + $type = reset( $icon ); + $icon = end( $icon ); + $fa_icon = sprintf( '%s-%s', $type, $icon ); + if ( array_key_exists( $fa_icon, $font_awesome5 ) ) { + $fa5_icon = $font_awesome5[ $fa_icon ]; + $fa5_class = explode( ' ', $fa5_icon ); + $type = reset( $fa5_class ); + $icon = end( $fa5_class ); + } + } + $classes = sprintf( '%s %s %s', self::get_icon_classes( $meta ), $type, $icon ); + $style = self::get_icon_style( $meta, array( 'font_size', 'vertical_align' ) ); + return sprintf( '', esc_attr( $classes ), $style ); + } + + + /** + * Get image icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_image_icon( $meta ) { + $args = array( + 'class' => sprintf( '%s _image', self::get_icon_classes( $meta ) ), + 'aria-hidden' => 'true', + ); + + $style = self::get_icon_style( $meta, array( 'vertical_align' ), false ); + if ( ! empty( $style ) ) { + $args['style'] = $style; + } + + return wp_get_attachment_image( $meta['icon'], $meta['image_size'], false, $args ); + } + + + /** + * Get SVG icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_svg_icon( $meta ) { + $classes = sprintf( '%s _svg', self::get_icon_classes( $meta ) ); + $style = self::get_icon_style( $meta, array( 'svg_width', 'vertical_align' ) ); + + $svg_icon = esc_url( wp_get_attachment_url( $meta['icon'] ) ); + $width = ''; + $height = ''; + if ( 'image/svg+xml' === get_post_mime_type( $meta['icon'] ) ) { + + // Check `WP_Filesystem` function exists OR not. + require_once ABSPATH . '/wp-admin/includes/file.php'; + \WP_Filesystem(); + global $wp_filesystem; + + $svg_icon = get_attached_file( $meta['icon'] ); + $svg_icon_content = $wp_filesystem->get_contents( $svg_icon ); + if ( $svg_icon_content ) { + $xmlget = simplexml_load_string( $svg_icon_content ); + $xmlattributes = $xmlget->attributes(); + $width = (string) $xmlattributes->width; + $width = (int) filter_var( $xmlattributes->width, FILTER_SANITIZE_NUMBER_INT ); + $height = (string) $xmlattributes->height; + $height = (int) filter_var( $xmlattributes->height, FILTER_SANITIZE_NUMBER_INT ); + } + } else { + $attachment_meta = wp_get_attachment_metadata( $meta['icon'] ); + if ( $attachment_meta ) { + $width = isset( $attachment_meta['width'] ) ? $attachment_meta['width'] : $width; + $height = isset( $attachment_meta['height'] ) ? $attachment_meta['height'] : $height; + } + } + if ( ! empty( $width ) ) { + $width = sprintf( ' width="%d"', $width ); + } + if ( ! empty( $height ) ) { + $height = sprintf( ' height="%d"', $height ); + } + $image_alt = get_post_meta( $meta['icon'], '_wp_attachment_image_alt', true ); + $image_alt = $image_alt ? wp_strip_all_tags( $image_alt ) : ''; + return sprintf( + '', + esc_url( wp_get_attachment_url( $meta['icon'] ) ), + esc_attr( $classes ), + $image_alt, + $width, + $height, + $style + ); + } + + /** + * Add menu item class in `Max Mega Menu` item. + * + * @param array $classes Item classes. + * @param array $item WP menu item. + * @param object $args Menu object. + * @return array + */ + public static function _add_menu_item_class( $classes, $item, $args ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore + $classes[] = 'menu-item'; + return $classes; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php new file mode 100644 index 00000000..cf7ca6b0 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/compat.php @@ -0,0 +1,23 @@ + 'fab fa-500px', + 'fa-fa-address-book-o' => 'far fa-address-book', + 'fa-fa-address-card-o' => 'far fa-address-card', + 'fa-fa-adn' => 'fab fa-adn', + 'fa-fa-amazon' => 'fab fa-amazon', + 'fa-fa-android' => 'fab fa-android', + 'fa-fa-angellist' => 'fab fa-angellist', + 'fa-fa-apple' => 'fab fa-apple', + 'fa-fa-area-chart' => 'fas fa-chart-area', + 'fa-fa-arrow-circle-o-down' => 'far fa-arrow-alt-circle-down', + 'fa-fa-arrow-circle-o-left' => 'far fa-arrow-alt-circle-left', + 'fa-fa-arrow-circle-o-right' => 'far fa-arrow-alt-circle-right', + 'fa-fa-arrow-circle-o-up' => 'far fa-arrow-alt-circle-up', + 'fa-fa-arrows-alt' => 'fas fa-expand-arrows-alt', + 'fa-fa-arrows-h' => 'fas fa-arrows-alt-h', + 'fa-fa-arrows-v' => 'fas fa-arrows-alt-v', + 'fa-fa-arrows' => 'fas fa-arrows-alt', + 'fa-fa-asl-interpreting' => 'fas fa-american-sign-language-interpreting', + 'fa-fa-automobile' => 'fas fa-car', + 'fa-fa-bandcamp' => 'fab fa-bandcamp', + 'fa-fa-bank' => 'fas fa-university', + 'fa-fa-bar-chart-o' => 'far fa-chart-bar', + 'fa-fa-bar-chart' => 'far fa-chart-bar', + 'fa-fa-bathtub' => 'fas fa-bath', + 'fa-fa-battery-0' => 'fas fa-battery-empty', + 'fa-fa-battery-1' => 'fas fa-battery-quarter', + 'fa-fa-battery-2' => 'fas fa-battery-half', + 'fa-fa-battery-3' => 'fas fa-battery-three-quarters', + 'fa-fa-battery-4' => 'fas fa-battery-full', + 'fa-fa-battery' => 'fas fa-battery-full', + 'fa-fa-behance' => 'fab fa-behance', + 'fa-fa-behance-square' => 'fab fa-behance-square', + 'fa-fa-bell-o' => 'far fa-bell', + 'fa-fa-bell-slash-o' => 'far fa-bell-slash', + 'fa-fa-bitbucket-square' => 'fab fa-bitbucket', + 'fa-fa-bitbucket' => 'fab fa-bitbucket', + 'fa-fa-bitcoin' => 'fab fa-btc', + 'fa-fa-black-tie' => 'fab fa-black-tie', + 'fa-fa-bluetooth-b' => 'fab fa-bluetooth-b', + 'fa-fa-bluetooth' => 'fab fa-bluetooth', + 'fa-fa-bookmark-o' => 'far fa-bookmark', + 'fa-fa-btc' => 'fab fa-btc', + 'fa-fa-building-o' => 'far fa-building', + 'fa-fa-buysellads' => 'fab fa-buysellads', + 'fa-fa-cab' => 'fas fa-taxi', + 'fa-fa-calendar-check-o' => 'far fa-calendar-check', + 'fa-fa-calendar-minus-o' => 'far fa-calendar-minus', + 'fa-fa-calendar-o' => 'far fa-calendar', + 'fa-fa-calendar-plus-o' => 'far fa-calendar-plus', + 'fa-fa-calendar-times-o' => 'far fa-calendar-times', + 'fa-fa-calendar' => 'fas fa-calendar-alt', + 'fa-fa-caret-square-o-down' => 'far fa-caret-square-down', + 'fa-fa-caret-square-o-left' => 'far fa-caret-square-left', + 'fa-fa-caret-square-o-right' => 'far fa-caret-square-right', + 'fa-fa-caret-square-o-up' => 'far fa-caret-square-up', + 'fa-fa-cc-amex' => 'fab fa-cc-amex', + 'fa-fa-cc-diners-club' => 'fab fa-cc-diners-club', + 'fa-fa-cc-discover' => 'fab fa-cc-discover', + 'fa-fa-cc-jcb' => 'fab fa-cc-jcb', + 'fa-fa-cc-mastercard' => 'fab fa-cc-mastercard', + 'fa-fa-cc-paypal' => 'fab fa-cc-paypal', + 'fa-fa-cc-stripe' => 'fab fa-cc-stripe', + 'fa-fa-cc-visa' => 'fab fa-cc-visa', + 'fa-fa-cc' => 'far fa-closed-captioning', + 'fa-fa-chain-broken' => 'fas fa-unlink', + 'fa-fa-chain' => 'fas fa-link', + 'fa-fa-check-circle-o' => 'far fa-check-circle', + 'fa-fa-check-square-o' => 'far fa-check-square', + 'fa-fa-chrome' => 'fab fa-chrome', + 'fa-fa-circle-o-notch' => 'fas fa-circle-notch', + 'fa-fa-circle-o' => 'far fa-circle', + 'fa-fa-circle-thin' => 'far fa-circle', + 'fa-fa-clipboard' => 'far fa-clipboard', + 'fa-fa-clock-o' => 'far fa-clock', + 'fa-fa-clone' => 'far fa-clone', + 'fa-fa-close' => 'fas fa-times', + 'fa-fa-cloud-download' => 'fas fa-cloud-download-alt', + 'fa-fa-cloud-upload' => 'fas fa-cloud-upload-alt', + 'fa-fa-cny' => 'fas fa-yen-sign', + 'fa-fa-code-fork' => 'fas fa-code-branch', + 'fa-fa-codepen' => 'fab fa-codepen', + 'fa-fa-codiepie' => 'fab fa-codiepie', + 'fa-fa-comment-o' => 'far fa-comment', + 'fa-fa-commenting-o' => 'far fa-comment-dots', + 'fa-fa-commenting' => 'fas fa-comment-dots', + 'fa-fa-comments-o' => 'far fa-comments', + 'fa-fa-compass' => 'far fa-compass', + 'fa-fa-connectdevelop' => 'fab fa-connectdevelop', + 'fa-fa-contao' => 'fab fa-contao', + 'fa-fa-copyright' => 'far fa-copyright', + 'fa-fa-creative-commons' => 'fab fa-creative-commons', + 'fa-fa-credit-card-alt' => 'fas fa-credit-card', + 'fa-fa-credit-card' => 'far fa-credit-card', + 'fa-fa-css3' => 'fab fa-css3', + 'fa-fa-cutlery' => 'fas fa-utensils', + 'fa-fa-dashboard' => 'fas fa-tachometer-alt', + 'fa-fa-dashcube' => 'fab fa-dashcube', + 'fa-fa-deafness' => 'fas fa-deaf', + 'fa-fa-dedent' => 'fas fa-outdent', + 'fa-fa-delicious' => 'fab fa-delicious', + 'fa-fa-deviantart' => 'fab fa-deviantart', + 'fa-fa-diamond' => 'far fa-gem', + 'fa-fa-digg' => 'fab fa-digg', + 'fa-fa-dollar' => 'fas fa-dollar-sign', + 'fa-fa-dot-circle-o' => 'far fa-dot-circle', + 'fa-fa-dribbble' => 'fab fa-dribbble', + 'fa-fa-drivers-license-o' => 'far fa-id-card', + 'fa-fa-drivers-license' => 'fas fa-id-card', + 'fa-fa-dropbox' => 'fab fa-dropbox', + 'fa-fa-drupal' => 'fab fa-drupal', + 'fa-fa-edge' => 'fab fa-edge', + 'fa-fa-eercast' => 'fab fa-sellcast', + 'fa-fa-empire' => 'fab fa-empire', + 'fa-fa-envelope-open-o' => 'far fa-envelope-open', + 'fa-fa-envelope-o' => 'far fa-envelope', + 'fa-fa-envira' => 'fab fa-envira', + 'fa-fa-etsy' => 'fab fa-etsy', + 'fa-fa-euro' => 'fas fa-euro-sign', + 'fa-fa-eur' => 'fas fa-euro-sign', + 'fa-fa-exchange' => 'fas fa-exchange-alt', + 'fa-fa-expeditedssl' => 'fab fa-expeditedssl', + 'fa-fa-external-link-square' => 'fas fa-external-link-square-alt', + 'fa-fa-external-link' => 'fas fa-external-link-alt', + 'fa-fa-eye-slash' => 'far fa-eye-slash', + 'fa-fa-eyedropper' => 'fas fa-eye-dropper', + 'fa-fa-eye' => 'far fa-eye', + 'fa-fa-facebook-f' => 'fab fa-facebook-f', + 'fa-fa-facebook-official' => 'fab fa-facebook', + 'fa-fa-facebook-square' => 'fab fa-facebook-square', + 'fa-fa-facebook' => 'fab fa-facebook-f', + 'fa-fa-feed' => 'fas fa-rss', + 'fa-fa-file-archive-o' => 'far fa-file-archive', + 'fa-fa-file-audio-o' => 'far fa-file-audio', + 'fa-fa-file-code-o' => 'far fa-file-code', + 'fa-fa-file-excel-o' => 'far fa-file-excel', + 'fa-fa-file-image-o' => 'far fa-file-image', + 'fa-fa-file-movie-o' => 'far fa-file-video', + 'fa-fa-file-o' => 'far fa-file', + 'fa-fa-file-pdf-o' => 'far fa-file-pdf', + 'fa-fa-file-photo-o' => 'far fa-file-image', + 'fa-fa-file-picture-o' => 'far fa-file-image', + 'fa-fa-file-powerpoint-o' => 'far fa-file-powerpoint', + 'fa-fa-file-sound-o' => 'far fa-file-audio', + 'fa-fa-file-text-o' => 'far fa-file-alt', + 'fa-fa-file-text' => 'fas fa-file-alt', + 'fa-fa-file-video-o' => 'far fa-file-video', + 'fa-fa-file-word-o' => 'far fa-file-word', + 'fa-fa-file-zip-o' => 'far fa-file-archive', + 'fa-fa-files-o' => 'far fa-copy', + 'fa-fa-firefox' => 'fab fa-firefox', + 'fa-fa-first-order' => 'fab fa-first-order', + 'fa-fa-flag-o' => 'far fa-flag', + 'fa-fa-flash' => 'fas fa-bolt', + 'fa-fa-flickr' => 'fab fa-flickr', + 'fa-fa-floppy-o' => 'far fa-save', + 'fa-fa-folder-o' => 'far fa-folder', + 'fa-fa-folder-open-o' => 'far fa-folder-open', + 'fa-fa-font-awesome' => 'fab fa-font-awesome', + 'fa-fa-fonticons' => 'fab fa-fonticons', + 'fa-fa-fort-awesome' => 'fab fa-fort-awesome', + 'fa-fa-forumbee' => 'fab fa-forumbee', + 'fa-fa-foursquare' => 'fab fa-foursquare', + 'fa-fa-free-code-camp' => 'fab fa-free-code-camp', + 'fa-fa-frown-o' => 'far fa-frown', + 'fa-fa-futbol-o' => 'far fa-futbol', + 'fa-fa-gbp' => 'fas fa-pound-sign', + 'fa-fa-gears' => 'fas fa-cogs', + 'fa-fa-gear' => 'fas fa-cog', + 'fa-fa-get-pocket' => 'fab fa-get-pocket', + 'fa-fa-ge' => 'fab fa-empire', + 'fa-fa-gg-circle' => 'fab fa-gg-circle', + 'fa-fa-gg' => 'fab fa-gg', + 'fa-fa-git-square' => 'fab fa-git-square', + 'fa-fa-github-alt' => 'fab fa-github-alt', + 'fa-fa-github-square' => 'fab fa-github-square', + 'fa-fa-github' => 'fab fa-github', + 'fa-fa-gitlab' => 'fab fa-gitlab', + 'fa-fa-gittip' => 'fab fa-gratipay', + 'fa-fa-git' => 'fab fa-git', + 'fa-fa-glass' => 'fas fa-glass-martini', + 'fa-fa-glide-g' => 'fab fa-glide-g', + 'fa-fa-glide' => 'fab fa-glide', + 'fa-fa-google-plus-circle' => 'fab fa-google-plus', + 'fa-fa-google-plus-official' => 'fab fa-google-plus', + 'fa-fa-google-plus-square' => 'fab fa-google-plus-square', + 'fa-fa-google-plus' => 'fab fa-google-plus-g', + 'fa-fa-google-wallet' => 'fab fa-google-wallet', + 'fa-fa-google' => 'fab fa-google', + 'fa-fa-gratipay' => 'fab fa-gratipay', + 'fa-fa-grav' => 'fab fa-grav', + 'fa-fa-group' => 'fas fa-users', + 'fa-fa-hacker-news' => 'fab fa-hacker-news', + 'fa-fa-hand-grab-o' => 'far fa-hand-rock', + 'fa-fa-hand-lizard-o' => 'far fa-hand-lizard', + 'fa-fa-hand-o-down' => 'far fa-hand-point-down', + 'fa-fa-hand-o-left' => 'far fa-hand-point-left', + 'fa-fa-hand-o-right' => 'far fa-hand-point-right', + 'fa-fa-hand-o-up' => 'far fa-hand-point-up', + 'fa-fa-hand-paper-o' => 'far fa-hand-paper', + 'fa-fa-hand-peace-o' => 'far fa-hand-peace', + 'fa-fa-hand-pointer-o' => 'far fa-hand-pointer', + 'fa-fa-hand-rock-o' => 'far fa-hand-rock', + 'fa-fa-hand-scissors-o' => 'far fa-hand-scissors', + 'fa-fa-hand-spock-o' => 'far fa-hand-spock', + 'fa-fa-hand-stop-o' => 'far fa-hand-paper', + 'fa-fa-handshake-o' => 'far fa-handshake', + 'fa-fa-hard-of-hearing' => 'fas fa-deaf', + 'fa-fa-hdd-o' => 'far fa-hdd', + 'fa-fa-header' => 'fas fa-heading', + 'fa-fa-heart-o' => 'far fa-heart', + 'fa-fa-hospital-o' => 'far fa-hospital', + 'fa-fa-hotel' => 'fas fa-bed', + 'fa-fa-hourglass-1' => 'fas fa-hourglass-start', + 'fa-fa-hourglass-2' => 'fas fa-hourglass-half', + 'fa-fa-hourglass-3' => 'fas fa-hourglass-end', + 'fa-fa-hourglass-o' => 'far fa-hourglass', + 'fa-fa-houzz' => 'fab fa-houzz', + 'fa-fa-html5' => 'fab fa-html5', + 'fa-fa-id-badge' => 'far fa-id-badge', + 'fa-fa-id-card-o' => 'far fa-id-card', + 'fa-fa-ils' => 'fas fa-shekel-sign', + 'fa-fa-image' => 'far fa-image', + 'fa-fa-imdb' => 'fab fa-imdb', + 'fa-fa-inr' => 'fas fa-rupee-sign', + 'fa-fa-instagram' => 'fab fa-instagram', + 'fa-fa-institution' => 'fas fa-university', + 'fa-fa-internet-explorer' => 'fab fa-internet-explorer', + 'fa-fa-intersex' => 'fas fa-transgender', + 'fa-fa-ioxhost' => 'fab fa-ioxhost', + 'fa-fa-joomla' => 'fab fa-joomla', + 'fa-fa-jpy' => 'fas fa-yen-sign', + 'fa-fa-jsfiddle' => 'fab fa-jsfiddle', + 'fa-fa-keyboard-o' => 'far fa-keyboard', + 'fa-fa-krw' => 'fas fa-won-sign', + 'fa-fa-lastfm-square' => 'fab fa-lastfm-square', + 'fa-fa-lastfm' => 'fab fa-lastfm', + 'fa-fa-leanpub' => 'fab fa-leanpub', + 'fa-fa-legal' => 'fas fa-gavel', + 'fa-fa-lemon-o' => 'far fa-lemon', + 'fa-fa-level-down' => 'fas fa-level-down-alt', + 'fa-fa-level-up' => 'fas fa-level-up-alt', + 'fa-fa-life-bouy' => 'far fa-life-ring', + 'fa-fa-life-buoy' => 'far fa-life-ring', + 'fa-fa-life-ring' => 'far fa-life-ring', + 'fa-fa-life-saver' => 'far fa-life-ring', + 'fa-fa-lightbulb-o' => 'far fa-lightbulb', + 'fa-fa-line-chart' => 'fas fa-chart-line', + 'fa-fa-linkedin-square' => 'fab fa-linkedin', + 'fa-fa-linkedin' => 'fab fa-linkedin-in', + 'fa-fa-linode' => 'fab fa-linode', + 'fa-fa-linux' => 'fab fa-linux', + 'fa-fa-list-alt' => 'far fa-list-alt', + 'fa-fa-long-arrow-down' => 'fas fa-long-arrow-alt-down', + 'fa-fa-long-arrow-left' => 'fas fa-long-arrow-alt-left', + 'fa-fa-long-arrow-right' => 'fas fa-long-arrow-alt-right', + 'fa-fa-long-arrow-up' => 'fas fa-long-arrow-alt-up', + 'fa-fa-mail-forward' => 'fas fa-share', + 'fa-fa-mail-reply-all' => 'fas fa-reply-all', + 'fa-fa-mail-reply' => 'fas fa-reply', + 'fa-fa-map-marker' => 'fas fa-map-marker-alt', + 'fa-fa-map-o' => 'far fa-map', + 'fa-fa-maxcdn' => 'fab fa-maxcdn', + 'fa-fa-meanpath' => 'fab fa-font-awesome', + 'fa-fa-medium' => 'fab fa-medium', + 'fa-fa-meetup' => 'fab fa-meetup', + 'fa-fa-meh-o' => 'far fa-meh', + 'fa-fa-minus-square-o' => 'far fa-minus-square', + 'fa-fa-mixcloud' => 'fab fa-mixcloud', + 'fa-fa-mobile-phone' => 'fas fa-mobile-alt', + 'fa-fa-mobile' => 'fas fa-mobile-alt', + 'fa-fa-modx' => 'fab fa-modx', + 'fa-fa-moon-o' => 'far fa-moon', + 'fa-fa-money' => 'far fa-money-bill-alt', + 'fa-fa-mortar-board' => 'fas fa-graduation-cap', + 'fa-fa-navicon' => 'fas fa-bars', + 'fa-fa-newspaper-o' => 'far fa-newspaper', + 'fa-fa-object-group' => 'far fa-object-group', + 'fa-fa-object-ungroup' => 'far fa-object-ungroup', + 'fa-fa-odnoklassniki-square' => 'fab fa-odnoklassniki-square', + 'fa-fa-odnoklassniki' => 'fab fa-odnoklassniki', + 'fa-fa-opencart' => 'fab fa-opencart', + 'fa-fa-openid' => 'fab fa-openid', + 'fa-fa-opera' => 'fab fa-opera', + 'fa-fa-optin-monster' => 'fab fa-optin-monster', + 'fa-fa-pagelines' => 'fab fa-pagelines', + 'fa-fa-paper-plane-o' => 'far fa-paper-plane', + 'fa-fa-paste' => 'far fa-clipboard', + 'fa-fa-pause-circle-o' => 'far fa-pause-circle', + 'fa-fa-paypal' => 'fab fa-paypal', + 'fa-fa-pencil-square' => 'fas fa-pen-square', + 'fa-fa-pencil-square-o' => 'far fa-edit', + 'fa-fa-pencil' => 'fas fa-pencil-alt', + 'fa-fa-photo' => 'far fa-image', + 'fa-fa-picture-o' => 'far fa-image', + 'fa-fa-pie-chart' => 'fas fa-chart-pie', + 'fa-fa-pied-piper-alt' => 'fab fa-pied-piper-alt', + 'fa-fa-pied-piper-pp' => 'fab fa-pied-piper-pp', + 'fa-fa-pied-piper' => 'fab fa-pied-piper', + 'fa-fa-pinterest-p' => 'fab fa-pinterest-p', + 'fa-fa-pinterest-square' => 'fab fa-pinterest-square', + 'fa-fa-pinterest' => 'fab fa-pinterest', + 'fa-fa-play-circle-o' => 'far fa-play-circle', + 'fa-fa-plus-square-o' => 'far fa-plus-square', + 'fa-fa-product-hunt' => 'fab fa-product-hunt', + 'fa-fa-qq' => 'fab fa-qq', + 'fa-fa-question-circle-o' => 'far fa-question-circle', + 'fa-fa-quora' => 'fab fa-quora', + 'fa-fa-ravelry' => 'fab fa-ravelry', + 'fa-fa-ra' => 'fab fa-rebel', + 'fa-fa-rebel' => 'fab fa-rebel', + 'fa-fa-reddit-alien' => 'fab fa-reddit-alien', + 'fa-fa-reddit-square' => 'fab fa-reddit-square', + 'fa-fa-reddit' => 'fab fa-reddit', + 'fa-fa-refresh' => 'fas fa-sync', + 'fa-fa-registered' => 'far fa-registered', + 'fa-fa-remove' => 'fas fa-times', + 'fa-fa-renren' => 'fab fa-renren', + 'fa-fa-reorder' => 'fas fa-bars', + 'fa-fa-repeat' => 'fas fa-redo', + 'fa-fa-resistance' => 'fab fa-rebel', + 'fa-fa-rmb' => 'fas fa-yen-sign', + 'fa-fa-rotate-left' => 'fas fa-undo', + 'fa-fa-rotate-right' => 'fas fa-redo', + 'fa-fa-rouble' => 'fas fa-ruble-sign', + 'fa-fa-ruble' => 'fas fa-ruble-sign', + 'fa-fa-rub' => 'fas fa-ruble-sign', + 'fa-fa-rupee' => 'fas fa-rupee-sign', + 'fa-fa-s15' => 'fas fa-bath', + 'fa-fa-safari' => 'fab fa-safari', + 'fa-fa-scissors' => 'fas fa-cut', + 'fa-fa-scribd' => 'fab fa-scribd', + 'fa-fa-sellsy' => 'fab fa-sellsy', + 'fa-fa-send-o' => 'far fa-paper-plane', + 'fa-fa-send' => 'fas fa-paper-plane', + 'fa-fa-share-square-o' => 'far fa-share-square', + 'fa-fa-shekel' => 'fas fa-shekel-sign', + 'fa-fa-sheqel' => 'fas fa-shekel-sign', + 'fa-fa-shield' => 'fas fa-shield-alt', + 'fa-fa-shirtsinbulk' => 'fab fa-shirtsinbulk', + 'fa-fa-sign-in' => 'fas fa-sign-in-alt', + 'fa-fa-sign-out' => 'fas fa-sign-out-alt', + 'fa-fa-signing' => 'fas fa-sign-language', + 'fa-fa-simplybuilt' => 'fab fa-simplybuilt', + 'fa-fa-skyatlas' => 'fab fa-skyatlas', + 'fa-fa-skype' => 'fab fa-skype', + 'fa-fa-slack' => 'fab fa-slack', + 'fa-fa-sliders' => 'fas fa-sliders-h', + 'fa-fa-slideshare' => 'fab fa-slideshare', + 'fa-fa-smile-o' => 'far fa-smile', + 'fa-fa-snapchat-ghost' => 'fab fa-snapchat-ghost', + 'fa-fa-snapchat-square' => 'fab fa-snapchat-square', + 'fa-fa-snapchat' => 'fab fa-snapchat', + 'fa-fa-snowflake-o' => 'far fa-snowflake', + 'fa-fa-soccer-ball-o' => 'far fa-futbol', + 'fa-fa-sort-alpha-asc' => 'fas fa-sort-alpha-down', + 'fa-fa-sort-alpha-desc' => 'fas fa-sort-alpha-up', + 'fa-fa-sort-amount-asc' => 'fas fa-sort-amount-down', + 'fa-fa-sort-amount-desc' => 'fas fa-sort-amount-up', + 'fa-fa-sort-asc' => 'fas fa-sort-up', + 'fa-fa-sort-desc' => 'fas fa-sort-down', + 'fa-fa-sort-numeric-asc' => 'fas fa-sort-numeric-down', + 'fa-fa-sort-numeric-desc' => 'fas fa-sort-numeric-up', + 'fa-fa-soundcloud' => 'fab fa-soundcloud', + 'fa-fa-spoon' => 'fas fa-utensil-spoon', + 'fa-fa-spotify' => 'fab fa-spotify', + 'fa-fa-square-o' => 'far fa-square', + 'fa-fa-stack-exchange' => 'fab fa-stack-exchange', + 'fa-fa-stack-overflow' => 'fab fa-stack-overflow', + 'fa-fa-star-half-empty' => 'far fa-star-half', + 'fa-fa-star-half-full' => 'far fa-star-half', + 'fa-fa-star-half-o' => 'far fa-star-half', + 'fa-fa-star-o' => 'far fa-star', + 'fa-fa-steam-square' => 'fab fa-steam-square', + 'fa-fa-steam' => 'fab fa-steam', + 'fa-fa-sticky-note-o' => 'far fa-sticky-note', + 'fa-fa-stop-circle-o' => 'far fa-stop-circle', + 'fa-fa-stumbleupon-circle' => 'fab fa-stumbleupon-circle', + 'fa-fa-stumbleupon' => 'fab fa-stumbleupon', + 'fa-fa-sun-o' => 'far fa-sun', + 'fa-fa-superpowers' => 'fab fa-superpowers', + 'fa-fa-support' => 'far fa-life-ring', + 'fa-fa-tablet' => 'fas fa-tablet-alt', + 'fa-fa-tachometer' => 'fas fa-tachometer-alt', + 'fa-fa-telegram' => 'fab fa-telegram', + 'fa-fa-television' => 'fas fa-tv', + 'fa-fa-tencent-weibo' => 'fab fa-tencent-weibo', + 'fa-fa-themeisle' => 'fab fa-themeisle', + 'fa-fa-thermometer-0' => 'fas fa-thermometer-empty', + 'fa-fa-thermometer-1' => 'fas fa-thermometer-quarter', + 'fa-fa-thermometer-2' => 'fas fa-thermometer-half', + 'fa-fa-thermometer-3' => 'fas fa-thermometer-three-quarters', + 'fa-fa-thermometer-4' => 'fas fa-thermometer-full', + 'fa-fa-thermometer' => 'fas fa-thermometer-full', + 'fa-fa-thumb-tack' => 'fas fa-thumbtack', + 'fa-fa-thumbs-o-down' => 'far fa-thumbs-down', + 'fa-fa-thumbs-o-up' => 'far fa-thumbs-up', + 'fa-fa-ticket' => 'fas fa-ticket-alt', + 'fa-fa-times-circle-o' => 'far fa-times-circle', + 'fa-fa-times-rectangle-o' => 'far fa-window-close', + 'fa-fa-times-rectangle' => 'fas fa-window-close', + 'fa-fa-toggle-down' => 'far fa-caret-square-down', + 'fa-fa-toggle-left' => 'far fa-caret-square-left', + 'fa-fa-toggle-right' => 'far fa-caret-square-right', + 'fa-fa-toggle-up' => 'far fa-caret-square-up', + 'fa-fa-trash-o' => 'far fa-trash-alt', + 'fa-fa-trash' => 'fas fa-trash-alt', + 'fa-fa-trello' => 'fab fa-trello', + 'fa-fa-tripadvisor' => 'fab fa-tripadvisor', + 'fa-fa-try' => 'fas fa-lira-sign', + 'fa-fa-tumblr-square' => 'fab fa-tumblr-square', + 'fa-fa-tumblr' => 'fab fa-tumblr', + 'fa-fa-turkish-lira' => 'fas fa-lira-sign', + 'fa-fa-twitch' => 'fab fa-twitch', + 'fa-fa-twitter-square' => 'fab fa-twitter-square', + 'fa-fa-twitter' => 'fab fa-twitter', + 'fa-fa-unsorted' => 'fas fa-sort', + 'fa-fa-usb' => 'fab fa-usb', + 'fa-fa-usd' => 'fas fa-dollar-sign', + 'fa-fa-user-circle-o' => 'far fa-user-circle', + 'fa-fa-user-o' => 'far fa-user', + 'fa-fa-vcard-o' => 'far fa-address-card', + 'fa-fa-vcard' => 'fas fa-address-card', + 'fa-fa-viacoin' => 'fab fa-viacoin', + 'fa-fa-viadeo-square' => 'fab fa-viadeo-square', + 'fa-fa-viadeo' => 'fab fa-viadeo', + 'fa-fa-video-camera' => 'fas fa-video', + 'fa-fa-vimeo-square' => 'fab fa-vimeo-square', + 'fa-fa-vimeo' => 'fab fa-vimeo-v', + 'fa-fa-vine' => 'fab fa-vine', + 'fa-fa-vk' => 'fab fa-vk', + 'fa-fa-volume-control-phone' => 'fas fa-phone-volume', + 'fa-fa-warning' => 'fas fa-exclamation-triangle', + 'fa-fa-wechat' => 'fab fa-weixin', + 'fa-fa-weibo' => 'fab fa-weibo', + 'fa-fa-weixin' => 'fab fa-weixin', + 'fa-fa-whatsapp' => 'fab fa-whatsapp', + 'fa-fa-wheelchair-alt' => 'fab fa-accessible-icon', + 'fa-fa-wikipedia-w' => 'fab fa-wikipedia-w', + 'fa-fa-window-close-o' => 'far fa-window-close', + 'fa-fa-window-maximize' => 'far fa-window-maximize', + 'fa-fa-window-restore' => 'far fa-window-restore', + 'fa-fa-windows' => 'fab fa-windows', + 'fa-fa-won' => 'fas fa-won-sign', + 'fa-fa-wordpress' => 'fab fa-wordpress', + 'fa-fa-wpbeginner' => 'fab fa-wpbeginner', + 'fa-fa-wpexplorer' => 'fab fa-wpexplorer', + 'fa-fa-wpforms' => 'fab fa-wpforms', + 'fa-fa-xing-square' => 'fab fa-xing-square', + 'fa-fa-xing' => 'fab fa-xing', + 'fa-fa-y-combinator-square' => 'fab fa-hacker-news', + 'fa-fa-y-combinator' => 'fab fa-y-combinator', + 'fa-fa-yahoo' => 'fab fa-yahoo', + 'fa-fa-yc' => 'fab fa-y-combinator', + 'fa-fa-yc-square' => 'fab fa-hacker-news', + 'fa-fa-yelp' => 'fab fa-yelp', + 'fa-fa-yen' => 'fas fa-yen-sign', + 'fa-fa-yoast' => 'fab fa-yoast', + 'fa-fa-youtube-play' => 'fab fa-youtube', + 'fa-fa-youtube-square' => 'fab fa-youtube-square', + 'fa-fa-youtube' => 'fab fa-youtube', + 'fa-fa-fa' => 'fab fa-font-awesome', + ); + $font_awesome_icon = apply_filters( 'menu_icons_backward_compatibility_icons', $font_awesome_icon ); + + return $font_awesome_icon; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php new file mode 100644 index 00000000..3f674bf4 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/font-awesome/font-awesome.php @@ -0,0 +1,122 @@ +version + ); + } + + return $stylesheet_uri; + } + + + /** + * Icon picker fontawesome items. + * + * @param array $icons Icons. + * @return array Icons. + */ + public static function _icon_picker_fa_items( $icons ) { + if ( empty( $icons ) ) { + return $icons; + } + + $deprecated_icons = array_search( 'fa-tripadvisor', array_column( $icons, 'id' ), true ); + if ( false !== $deprecated_icons ) { + unset( $icons[ $deprecated_icons ] ); + $icons = array_values( $icons ); + } + + $font_awesome = font_awesome_backward_compatible(); + foreach ( $icons as $key => $icon ) { + $old_fa_icon = sprintf( 'fa-%s', $icons[ $key ]['id'] ); + if ( array_key_exists( $old_fa_icon, $font_awesome ) ) { + $icons[ $key ]['id'] = trim( $font_awesome[ $old_fa_icon ] ); + } else { + $icons[ $key ]['id'] = sprintf( 'fa %s', trim( $icons[ $key ]['id'] ) ); + } + } + + // Fa5 extra icons support. + $global_settins = get_option( 'menu-icons', false ); + if ( ! empty( $global_settins['global']['fa5_extra_icons'] ) ) { + $fa5_extra_icons = $global_settins['global']['fa5_extra_icons']; + $fa5_extra_icons = explode( ',', $fa5_extra_icons ); + $fa5_extra_icons = array_map( 'trim', $fa5_extra_icons ); + if ( ! empty( $fa5_extra_icons ) ) { + foreach ( $fa5_extra_icons as $fa5_icon ) { + $icon_name = explode( '-', $fa5_icon ); + $icon_name = end( $icon_name ); + $icons[] = array( + 'group' => 'all', + 'id' => $fa5_icon, + 'name' => $icon_name, + ); + } + } + } + + return $icons; + } + + + /** + * Icon picker font media template. + * + * @param string $template Media template. + * @return string Media template. + */ + public static function _icon_picker_font_media_templates( $template ) { + $templates = array( + 'icon' => '', + 'item' => sprintf( + '
        +
        + +
        {{ data.name }}
        +
        +
        +
        ', + esc_attr__( 'Deselect', 'icon-picker' ) + ), + ); + + return $templates; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php new file mode 100644 index 00000000..a63962ce --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/form-fields.php @@ -0,0 +1,575 @@ + + */ + +/** + * Form Fields + */ +abstract class Kucrut_Form_Field { + + /** + * Holds field & argument defaults + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'field' => array( + 'id' => '', + 'type' => 'text', + 'value' => null, + 'default' => null, + 'attributes' => array(), + 'description' => '', + 'choices' => array(), + ), + 'args' => array( + 'keys' => array(), + 'inline_description' => false, + ), + ); + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $types = array( + 'text' => 'Kucrut_Form_Field_Text', + 'number' => 'Kucrut_Form_Field_Text', + 'url' => 'Kucrut_Form_Field_Text', + 'color' => 'Kucrut_Form_Field_Text', + 'date' => 'Kucrut_Form_Field_Text', + 'hidden' => 'Kucrut_Form_Field_Text', + 'checkbox' => 'Kucrut_Form_Field_Checkbox', + 'radio' => 'Kucrut_Form_Field_Radio', + 'textarea' => 'Kucrut_Form_Field_Textarea', + 'select' => 'Kucrut_Form_Field_Select', + 'select_multiple' => 'Kucrut_Form_Field_Select_Multiple', + 'select_pages' => 'Kucrut_Form_Field_Select_Pages', + 'special' => 'Kucrut_Form_Field_Special', + ); + + /** + * Holds forbidden attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $forbidden_attributes = array( + 'id', + 'name', + 'value', + 'checked', + 'multiple', + ); + + /** + * Holds allowed html tags + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $allowed_html = array( + 'a' => array( + 'href' => true, + 'target' => true, + 'title' => true, + ), + 'code' => true, + 'em' => true, + 'p' => array( 'class' => true ), + 'span' => array( 'class' => true ), + 'strong' => true, + ); + + /** + * Holds constructed field + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $field; + + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $attributes = array(); + + + /** + * Loader + * + * @param string URL path to this directory + */ + final public static function load( $url_path = null ) { + // Set URL path for assets + if ( ! is_null( $url_path ) ) { + self::$url_path = $url_path; + } else { + self::$url_path = plugin_dir_url( __FILE__ ); + } + + // Supported field types + self::$types = apply_filters( + 'form_field_types', + self::$types + ); + } + + + /** + * Create field + * + * @param array $field Field array + * @param array $args Extra field arguments + */ + final public static function create( array $field, $args = array() ) { + $field = wp_parse_args( $field, self::$defaults['field'] ); + if ( ! isset( self::$types[ $field['type'] ] ) + || ! is_subclass_of( self::$types[ $field['type'] ], __CLASS__ ) + ) { + trigger_error( + sprintf( + esc_html__( '%1$s: Type %2$s is not supported, reverting to text.', 'menu-icons' ), + __CLASS__, + esc_html( $field['type'] ) + ), + E_USER_WARNING + ); + $field['type'] = 'text'; + } + + if ( is_null( $field['value'] ) && ! is_null( $field['default'] ) ) { + $field['value'] = $field['default']; + } + + foreach ( self::$forbidden_attributes as $key ) { + unset( $field['attributes'][ $key ] ); + } + + $args = (object) wp_parse_args( $args, self::$defaults['args'] ); + $class = self::$types[ $field['type'] ]; + + return new $class( $field, $args ); + } + + + /** + * Constructor + * + * @since 0.1.0 + * @param array $field Field array + * @param object $args Extra field arguments + */ + public function __construct( $field, $args ) { + $this->field = $field; + $this->args = $args; + + if ( ! is_array( $this->args->keys ) ) { + $this->args->keys = array(); + } + $this->args->keys[] = $field['id']; + + $this->attributes['id'] = $this->create_id(); + $this->attributes['name'] = $this->create_name(); + + $this->attributes = wp_parse_args( + $this->attributes, + (array) $field['attributes'] + ); + + $this->set_properties(); + } + + + /** + * Attribute + * + * @since 0.1.0 + * @param string $key Attribute key + * @return mixed NULL if attribute doesn't exist + */ + public function __get( $key ) { + foreach ( array( 'attributes', 'field' ) as $group ) { + if ( isset( $this->{$group}[ $key ] ) ) { + return $this->{$group}[ $key ]; + } + } + + return null; + } + + + /** + * Create id/name attribute + * + * @since 0.1.0 + * @param string $format Attribute format + */ + protected function create_id_name( $format ) { + return call_user_func_array( + 'sprintf', + array_merge( + array( $format ), + $this->args->keys + ) + ); + } + + + /** + * Create id attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_id() { + $format = implode( '-', $this->args->keys ); + + return $this->create_id_name( $format ); + } + + + /** + * Create name attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_name() { + $format = '%s'; + $format .= str_repeat( '[%s]', ( count( $this->args->keys ) - 1 ) ); + + return $this->create_id_name( $format ); + } + + + /** + * Set field properties + * + * @since 0.1.0 + */ + protected function set_properties() {} + + + /** + * Build field attributes + * + * @since 0.1.0 + * @param array $excludes Attributes to be excluded + * @return string + */ + protected function build_attributes( $excludes = array() ) { + $excludes = array_filter( (array) $excludes ); + $attributes = ''; + + foreach ( $this->attributes as $key => $value ) { + if ( in_array( $key, $excludes, true ) ) { + continue; + } + + if ( 'class' === $key ) { + $value = implode( ' ', (array) $value ); + } + + $attributes .= sprintf( + ' %s="%s"', + esc_attr( $key ), + esc_attr( $value ) + ); + } + + return $attributes; + } + + + /** + * Print field + * + * @since 0.1.0 + */ + abstract public function render(); + + + /** + * Print field description + * + * @since 0.1.0 + */ + public function description() { + if ( ! empty( $this->field['description'] ) ) { + $tag = ( ! empty( $this->args->inline_description ) ) ? 'span' : 'p'; + + printf( // WPCS: XSS ok. + '<%1$s class="description">%2$s', + $tag, + wp_kses( $this->field['description'], $this->allowed_html ) + ); + } + } +} + + +/** + * Field: text + */ +class Kucrut_Form_Field_Text extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + + if ( in_array( $this->field['type'], array( 'text', 'url' ), true ) ) { + if ( ! isset( $this->attributes['class'] ) ) { + $this->attributes['class'] = array(); + } + $this->attributes['class'] = array_unique( + array_merge( + array( 'regular-text' ), + $this->attributes['class'] + ) + ); + } + } + + + public function render() { + printf( // WPCS: xss ok + $this->template, + esc_attr( $this->field['type'] ), + esc_attr( $this->field['value'] ), + $this->build_attributes() + ); + $this->description(); + } +} + + +/** + * Field: Textarea + */ +class Kucrut_Form_Field_Textarea extends Kucrut_Form_Field { + + protected $template = '%s'; + + protected $attributes = array( + 'class' => 'widefat', + 'cols' => 50, + 'rows' => 5, + ); + + + public function render() { + printf( // WPCS: XSS ok. + $this->template, + $this->build_attributes(), + esc_textarea( $this->field['value'] ) + ); + } +} + + +/** + * Field: Checkbox + */ +class Kucrut_Form_Field_Checkbox extends Kucrut_Form_Field { + + protected $template = '
        '; + + + protected function set_properties() { + $this->field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + } + + + protected function checked( $value ) { + return checked( in_array( $value, $this->field['value'], true ), true, false ); + } + + + public function render() { + foreach ( $this->field['choices'] as $value => $label ) { + printf( // WPCS: XSS ok. + $this->template, + $this->field['type'], + esc_attr( $value ), + $this->checked( $value ), + $this->build_attributes( 'id' ), + esc_html( $label ) + ); + } + } +} + + +/** + * Field: Radio + */ +class Kucrut_Form_Field_Radio extends Kucrut_Form_Field_Checkbox { + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function checked( $value ) { + return checked( $value, $this->field['value'], false ); + } +} + + +/** + * Field: Select + */ +class Kucrut_Form_Field_Select extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function selected( $value ) { + return selected( ( $value === $this->field['value'] ), true, false ); + } + + + public function render() { + ?> + build_attributes() // xss ok ?>> + field['choices'] as $index => $choice ) : ?> + + template, + esc_attr( $value ), + $this->selected( $value ), + esc_html( $label ) + ); + ?> + + + field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + $this->attributes['multiple'] = 'multiple'; + } + + + protected function selected( $value ) { + return selected( in_array( $value, $this->field['value'], true ), true, false ); + } +} + + +/** + * Field: Select Pages + */ +class Kucrut_Form_Field_Select_Pages extends Kucrut_Form_Field_Select { + + protected $wp_dropdown_pages_args = array( + 'depth' => 0, + 'child_of' => 0, + 'option_none_value' => '', + ); + + + public function __construct( $field, $args ) { + $this->wp_dropdown_pages_args['show_option_none'] = __( '— Select —', 'menu-icons' ); + parent::__construct( $field, $args ); + } + + + public function set_properties() { + parent::set_properties(); + + if ( empty( $this->args->wp_dropdown_pages_args ) ) { + $this->args->wp_dropdown_pages_args = array(); + } + + // Apply defeaults + $this->args->wp_dropdown_pages_args = wp_parse_args( + $this->args->wp_dropdown_pages_args, + $this->wp_dropdown_pages_args + ); + + // Force some args + $this->args->wp_dropdown_pages_args = array_merge( + $this->args->wp_dropdown_pages_args, + array( + 'echo' => true, + 'name' => $this->attributes['name'], + 'id' => $this->attributes['id'], + 'selected' => $this->field['value'], + ) + ); + } + + + public function render() { + wp_dropdown_pages( $this->args->wp_dropdown_pages_args ); // WPCS: XSS ok. + } +} + + +/** + * Field: Special (Callback) + */ +class Kucrut_Form_Field_Special extends Kucrut_Form_Field { + public function render() { + call_user_func_array( + $this->field['render_cb'], + array( $this ) + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php new file mode 100644 index 00000000..7985369a --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/library/functions.php @@ -0,0 +1,111 @@ + + */ + + +if ( ! function_exists( 'kucrut_get_array_value_deep' ) ) { + /** + * Get value of a multidimensional array + * + * @since 0.1.0 + * @param array $array Haystack + * @param array $keys Needles + * @return mixed + */ + function kucrut_get_array_value_deep( array $array, array $keys ) { + if ( empty( $array ) || empty( $keys ) ) { + return $array; + } + + foreach ( $keys as $idx => $key ) { + unset( $keys[ $idx ] ); + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + if ( ! empty( $keys ) ) { + $array = $array[ $key ]; + } + } + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + return $array[ $key ]; + } +} + + +if ( ! function_exists( 'kucrut_validate' ) ) { + /** + * Validate settings values + * + * @param array $values Settings values + * @return array + */ + function kucrut_validate( $values, $sanitize_cb = 'wp_kses_data' ) { + foreach ( $values as $key => $value ) { + if ( is_array( $value ) ) { + $values[ $key ] = kucrut_validate( $value ); + } else { + $values[ $key ] = call_user_func_array( + $sanitize_cb, + array( $value ) + ); + } + } + + return $values; + } +} + + +if ( ! function_exists( 'kucrut_get_image_sizes' ) ) { + /** + * Get image sizes + * + * @since 0.9.0 + * @access protected + * @return array + */ + function kucrut_get_image_sizes() { + $_sizes = array( + 'thumbnail' => __( 'Thumbnail', 'menu-icons' ), + 'medium' => __( 'Medium', 'menu-icons' ), + 'large' => __( 'Large', 'menu-icons' ), + 'full' => __( 'Full Size', 'menu-icons' ), + ); + + $_sizes = apply_filters( 'image_size_names_choose', $_sizes ); + + $sizes = array(); + foreach ( $_sizes as $value => $label ) { + $sizes[] = array( + 'value' => $value, + 'label' => $label, + ); + } + + return $sizes; + } +} + + +if ( ! function_exists( 'kucrut_get_script_suffix' ) ) { + /** + * Get script & style suffix + * + * When SCRIPT_DEBUG is defined true, this will return '.min'. + * + * @return string + */ + function kucrut_get_script_suffix() { + return ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php new file mode 100644 index 00000000..4749e150 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/media-template.php @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ +final class Menu_Icons_Meta { + + const KEY = 'menu-icons'; + + /** + * Default meta value + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $defaults = array( + 'type' => '', + 'icon' => '', + 'url' => '', + ); + + + /** + * Initialize metadata functionalities + * + * @since 0.9.0 + */ + public static function init() { + add_filter( 'is_protected_meta', array( __CLASS__, '_protect_meta_key' ), 10, 3 ); + } + + + /** + * Protect meta key + * + * This prevents our meta key from showing up on Custom Fields meta box. + * + * @since 0.3.0 + * @wp_hook filter is_protected_meta + * @param bool $protected Protection status. + * @param string $meta_key Meta key. + * @param string $meta_type Meta type. + * @return bool Protection status. + */ + public static function _protect_meta_key( $protected, $meta_key, $meta_type ) { + if ( self::KEY === $meta_key ) { + $protected = true; + } + + return $protected; + } + + + /** + * Get menu item meta value + * + * @since 0.3.0 + * @since 0.9.0 Add $defaults parameter. + * @param int $id Menu item ID. + * @param array $defaults Optional. Default value. + * @return array + */ + public static function get( $id, $defaults = array() ) { + $defaults = wp_parse_args( $defaults, self::$defaults ); + $value = get_post_meta( $id, self::KEY, true ); + $value = wp_parse_args( (array) $value, $defaults ); + + if ( ! empty( $value['type'] ) && 'fa' === $value['type'] ) { + if ( ! empty( $value['icon'] ) && count( explode( ' ', $value['icon'] ) ) <= 1 ) { + $value['icon'] = sprintf( 'fa %s', $value['icon'] ); + } + } + + $font_awesome5 = font_awesome_backward_compatible(); + $icon = ! empty( $value['icon'] ) ? $value['icon'] : ''; + $icon = explode( ' ', $icon ); + $icon = sprintf( '%s-%s', reset( $icon ), end( $icon ) ); + + if ( ! empty( $font_awesome5[ $icon ] ) ) { + $value['icon'] = $font_awesome5[ $icon ]; + } + + // Backward-compatibility. + if ( empty( $value['icon'] ) && + ! empty( $value['type'] ) && + ! empty( $value[ "{$value['type']}-icon" ] ) + ) { + $value['icon'] = $value[ "{$value['type']}-icon" ]; + } + + if ( ! empty( $value['width'] ) ) { + $value['svg_width'] = $value['width']; + } + unset( $value['width'] ); + + if ( isset( $value['position'] ) && + ! in_array( $value['position'], array( 'before', 'after' ), true ) + ) { + $value['position'] = $defaults['position']; + } + + if ( isset( $value['size'] ) && ! isset( $value['font_size'] ) ) { + $value['font_size'] = $value['size']; + unset( $value['size'] ); + } + + // The values below will NOT be saved + if ( ! empty( $value['icon'] ) && + in_array( $value['type'], array( 'image', 'svg' ), true ) + ) { + $value['url'] = wp_get_attachment_image_url( $value['icon'], 'thumbnail', false ); + } + + return $value; + } + + + /** + * Update menu item metadata + * + * @since 0.9.0 + * + * @param int $id Menu item ID. + * @param mixed $value Metadata value. + * + * @return void + */ + public static function update( $id, $value ) { + /** + * Allow plugins/themes to filter the values + * + * Deprecated. + * + * @since 0.1.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $_value = apply_filters( 'menu_icons_values', $value, $id ); + + if ( $_value !== $value && WP_DEBUG ) { + _deprecated_function( 'menu_icons_values', '0.8.0', 'menu_icons_item_meta_values' ); + } + + /** + * Allow plugins/themes to filter the values + * + * @since 0.8.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $value = apply_filters( 'menu_icons_item_meta_values', $_value, $id ); + + // Don't bother saving if `type` or `icon` is not set. + if ( empty( $value['type'] ) || empty( $value['icon'] ) ) { + $value = false; + } + + // Update + if ( ! empty( $value ) ) { + update_post_meta( $id, self::KEY, $value ); + } else { + delete_post_meta( $id, self::KEY ); + } + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php new file mode 100644 index 00000000..f653abe6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/menu-icons/includes/picker.php @@ -0,0 +1,305 @@ + + */ + + +/** + * Nav menu admin + */ +final class Menu_Icons_Picker { + + /** + * Initialize class + * + * @since 0.1.0 + */ + public static function init() { + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ) ); + add_filter( 'wp_nav_menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 4 ); + add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 ); + add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 ); + add_filter( 'icon_picker_type_props', array( __CLASS__, '_add_extra_type_props_data' ), 10, 3 ); + + if ( ! version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) ) { + add_filter( + 'wp_edit_nav_menu_walker', function() { + return 'Menu_Item_Custom_Fields_Walker'; + }, 99 + ); + } + } + + + /** + * Load Icon Picker + * + * @since 0.9.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + Icon_Picker::instance()->load(); + + add_action( 'print_media_templates', array( __CLASS__, '_media_templates' ) ); + } + + + /** + * Get menu item setting fields + * + * @since 0.9.0 + * @access protected + * @param array $meta Menu item meta value. + * @return array + */ + protected static function _get_menu_item_fields( $meta ) { + $fa_icon = sprintf( '%s-%s', $meta['type'], $meta['icon'] ); + $font_awesome5 = font_awesome_backward_compatible(); + + if ( array_key_exists( $fa_icon, $font_awesome5 ) ) { + $fa5_icon = $font_awesome5[ $fa_icon ]; + $fa5_class = explode( ' ', $fa5_icon ); + $type = reset( $fa5_class ); + $icon = end( $fa5_class ); + $meta['icon'] = sprintf( '%s %s', $type, $icon ); + } + + $fields = array_merge( + array( + array( + 'id' => 'type', + 'label' => __( 'Type', 'menu-icons' ), + 'value' => $meta['type'], + ), + array( + 'id' => 'icon', + 'label' => __( 'Icon', 'menu-icons' ), + 'value' => $meta['icon'], + ), + ), + Menu_Icons_Settings::get_settings_fields( $meta ) + ); + + return $fields; + } + + + /** + * Print fields + * + * @since 0.1.0 + * @access protected + * @uses add_action() Calls 'menu_icons_before_fields' hook + * @uses add_action() Calls 'menu_icons_after_fields' hook + * @wp_hook action menu_item_custom_fields + * + * @param object $item Menu item data object. + * @param int $depth Nav menu depth. + * @param array $args Menu item args. + * @param int $id Nav menu ID. + * + * @return string Form fields + */ + public static function _fields( $id, $item, $depth, $args ) { + $input_id = sprintf( 'menu-icons-%d', $item->ID ); + $input_name = sprintf( 'menu-icons[%d]', $item->ID ); + $menu_settings = Menu_Icons_Settings::get_menu_settings( Menu_Icons_Settings::get_current_menu_id() ); + $meta = Menu_Icons_Meta::get( $item->ID, $menu_settings ); + $fields = self::_get_menu_item_fields( $meta ); + ?> + + id ) { + return; + } + + check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); + + // Sanitize + if ( ! empty( $_POST['menu-icons'][ $menu_item_db_id ] ) ) { + $value = array_map( + 'sanitize_text_field', + wp_unslash( (array) $_POST['menu-icons'][ $menu_item_db_id ] ) + ); + } else { + $value = array(); + } + + Menu_Icons_Meta::update( $menu_item_db_id, $value ); + } + + + /** + * Get and print media templates from all types + * + * @since 0.2.0 + * @since 0.9.0 Deprecate menu_icons_media_templates filter. + * @wp_hook action print_media_templates + */ + public static function _media_templates() { + $id_prefix = 'tmpl-menu-icons'; + + // Deprecated. + $templates = apply_filters( 'menu_icons_media_templates', array() ); + + if ( ! empty( $templates ) ) { + if ( WP_DEBUG ) { + _deprecated_function( 'menu_icons_media_templates', '0.9.0', 'menu_icons_js_templates' ); + } + + foreach ( $templates as $key => $template ) { + $id = sprintf( '%s-%s', $id_prefix, $key ); + self::_print_tempate( $id, $template ); + } + } + + require_once dirname( __FILE__ ) . '/media-template.php'; + } + + + /** + * Print media template + * + * @since 0.2.0 + * @param string $id Template ID. + * @param string $template Media template HTML. + */ + protected static function _print_tempate( $id, $template ) { + ?> + + + */ + +/** + * Menu Icons Settings module + */ +final class Menu_Icons_Settings { + + const UPDATE_KEY = 'menu-icons-settings-update'; + + const RESET_KEY = 'menu-icons-settings-reset'; + + const TRANSIENT_KEY = 'menu_icons_message'; + + /** + * Default setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'global' => array( + 'icon_types' => array( 'dashicons' ), + ), + ); + + /** + * Setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $settings = array(); + + /** + * Script dependencies + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $script_deps = array( 'jquery' ); + + /** + * Settings init + * + * @since 0.3.0 + */ + public static function init() { + // Include Menu Icons for Block Editor + if ( class_exists( '\ThemeIsle\GutenbergMenuIcons' ) ) { + \ThemeIsle\GutenbergMenuIcons::instance(); + add_action( 'enqueue_block_assets', array( __CLASS__, '_enqueue_font_awesome' ) ); + } + + /** + * Allow themes/plugins to override the default settings + * + * @since 0.9.0 + * + * @param array $default_settings Default settings. + */ + self::$defaults = apply_filters( 'menu_icons_settings_defaults', self::$defaults ); + + self::$settings = get_option( 'menu-icons', self::$defaults ); + + foreach ( self::$settings as $key => &$value ) { + if ( 'global' === $key ) { + // Remove unregistered icon types. + $value['icon_types'] = array_values( + array_intersect( + array_keys( Menu_Icons::get( 'types' ) ), + array_filter( (array) $value['icon_types'] ) + ) + ); + } else { + // Backward-compatibility. + if ( isset( $value['width'] ) && ! isset( $value['svg_width'] ) ) { + $value['svg_width'] = $value['width']; + } + + unset( $value['width'] ); + } + } + + unset( $value ); + + /** + * Allow themes/plugins to override the settings + * + * @since 0.9.0 + * + * @param array $settings Menu Icons settings. + */ + self::$settings = apply_filters( 'menu_icons_settings', self::$settings ); + + if ( self::is_menu_icons_disabled_for_menu() ) { + return; + } + + if ( ! empty( self::$settings['global']['icon_types'] ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/picker.php'; + Menu_Icons_Picker::init(); + self::$script_deps[] = 'icon-picker'; + } + + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ), 1 ); + add_action( 'wp_ajax_menu_icons_update_settings', array( __CLASS__, '_ajax_menu_icons_update_settings' ) ); + } + + /** + * Check if menu icons is disabled for a menu + * + * @since 0.8.0 + * + * @param int $menu_id Menu ID. Defaults to current menu being edited. + * + * @return bool + */ + public static function is_menu_icons_disabled_for_menu( $menu_id = 0 ) { + if ( empty( $menu_id ) ) { + $menu_id = self::get_current_menu_id(); + } + + // When we're creating a new menu or the recently edited menu + // could not be found. + if ( empty( $menu_id ) ) { + return true; + } + + $menu_settings = self::get_menu_settings( $menu_id ); + $is_disabled = ! empty( $menu_settings['disabled'] ); + + return $is_disabled; + } + + /** + * Get ID of menu being edited + * + * @since 0.7.0 + * @since 0.8.0 Get the recently edited menu from user option. + * + * @return int + */ + public static function get_current_menu_id() { + global $nav_menu_selected_id; + + if ( ! empty( $nav_menu_selected_id ) ) { + return $nav_menu_selected_id; + } + + if ( is_admin() && isset( $_REQUEST['menu'] ) ) { + $menu_id = absint( $_REQUEST['menu'] ); + } else { + $menu_id = absint( get_user_option( 'nav_menu_recently_edited' ) ); + } + + return $menu_id; + } + + /** + * Get menu settings + * + * @since 0.3.0 + * + * @param int $menu_id + * + * @return array + */ + public static function get_menu_settings( $menu_id ) { + $menu_settings = self::get( sprintf( 'menu_%d', $menu_id ) ); + $menu_settings = apply_filters( 'menu_icons_menu_settings', $menu_settings, $menu_id ); + + if ( ! is_array( $menu_settings ) ) { + $menu_settings = array(); + } + + return $menu_settings; + } + + /** + * Get setting value + * + * @since 0.3.0 + * @return mixed + */ + public static function get() { + $args = func_get_args(); + + return kucrut_get_array_value_deep( self::$settings, $args ); + } + + /** + * Prepare wp-admin/nav-menus.php page + * + * @since 0.3.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + add_action( 'admin_enqueue_scripts', array( __CLASS__, '_enqueue_assets' ), 99 ); + + /** + * Allow settings meta box to be disabled. + * + * @since 0.4.0 + * + * @param bool $disabled Defaults to FALSE. + */ + $settings_disabled = apply_filters( 'menu_icons_disable_settings', false ); + if ( true === $settings_disabled ) { + return; + } + + self::_maybe_update_settings(); + self::_add_settings_meta_box(); + + add_action( 'admin_notices', array( __CLASS__, '_admin_notices' ) ); + } + + /** + * Update settings + * + * @since 0.3.0 + */ + public static function _maybe_update_settings() { + if ( ! empty( $_POST['menu-icons']['settings'] ) ) { + check_admin_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_redirect( $redirect_url ); + } elseif ( ! empty( $_REQUEST[ self::RESET_KEY ] ) ) { + check_admin_referer( self::RESET_KEY, self::RESET_KEY ); + wp_redirect( self::_reset_settings() ); + } + } + + /** + * Update settings + * + * @since 0.7.0 + * @access protected + * + * @param array $values Settings values. + * + * @return string Redirect URL. + */ + protected static function _update_settings( $values ) { + update_option( + 'menu-icons', + wp_parse_args( + kucrut_validate( $values ), + self::$settings + ) + ); + set_transient( self::TRANSIENT_KEY, 'updated', 30 ); + + $redirect_url = remove_query_arg( + array( 'menu-icons-reset' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Reset settings + * + * @since 0.7.0 + * @access protected + * @return string Redirect URL. + */ + protected static function _reset_settings() { + delete_option( 'menu-icons' ); + set_transient( self::TRANSIENT_KEY, 'reset', 30 ); + + $redirect_url = remove_query_arg( + array( self::RESET_KEY, 'menu-icons-updated' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Settings meta box + * + * @since 0.3.0 + * @access private + */ + private static function _add_settings_meta_box() { + add_meta_box( + 'menu-icons-settings', + __( 'Menu Icons Settings', 'menu-icons' ), + array( __CLASS__, '_meta_box' ), + 'nav-menus', + 'side', + 'low', + array() + ); + } + + /** + * Update settings via ajax + * + * @since 0.7.0 + * @wp_hook action wp_ajax_menu_icons_update_settings + */ + public static function _ajax_menu_icons_update_settings() { + check_ajax_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + if ( empty( $_POST['menu-icons']['settings'] ) ) { + wp_send_json_error(); + } + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_send_json_success( array( 'redirectUrl' => $redirect_url ) ); + } + + /** + * Print admin notices + * + * @since 0.3.0 + * @wp_hook action admin_notices + */ + public static function _admin_notices() { + $messages = array( + 'updated' => __( 'Menu Icons Settings have been successfully updated.', 'menu-icons' ), + 'reset' => __( 'Menu Icons Settings have been successfully reset.', 'menu-icons' ), + ); + + $message_type = get_transient( self::TRANSIENT_KEY ); + + if ( ! empty( $message_type ) && ! empty( $messages[ $message_type ] ) ) { + printf( + '

        %s

        ', + wp_kses( $messages[ $message_type ], array( 'strong' => true ) ) + ); + } + + delete_transient( self::TRANSIENT_KEY ); + } + + /** + * Settings meta box + * + * @since 0.3.0 + */ + public static function _meta_box() { + ?> +
        + + $section ) : ?> + + + +
        +

        + + + %s', + esc_url( + wp_nonce_url( + admin_url( '/nav-menus.php' ), + self::RESET_KEY, + self::RESET_KEY + ) + ), + esc_attr__( 'Discard all changes and reset to default state', 'menu-icons' ), + esc_html__( 'Reset', 'menu-icons' ) + ); + ?> + + + + + + +

        + array( + 'id' => 'global', + 'title' => __( 'Global', 'menu-icons' ), + 'description' => __( 'Global settings', 'menu-icons' ), + 'fields' => array( + array( + 'id' => 'icon_types', + 'type' => 'checkbox', + 'label' => __( 'Icon Types', 'menu-icons' ), + 'choices' => $icon_types, + 'value' => self::get( 'global', 'icon_types' ), + ), + array( + 'id' => 'fa5_extra_icons', + 'type' => 'textarea', + 'label' => __( 'FA Custom Icon Classes', 'menu-icons' ), + 'value' => self::get( 'global', 'fa5_extra_icons' ), + 'help_text' => '( comma separated icons )', + ), + ), + 'args' => array(), + ), + ); + + if ( ! empty( $menu_id ) ) { + $menu_term = get_term( $menu_id, 'nav_menu' ); + $menu_key = sprintf( 'menu_%d', $menu_id ); + $menu_settings = self::get_menu_settings( $menu_id ); + + $sections['menu'] = array( + 'id' => $menu_key, + 'title' => __( 'Current Menu', 'menu-icons' ), + 'description' => sprintf( + __( '"%s" menu settings', 'menu-icons' ), + apply_filters( 'single_term_title', $menu_term->name ) + ), + 'fields' => self::get_settings_fields( $menu_settings ), + 'args' => array( 'inline_description' => true ), + ); + } + + return apply_filters( 'menu_icons_settings_sections', $sections, $menu_id ); + } + + /** + * Get settings fields + * + * @since 0.4.0 + * + * @param array $values Values to be applied to each field. + * + * @uses apply_filters() Calls 'menu_icons_settings_fields'. + * @return array + */ + public static function get_settings_fields( array $values = array() ) { + $fields = array( + 'hide_label' => array( + 'id' => 'hide_label', + 'type' => 'select', + 'label' => __( 'Hide Label', 'menu-icons' ), + 'default' => '', + 'choices' => array( + array( + 'value' => '', + 'label' => __( 'No', 'menu-icons' ), + ), + array( + 'value' => '1', + 'label' => __( 'Yes', 'menu-icons' ), + ), + ), + ), + 'position' => array( + 'id' => 'position', + 'type' => 'select', + 'label' => __( 'Position', 'menu-icons' ), + 'default' => 'before', + 'choices' => array( + array( + 'value' => 'before', + 'label' => __( 'Before', 'menu-icons' ), + ), + array( + 'value' => 'after', + 'label' => __( 'After', 'menu-icons' ), + ), + ), + ), + 'vertical_align' => array( + 'id' => 'vertical_align', + 'type' => 'select', + 'label' => __( 'Vertical Align', 'menu-icons' ), + 'default' => 'middle', + 'choices' => array( + array( + 'value' => 'super', + 'label' => __( 'Super', 'menu-icons' ), + ), + array( + 'value' => 'top', + 'label' => __( 'Top', 'menu-icons' ), + ), + array( + 'value' => 'text-top', + 'label' => __( 'Text Top', 'menu-icons' ), + ), + array( + 'value' => 'middle', + 'label' => __( 'Middle', 'menu-icons' ), + ), + array( + 'value' => 'baseline', + 'label' => __( 'Baseline', 'menu-icons' ), + ), + array( + 'value' => 'text-bottom', + 'label' => __( 'Text Bottom', 'menu-icons' ), + ), + array( + 'value' => 'bottom', + 'label' => __( 'Bottom', 'menu-icons' ), + ), + array( + 'value' => 'sub', + 'label' => __( 'Sub', 'menu-icons' ), + ), + ), + ), + 'font_size' => array( + 'id' => 'font_size', + 'type' => 'number', + 'label' => __( 'Font Size', 'menu-icons' ), + 'default' => '1.2', + 'description' => 'em', + 'attributes' => array( + 'min' => '0.1', + 'step' => '0.1', + ), + ), + 'svg_width' => array( + 'id' => 'svg_width', + 'type' => 'number', + 'label' => __( 'SVG Width', 'menu-icons' ), + 'default' => '1', + 'description' => 'em', + 'attributes' => array( + 'min' => '.5', + 'step' => '.1', + ), + ), + 'image_size' => array( + 'id' => 'image_size', + 'type' => 'select', + 'label' => __( 'Image Size', 'menu-icons' ), + 'default' => 'thumbnail', + 'choices' => kucrut_get_image_sizes(), + ), + ); + + $fields = apply_filters( 'menu_icons_settings_fields', $fields ); + + foreach ( $fields as &$field ) { + if ( isset( $values[ $field['id'] ] ) ) { + $field['value'] = $values[ $field['id'] ]; + } + + if ( ! isset( $field['value'] ) && isset( $field['default'] ) ) { + $field['value'] = $field['default']; + } + } + + unset( $field ); + + return $fields; + } + + /** + * Get processed settings fields + * + * @since 0.3.0 + * @access private + * @return array + */ + private static function _get_fields() { + if ( ! class_exists( 'Kucrut_Form_Field' ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/library/form-fields.php'; + } + + $keys = array( 'menu-icons', 'settings' ); + $sections = self::get_fields(); + + foreach ( $sections as &$section ) { + $_keys = array_merge( $keys, array( $section['id'] ) ); + $_args = array_merge( array( 'keys' => $_keys ), $section['args'] ); + + foreach ( $section['fields'] as &$field ) { + $field = Kucrut_Form_Field::create( $field, $_args ); + } + + unset( $field ); + } + + unset( $section ); + + return $sections; + } + + /** + * Enqueue scripts & styles for Block Icons + * + * @since 0.3.0 + * @wp_hook action enqueue_block_assets + */ + public static function _enqueue_font_awesome() { + $url = Menu_Icons::get( 'url' ); + + wp_register_style( + 'font-awesome-5', + "{$url}css/fontawesome/css/all.min.css" + ); + } + + /** + * Enqueue scripts & styles for Appearance > Menus page + * + * @since 0.3.0 + * @wp_hook action admin_enqueue_scripts + */ + public static function _enqueue_assets() { + $url = Menu_Icons::get( 'url' ); + $suffix = kucrut_get_script_suffix(); + + if ( defined( 'MENU_ICONS_SCRIPT_DEBUG' ) && MENU_ICONS_SCRIPT_DEBUG ) { + $script_url = '//localhost:8081/'; + } else { + $script_url = $url; + } + + wp_enqueue_style( + 'menu-icons', + "{$url}css/admin{$suffix}.css", + false, + Menu_Icons::VERSION + ); + + wp_enqueue_script( + 'menu-icons', + "{$script_url}js/admin{$suffix}.js", + self::$script_deps, + Menu_Icons::VERSION, + true + ); + + $customizer_url = add_query_arg( + array( + 'autofocus[section]' => 'custom_css', + 'return' => admin_url( 'nav-menus.php' ), + ), + admin_url( 'customize.php' ) + ); + + /** + * Allow plugins/themes to filter the settings' JS data + * + * @since 0.9.0 + * + * @param array $js_data JS Data. + */ + $menu_current_theme = ''; + $theme = wp_get_theme(); + if ( ! empty( $theme ) ) { + if ( is_child_theme() && $theme->parent() ) { + $menu_current_theme = $theme->parent()->get( 'Name' ); + } else { + $menu_current_theme = $theme->get( 'Name' ); + } + } + $upsell_notices = array(); + $box_data = ' + + + + + + = $failed_attempt_limit; + } + + /** + * Reset a compromised password. + * + * If we know that the the password is compromised, we have the responsibility to reset it and inform the + * user. `get_user_time_delay()` mitigates brute force attempts, but this acts as an extra layer of defense + * which guarantees that attackers can't brute force it (unless they compromise the new password). + * + * @param WP_User $user The user who failed to login + */ + public static function reset_compromised_password( $user ) { + // Unhook because `wp_password_change_notification()` wouldn't notify the site admin when + // their password is compromised. + remove_action( 'after_password_reset', 'wp_password_change_notification' ); + reset_password( $user, wp_generate_password( 25 ) ); + update_user_meta( $user->ID, self::USER_PASSWORD_WAS_RESET_KEY, true ); + add_action( 'after_password_reset', 'wp_password_change_notification' ); + + self::delete_login_nonce( $user->ID ); + delete_user_meta( $user->ID, self::USER_RATE_LIMIT_KEY ); + delete_user_meta( $user->ID, self::USER_FAILED_LOGIN_ATTEMPTS_KEY ); + } + + /** + * Notify the user and admin that a password was reset for being compromised. + * + * @param WP_User $user The user whose password should be reset + */ + public static function send_password_reset_emails( $user ) { + self::notify_user_password_reset( $user ); + + /** + * Filters whether or not to email the site admin when a user's password has been + * compromised and reset. + * + * @param bool $reset `true` to notify the admin, `false` to not notify them. + */ + $notify_admin = apply_filters( 'two_factor_notify_admin_user_password_reset', true ); + $admin_email = get_option( 'admin_email' ); + + if ( $notify_admin && $admin_email !== $user->user_email ) { + self::notify_admin_user_password_reset( $user ); + } + } + + /** + * Notify the user that their password has been compromised and reset. + * + * @param WP_User $user The user to notify + * + * @return bool `true` if the email was sent, `false` if it failed. + */ + public static function notify_user_password_reset( $user ) { + $user_message = sprintf( + 'Hello %1$s, an unusually high number of failed login attempts have been detected on your account at %2$s. + + These attempts successfully entered your password, and were only blocked because they failed to enter your second authentication factor. Despite not being able to access your account, this behavior indicates that the attackers have compromised your password. The most common reasons for this are that your password was easy to guess, or was reused on another site which has been compromised. + + To protect your account, your password has been reset, and you will need to create a new one. For advice on setting a strong password, please read %3$s + + To pick a new password, please visit %4$s + + This is an automated notification. If you would like to speak to a site administrator, please contact them directly.', + esc_html( $user->user_login ), + home_url(), + 'https://wordpress.org/documentation/article/password-best-practices/', + esc_url( add_query_arg( 'action', 'lostpassword', wp_login_url() ) ) + ); + $user_message = str_replace( "\t", '', $user_message ); + + return wp_mail( $user->user_email, 'Your password was compromised and has been reset', $user_message ); + } + + /** + * Notify the admin that a user's password was compromised and reset. + * + * @param WP_User $user The user whose password was reset. + * + * @return bool `true` if the email was sent, `false` if it failed. + */ + public static function notify_admin_user_password_reset( $user ) { + $admin_email = get_option( 'admin_email' ); + $subject = sprintf( 'Compromised password for %s has been reset', esc_html( $user->user_login ) ); + + $message = sprintf( + 'Hello, this is a notice from the Two Factor plugin to inform you that an unusually high number of failed login attempts have been detected on the %1$s account (ID %2$d). + + Those attempts successfully entered the user\'s password, and were only blocked because they entered invalid second authentication factors. + + To protect their account, the password has automatically been reset, and they have been notified that they will need to create a new one. + + If you do not wish to receive these notifications, you can disable them with the `two_factor_notify_admin_user_password_reset` filter. See %3$s for more information. + + Thank you', + esc_html( $user->user_login ), + $user->ID, + 'https://developer.wordpress.org/plugins/hooks/' + ); + $message = str_replace( "\t", '', $message ); + + return wp_mail( $admin_email, $subject, $message ); + } + + /** + * Show the password reset error when on the login screen. + */ + public static function show_password_reset_error() { + $error = new WP_Error( + 'too_many_attempts', + sprintf( + '

        %s

        +

        %s

        ', + __( 'There have been too many failed two-factor authentication attempts, which often indicates that the password has been compromised. The password has been reset in order to protect the account.', 'two-factor' ), + __( 'If you are the owner of this account, please check your email for instructions on regaining access.', 'two-factor' ) + ) + ); + + login_header( __( 'Password Reset', 'two-factor' ), '', $error ); + login_footer(); + } + + /** + * Filter the columns on the Users admin screen. + * + * @param array $columns Available columns. + * @return array Updated array of columns. + */ + public static function filter_manage_users_columns( array $columns ) { + $columns['two-factor'] = __( 'Two-Factor', 'two-factor' ); + return $columns; + } + + /** + * Output the 2FA column data on the Users screen. + * + * @param string $output The column output. + * @param string $column_name The column ID. + * @param int $user_id The user ID. + * @return string The column output. + */ + public static function manage_users_custom_column( $output, $column_name, $user_id ) { + + if ( 'two-factor' !== $column_name ) { + return $output; + } + + if ( ! self::is_user_using_two_factor( $user_id ) ) { + return sprintf( '%s', esc_html__( 'Disabled', 'two-factor' ) ); + } else { + $provider = self::get_primary_provider_for_user( $user_id ); + return esc_html( $provider->get_label() ); + } + + } + + /** + * Add user profile fields. + * + * This executes during the `show_user_profile` & `edit_user_profile` actions. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public static function user_two_factor_options( $user ) { + wp_enqueue_style( 'user-edit-2fa', plugins_url( 'user-edit.css', __FILE__ ), array(), TWO_FACTOR_VERSION ); + + $enabled_providers = array_keys( self::get_available_providers_for_user( $user ) ); + $primary_provider = self::get_primary_provider_for_user( $user->ID ); + + if ( ! empty( $primary_provider ) && is_object( $primary_provider ) ) { + $primary_provider_key = get_class( $primary_provider ); + } else { + $primary_provider_key = null; + } + + wp_nonce_field( 'user_two_factor_options', '_nonce_user_two_factor_options', false ); + + ?> + + + + + + +
        + + + + + + + + + + + + $object ) : ?> + + + + + + + +
        /> /> + + +
        +
        + } + */ +u2f.Transports; + +/** + * Data object for a single sign request. + * @typedef {{ + * version: string, + * challenge: string, + * keyHandle: string, + * appId: string + * }} + */ +u2f.SignRequest; + + +/** + * Data object for a sign response. + * @typedef {{ + * keyHandle: string, + * signatureData: string, + * clientData: string + * }} + */ +u2f.SignResponse; + + +/** + * Data object for a registration request. + * @typedef {{ + * version: string, + * challenge: string + * }} + */ +u2f.RegisterRequest; + + +/** + * Data object for a registration response. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: Transports, + * appId: string + * }} + */ +u2f.RegisterResponse; + + +/** + * Data object for a registered key. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: ?Transports, + * appId: ?string + * }} + */ +u2f.RegisteredKey; + + +/** + * Data object for a get API register response. + * @typedef {{ + * js_api_version: number + * }} + */ +u2f.GetJsApiVersionResponse; + + +//Low level MessagePort API support + +/** + * Sets up a MessagePort to the U2F extension using the + * available mechanisms. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + */ +u2f.getMessagePort = function(callback) { + if (typeof chrome != 'undefined' && chrome.runtime) { + // The actual message here does not matter, but we need to get a reply + // for the callback to run. Thus, send an empty signature request + // in order to get a failure response. + var msg = { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: [] + }; + chrome.runtime.sendMessage(u2f.EXTENSION_ID, msg, function() { + if (!chrome.runtime.lastError) { + // We are on a whitelisted origin and can talk directly + // with the extension. + u2f.getChromeRuntimePort_(callback); + } else { + // chrome.runtime was available, but we couldn't message + // the extension directly, use iframe + u2f.getIframePort_(callback); + } + }); + } else if (u2f.isAndroidChrome_()) { + u2f.getAuthenticatorPort_(callback); + } else if (u2f.isIosChrome_()) { + u2f.getIosPort_(callback); + } else { + // chrome.runtime was not available at all, which is normal + // when this origin doesn't have access to any extensions. + u2f.getIframePort_(callback); + } +}; + +/** + * Detect chrome running on android based on the browser's useragent. + * @private + */ +u2f.isAndroidChrome_ = function() { + var userAgent = navigator.userAgent; + return userAgent.indexOf('Chrome') != -1 && + userAgent.indexOf('Android') != -1; +}; + +/** + * Detect chrome running on iOS based on the browser's platform. + * @private + */ +u2f.isIosChrome_ = function() { + return ["iPhone", "iPad", "iPod"].indexOf(navigator.platform) > -1; +}; + +/** + * Connects directly to the extension via chrome.runtime.connect. + * @param {function(u2f.WrappedChromeRuntimePort_)} callback + * @private + */ +u2f.getChromeRuntimePort_ = function(callback) { + var port = chrome.runtime.connect(u2f.EXTENSION_ID, + {'includeTlsChannelId': true}); + setTimeout(function() { + callback(new u2f.WrappedChromeRuntimePort_(port)); + }, 0); +}; + +/** + * Return a 'port' abstraction to the Authenticator app. + * @param {function(u2f.WrappedAuthenticatorPort_)} callback + * @private + */ +u2f.getAuthenticatorPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedAuthenticatorPort_()); + }, 0); +}; + +/** + * Return a 'port' abstraction to the iOS client app. + * @param {function(u2f.WrappedIosPort_)} callback + * @private + */ +u2f.getIosPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedIosPort_()); + }, 0); +}; + +/** + * A wrapper for chrome.runtime.Port that is compatible with MessagePort. + * @param {Port} port + * @constructor + * @private + */ +u2f.WrappedChromeRuntimePort_ = function(port) { + this.port_ = port; +}; + +/** + * Format and return a sign request compliant with the JS API version supported by the extension. + * @param {Array} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ +u2f.formatSignRequest_ = + function(appId, challenge, registeredKeys, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API. + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: challenge, + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: signRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API. + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + appId: appId, + challenge: challenge, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; +}; + +/** + * Format and return a register request compliant with the JS API version supported by the extension.. + * @param {Array} signRequests + * @param {Array} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ +u2f.formatRegisterRequest_ = + function(appId, registeredKeys, registerRequests, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API. + for (var i = 0; i < registerRequests.length; i++) { + registerRequests[i].appId = appId; + } + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: registerRequests[0], + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + signRequests: signRequests, + registerRequests: registerRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API. + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + appId: appId, + registerRequests: registerRequests, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; +}; + + +/** + * Posts a message on the underlying channel. + * @param {Object} message + */ +u2f.WrappedChromeRuntimePort_.prototype.postMessage = function(message) { + this.port_.postMessage(message); +}; + + +/** + * Emulates the HTML 5 addEventListener interface. Works only for the + * onmessage event, which is hooked up to the chrome.runtime.Port.onMessage. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedChromeRuntimePort_.prototype.addEventListener = + function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message' || name == 'onmessage') { + this.port_.onMessage.addListener(function(message) { + // Emulate a minimal MessageEvent object. + handler({'data': message}); + }); + } else { + console.error('WrappedChromeRuntimePort only supports onMessage'); + } +}; + +/** + * Wrap the Authenticator app with a MessagePort interface. + * @constructor + * @private + */ +u2f.WrappedAuthenticatorPort_ = function() { + this.requestId_ = -1; + this.requestObject_ = null; +} + +/** + * Launch the Authenticator intent. + * @param {Object} message + */ +u2f.WrappedAuthenticatorPort_.prototype.postMessage = function(message) { + var intentUrl = + u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ + + ';S.request=' + encodeURIComponent(JSON.stringify(message)) + + ';end'; + document.location = intentUrl; +}; + +/** + * Tells what type of port this is. + * @return {String} port type + */ +u2f.WrappedAuthenticatorPort_.prototype.getPortType = function() { + return "WrappedAuthenticatorPort_"; +}; + + +/** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedAuthenticatorPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message') { + var self = this; + /* Register a callback to that executes when + * chrome injects the response. */ + window.addEventListener( + 'message', self.onRequestUpdate_.bind(self, handler), false); + } else { + console.error('WrappedAuthenticatorPort only supports message'); + } +}; + +/** + * Callback invoked when a response is received from the Authenticator. + * @param function({data: Object}) callback + * @param {Object} message message Object + */ +u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_ = + function(callback, message) { + var messageObject = JSON.parse(message.data); + var intentUrl = messageObject['intentURL']; + + var errorCode = messageObject['errorCode']; + var responseObject = null; + if (messageObject.hasOwnProperty('data')) { + responseObject = /** @type {Object} */ ( + JSON.parse(messageObject['data'])); + } + + callback({'data': responseObject}); +}; + +/** + * Base URL for intents to Authenticator. + * @const + * @private + */ +u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ = + 'intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE'; + +/** + * Wrap the iOS client app with a MessagePort interface. + * @constructor + * @private + */ +u2f.WrappedIosPort_ = function() {}; + +/** + * Launch the iOS client app request + * @param {Object} message + */ +u2f.WrappedIosPort_.prototype.postMessage = function(message) { + var str = JSON.stringify(message); + var url = "u2f://auth?" + encodeURI(str); + location.replace(url); +}; + +/** + * Tells what type of port this is. + * @return {String} port type + */ +u2f.WrappedIosPort_.prototype.getPortType = function() { + return "WrappedIosPort_"; +}; + +/** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ +u2f.WrappedIosPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name !== 'message') { + console.error('WrappedIosPort only supports message'); + } +}; + +/** + * Sets up an embedded trampoline iframe, sourced from the extension. + * @param {function(MessagePort)} callback + * @private + */ +u2f.getIframePort_ = function(callback) { + // Create the iframe + var iframeOrigin = 'chrome-extension://' + u2f.EXTENSION_ID; + var iframe = document.createElement('iframe'); + iframe.src = iframeOrigin + '/u2f-comms.html'; + iframe.setAttribute('style', 'display:none'); + document.body.appendChild(iframe); + + var channel = new MessageChannel(); + var ready = function(message) { + if (message.data == 'ready') { + channel.port1.removeEventListener('message', ready); + callback(channel.port1); + } else { + console.error('First event on iframe port was not "ready"'); + } + }; + channel.port1.addEventListener('message', ready); + channel.port1.start(); + + iframe.addEventListener('load', function() { + // Deliver the port to the iframe and initialize + iframe.contentWindow.postMessage('init', iframeOrigin, [channel.port2]); + }); +}; + + +//High-level JS API + +/** + * Default extension response timeout in seconds. + * @const + */ +u2f.EXTENSION_TIMEOUT_SEC = 30; + +/** + * A singleton instance for a MessagePort to the extension. + * @type {MessagePort|u2f.WrappedChromeRuntimePort_} + * @private + */ +u2f.port_ = null; + +/** + * Callbacks waiting for a port + * @type {Array} + * @private + */ +u2f.waitingForPort_ = []; + +/** + * A counter for requestIds. + * @type {number} + * @private + */ +u2f.reqCounter_ = 0; + +/** + * A map from requestIds to client callbacks + * @type {Object.} + * @private + */ +u2f.callbackMap_ = {}; + +/** + * Creates or retrieves the MessagePort singleton to use. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + * @private + */ +u2f.getPortSingleton_ = function(callback) { + if (u2f.port_) { + callback(u2f.port_); + } else { + if (u2f.waitingForPort_.length == 0) { + u2f.getMessagePort(function(port) { + u2f.port_ = port; + u2f.port_.addEventListener('message', + /** @type {function(Event)} */ (u2f.responseHandler_)); + + // Careful, here be async callbacks. Maybe. + while (u2f.waitingForPort_.length) + u2f.waitingForPort_.shift()(u2f.port_); + }); + } + u2f.waitingForPort_.push(callback); + } +}; + +/** + * Handles response messages from the extension. + * @param {MessageEvent.} message + * @private + */ +u2f.responseHandler_ = function(message) { + var response = message.data; + var reqId = response['requestId']; + if (!reqId || !u2f.callbackMap_[reqId]) { + console.error('Unknown or missing requestId in response.'); + return; + } + var cb = u2f.callbackMap_[reqId]; + delete u2f.callbackMap_[reqId]; + cb(response['responseData']); +}; + +/** + * Dispatches an array of sign requests to available U2F tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the sign request. + * @param {string=} appId + * @param {string=} challenge + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sign = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual sign request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0 : response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual sign request in the supported API version. + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + } +}; + +/** + * Dispatches an array of sign requests to available U2F tokens. + * @param {string=} appId + * @param {string=} challenge + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sendSignRequest = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatSignRequest_(appId, challenge, registeredKeys, timeoutSeconds, reqId); + port.postMessage(req); + }); +}; + +/** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the register request. + * @param {string=} appId + * @param {Array} registerRequests + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.register = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual register request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0: response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual register request in the supported API version. + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + } +}; + +/** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * @param {string=} appId + * @param {Array} registerRequests + * @param {Array} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.sendRegisterRequest = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatRegisterRequest_( + appId, registeredKeys, registerRequests, timeoutSeconds, reqId); + port.postMessage(req); + }); +}; + + +/** + * Dispatches a message to the extension to find out the supported + * JS API version. + * If the user is on a mobile phone and is thus using Google Authenticator instead + * of the Chrome extension, don't send the request and simply return 0. + * @param {function((u2f.Error|u2f.GetJsApiVersionResponse))} callback + * @param {number=} opt_timeoutSeconds + */ +u2f.getApiVersion = function(callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + // If we are using Android Google Authenticator or iOS client app, + // do not fire an intent to ask which JS API version to use. + if (port.getPortType) { + var apiVersion; + switch (port.getPortType()) { + case 'WrappedIosPort_': + case 'WrappedAuthenticatorPort_': + apiVersion = 1.1; + break; + + default: + apiVersion = 0; + break; + } + callback({ 'js_api_version': apiVersion }); + return; + } + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var req = { + type: u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST, + timeoutSeconds: (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC), + requestId: reqId + }; + port.postMessage(req); + }); +}; diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php new file mode 100644 index 00000000..e819bbc1 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/Yubico/U2F.php @@ -0,0 +1,507 @@ +appId = $appId; + $this->attestDir = $attestDir; + } + + /** + * Called to get a registration request to send to a user. + * Returns an array of one registration request and a array of sign requests. + * + * @param array $registrations List of current registrations for this + * user, to prevent the user from registering the same authenticator several + * times. + * @return array An array of two elements, the first containing a + * RegisterRequest the second being an array of SignRequest + * @throws Error + */ + public function getRegisterData(array $registrations = array()) + { + $challenge = $this->createChallenge(); + $request = new RegisterRequest($challenge, $this->appId); + $signs = $this->getAuthenticateData($registrations); + return array($request, $signs); + } + + /** + * Called to verify and unpack a registration message. + * + * @param RegisterRequest $request this is a reply to + * @param object $response response from a user + * @param bool $includeCert set to true if the attestation certificate should be + * included in the returned Registration object + * @return Registration + * @throws Error + */ + public function doRegister($request, $response, $includeCert = true) + { + if( !is_object( $request ) ) { + throw new \InvalidArgumentException('$request of doRegister() method only accepts object.'); + } + + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of doRegister() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING ); + } + + if( !is_bool( $includeCert ) ) { + throw new \InvalidArgumentException('$include_cert of doRegister() method only accepts boolean.'); + } + + $rawReg = $this->base64u_decode($response->registrationData); + $regData = array_values(unpack('C*', $rawReg)); + $clientData = $this->base64u_decode($response->clientData); + $cli = json_decode($clientData); + + if($cli->challenge !== $request->challenge) { + throw new Error('Registration challenge does not match', ERR_UNMATCHED_CHALLENGE ); + } + + $registration = new Registration(); + $offs = 1; + $pubKey = substr($rawReg, $offs, PUBKEY_LEN); + $offs += PUBKEY_LEN; + // Decode the pubKey to make sure it's good. + $tmpKey = $this->pubkey_to_pem($pubKey); + if($tmpKey === null) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + $registration->publicKey = base64_encode($pubKey); + $khLen = $regData[$offs++]; + $kh = substr($rawReg, $offs, $khLen); + $offs += $khLen; + $registration->keyHandle = $this->base64u_encode($kh); + + // length of certificate is stored in byte 3 and 4 (excluding the first 4 bytes). + $certLen = 4; + $certLen += ($regData[$offs + 2] << 8); + $certLen += $regData[$offs + 3]; + + $rawCert = $this->fixSignatureUnusedBits(substr($rawReg, $offs, $certLen)); + $offs += $certLen; + $pemCert = "-----BEGIN CERTIFICATE-----\r\n"; + $pemCert .= chunk_split(base64_encode($rawCert), 64); + $pemCert .= "-----END CERTIFICATE-----"; + if($includeCert) { + $registration->certificate = base64_encode($rawCert); + } + if($this->attestDir) { + if(openssl_x509_checkpurpose($pemCert, -1, $this->get_certs()) !== true) { + throw new Error('Attestation certificate can not be validated', ERR_ATTESTATION_VERIFICATION ); + } + } + + if(!openssl_pkey_get_public($pemCert)) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + $signature = substr($rawReg, $offs); + + $dataToVerify = chr(0); + $dataToVerify .= hash('sha256', $request->appId, true); + $dataToVerify .= hash('sha256', $clientData, true); + $dataToVerify .= $kh; + $dataToVerify .= $pubKey; + + if(openssl_verify($dataToVerify, $signature, $pemCert, 'sha256') === 1) { + return $registration; + } else { + throw new Error('Attestation signature does not match', ERR_ATTESTATION_SIGNATURE ); + } + } + + /** + * Called to get an authentication request. + * + * @param array $registrations An array of the registrations to create authentication requests for. + * @return array An array of SignRequest + * @throws Error + */ + public function getAuthenticateData(array $registrations) + { + $sigs = array(); + $challenge = $this->createChallenge(); + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of getAuthenticateData() method only accepts array of object.'); + } + + $sig = new SignRequest(); + $sig->appId = $this->appId; + $sig->keyHandle = $reg->keyHandle; + $sig->challenge = $challenge; + $sigs[] = $sig; + } + return $sigs; + } + + /** + * Called to verify an authentication response + * + * @param array $requests An array of outstanding authentication requests + * @param array $registrations An array of current registrations + * @param object $response A response from the authenticator + * @return Registration + * @throws Error + * + * The Registration object returned on success contains an updated counter + * that should be saved for future authentications. + * If the Error returned is ERR_COUNTER_TOO_LOW this is an indication of + * token cloning or similar and appropriate action should be taken. + */ + public function doAuthenticate(array $requests, array $registrations, $response) + { + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of doAuthenticate() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING ); + } + + /** @var object|null $req */ + $req = null; + + /** @var object|null $reg */ + $reg = null; + + $clientData = $this->base64u_decode($response->clientData); + $decodedClient = json_decode($clientData); + foreach ($requests as $req) { + if( !is_object( $req ) ) { + throw new \InvalidArgumentException('$requests of doAuthenticate() method only accepts array of object.'); + } + + if($req->keyHandle === $response->keyHandle && $req->challenge === $decodedClient->challenge) { + break; + } + + $req = null; + } + if($req === null) { + throw new Error('No matching request found', ERR_NO_MATCHING_REQUEST ); + } + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of doAuthenticate() method only accepts array of object.'); + } + + if($reg->keyHandle === $response->keyHandle) { + break; + } + $reg = null; + } + if($reg === null) { + throw new Error('No matching registration found', ERR_NO_MATCHING_REGISTRATION ); + } + $pemKey = $this->pubkey_to_pem($this->base64u_decode($reg->publicKey)); + if($pemKey === null) { + throw new Error('Decoding of public key failed', ERR_PUBKEY_DECODE ); + } + + $signData = $this->base64u_decode($response->signatureData); + $dataToVerify = hash('sha256', $req->appId, true); + $dataToVerify .= substr($signData, 0, 5); + $dataToVerify .= hash('sha256', $clientData, true); + $signature = substr($signData, 5); + + if(openssl_verify($dataToVerify, $signature, $pemKey, 'sha256') === 1) { + $ctr = unpack("Nctr", substr($signData, 1, 4)); + $counter = $ctr['ctr']; + /* TODO: wrap-around should be handled somehow.. */ + if($counter > $reg->counter) { + $reg->counter = $counter; + return $reg; + } else { + throw new Error('Counter too low.', ERR_COUNTER_TOO_LOW ); + } + } else { + throw new Error('Authentication failed', ERR_AUTHENTICATION_FAILURE ); + } + } + + /** + * @return array + */ + private function get_certs() + { + $files = array(); + $dir = $this->attestDir; + if($dir && $handle = opendir($dir)) { + while(false !== ($entry = readdir($handle))) { + if(is_file("$dir/$entry")) { + $files[] = "$dir/$entry"; + } + } + closedir($handle); + } + return $files; + } + + /** + * @param string $data + * @return string + */ + private function base64u_encode($data) + { + return trim(strtr(base64_encode($data), '+/', '-_'), '='); + } + + /** + * @param string $data + * @return string + */ + private function base64u_decode($data) + { + return base64_decode(strtr($data, '-_', '+/')); + } + + /** + * @param string $key + * @return null|string + */ + private function pubkey_to_pem($key) + { + if(strlen($key) !== PUBKEY_LEN || $key[0] !== "\x04") { + return null; + } + + /* + * Convert the public key to binary DER format first + * Using the ECC SubjectPublicKeyInfo OIDs from RFC 5480 + * + * SEQUENCE(2 elem) 30 59 + * SEQUENCE(2 elem) 30 13 + * OID1.2.840.10045.2.1 (id-ecPublicKey) 06 07 2a 86 48 ce 3d 02 01 + * OID1.2.840.10045.3.1.7 (secp256r1) 06 08 2a 86 48 ce 3d 03 01 07 + * BIT STRING(520 bit) 03 42 ..key.. + */ + $der = "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01"; + $der .= "\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42"; + $der .= "\0".$key; + + $pem = "-----BEGIN PUBLIC KEY-----\r\n"; + $pem .= chunk_split(base64_encode($der), 64); + $pem .= "-----END PUBLIC KEY-----"; + + return $pem; + } + + /** + * @return string + * @throws Error + */ + private function createChallenge() + { + $challenge = openssl_random_pseudo_bytes(32, $crypto_strong ); + if( $crypto_strong !== true ) { + throw new Error('Unable to obtain a good source of randomness', ERR_BAD_RANDOM); + } + + $challenge = $this->base64u_encode( $challenge ); + + return $challenge; + } + + /** + * Fixes a certificate where the signature contains unused bits. + * + * @param string $cert + * @return mixed + */ + private function fixSignatureUnusedBits($cert) + { + if(in_array(hash('sha256', $cert), $this->FIXCERTS)) { + $cert[strlen($cert) - 257] = "\0"; + } + return $cert; + } +} + +/** + * Class for building a registration request + * + * @package u2flib_server + */ +class RegisterRequest +{ + /** Protocol version */ + public $version = U2F_VERSION; + + /** Registration challenge */ + public $challenge; + + /** Application id */ + public $appId; + + /** + * @param string $challenge + * @param string $appId + * @internal + */ + public function __construct($challenge, $appId) + { + $this->challenge = $challenge; + $this->appId = $appId; + } +} + +/** + * Class for building up an authentication request + * + * @package u2flib_server + */ +class SignRequest +{ + /** Protocol version */ + public $version = U2F_VERSION; + + /** Authentication challenge */ + public $challenge; + + /** Key handle of a registered authenticator */ + public $keyHandle; + + /** Application id */ + public $appId; +} + +/** + * Class returned for successful registrations + * + * @package u2flib_server + */ +class Registration +{ + /** The key handle of the registered authenticator */ + public $keyHandle; + + /** The public key of the registered authenticator */ + public $publicKey; + + /** The attestation certificate of the registered authenticator */ + public $certificate; + + /** The counter associated with this registration */ + public $counter = -1; +} + +/** + * Error class, returned on errors + * + * @package u2flib_server + */ +class Error extends \Exception +{ + /** + * Override constructor and make message and code mandatory + * @param string $message + * @param int $code + * @param \Exception|null $previous + */ + public function __construct($message, $code, \Exception $previous = null) { + parent::__construct($message, $code, $previous); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php new file mode 100644 index 00000000..a2876b02 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/includes/function.login-footer.php @@ -0,0 +1,87 @@ + +

        + %s', + esc_url( home_url( '/' ) ), + sprintf( + /* translators: %s: Site title. */ + _x( '← Go to %s', 'site' ), + get_bloginfo( 'title', 'display' ) + ) + ); + /** + * Filter the "Go to site" link displayed in the login page footer. + * + * @since 5.7.0 + * + * @param string $link HTML link to the home URL of the current site. + */ + echo apply_filters( 'login_site_html_link', $html_link ); + ?> +

        + ', '' ); + } + + ?> + . ?> + + + + +
        + + + + + ` element. + * Default 'Log In'. + * @param string $message Optional. Message to display in header. Default empty. + * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance. + */ +function login_header( $title = 'Log In', $message = '', $wp_error = null ) { + global $error, $interim_login, $action; + + // Don't index any of these forms. + add_filter( 'wp_robots', 'wp_robots_sensitive_page' ); + add_action( 'login_head', 'wp_strict_cross_origin_referrer' ); + + add_action( 'login_head', 'wp_login_viewport_meta' ); + + if ( ! is_wp_error( $wp_error ) ) { + $wp_error = new WP_Error(); + } + + // Shake it! + $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' ); + /** + * Filters the error codes array for shaking the login form. + * + * @since 3.0.0 + * + * @param array $shake_error_codes Error codes that shake the login form. + */ + $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); + + if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) { + add_action( 'login_footer', 'wp_shake_js', 12 ); + } + + $login_title = get_bloginfo( 'name', 'display' ); + + /* translators: Login screen title. 1: Login screen name, 2: Network or site name. */ + $login_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $login_title ); + + if ( wp_is_recovery_mode() ) { + /* translators: %s: Login screen title. */ + $login_title = sprintf( __( 'Recovery Mode — %s' ), $login_title ); + } + + /** + * Filters the title tag content for login page. + * + * @since 4.9.0 + * + * @param string $login_title The page title, with extra context added. + * @param string $title The original page title. + */ + $login_title = apply_filters( 'login_title', $login_title, $title ); + + ?> + > + + + <?php echo $login_title; ?> + get_error_code() ) { + ?> + + + + + + + + +
        +

        + add( 'error', $error ); + unset( $error ); + } + + if ( $wp_error->has_errors() ) { + $errors = ''; + $messages = ''; + + foreach ( $wp_error->get_error_codes() as $code ) { + $severity = $wp_error->get_error_data( $code ); + foreach ( $wp_error->get_error_messages( $code ) as $error_message ) { + if ( 'message' === $severity ) { + $messages .= ' ' . $error_message . "
        \n"; + } else { + $errors .= ' ' . $error_message . "
        \n"; + } + } + } + + if ( ! empty( $errors ) ) { + /** + * Filters the error messages displayed above the login form. + * + * @since 2.1.0 + * + * @param string $errors Login error message. + */ + echo '
        ' . apply_filters( 'login_errors', $errors ) . "
        \n"; + } + + if ( ! empty( $messages ) ) { + /** + * Filters instructional messages displayed above the login form. + * + * @since 2.5.0 + * + * @param string $messages Login messages. + */ + echo '

        ' . apply_filters( 'login_messages', $messages ) . "

        \n"; + } + } +} // End of login_header(). + +/** + * Outputs the viewport meta tag for the login page. + * + * @since 3.7.0 + */ +function wp_login_viewport_meta() { + ?> + + = 7) { + setupTypeNumber(test); + } + + if (_dataCache == null) { + _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList); + } + + mapData(_dataCache, maskPattern); + }; + + var setupPositionProbePattern = function(row, col) { + + for (var r = -1; r <= 7; r += 1) { + + if (row + r <= -1 || _moduleCount <= row + r) continue; + + for (var c = -1; c <= 7; c += 1) { + + if (col + c <= -1 || _moduleCount <= col + c) continue; + + if ( (0 <= r && r <= 6 && (c == 0 || c == 6) ) + || (0 <= c && c <= 6 && (r == 0 || r == 6) ) + || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) { + _modules[row + r][col + c] = true; + } else { + _modules[row + r][col + c] = false; + } + } + } + }; + + var getBestMaskPattern = function() { + + var minLostPoint = 0; + var pattern = 0; + + for (var i = 0; i < 8; i += 1) { + + makeImpl(true, i); + + var lostPoint = QRUtil.getLostPoint(_this); + + if (i == 0 || minLostPoint > lostPoint) { + minLostPoint = lostPoint; + pattern = i; + } + } + + return pattern; + }; + + var setupTimingPattern = function() { + + for (var r = 8; r < _moduleCount - 8; r += 1) { + if (_modules[r][6] != null) { + continue; + } + _modules[r][6] = (r % 2 == 0); + } + + for (var c = 8; c < _moduleCount - 8; c += 1) { + if (_modules[6][c] != null) { + continue; + } + _modules[6][c] = (c % 2 == 0); + } + }; + + var setupPositionAdjustPattern = function() { + + var pos = QRUtil.getPatternPosition(_typeNumber); + + for (var i = 0; i < pos.length; i += 1) { + + for (var j = 0; j < pos.length; j += 1) { + + var row = pos[i]; + var col = pos[j]; + + if (_modules[row][col] != null) { + continue; + } + + for (var r = -2; r <= 2; r += 1) { + + for (var c = -2; c <= 2; c += 1) { + + if (r == -2 || r == 2 || c == -2 || c == 2 + || (r == 0 && c == 0) ) { + _modules[row + r][col + c] = true; + } else { + _modules[row + r][col + c] = false; + } + } + } + } + } + }; + + var setupTypeNumber = function(test) { + + var bits = QRUtil.getBCHTypeNumber(_typeNumber); + + for (var i = 0; i < 18; i += 1) { + var mod = (!test && ( (bits >> i) & 1) == 1); + _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod; + } + + for (var i = 0; i < 18; i += 1) { + var mod = (!test && ( (bits >> i) & 1) == 1); + _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod; + } + }; + + var setupTypeInfo = function(test, maskPattern) { + + var data = (_errorCorrectionLevel << 3) | maskPattern; + var bits = QRUtil.getBCHTypeInfo(data); + + // vertical + for (var i = 0; i < 15; i += 1) { + + var mod = (!test && ( (bits >> i) & 1) == 1); + + if (i < 6) { + _modules[i][8] = mod; + } else if (i < 8) { + _modules[i + 1][8] = mod; + } else { + _modules[_moduleCount - 15 + i][8] = mod; + } + } + + // horizontal + for (var i = 0; i < 15; i += 1) { + + var mod = (!test && ( (bits >> i) & 1) == 1); + + if (i < 8) { + _modules[8][_moduleCount - i - 1] = mod; + } else if (i < 9) { + _modules[8][15 - i - 1 + 1] = mod; + } else { + _modules[8][15 - i - 1] = mod; + } + } + + // fixed module + _modules[_moduleCount - 8][8] = (!test); + }; + + var mapData = function(data, maskPattern) { + + var inc = -1; + var row = _moduleCount - 1; + var bitIndex = 7; + var byteIndex = 0; + var maskFunc = QRUtil.getMaskFunction(maskPattern); + + for (var col = _moduleCount - 1; col > 0; col -= 2) { + + if (col == 6) col -= 1; + + while (true) { + + for (var c = 0; c < 2; c += 1) { + + if (_modules[row][col - c] == null) { + + var dark = false; + + if (byteIndex < data.length) { + dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1); + } + + var mask = maskFunc(row, col - c); + + if (mask) { + dark = !dark; + } + + _modules[row][col - c] = dark; + bitIndex -= 1; + + if (bitIndex == -1) { + byteIndex += 1; + bitIndex = 7; + } + } + } + + row += inc; + + if (row < 0 || _moduleCount <= row) { + row -= inc; + inc = -inc; + break; + } + } + } + }; + + var createBytes = function(buffer, rsBlocks) { + + var offset = 0; + + var maxDcCount = 0; + var maxEcCount = 0; + + var dcdata = new Array(rsBlocks.length); + var ecdata = new Array(rsBlocks.length); + + for (var r = 0; r < rsBlocks.length; r += 1) { + + var dcCount = rsBlocks[r].dataCount; + var ecCount = rsBlocks[r].totalCount - dcCount; + + maxDcCount = Math.max(maxDcCount, dcCount); + maxEcCount = Math.max(maxEcCount, ecCount); + + dcdata[r] = new Array(dcCount); + + for (var i = 0; i < dcdata[r].length; i += 1) { + dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset]; + } + offset += dcCount; + + var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); + var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1); + + var modPoly = rawPoly.mod(rsPoly); + ecdata[r] = new Array(rsPoly.getLength() - 1); + for (var i = 0; i < ecdata[r].length; i += 1) { + var modIndex = i + modPoly.getLength() - ecdata[r].length; + ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0; + } + } + + var totalCodeCount = 0; + for (var i = 0; i < rsBlocks.length; i += 1) { + totalCodeCount += rsBlocks[i].totalCount; + } + + var data = new Array(totalCodeCount); + var index = 0; + + for (var i = 0; i < maxDcCount; i += 1) { + for (var r = 0; r < rsBlocks.length; r += 1) { + if (i < dcdata[r].length) { + data[index] = dcdata[r][i]; + index += 1; + } + } + } + + for (var i = 0; i < maxEcCount; i += 1) { + for (var r = 0; r < rsBlocks.length; r += 1) { + if (i < ecdata[r].length) { + data[index] = ecdata[r][i]; + index += 1; + } + } + } + + return data; + }; + + var createData = function(typeNumber, errorCorrectionLevel, dataList) { + + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel); + + var buffer = qrBitBuffer(); + + for (var i = 0; i < dataList.length; i += 1) { + var data = dataList[i]; + buffer.put(data.getMode(), 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); + data.write(buffer); + } + + // calc num max data. + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i += 1) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() > totalDataCount * 8) { + throw 'code length overflow. (' + + buffer.getLengthInBits() + + '>' + + totalDataCount * 8 + + ')'; + } + + // end code + if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { + buffer.put(0, 4); + } + + // padding + while (buffer.getLengthInBits() % 8 != 0) { + buffer.putBit(false); + } + + // padding + while (true) { + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(PAD0, 8); + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(PAD1, 8); + } + + return createBytes(buffer, rsBlocks); + }; + + _this.addData = function(data, mode) { + + mode = mode || 'Byte'; + + var newData = null; + + switch(mode) { + case 'Numeric' : + newData = qrNumber(data); + break; + case 'Alphanumeric' : + newData = qrAlphaNum(data); + break; + case 'Byte' : + newData = qr8BitByte(data); + break; + case 'Kanji' : + newData = qrKanji(data); + break; + default : + throw 'mode:' + mode; + } + + _dataList.push(newData); + _dataCache = null; + }; + + _this.isDark = function(row, col) { + if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) { + throw row + ',' + col; + } + return _modules[row][col]; + }; + + _this.getModuleCount = function() { + return _moduleCount; + }; + + _this.make = function() { + if (_typeNumber < 1) { + var typeNumber = 1; + + for (; typeNumber < 40; typeNumber++) { + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, _errorCorrectionLevel); + var buffer = qrBitBuffer(); + + for (var i = 0; i < _dataList.length; i++) { + var data = _dataList[i]; + buffer.put(data.getMode(), 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); + data.write(buffer); + } + + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() <= totalDataCount * 8) { + break; + } + } + + _typeNumber = typeNumber; + } + + makeImpl(false, getBestMaskPattern() ); + }; + + _this.createTableTag = function(cellSize, margin) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var qrHtml = ''; + + qrHtml += ''; + qrHtml += ''; + + for (var r = 0; r < _this.getModuleCount(); r += 1) { + + qrHtml += ''; + + for (var c = 0; c < _this.getModuleCount(); c += 1) { + qrHtml += ''; + } + + qrHtml += ''; + qrHtml += '
        '; + } + + qrHtml += '
        '; + + return qrHtml; + }; + + _this.createSvgTag = function(cellSize, margin, alt, title) { + + var opts = {}; + if (typeof arguments[0] == 'object') { + // Called by options. + opts = arguments[0]; + // overwrite cellSize and margin. + cellSize = opts.cellSize; + margin = opts.margin; + alt = opts.alt; + title = opts.title; + } + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + // Compose alt property surrogate + alt = (typeof alt === 'string') ? {text: alt} : alt || {}; + alt.text = alt.text || null; + alt.id = (alt.text) ? alt.id || 'qrcode-description' : null; + + // Compose title property surrogate + title = (typeof title === 'string') ? {text: title} : title || {}; + title.text = title.text || null; + title.id = (title.text) ? title.id || 'qrcode-title' : null; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var c, mc, r, mr, qrSvg='', rect; + + rect = 'l' + cellSize + ',0 0,' + cellSize + + ' -' + cellSize + ',0 0,-' + cellSize + 'z '; + + qrSvg += '' + + escapeXml(title.text) + '' : ''; + qrSvg += (alt.text) ? '' + + escapeXml(alt.text) + '' : ''; + qrSvg += ''; + qrSvg += ''; + qrSvg += ''; + + return qrSvg; + }; + + _this.createDataURL = function(cellSize, margin) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + return createDataURL(size, size, function(x, y) { + if (min <= x && x < max && min <= y && y < max) { + var c = Math.floor( (x - min) / cellSize); + var r = Math.floor( (y - min) / cellSize); + return _this.isDark(r, c)? 0 : 1; + } else { + return 1; + } + } ); + }; + + _this.createImgTag = function(cellSize, margin, alt) { + + cellSize = cellSize || 2; + margin = (typeof margin == 'undefined')? cellSize * 4 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + + var img = ''; + img += '': escaped += '>'; break; + case '&': escaped += '&'; break; + case '"': escaped += '"'; break; + default : escaped += c; break; + } + } + return escaped; + }; + + var _createHalfASCII = function(margin) { + var cellSize = 1; + margin = (typeof margin == 'undefined')? cellSize * 2 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + var y, x, r1, r2, p; + + var blocks = { + '██': '█', + '█ ': '▀', + ' █': '▄', + ' ': ' ' + }; + + var blocksLastLineNoMargin = { + '██': '▀', + '█ ': '▀', + ' █': ' ', + ' ': ' ' + }; + + var ascii = ''; + for (y = 0; y < size; y += 2) { + r1 = Math.floor((y - min) / cellSize); + r2 = Math.floor((y + 1 - min) / cellSize); + for (x = 0; x < size; x += 1) { + p = '█'; + + if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) { + p = ' '; + } + + if (min <= x && x < max && min <= y+1 && y+1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) { + p += ' '; + } + else { + p += '█'; + } + + // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square. + ascii += (margin < 1 && y+1 >= max) ? blocksLastLineNoMargin[p] : blocks[p]; + } + + ascii += '\n'; + } + + if (size % 2 && margin > 0) { + return ascii.substring(0, ascii.length - size - 1) + Array(size+1).join('▀'); + } + + return ascii.substring(0, ascii.length-1); + }; + + _this.createASCII = function(cellSize, margin) { + cellSize = cellSize || 1; + + if (cellSize < 2) { + return _createHalfASCII(margin); + } + + cellSize -= 1; + margin = (typeof margin == 'undefined')? cellSize * 2 : margin; + + var size = _this.getModuleCount() * cellSize + margin * 2; + var min = margin; + var max = size - margin; + + var y, x, r, p; + + var white = Array(cellSize+1).join('██'); + var black = Array(cellSize+1).join(' '); + + var ascii = ''; + var line = ''; + for (y = 0; y < size; y += 1) { + r = Math.floor( (y - min) / cellSize); + line = ''; + for (x = 0; x < size; x += 1) { + p = 1; + + if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) { + p = 0; + } + + // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square. + line += p ? white : black; + } + + for (r = 0; r < cellSize; r += 1) { + ascii += line + '\n'; + } + } + + return ascii.substring(0, ascii.length-1); + }; + + _this.renderTo2dContext = function(context, cellSize) { + cellSize = cellSize || 2; + var length = _this.getModuleCount(); + for (var row = 0; row < length; row++) { + for (var col = 0; col < length; col++) { + context.fillStyle = _this.isDark(row, col) ? 'black' : 'white'; + context.fillRect(row * cellSize, col * cellSize, cellSize, cellSize); + } + } + } + + return _this; + }; + + //--------------------------------------------------------------------- + // qrcode.stringToBytes + //--------------------------------------------------------------------- + + qrcode.stringToBytesFuncs = { + 'default' : function(s) { + var bytes = []; + for (var i = 0; i < s.length; i += 1) { + var c = s.charCodeAt(i); + bytes.push(c & 0xff); + } + return bytes; + } + }; + + qrcode.stringToBytes = qrcode.stringToBytesFuncs['default']; + + //--------------------------------------------------------------------- + // qrcode.createStringToBytes + //--------------------------------------------------------------------- + + /** + * @param unicodeData base64 string of byte array. + * [16bit Unicode],[16bit Bytes], ... + * @param numChars + */ + qrcode.createStringToBytes = function(unicodeData, numChars) { + + // create conversion map. + + var unicodeMap = function() { + + var bin = base64DecodeInputStream(unicodeData); + var read = function() { + var b = bin.read(); + if (b == -1) throw 'eof'; + return b; + }; + + var count = 0; + var unicodeMap = {}; + while (true) { + var b0 = bin.read(); + if (b0 == -1) break; + var b1 = read(); + var b2 = read(); + var b3 = read(); + var k = String.fromCharCode( (b0 << 8) | b1); + var v = (b2 << 8) | b3; + unicodeMap[k] = v; + count += 1; + } + if (count != numChars) { + throw count + ' != ' + numChars; + } + + return unicodeMap; + }(); + + var unknownChar = '?'.charCodeAt(0); + + return function(s) { + var bytes = []; + for (var i = 0; i < s.length; i += 1) { + var c = s.charCodeAt(i); + if (c < 128) { + bytes.push(c); + } else { + var b = unicodeMap[s.charAt(i)]; + if (typeof b == 'number') { + if ( (b & 0xff) == b) { + // 1byte + bytes.push(b); + } else { + // 2bytes + bytes.push(b >>> 8); + bytes.push(b & 0xff); + } + } else { + bytes.push(unknownChar); + } + } + } + return bytes; + }; + }; + + //--------------------------------------------------------------------- + // QRMode + //--------------------------------------------------------------------- + + var QRMode = { + MODE_NUMBER : 1 << 0, + MODE_ALPHA_NUM : 1 << 1, + MODE_8BIT_BYTE : 1 << 2, + MODE_KANJI : 1 << 3 + }; + + //--------------------------------------------------------------------- + // QRErrorCorrectionLevel + //--------------------------------------------------------------------- + + var QRErrorCorrectionLevel = { + L : 1, + M : 0, + Q : 3, + H : 2 + }; + + //--------------------------------------------------------------------- + // QRMaskPattern + //--------------------------------------------------------------------- + + var QRMaskPattern = { + PATTERN000 : 0, + PATTERN001 : 1, + PATTERN010 : 2, + PATTERN011 : 3, + PATTERN100 : 4, + PATTERN101 : 5, + PATTERN110 : 6, + PATTERN111 : 7 + }; + + //--------------------------------------------------------------------- + // QRUtil + //--------------------------------------------------------------------- + + var QRUtil = function() { + + var PATTERN_POSITION_TABLE = [ + [], + [6, 18], + [6, 22], + [6, 26], + [6, 30], + [6, 34], + [6, 22, 38], + [6, 24, 42], + [6, 26, 46], + [6, 28, 50], + [6, 30, 54], + [6, 32, 58], + [6, 34, 62], + [6, 26, 46, 66], + [6, 26, 48, 70], + [6, 26, 50, 74], + [6, 30, 54, 78], + [6, 30, 56, 82], + [6, 30, 58, 86], + [6, 34, 62, 90], + [6, 28, 50, 72, 94], + [6, 26, 50, 74, 98], + [6, 30, 54, 78, 102], + [6, 28, 54, 80, 106], + [6, 32, 58, 84, 110], + [6, 30, 58, 86, 114], + [6, 34, 62, 90, 118], + [6, 26, 50, 74, 98, 122], + [6, 30, 54, 78, 102, 126], + [6, 26, 52, 78, 104, 130], + [6, 30, 56, 82, 108, 134], + [6, 34, 60, 86, 112, 138], + [6, 30, 58, 86, 114, 142], + [6, 34, 62, 90, 118, 146], + [6, 30, 54, 78, 102, 126, 150], + [6, 24, 50, 76, 102, 128, 154], + [6, 28, 54, 80, 106, 132, 158], + [6, 32, 58, 84, 110, 136, 162], + [6, 26, 54, 82, 110, 138, 166], + [6, 30, 58, 86, 114, 142, 170] + ]; + var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0); + var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0); + var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1); + + var _this = {}; + + var getBCHDigit = function(data) { + var digit = 0; + while (data != 0) { + digit += 1; + data >>>= 1; + } + return digit; + }; + + _this.getBCHTypeInfo = function(data) { + var d = data << 10; + while (getBCHDigit(d) - getBCHDigit(G15) >= 0) { + d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) ); + } + return ( (data << 10) | d) ^ G15_MASK; + }; + + _this.getBCHTypeNumber = function(data) { + var d = data << 12; + while (getBCHDigit(d) - getBCHDigit(G18) >= 0) { + d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) ); + } + return (data << 12) | d; + }; + + _this.getPatternPosition = function(typeNumber) { + return PATTERN_POSITION_TABLE[typeNumber - 1]; + }; + + _this.getMaskFunction = function(maskPattern) { + + switch (maskPattern) { + + case QRMaskPattern.PATTERN000 : + return function(i, j) { return (i + j) % 2 == 0; }; + case QRMaskPattern.PATTERN001 : + return function(i, j) { return i % 2 == 0; }; + case QRMaskPattern.PATTERN010 : + return function(i, j) { return j % 3 == 0; }; + case QRMaskPattern.PATTERN011 : + return function(i, j) { return (i + j) % 3 == 0; }; + case QRMaskPattern.PATTERN100 : + return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; }; + case QRMaskPattern.PATTERN101 : + return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; }; + case QRMaskPattern.PATTERN110 : + return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; }; + case QRMaskPattern.PATTERN111 : + return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; }; + + default : + throw 'bad maskPattern:' + maskPattern; + } + }; + + _this.getErrorCorrectPolynomial = function(errorCorrectLength) { + var a = qrPolynomial([1], 0); + for (var i = 0; i < errorCorrectLength; i += 1) { + a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) ); + } + return a; + }; + + _this.getLengthInBits = function(mode, type) { + + if (1 <= type && type < 10) { + + // 1 - 9 + + switch(mode) { + case QRMode.MODE_NUMBER : return 10; + case QRMode.MODE_ALPHA_NUM : return 9; + case QRMode.MODE_8BIT_BYTE : return 8; + case QRMode.MODE_KANJI : return 8; + default : + throw 'mode:' + mode; + } + + } else if (type < 27) { + + // 10 - 26 + + switch(mode) { + case QRMode.MODE_NUMBER : return 12; + case QRMode.MODE_ALPHA_NUM : return 11; + case QRMode.MODE_8BIT_BYTE : return 16; + case QRMode.MODE_KANJI : return 10; + default : + throw 'mode:' + mode; + } + + } else if (type < 41) { + + // 27 - 40 + + switch(mode) { + case QRMode.MODE_NUMBER : return 14; + case QRMode.MODE_ALPHA_NUM : return 13; + case QRMode.MODE_8BIT_BYTE : return 16; + case QRMode.MODE_KANJI : return 12; + default : + throw 'mode:' + mode; + } + + } else { + throw 'type:' + type; + } + }; + + _this.getLostPoint = function(qrcode) { + + var moduleCount = qrcode.getModuleCount(); + + var lostPoint = 0; + + // LEVEL1 + + for (var row = 0; row < moduleCount; row += 1) { + for (var col = 0; col < moduleCount; col += 1) { + + var sameCount = 0; + var dark = qrcode.isDark(row, col); + + for (var r = -1; r <= 1; r += 1) { + + if (row + r < 0 || moduleCount <= row + r) { + continue; + } + + for (var c = -1; c <= 1; c += 1) { + + if (col + c < 0 || moduleCount <= col + c) { + continue; + } + + if (r == 0 && c == 0) { + continue; + } + + if (dark == qrcode.isDark(row + r, col + c) ) { + sameCount += 1; + } + } + } + + if (sameCount > 5) { + lostPoint += (3 + sameCount - 5); + } + } + }; + + // LEVEL2 + + for (var row = 0; row < moduleCount - 1; row += 1) { + for (var col = 0; col < moduleCount - 1; col += 1) { + var count = 0; + if (qrcode.isDark(row, col) ) count += 1; + if (qrcode.isDark(row + 1, col) ) count += 1; + if (qrcode.isDark(row, col + 1) ) count += 1; + if (qrcode.isDark(row + 1, col + 1) ) count += 1; + if (count == 0 || count == 4) { + lostPoint += 3; + } + } + } + + // LEVEL3 + + for (var row = 0; row < moduleCount; row += 1) { + for (var col = 0; col < moduleCount - 6; col += 1) { + if (qrcode.isDark(row, col) + && !qrcode.isDark(row, col + 1) + && qrcode.isDark(row, col + 2) + && qrcode.isDark(row, col + 3) + && qrcode.isDark(row, col + 4) + && !qrcode.isDark(row, col + 5) + && qrcode.isDark(row, col + 6) ) { + lostPoint += 40; + } + } + } + + for (var col = 0; col < moduleCount; col += 1) { + for (var row = 0; row < moduleCount - 6; row += 1) { + if (qrcode.isDark(row, col) + && !qrcode.isDark(row + 1, col) + && qrcode.isDark(row + 2, col) + && qrcode.isDark(row + 3, col) + && qrcode.isDark(row + 4, col) + && !qrcode.isDark(row + 5, col) + && qrcode.isDark(row + 6, col) ) { + lostPoint += 40; + } + } + } + + // LEVEL4 + + var darkCount = 0; + + for (var col = 0; col < moduleCount; col += 1) { + for (var row = 0; row < moduleCount; row += 1) { + if (qrcode.isDark(row, col) ) { + darkCount += 1; + } + } + } + + var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; + lostPoint += ratio * 10; + + return lostPoint; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // QRMath + //--------------------------------------------------------------------- + + var QRMath = function() { + + var EXP_TABLE = new Array(256); + var LOG_TABLE = new Array(256); + + // initialize tables + for (var i = 0; i < 8; i += 1) { + EXP_TABLE[i] = 1 << i; + } + for (var i = 8; i < 256; i += 1) { + EXP_TABLE[i] = EXP_TABLE[i - 4] + ^ EXP_TABLE[i - 5] + ^ EXP_TABLE[i - 6] + ^ EXP_TABLE[i - 8]; + } + for (var i = 0; i < 255; i += 1) { + LOG_TABLE[EXP_TABLE[i] ] = i; + } + + var _this = {}; + + _this.glog = function(n) { + + if (n < 1) { + throw 'glog(' + n + ')'; + } + + return LOG_TABLE[n]; + }; + + _this.gexp = function(n) { + + while (n < 0) { + n += 255; + } + + while (n >= 256) { + n -= 255; + } + + return EXP_TABLE[n]; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // qrPolynomial + //--------------------------------------------------------------------- + + function qrPolynomial(num, shift) { + + if (typeof num.length == 'undefined') { + throw num.length + '/' + shift; + } + + var _num = function() { + var offset = 0; + while (offset < num.length && num[offset] == 0) { + offset += 1; + } + var _num = new Array(num.length - offset + shift); + for (var i = 0; i < num.length - offset; i += 1) { + _num[i] = num[i + offset]; + } + return _num; + }(); + + var _this = {}; + + _this.getAt = function(index) { + return _num[index]; + }; + + _this.getLength = function() { + return _num.length; + }; + + _this.multiply = function(e) { + + var num = new Array(_this.getLength() + e.getLength() - 1); + + for (var i = 0; i < _this.getLength(); i += 1) { + for (var j = 0; j < e.getLength(); j += 1) { + num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) ); + } + } + + return qrPolynomial(num, 0); + }; + + _this.mod = function(e) { + + if (_this.getLength() - e.getLength() < 0) { + return _this; + } + + var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) ); + + var num = new Array(_this.getLength() ); + for (var i = 0; i < _this.getLength(); i += 1) { + num[i] = _this.getAt(i); + } + + for (var i = 0; i < e.getLength(); i += 1) { + num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio); + } + + // recursive call + return qrPolynomial(num, 0).mod(e); + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // QRRSBlock + //--------------------------------------------------------------------- + + var QRRSBlock = function() { + + var RS_BLOCK_TABLE = [ + + // L + // M + // Q + // H + + // 1 + [1, 26, 19], + [1, 26, 16], + [1, 26, 13], + [1, 26, 9], + + // 2 + [1, 44, 34], + [1, 44, 28], + [1, 44, 22], + [1, 44, 16], + + // 3 + [1, 70, 55], + [1, 70, 44], + [2, 35, 17], + [2, 35, 13], + + // 4 + [1, 100, 80], + [2, 50, 32], + [2, 50, 24], + [4, 25, 9], + + // 5 + [1, 134, 108], + [2, 67, 43], + [2, 33, 15, 2, 34, 16], + [2, 33, 11, 2, 34, 12], + + // 6 + [2, 86, 68], + [4, 43, 27], + [4, 43, 19], + [4, 43, 15], + + // 7 + [2, 98, 78], + [4, 49, 31], + [2, 32, 14, 4, 33, 15], + [4, 39, 13, 1, 40, 14], + + // 8 + [2, 121, 97], + [2, 60, 38, 2, 61, 39], + [4, 40, 18, 2, 41, 19], + [4, 40, 14, 2, 41, 15], + + // 9 + [2, 146, 116], + [3, 58, 36, 2, 59, 37], + [4, 36, 16, 4, 37, 17], + [4, 36, 12, 4, 37, 13], + + // 10 + [2, 86, 68, 2, 87, 69], + [4, 69, 43, 1, 70, 44], + [6, 43, 19, 2, 44, 20], + [6, 43, 15, 2, 44, 16], + + // 11 + [4, 101, 81], + [1, 80, 50, 4, 81, 51], + [4, 50, 22, 4, 51, 23], + [3, 36, 12, 8, 37, 13], + + // 12 + [2, 116, 92, 2, 117, 93], + [6, 58, 36, 2, 59, 37], + [4, 46, 20, 6, 47, 21], + [7, 42, 14, 4, 43, 15], + + // 13 + [4, 133, 107], + [8, 59, 37, 1, 60, 38], + [8, 44, 20, 4, 45, 21], + [12, 33, 11, 4, 34, 12], + + // 14 + [3, 145, 115, 1, 146, 116], + [4, 64, 40, 5, 65, 41], + [11, 36, 16, 5, 37, 17], + [11, 36, 12, 5, 37, 13], + + // 15 + [5, 109, 87, 1, 110, 88], + [5, 65, 41, 5, 66, 42], + [5, 54, 24, 7, 55, 25], + [11, 36, 12, 7, 37, 13], + + // 16 + [5, 122, 98, 1, 123, 99], + [7, 73, 45, 3, 74, 46], + [15, 43, 19, 2, 44, 20], + [3, 45, 15, 13, 46, 16], + + // 17 + [1, 135, 107, 5, 136, 108], + [10, 74, 46, 1, 75, 47], + [1, 50, 22, 15, 51, 23], + [2, 42, 14, 17, 43, 15], + + // 18 + [5, 150, 120, 1, 151, 121], + [9, 69, 43, 4, 70, 44], + [17, 50, 22, 1, 51, 23], + [2, 42, 14, 19, 43, 15], + + // 19 + [3, 141, 113, 4, 142, 114], + [3, 70, 44, 11, 71, 45], + [17, 47, 21, 4, 48, 22], + [9, 39, 13, 16, 40, 14], + + // 20 + [3, 135, 107, 5, 136, 108], + [3, 67, 41, 13, 68, 42], + [15, 54, 24, 5, 55, 25], + [15, 43, 15, 10, 44, 16], + + // 21 + [4, 144, 116, 4, 145, 117], + [17, 68, 42], + [17, 50, 22, 6, 51, 23], + [19, 46, 16, 6, 47, 17], + + // 22 + [2, 139, 111, 7, 140, 112], + [17, 74, 46], + [7, 54, 24, 16, 55, 25], + [34, 37, 13], + + // 23 + [4, 151, 121, 5, 152, 122], + [4, 75, 47, 14, 76, 48], + [11, 54, 24, 14, 55, 25], + [16, 45, 15, 14, 46, 16], + + // 24 + [6, 147, 117, 4, 148, 118], + [6, 73, 45, 14, 74, 46], + [11, 54, 24, 16, 55, 25], + [30, 46, 16, 2, 47, 17], + + // 25 + [8, 132, 106, 4, 133, 107], + [8, 75, 47, 13, 76, 48], + [7, 54, 24, 22, 55, 25], + [22, 45, 15, 13, 46, 16], + + // 26 + [10, 142, 114, 2, 143, 115], + [19, 74, 46, 4, 75, 47], + [28, 50, 22, 6, 51, 23], + [33, 46, 16, 4, 47, 17], + + // 27 + [8, 152, 122, 4, 153, 123], + [22, 73, 45, 3, 74, 46], + [8, 53, 23, 26, 54, 24], + [12, 45, 15, 28, 46, 16], + + // 28 + [3, 147, 117, 10, 148, 118], + [3, 73, 45, 23, 74, 46], + [4, 54, 24, 31, 55, 25], + [11, 45, 15, 31, 46, 16], + + // 29 + [7, 146, 116, 7, 147, 117], + [21, 73, 45, 7, 74, 46], + [1, 53, 23, 37, 54, 24], + [19, 45, 15, 26, 46, 16], + + // 30 + [5, 145, 115, 10, 146, 116], + [19, 75, 47, 10, 76, 48], + [15, 54, 24, 25, 55, 25], + [23, 45, 15, 25, 46, 16], + + // 31 + [13, 145, 115, 3, 146, 116], + [2, 74, 46, 29, 75, 47], + [42, 54, 24, 1, 55, 25], + [23, 45, 15, 28, 46, 16], + + // 32 + [17, 145, 115], + [10, 74, 46, 23, 75, 47], + [10, 54, 24, 35, 55, 25], + [19, 45, 15, 35, 46, 16], + + // 33 + [17, 145, 115, 1, 146, 116], + [14, 74, 46, 21, 75, 47], + [29, 54, 24, 19, 55, 25], + [11, 45, 15, 46, 46, 16], + + // 34 + [13, 145, 115, 6, 146, 116], + [14, 74, 46, 23, 75, 47], + [44, 54, 24, 7, 55, 25], + [59, 46, 16, 1, 47, 17], + + // 35 + [12, 151, 121, 7, 152, 122], + [12, 75, 47, 26, 76, 48], + [39, 54, 24, 14, 55, 25], + [22, 45, 15, 41, 46, 16], + + // 36 + [6, 151, 121, 14, 152, 122], + [6, 75, 47, 34, 76, 48], + [46, 54, 24, 10, 55, 25], + [2, 45, 15, 64, 46, 16], + + // 37 + [17, 152, 122, 4, 153, 123], + [29, 74, 46, 14, 75, 47], + [49, 54, 24, 10, 55, 25], + [24, 45, 15, 46, 46, 16], + + // 38 + [4, 152, 122, 18, 153, 123], + [13, 74, 46, 32, 75, 47], + [48, 54, 24, 14, 55, 25], + [42, 45, 15, 32, 46, 16], + + // 39 + [20, 147, 117, 4, 148, 118], + [40, 75, 47, 7, 76, 48], + [43, 54, 24, 22, 55, 25], + [10, 45, 15, 67, 46, 16], + + // 40 + [19, 148, 118, 6, 149, 119], + [18, 75, 47, 31, 76, 48], + [34, 54, 24, 34, 55, 25], + [20, 45, 15, 61, 46, 16] + ]; + + var qrRSBlock = function(totalCount, dataCount) { + var _this = {}; + _this.totalCount = totalCount; + _this.dataCount = dataCount; + return _this; + }; + + var _this = {}; + + var getRsBlockTable = function(typeNumber, errorCorrectionLevel) { + + switch(errorCorrectionLevel) { + case QRErrorCorrectionLevel.L : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; + case QRErrorCorrectionLevel.M : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; + case QRErrorCorrectionLevel.Q : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; + case QRErrorCorrectionLevel.H : + return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; + default : + return undefined; + } + }; + + _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) { + + var rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel); + + if (typeof rsBlock == 'undefined') { + throw 'bad rs block @ typeNumber:' + typeNumber + + '/errorCorrectionLevel:' + errorCorrectionLevel; + } + + var length = rsBlock.length / 3; + + var list = []; + + for (var i = 0; i < length; i += 1) { + + var count = rsBlock[i * 3 + 0]; + var totalCount = rsBlock[i * 3 + 1]; + var dataCount = rsBlock[i * 3 + 2]; + + for (var j = 0; j < count; j += 1) { + list.push(qrRSBlock(totalCount, dataCount) ); + } + } + + return list; + }; + + return _this; + }(); + + //--------------------------------------------------------------------- + // qrBitBuffer + //--------------------------------------------------------------------- + + var qrBitBuffer = function() { + + var _buffer = []; + var _length = 0; + + var _this = {}; + + _this.getBuffer = function() { + return _buffer; + }; + + _this.getAt = function(index) { + var bufIndex = Math.floor(index / 8); + return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1; + }; + + _this.put = function(num, length) { + for (var i = 0; i < length; i += 1) { + _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1); + } + }; + + _this.getLengthInBits = function() { + return _length; + }; + + _this.putBit = function(bit) { + + var bufIndex = Math.floor(_length / 8); + if (_buffer.length <= bufIndex) { + _buffer.push(0); + } + + if (bit) { + _buffer[bufIndex] |= (0x80 >>> (_length % 8) ); + } + + _length += 1; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrNumber + //--------------------------------------------------------------------- + + var qrNumber = function(data) { + + var _mode = QRMode.MODE_NUMBER; + var _data = data; + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _data.length; + }; + + _this.write = function(buffer) { + + var data = _data; + + var i = 0; + + while (i + 2 < data.length) { + buffer.put(strToNum(data.substring(i, i + 3) ), 10); + i += 3; + } + + if (i < data.length) { + if (data.length - i == 1) { + buffer.put(strToNum(data.substring(i, i + 1) ), 4); + } else if (data.length - i == 2) { + buffer.put(strToNum(data.substring(i, i + 2) ), 7); + } + } + }; + + var strToNum = function(s) { + var num = 0; + for (var i = 0; i < s.length; i += 1) { + num = num * 10 + chatToNum(s.charAt(i) ); + } + return num; + }; + + var chatToNum = function(c) { + if ('0' <= c && c <= '9') { + return c.charCodeAt(0) - '0'.charCodeAt(0); + } + throw 'illegal char :' + c; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrAlphaNum + //--------------------------------------------------------------------- + + var qrAlphaNum = function(data) { + + var _mode = QRMode.MODE_ALPHA_NUM; + var _data = data; + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _data.length; + }; + + _this.write = function(buffer) { + + var s = _data; + + var i = 0; + + while (i + 1 < s.length) { + buffer.put( + getCode(s.charAt(i) ) * 45 + + getCode(s.charAt(i + 1) ), 11); + i += 2; + } + + if (i < s.length) { + buffer.put(getCode(s.charAt(i) ), 6); + } + }; + + var getCode = function(c) { + + if ('0' <= c && c <= '9') { + return c.charCodeAt(0) - '0'.charCodeAt(0); + } else if ('A' <= c && c <= 'Z') { + return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10; + } else { + switch (c) { + case ' ' : return 36; + case '$' : return 37; + case '%' : return 38; + case '*' : return 39; + case '+' : return 40; + case '-' : return 41; + case '.' : return 42; + case '/' : return 43; + case ':' : return 44; + default : + throw 'illegal char :' + c; + } + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qr8BitByte + //--------------------------------------------------------------------- + + var qr8BitByte = function(data) { + + var _mode = QRMode.MODE_8BIT_BYTE; + var _data = data; + var _bytes = qrcode.stringToBytes(data); + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return _bytes.length; + }; + + _this.write = function(buffer) { + for (var i = 0; i < _bytes.length; i += 1) { + buffer.put(_bytes[i], 8); + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // qrKanji + //--------------------------------------------------------------------- + + var qrKanji = function(data) { + + var _mode = QRMode.MODE_KANJI; + var _data = data; + + var stringToBytes = qrcode.stringToBytesFuncs['SJIS']; + if (!stringToBytes) { + throw 'sjis not supported.'; + } + !function(c, code) { + // self test for sjis support. + var test = stringToBytes(c); + if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) { + throw 'sjis not supported.'; + } + }('\u53cb', 0x9746); + + var _bytes = stringToBytes(data); + + var _this = {}; + + _this.getMode = function() { + return _mode; + }; + + _this.getLength = function(buffer) { + return ~~(_bytes.length / 2); + }; + + _this.write = function(buffer) { + + var data = _bytes; + + var i = 0; + + while (i + 1 < data.length) { + + var c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]); + + if (0x8140 <= c && c <= 0x9FFC) { + c -= 0x8140; + } else if (0xE040 <= c && c <= 0xEBBF) { + c -= 0xC140; + } else { + throw 'illegal char at ' + (i + 1) + '/' + c; + } + + c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff); + + buffer.put(c, 13); + + i += 2; + } + + if (i < data.length) { + throw 'illegal char at ' + (i + 1); + } + }; + + return _this; + }; + + //===================================================================== + // GIF Support etc. + // + + //--------------------------------------------------------------------- + // byteArrayOutputStream + //--------------------------------------------------------------------- + + var byteArrayOutputStream = function() { + + var _bytes = []; + + var _this = {}; + + _this.writeByte = function(b) { + _bytes.push(b & 0xff); + }; + + _this.writeShort = function(i) { + _this.writeByte(i); + _this.writeByte(i >>> 8); + }; + + _this.writeBytes = function(b, off, len) { + off = off || 0; + len = len || b.length; + for (var i = 0; i < len; i += 1) { + _this.writeByte(b[i + off]); + } + }; + + _this.writeString = function(s) { + for (var i = 0; i < s.length; i += 1) { + _this.writeByte(s.charCodeAt(i) ); + } + }; + + _this.toByteArray = function() { + return _bytes; + }; + + _this.toString = function() { + var s = ''; + s += '['; + for (var i = 0; i < _bytes.length; i += 1) { + if (i > 0) { + s += ','; + } + s += _bytes[i]; + } + s += ']'; + return s; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // base64EncodeOutputStream + //--------------------------------------------------------------------- + + var base64EncodeOutputStream = function() { + + var _buffer = 0; + var _buflen = 0; + var _length = 0; + var _base64 = ''; + + var _this = {}; + + var writeEncoded = function(b) { + _base64 += String.fromCharCode(encode(b & 0x3f) ); + }; + + var encode = function(n) { + if (n < 0) { + // error. + } else if (n < 26) { + return 0x41 + n; + } else if (n < 52) { + return 0x61 + (n - 26); + } else if (n < 62) { + return 0x30 + (n - 52); + } else if (n == 62) { + return 0x2b; + } else if (n == 63) { + return 0x2f; + } + throw 'n:' + n; + }; + + _this.writeByte = function(n) { + + _buffer = (_buffer << 8) | (n & 0xff); + _buflen += 8; + _length += 1; + + while (_buflen >= 6) { + writeEncoded(_buffer >>> (_buflen - 6) ); + _buflen -= 6; + } + }; + + _this.flush = function() { + + if (_buflen > 0) { + writeEncoded(_buffer << (6 - _buflen) ); + _buffer = 0; + _buflen = 0; + } + + if (_length % 3 != 0) { + // padding + var padlen = 3 - _length % 3; + for (var i = 0; i < padlen; i += 1) { + _base64 += '='; + } + } + }; + + _this.toString = function() { + return _base64; + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // base64DecodeInputStream + //--------------------------------------------------------------------- + + var base64DecodeInputStream = function(str) { + + var _str = str; + var _pos = 0; + var _buffer = 0; + var _buflen = 0; + + var _this = {}; + + _this.read = function() { + + while (_buflen < 8) { + + if (_pos >= _str.length) { + if (_buflen == 0) { + return -1; + } + throw 'unexpected end of file./' + _buflen; + } + + var c = _str.charAt(_pos); + _pos += 1; + + if (c == '=') { + _buflen = 0; + return -1; + } else if (c.match(/^\s$/) ) { + // ignore if whitespace. + continue; + } + + _buffer = (_buffer << 6) | decode(c.charCodeAt(0) ); + _buflen += 6; + } + + var n = (_buffer >>> (_buflen - 8) ) & 0xff; + _buflen -= 8; + return n; + }; + + var decode = function(c) { + if (0x41 <= c && c <= 0x5a) { + return c - 0x41; + } else if (0x61 <= c && c <= 0x7a) { + return c - 0x61 + 26; + } else if (0x30 <= c && c <= 0x39) { + return c - 0x30 + 52; + } else if (c == 0x2b) { + return 62; + } else if (c == 0x2f) { + return 63; + } else { + throw 'c:' + c; + } + }; + + return _this; + }; + + //--------------------------------------------------------------------- + // gifImage (B/W) + //--------------------------------------------------------------------- + + var gifImage = function(width, height) { + + var _width = width; + var _height = height; + var _data = new Array(width * height); + + var _this = {}; + + _this.setPixel = function(x, y, pixel) { + _data[y * _width + x] = pixel; + }; + + _this.write = function(out) { + + //--------------------------------- + // GIF Signature + + out.writeString('GIF87a'); + + //--------------------------------- + // Screen Descriptor + + out.writeShort(_width); + out.writeShort(_height); + + out.writeByte(0x80); // 2bit + out.writeByte(0); + out.writeByte(0); + + //--------------------------------- + // Global Color Map + + // black + out.writeByte(0x00); + out.writeByte(0x00); + out.writeByte(0x00); + + // white + out.writeByte(0xff); + out.writeByte(0xff); + out.writeByte(0xff); + + //--------------------------------- + // Image Descriptor + + out.writeString(','); + out.writeShort(0); + out.writeShort(0); + out.writeShort(_width); + out.writeShort(_height); + out.writeByte(0); + + //--------------------------------- + // Local Color Map + + //--------------------------------- + // Raster Data + + var lzwMinCodeSize = 2; + var raster = getLZWRaster(lzwMinCodeSize); + + out.writeByte(lzwMinCodeSize); + + var offset = 0; + + while (raster.length - offset > 255) { + out.writeByte(255); + out.writeBytes(raster, offset, 255); + offset += 255; + } + + out.writeByte(raster.length - offset); + out.writeBytes(raster, offset, raster.length - offset); + out.writeByte(0x00); + + //--------------------------------- + // GIF Terminator + out.writeString(';'); + }; + + var bitOutputStream = function(out) { + + var _out = out; + var _bitLength = 0; + var _bitBuffer = 0; + + var _this = {}; + + _this.write = function(data, length) { + + if ( (data >>> length) != 0) { + throw 'length over'; + } + + while (_bitLength + length >= 8) { + _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) ); + length -= (8 - _bitLength); + data >>>= (8 - _bitLength); + _bitBuffer = 0; + _bitLength = 0; + } + + _bitBuffer = (data << _bitLength) | _bitBuffer; + _bitLength = _bitLength + length; + }; + + _this.flush = function() { + if (_bitLength > 0) { + _out.writeByte(_bitBuffer); + } + }; + + return _this; + }; + + var getLZWRaster = function(lzwMinCodeSize) { + + var clearCode = 1 << lzwMinCodeSize; + var endCode = (1 << lzwMinCodeSize) + 1; + var bitLength = lzwMinCodeSize + 1; + + // Setup LZWTable + var table = lzwTable(); + + for (var i = 0; i < clearCode; i += 1) { + table.add(String.fromCharCode(i) ); + } + table.add(String.fromCharCode(clearCode) ); + table.add(String.fromCharCode(endCode) ); + + var byteOut = byteArrayOutputStream(); + var bitOut = bitOutputStream(byteOut); + + // clear code + bitOut.write(clearCode, bitLength); + + var dataIndex = 0; + + var s = String.fromCharCode(_data[dataIndex]); + dataIndex += 1; + + while (dataIndex < _data.length) { + + var c = String.fromCharCode(_data[dataIndex]); + dataIndex += 1; + + if (table.contains(s + c) ) { + + s = s + c; + + } else { + + bitOut.write(table.indexOf(s), bitLength); + + if (table.size() < 0xfff) { + + if (table.size() == (1 << bitLength) ) { + bitLength += 1; + } + + table.add(s + c); + } + + s = c; + } + } + + bitOut.write(table.indexOf(s), bitLength); + + // end code + bitOut.write(endCode, bitLength); + + bitOut.flush(); + + return byteOut.toByteArray(); + }; + + var lzwTable = function() { + + var _map = {}; + var _size = 0; + + var _this = {}; + + _this.add = function(key) { + if (_this.contains(key) ) { + throw 'dup key:' + key; + } + _map[key] = _size; + _size += 1; + }; + + _this.size = function() { + return _size; + }; + + _this.indexOf = function(key) { + return _map[key]; + }; + + _this.contains = function(key) { + return typeof _map[key] != 'undefined'; + }; + + return _this; + }; + + return _this; + }; + + var createDataURL = function(width, height, getPixel) { + var gif = gifImage(width, height); + for (var y = 0; y < height; y += 1) { + for (var x = 0; x < width; x += 1) { + gif.setPixel(x, y, getPixel(x, y) ); + } + } + + var b = byteArrayOutputStream(); + gif.write(b); + + var base64 = base64EncodeOutputStream(); + var bytes = b.toByteArray(); + for (var i = 0; i < bytes.length; i += 1) { + base64.writeByte(bytes[i]); + } + base64.flush(); + + return 'data:image/gif;base64,' + base64; + }; + + //--------------------------------------------------------------------- + // returns qrcode function. + + return qrcode; +}(); + +// multibyte support +!function() { + + qrcode.stringToBytesFuncs['UTF-8'] = function(s) { + // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array + function toUTF8Array(str) { + var utf8 = []; + for (var i=0; i < str.length; i++) { + var charcode = str.charCodeAt(i); + if (charcode < 0x80) utf8.push(charcode); + else if (charcode < 0x800) { + utf8.push(0xc0 | (charcode >> 6), + 0x80 | (charcode & 0x3f)); + } + else if (charcode < 0xd800 || charcode >= 0xe000) { + utf8.push(0xe0 | (charcode >> 12), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + // surrogate pair + else { + i++; + // UTF-16 encodes 0x10000-0x10FFFF by + // subtracting 0x10000 and splitting the + // 20 bits of 0x0-0xFFFFF into two halves + charcode = 0x10000 + (((charcode & 0x3ff)<<10) + | (str.charCodeAt(i) & 0x3ff)); + utf8.push(0xf0 | (charcode >>18), + 0x80 | ((charcode>>12) & 0x3f), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + } + return utf8; + } + return toUTF8Array(s); + }; + +}(); + +(function (factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } +}(function () { + return qrcode; +})); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php new file mode 100644 index 00000000..3caf4427 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-backup-codes.php @@ -0,0 +1,402 @@ + WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'rest_generate_codes' ), + 'permission_callback' => function( $request ) { + return current_user_can( 'edit_user', $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'number', + ), + 'enable_provider' => array( + 'required' => false, + 'type' => 'boolean', + 'default' => false, + ), + ), + ) + ); + } + + /** + * Displays an admin notice when backup codes have run out. + * + * @since 0.1-dev + * + * @codeCoverageIgnore + */ + public function admin_notices() { + $user = wp_get_current_user(); + + // Return if the provider is not enabled. + if ( ! in_array( __CLASS__, Two_Factor_Core::get_enabled_providers_for_user( $user->ID ), true ) ) { + return; + } + + // Return if we are not out of codes. + if ( $this->is_available_for_user( $user ) ) { + return; + } + ?> +
        +

        + + regenerate!', 'two-factor' ), + esc_url( get_edit_user_link( $user->ID ) . '#two-factor-backup-codes' ) + ), + array( 'a' => array( 'href' => true ) ) + ); + ?> + +

        +
        + +

        + + + + +

        + + + ID, self::BACKUP_CODES_META_KEY, true ); + } + + for ( $i = 0; $i < $num_codes; $i++ ) { + $code = $this->get_code(); + $codes_hashed[] = wp_hash_password( $code ); + $codes[] = $code; + unset( $code ); + } + + update_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, $codes_hashed ); + + // Unhashed. + return $codes; + } + + /** + * Generates Backup Codes for returning through the WordPress Rest API. + * + * @since 0.8.0 + */ + public function rest_generate_codes( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + // Hardcode these, the user shouldn't be able to choose them. + $args = array( + 'number' => self::NUMBER_OF_CODES, + 'method' => 'replace', + ); + + // Setup the return data. + $codes = $this->generate_codes( $user, $args ); + $count = self::codes_remaining_for_user( $user ); + $title = sprintf( + /* translators: %s: the site's domain */ + __( 'Two-Factor Backup Codes for %s', 'two-factor' ), + home_url( '/' ) + ); + + // Generate download content. + $download_link = 'data:application/text;charset=utf-8,'; + $download_link .= rawurlencode( "{$title}\r\n\r\n" ); + + $i = 1; + foreach ( $codes as $code ) { + $download_link .= rawurlencode( "{$i}. {$code}\r\n" ); + $i++; + } + + $i18n = array( + /* translators: %s: count */ + 'count' => esc_html( sprintf( _n( '%s unused code remaining.', '%s unused codes remaining.', $count, 'two-factor' ), $count ) ), + ); + + if ( $request->get_param( 'enable_provider' ) && ! Two_Factor_Core::enable_provider_for_user( $user_id, 'Two_Factor_Backup_Codes' ) ) { + return new WP_Error( 'db_error', __( 'Unable to enable Backup Codes provider for this user.', 'two-factor' ), array( 'status' => 500 ) ); + } + + return array( + 'codes' => $codes, + 'download_link' => $download_link, + 'remaining' => $count, + 'i18n' => $i18n, + ); + } + + /** + * Returns the number of unused codes for the specified user + * + * @param WP_User $user WP_User object of the logged-in user. + * @return int $int The number of unused codes remaining + */ + public static function codes_remaining_for_user( $user ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + if ( is_array( $backup_codes ) && ! empty( $backup_codes ) ) { + return count( $backup_codes ); + } + return 0; + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function authentication_page( $user ) { + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +

        +

        + + +

        + sanitize_code_from_request( 'two-factor-backup-code' ); + if ( ! $backup_code ) { + return false; + } + + return $this->validate_code( $user, $backup_code ); + } + + /** + * Validates a backup code. + * + * Backup Codes are single use and are deleted upon a successful validation. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @param int $code The backup code. + * @return boolean + */ + public function validate_code( $user, $code ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + + if ( is_array( $backup_codes ) && ! empty( $backup_codes ) ) { + foreach ( $backup_codes as $code_index => $code_hashed ) { + if ( wp_check_password( $code, $code_hashed, $user->ID ) ) { + $this->delete_code( $user, $code_hashed ); + return true; + } + } + } + return false; + } + + /** + * Deletes a backup code. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @param string $code_hashed The hashed the backup code. + */ + public function delete_code( $user, $code_hashed ) { + $backup_codes = get_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, true ); + + // Delete the current code from the list since it's been used. + $backup_codes = array_flip( $backup_codes ); + unset( $backup_codes[ $code_hashed ] ); + $backup_codes = array_values( array_flip( $backup_codes ) ); + + // Update the backup code master list. + update_user_meta( $user->ID, self::BACKUP_CODES_META_KEY, $backup_codes ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php new file mode 100644 index 00000000..f1625dce --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-dummy.php @@ -0,0 +1,99 @@ + +

        + get_code(); + + update_user_meta( $user_id, self::TOKEN_META_KEY_TIMESTAMP, time() ); + update_user_meta( $user_id, self::TOKEN_META_KEY, wp_hash( $token ) ); + + return $token; + } + + /** + * Check if user has a valid token already. + * + * @param int $user_id User ID. + * @return boolean If user has a valid email token. + */ + public function user_has_token( $user_id ) { + $hashed_token = $this->get_user_token( $user_id ); + + if ( ! empty( $hashed_token ) ) { + return true; + } + + return false; + } + + /** + * Has the user token validity timestamp expired. + * + * @param integer $user_id User ID. + * + * @return boolean + */ + public function user_token_has_expired( $user_id ) { + $token_lifetime = $this->user_token_lifetime( $user_id ); + $token_ttl = $this->user_token_ttl( $user_id ); + + // Invalid token lifetime is considered an expired token. + if ( is_int( $token_lifetime ) && $token_lifetime <= $token_ttl ) { + return false; + } + + return true; + } + + /** + * Get the lifetime of a user token in seconds. + * + * @param integer $user_id User ID. + * + * @return integer|null Return `null` if the lifetime can't be measured. + */ + public function user_token_lifetime( $user_id ) { + $timestamp = intval( get_user_meta( $user_id, self::TOKEN_META_KEY_TIMESTAMP, true ) ); + + if ( ! empty( $timestamp ) ) { + return time() - $timestamp; + } + + return null; + } + + /** + * Return the token time-to-live for a user. + * + * @param integer $user_id User ID. + * + * @return integer + */ + public function user_token_ttl( $user_id ) { + $token_ttl = 15 * MINUTE_IN_SECONDS; + + /** + * Number of seconds the token is considered valid + * after the generation. + * + * @param integer $token_ttl Token time-to-live in seconds. + * @param integer $user_id User ID. + */ + return (int) apply_filters( 'two_factor_token_ttl', $token_ttl, $user_id ); + } + + /** + * Get the authentication token for the user. + * + * @param int $user_id User ID. + * + * @return string|boolean User token or `false` if no token found. + */ + public function get_user_token( $user_id ) { + $hashed_token = get_user_meta( $user_id, self::TOKEN_META_KEY, true ); + + if ( ! empty( $hashed_token ) && is_string( $hashed_token ) ) { + return $hashed_token; + } + + return false; + } + + /** + * Validate the user token. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param string $token User token. + * @return boolean + */ + public function validate_token( $user_id, $token ) { + $hashed_token = $this->get_user_token( $user_id ); + + // Bail if token is empty or it doesn't match. + if ( empty( $hashed_token ) || ! hash_equals( wp_hash( $token ), $hashed_token ) ) { + return false; + } + + if ( $this->user_token_has_expired( $user_id ) ) { + return false; + } + + // Ensure the token can be used only once. + $this->delete_token( $user_id ); + + return true; + } + + /** + * Delete the user token. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + */ + public function delete_token( $user_id ) { + delete_user_meta( $user_id, self::TOKEN_META_KEY ); + } + + /** + * Generate and email the user token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return bool Whether the email contents were sent successfully. + */ + public function generate_and_email_token( $user ) { + $token = $this->generate_token( $user->ID ); + + /* translators: %s: site name */ + $subject = wp_strip_all_tags( sprintf( __( 'Your login confirmation code for %s', 'two-factor' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); + /* translators: %s: token */ + $message = wp_strip_all_tags( sprintf( __( 'Enter %s to log in.', 'two-factor' ), $token ) ); + + /** + * Filter the token email subject. + * + * @param string $subject The email subject line. + * @param int $user_id The ID of the user. + */ + $subject = apply_filters( 'two_factor_token_email_subject', $subject, $user->ID ); + + /** + * Filter the token email message. + * + * @param string $message The email message. + * @param string $token The token. + * @param int $user_id The ID of the user. + */ + $message = apply_filters( 'two_factor_token_email_message', $message, $token, $user->ID ); + + return wp_mail( $user->user_email, $subject, $message ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function authentication_page( $user ) { + if ( ! $user ) { + return; + } + + if ( ! $this->user_has_token( $user->ID ) || $this->user_token_has_expired( $user->ID ) ) { + $this->generate_and_email_token( $user ); + } + + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +

        +

        + + + +

        +

        + +

        + + ID ) && isset( $_REQUEST[ self::INPUT_NAME_RESEND_CODE ] ) ) { + $this->generate_and_email_token( $user ); + return true; + } + + return false; + } + + /** + * Validates the users input token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function validate_authentication( $user ) { + $code = $this->sanitize_code_from_request( 'two-factor-email-code' ); + if ( ! isset( $user->ID ) || ! $code ) { + return false; + } + + return $this->validate_token( $user->ID, $code ); + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function is_available_for_user( $user ) { + return true; + } + + /** + * Inserts markup at the end of the user profile field for this provider. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function user_options( $user ) { + $email = $user->user_email; + ?> +
        + +
        + wp_strip_all_tags( __( 'Name', 'two-factor' ) ), + 'added' => wp_strip_all_tags( __( 'Added', 'two-factor' ) ), + 'last_used' => wp_strip_all_tags( __( 'Last Used', 'two-factor' ) ), + ); + } + + /** + * Prepares the list of items for displaying. + * + * @since 0.1-dev + */ + public function prepare_items() { + $columns = $this->get_columns(); + $hidden = array(); + $sortable = array(); + $primary = 'name'; + $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); + } + + /** + * Generates content for a single row of the table + * + * @since 0.1-dev + * @access protected + * + * @param object $item The current item. + * @param string $column_name The current column name. + * @return string + */ + protected function column_default( $item, $column_name ) { + switch ( $column_name ) { + case 'name': + $out = ''; + + $actions = array( + 'rename hide-if-no-js' => Two_Factor_FIDO_U2F_Admin::rename_link( $item ), + 'delete' => Two_Factor_FIDO_U2F_Admin::delete_link( $item ), + ); + + return esc_html( $item->name ) . $out . self::row_actions( $actions ); + case 'added': + return gmdate( get_option( 'date_format', 'r' ), $item->added ); + case 'last_used': + return gmdate( get_option( 'date_format', 'r' ), $item->last_used ); + default: + return 'WTF^^?'; + } + } + + /** + * Generates custom table navigation to prevent conflicting nonces. + * + * @since 0.1-dev + * @access protected + * + * @param string $which The location of the bulk actions: 'top' or 'bottom'. + */ + protected function display_tablenav( $which ) { + // Not used for the Security key list. + } + + /** + * Generates content for a single row of the table + * + * @since 0.1-dev + * @access public + * + * @param object $item The current item. + */ + public function single_row( $item ) { + ?> + + single_row_columns( $item ); ?> + + + + + + + + +
        + getRegisterData( $security_keys ); + list( $req,$sigs ) = $data; + + update_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY, $req ); + } catch ( Exception $e ) { + return false; + } + + wp_enqueue_style( + 'fido-u2f-admin', + plugins_url( 'css/fido-u2f-admin.css', __FILE__ ), + null, + self::asset_version() + ); + + wp_enqueue_script( + 'fido-u2f-admin', + plugins_url( 'js/fido-u2f-admin.js', __FILE__ ), + array( 'jquery', 'fido-u2f-api' ), + self::asset_version(), + true + ); + + /** + * Pass a U2F challenge and user data to our scripts + */ + + $translation_array = array( + 'user_id' => $user_id, + 'register' => array( + 'request' => $req, + 'sigs' => $sigs, + ), + 'text' => array( + 'insert' => esc_html__( 'Now insert (and tap) your Security Key.', 'two-factor' ), + 'error' => esc_html__( 'U2F request failed.', 'two-factor' ), + 'error_codes' => array( + // Map u2f.ErrorCodes to error messages. + 0 => esc_html__( 'Request OK.', 'two-factor' ), + 1 => esc_html__( 'Other U2F error.', 'two-factor' ), + 2 => esc_html__( 'Bad U2F request.', 'two-factor' ), + 3 => esc_html__( 'Unsupported U2F configuration.', 'two-factor' ), + 4 => esc_html__( 'U2F device ineligible.', 'two-factor' ), + 5 => esc_html__( 'U2F request timeout reached.', 'two-factor' ), + ), + 'u2f_not_supported' => esc_html__( 'FIDO U2F appears to be not supported by your web browser. Try using Google Chrome or Firefox.', 'two-factor' ), + ), + ); + + wp_localize_script( + 'fido-u2f-admin', + 'u2fL10n', + $translation_array + ); + + /** + * Script for admin UI + */ + + wp_enqueue_script( + 'inline-edit-key', + plugins_url( 'js/fido-u2f-admin-inline-edit.js', __FILE__ ), + array( 'jquery' ), + self::asset_version(), + true + ); + + wp_localize_script( + 'inline-edit-key', + 'inlineEditL10n', + array( + 'error' => esc_html__( 'Error while saving the changes.', 'two-factor' ), + ) + ); + } + + /** + * Return the current asset version number. + * + * Added as own helper to allow swapping the implementation once we inject + * it as a dependency. + * + * @return string + */ + protected static function asset_version() { + return Two_Factor_FIDO_U2F::asset_version(); + } + + /** + * Display the security key section in a users profile. + * + * This executes during the `show_user_security_settings` action. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public static function show_user_profile( $user ) { + wp_nonce_field( "user_security_keys-{$user->ID}", '_nonce_user_security_keys' ); + $new_key = false; + + $security_keys = Two_Factor_FIDO_U2F::get_security_keys( $user->ID ); + if ( $security_keys ) { + foreach ( $security_keys as &$security_key ) { + if ( property_exists( $security_key, 'new' ) ) { + $new_key = true; + unset( $security_key->new ); + + // If we've got a new one, update the db record to not save it there any longer. + Two_Factor_FIDO_U2F::update_security_key( $user->ID, $security_key ); + } + } + unset( $security_key ); + } + + ?> +
        +

        + + +

        + +

        + + +
        + + + + + +
        + + +
        +

        +
        + + +

        + + items = $security_keys; + $u2f_list_table->prepare_items(); + $u2f_list_table->display(); + $u2f_list_table->inline_edit(); + ?> +
        + doRegister( get_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY, true ), $response ); + $reg->new = true; + + Two_Factor_FIDO_U2F::add_security_key( $user_id, $reg ); + } catch ( Exception $e ) { + return false; + } + + delete_user_meta( $user_id, self::REGISTER_DATA_USER_META_KEY ); + + wp_safe_redirect( + add_query_arg( + array( + 'new_app_pass' => 1, + ), + wp_get_referer() + ) . '#security-keys-section' + ); + exit; + } + } + + /** + * Catch the delete security key request. + * + * This executes during the `load-profile.php` & `load-user-edit.php` actions. + * + * @since 0.1-dev + * + * @access public + * @static + */ + public static function catch_delete_security_key() { + $user_id = Two_Factor_Core::current_user_being_edited(); + + if ( ! empty( $user_id ) && ! empty( $_REQUEST['delete_security_key'] ) ) { + $slug = $_REQUEST['delete_security_key']; + + check_admin_referer( "delete_security_key-{$slug}", '_nonce_delete_security_key' ); + + Two_Factor_FIDO_U2F::delete_security_key( $user_id, $slug ); + + wp_safe_redirect( remove_query_arg( 'new_app_pass', wp_get_referer() ) . '#security-keys-section' ); + exit; + } + } + + /** + * Generate a link to rename a specified security key. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param array $item The current item. + * @return string + */ + public static function rename_link( $item ) { + return sprintf( '%s', esc_html__( 'Rename', 'two-factor' ) ); + } + + /** + * Generate a link to delete a specified security key. + * + * @since 0.1-dev + * + * @access public + * @static + * + * @param array $item The current item. + * @return string + */ + public static function delete_link( $item ) { + $delete_link = add_query_arg( 'delete_security_key', $item->keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $delete_link = wp_nonce_url( $delete_link, "delete_security_key-{$item->keyHandle}", '_nonce_delete_security_key' ); + return sprintf( '%2$s', esc_url( $delete_link ), esc_html__( 'Delete', 'two-factor' ) ); + } + + /** + * Ajax handler for quick edit saving for a security key. + * + * @since 0.1-dev + * + * @access public + * @static + */ + public static function wp_ajax_inline_save() { + check_ajax_referer( 'keyinlineeditnonce', '_inline_edit' ); + + require TWO_FACTOR_DIR . 'providers/class-two-factor-fido-u2f-admin-list-table.php'; + $wp_list_table = new Two_Factor_FIDO_U2F_Admin_List_Table(); + + if ( ! isset( $_POST['keyHandle'] ) ) { + wp_die(); + } + + $user_id = Two_Factor_Core::current_user_being_edited(); + $security_keys = Two_Factor_FIDO_U2F::get_security_keys( $user_id ); + if ( ! $security_keys ) { + wp_die(); + } + + foreach ( $security_keys as &$key ) { + if ( $key->keyHandle === $_POST['keyHandle'] ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + break; + } + } + + $key->name = $_POST['name']; + + $updated = Two_Factor_FIDO_U2F::update_security_key( $user_id, $key ); + if ( ! $updated ) { + wp_die( esc_html__( 'Item not updated.', 'two-factor' ) ); + } + $wp_list_table->single_row( $key ); + wp_die(); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php new file mode 100644 index 00000000..330451c2 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-fido-u2f.php @@ -0,0 +1,397 @@ + +

        + ID ); + $data = self::$u2f->getAuthenticateData( $keys ); + update_user_meta( $user->ID, self::AUTH_DATA_USER_META_KEY, $data ); + } catch ( Exception $e ) { + ?> +

        + $data, + ) + ); + + wp_enqueue_script( 'fido-u2f-login' ); + + ?> +

        + + ID, self::AUTH_DATA_USER_META_KEY, true ); + + $response = json_decode( stripslashes( $_REQUEST['u2f_response'] ) ); + + $keys = self::get_security_keys( $user->ID ); + + try { + $reg = self::$u2f->doAuthenticate( $requests, $keys, $response ); + + $reg->last_used = time(); + + self::update_security_key( $user->ID, $reg ); + + return true; + } catch ( Exception $e ) { + return false; + } + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function is_available_for_user( $user ) { + return (bool) self::get_security_keys( $user->ID ); + } + + /** + * Inserts markup at the end of the user profile field for this provider. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + public function user_options( $user ) { + ?> +

        + +

        + keyHandle ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $register, 'publicKey' ) || empty( $register->publicKey ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $register, 'certificate' ) || empty( $register->certificate ) + || ! property_exists( $register, 'counter' ) || ( -1 > $register->counter ) + ) { + return false; + } + + $register = array( + 'keyHandle' => $register->keyHandle, // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'publicKey' => $register->publicKey, // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + 'certificate' => $register->certificate, + 'counter' => $register->counter, + ); + + $register['name'] = __( 'New Security Key', 'two-factor' ); + $register['added'] = time(); + $register['last_used'] = $register['added']; + + return add_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY, $register ); + } + + /** + * Retrieve registered security keys for a user. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @return array|bool Array of keys on success, false on failure. + */ + public static function get_security_keys( $user_id ) { + if ( ! is_numeric( $user_id ) ) { + return false; + } + + $keys = get_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY ); + if ( $keys ) { + foreach ( $keys as &$key ) { + $key = (object) $key; + } + unset( $key ); + } + + return $keys; + } + + /** + * Update registered security key. + * + * Use the $prev_value parameter to differentiate between meta fields with the + * same key and user ID. + * + * If the meta field for the user does not exist, it will be added. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param object $data The data of registered security key. + * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. + */ + public static function update_security_key( $user_id, $data ) { + if ( ! is_numeric( $user_id ) ) { + return false; + } + + if ( + ! is_object( $data ) + || ! property_exists( $data, 'keyHandle' ) || empty( $data->keyHandle ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $data, 'publicKey' ) || empty( $data->publicKey ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + || ! property_exists( $data, 'certificate' ) || empty( $data->certificate ) + || ! property_exists( $data, 'counter' ) || ( -1 > $data->counter ) + ) { + return false; + } + + $keys = self::get_security_keys( $user_id ); + if ( $keys ) { + foreach ( $keys as $key ) { + if ( $key->keyHandle === $data->keyHandle ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + return update_user_meta( $user_id, self::REGISTERED_KEY_USER_META_KEY, (array) $data, (array) $key ); + } + } + } + + return self::add_security_key( $user_id, $data ); + } + + /** + * Remove registered security key matching criteria from a user. + * + * @since 0.1-dev + * + * @param int $user_id User ID. + * @param string $keyHandle Optional. Key handle. + * @return bool True on success, false on failure. + */ + public static function delete_security_key( $user_id, $keyHandle = null ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + global $wpdb; + + if ( ! is_numeric( $user_id ) ) { + return false; + } + + $user_id = absint( $user_id ); + if ( ! $user_id ) { + return false; + } + + $keyHandle = wp_unslash( $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + $keyHandle = maybe_serialize( $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + + $query = $wpdb->prepare( "SELECT umeta_id FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id = %d", self::REGISTERED_KEY_USER_META_KEY, $user_id ); + + if ( $keyHandle ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + $key_handle_lookup = sprintf( ':"%s";s:', $keyHandle ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase + + $query .= $wpdb->prepare( + ' AND meta_value LIKE %s', + '%' . $wpdb->esc_like( $key_handle_lookup ) . '%' + ); + } + + $meta_ids = $wpdb->get_col( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + if ( ! count( $meta_ids ) ) { + return false; + } + + foreach ( $meta_ids as $meta_id ) { + delete_metadata_by_mid( 'user', $meta_id ); + } + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php new file mode 100644 index 00000000..f7c84ecb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-provider.php @@ -0,0 +1,125 @@ +get_label() ); + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + */ + abstract public function authentication_page( $user ); + + /** + * Allow providers to do extra processing before the authentication. + * Return `true` to prevent the authentication and render the + * authentication page. + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + public function pre_process_authentication( $user ) { + return false; + } + + /** + * Validates the users input token. + * + * @since 0.1-dev + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + abstract public function validate_authentication( $user ); + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @param WP_User $user WP_User object of the logged-in user. + * @return boolean + */ + abstract public function is_available_for_user( $user ); + + /** + * Generate a random eight-digit string to send out as an auth code. + * + * @since 0.1-dev + * + * @param int $length The code length. + * @param string|array $chars Valid auth code characters. + * @return string + */ + public static function get_code( $length = 8, $chars = '1234567890' ) { + $code = ''; + if ( is_array( $chars ) ) { + $chars = implode( '', $chars ); + } + for ( $i = 0; $i < $length; $i++ ) { + $code .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 ); + } + return $code; + } + + /** + * Sanitizes a numeric code to be used as an auth code. + * + * @param string $field The _REQUEST field to check for the code. + * @param int $length The valid expected length of the field. + * @return false|string Auth code on success, false if the field is not set or not expected length. + */ + public static function sanitize_code_from_request( $field, $length = 0 ) { + if ( empty( $_REQUEST[ $field ] ) ) { + return false; + } + + $code = wp_unslash( $_REQUEST[ $field ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, handled by the core method already. + $code = preg_replace( '/\s+/', '', $code ); + + // Maybe validate the length. + if ( $length && strlen( $code ) !== $length ) { + return false; + } + + return (string) $code; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php new file mode 100644 index 00000000..12a80763 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/class-two-factor-totp.php @@ -0,0 +1,768 @@ + WP_REST_Server::DELETABLE, + 'callback' => array( $this, 'rest_delete_totp' ), + 'permission_callback' => function( $request ) { + return current_user_can( 'edit_user', $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'number', + ), + ), + ), + array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'rest_setup_totp' ), + 'permission_callback' => function( $request ) { + return current_user_can( 'edit_user', $request['user_id'] ); + }, + 'args' => array( + 'user_id' => array( + 'required' => true, + 'type' => 'number', + ), + 'key' => array( + 'type' => 'string', + 'default' => '', + 'validate_callback' => null, // Note: validation handled in ::rest_setup_totp(). + ), + 'code' => array( + 'type' => 'string', + 'default' => '', + 'validate_callback' => null, // Note: validation handled in ::rest_setup_totp(). + ), + 'enable_provider' => array( + 'required' => false, + 'type' => 'boolean', + 'default' => false, + ), + ), + ), + ) + ); + } + + /** + * Returns the name of the provider. + */ + public function get_label() { + return _x( 'Time Based One-Time Password (TOTP)', 'Provider Label', 'two-factor' ); + } + + /** + * Enqueue scripts + * + * @codeCoverageIgnore + */ + public function enqueue_assets( $hook_suffix ) { + $environment_prefix = file_exists( TWO_FACTOR_DIR . '/dist' ) ? '/dist' : ''; + + wp_register_script( + 'two-factor-qr-code-generator', + plugins_url( $environment_prefix . '/includes/qrcode-generator/qrcode.js', __DIR__ ), + array(), + TWO_FACTOR_VERSION, + true + ); + } + + /** + * Rest API endpoint for handling deactivation of TOTP. + * + * @param WP_Rest_Request $request The Rest Request object. + * @return array Success array. + */ + public function rest_delete_totp( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + $this->delete_user_totp_key( $user_id ); + + ob_start(); + $this->user_two_factor_options( $user ); + $html = ob_get_clean(); + + return [ + 'success' => true, + 'html' => $html, + ]; + } + + /** + * REST API endpoint for setting up TOTP. + * + * @param WP_Rest_Request $request The Rest Request object. + * @return WP_Error|array Array of data on success, WP_Error on error. + */ + public function rest_setup_totp( $request ) { + $user_id = $request['user_id']; + $user = get_user_by( 'id', $user_id ); + + $key = $request['key']; + $code = preg_replace( '/\s+/', '', $request['code'] ); + + if ( ! $this->is_valid_key( $key ) ) { + return new WP_Error( 'invalid_key', __( 'Invalid Two Factor Authentication secret key.', 'two-factor' ), array( 'status' => 400 ) ); + } + + if ( ! $this->is_valid_authcode( $key, $code ) ) { + return new WP_Error( 'invalid_key_code', __( 'Invalid Two Factor Authentication code.', 'two-factor' ), array( 'status' => 400 ) ); + } + + if ( ! $this->set_user_totp_key( $user_id, $key ) ) { + return new WP_Error( 'db_error', __( 'Unable to save Two Factor Authentication code. Please re-scan the QR code and enter the code provided by your application.', 'two-factor' ), array( 'status' => 500 ) ); + } + + if ( $request->get_param( 'enable_provider' ) && ! Two_Factor_Core::enable_provider_for_user( $user_id, 'Two_Factor_Totp' ) ) { + return new WP_Error( 'db_error', __( 'Unable to enable TOTP provider for this user.', 'two-factor' ), array( 'status' => 500 ) ); + } + + ob_start(); + $this->user_two_factor_options( $user ); + $html = ob_get_clean(); + + return [ + 'success' => true, + 'html' => $html, + ]; + } + + /** + * Generates a URL that can be used to create a QR code. + * + * @param WP_User $user The user to generate a URL for. + * @param string $key The secret key. + * + * @return string + */ + public static function generate_qr_code_url( $user, $secret_key ) { + $issuer = get_bloginfo( 'name', 'display' ); + + /** + * Filter the Issuer for the TOTP. + * + * Must follow the TOTP format for a "issuer". Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format#issuer + * @param string $issuer The issuer for TOTP. + */ + $issuer = apply_filters( 'two_factor_totp_issuer', $issuer ); + + /** + * Filter the Label for the TOTP. + * + * Must follow the TOTP format for a "label". Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format#label + * @param string $totp_title The label for the TOTP. + * @param WP_User $user The User object. + * @param string $issuer The issuer of the TOTP. This should be the prefix of the result. + */ + $totp_title = apply_filters( 'two_factor_totp_title', $issuer . ':' . $user->user_login, $user, $issuer ); + + $totp_url = add_query_arg( + array( + 'secret' => rawurlencode( $secret_key ), + 'issuer' => rawurlencode( $issuer ), + ), + 'otpauth://totp/' . rawurlencode( $totp_title ) + ); + + /** + * Filter the TOTP generated URL. + * + * Must follow the TOTP format. Do not URL Encode. + * + * @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format + * @param string $totp_url The TOTP URL. + * @param WP_User $user The user object. + */ + $totp_url = apply_filters( 'two_factor_totp_url', $totp_url, $user ); + $totp_url = esc_url( $totp_url, array( 'otpauth' ) ); + + return $totp_url; + } + + /** + * Display TOTP options on the user settings page. + * + * @param WP_User $user The current user being edited. + * @return false + * + * @codeCoverageIgnore + */ + public function user_two_factor_options( $user ) { + if ( ! isset( $user->ID ) ) { + return false; + } + + $key = $this->get_user_totp_key( $user->ID ); + + wp_enqueue_script( 'two-factor-qr-code-generator' ); + + ?> +
        + generate_key(); + $totp_url = $this->generate_qr_code_url( $user, $key ); + + ?> + +

        + +

        +

        + + Loading... + + +

        + + + + + +

        + +

        +

        + + + +

        + + + + +

        + +

        +

        + + + + + +

        + +
        + sanitize_code_from_request( 'authcode', self::DEFAULT_DIGIT_COUNT ); + if ( ! $code ) { + return false; + } + + return $this->validate_code_for_user( $user, $code ); + } + + /** + * Validates an authentication code for a given user, preventing re-use and older TOTP keys. + * + * @param WP_User $user WP_User object of the logged-in user. + * @param int $code The TOTP token to validate. + * + * @return bool Whether the code is valid for the user and a newer code has not been used. + */ + public function validate_code_for_user( $user, $code ) { + $valid_timestamp = $this->get_authcode_valid_ticktime( + $this->get_user_totp_key( $user->ID ), + $code + ); + + if ( ! $valid_timestamp ) { + return false; + } + + $last_totp_login = (int) get_user_meta( $user->ID, self::LAST_SUCCESSFUL_LOGIN_META_KEY, true ); + + // The TOTP authentication is not valid, if we've seen the same or newer code. + if ( $last_totp_login && $last_totp_login >= $valid_timestamp ) { + return false; + } + + update_user_meta( $user->ID, self::LAST_SUCCESSFUL_LOGIN_META_KEY, $valid_timestamp ); + + return true; + } + + + /** + * Checks if a given code is valid for a given key, allowing for a certain amount of time drift. + * + * @param string $key The share secret key to use. + * @param string $authcode The code to test. + * + * @return bool Whether the code is valid within the time frame. + */ + public static function is_valid_authcode( $key, $authcode ) { + return (bool) self::get_authcode_valid_ticktime( $key, $authcode ); + } + + /** + * Checks if a given code is valid for a given key, allowing for a certain amount of time drift. + * + * @param string $key The share secret key to use. + * @param string $authcode The code to test. + * + * @return false|int Returns the timestamp of the authcode on success, False otherwise. + */ + public static function get_authcode_valid_ticktime( $key, $authcode ) { + /** + * Filter the maximum ticks to allow when checking valid codes. + * + * Ticks are the allowed offset from the correct time in 30 second increments, + * so the default of 4 allows codes that are two minutes to either side of server time + * + * @deprecated 0.7.0 Use {@see 'two_factor_totp_time_step_allowance'} instead. + * @param int $max_ticks Max ticks of time correction to allow. Default 4. + */ + $max_ticks = apply_filters_deprecated( 'two-factor-totp-time-step-allowance', array( self::DEFAULT_TIME_STEP_ALLOWANCE ), '0.7.0', 'two_factor_totp_time_step_allowance' ); + + $max_ticks = apply_filters( 'two_factor_totp_time_step_allowance', self::DEFAULT_TIME_STEP_ALLOWANCE ); + + // Array of all ticks to allow, sorted using absolute value to test closest match first. + $ticks = range( - $max_ticks, $max_ticks ); + usort( $ticks, array( __CLASS__, 'abssort' ) ); + + $time = floor( time() / self::DEFAULT_TIME_STEP_SEC ); + + foreach ( $ticks as $offset ) { + $log_time = $time + $offset; + if ( hash_equals( self::calc_totp( $key, $log_time ), $authcode ) ) { + // Return the tick timestamp. + return $log_time * self::DEFAULT_TIME_STEP_SEC; + } + } + + return false; + } + + /** + * Generates key + * + * @param int $bitsize Nume of bits to use for key. + * + * @return string $bitsize long string composed of available base32 chars. + */ + public static function generate_key( $bitsize = self::DEFAULT_KEY_BIT_SIZE ) { + $bytes = ceil( $bitsize / 8 ); + $secret = wp_generate_password( $bytes, true, true ); + + return self::base32_encode( $secret ); + } + + /** + * Pack stuff + * + * @param string $value The value to be packed. + * + * @return string Binary packed string. + */ + public static function pack64( $value ) { + // 64bit mode (PHP_INT_SIZE == 8). + if ( PHP_INT_SIZE >= 8 ) { + // If we're on PHP 5.6.3+ we can use the new 64bit pack functionality. + if ( version_compare( PHP_VERSION, '5.6.3', '>=' ) && PHP_INT_SIZE >= 8 ) { + return pack( 'J', $value ); // phpcs:ignore PHPCompatibility.ParameterValues.NewPackFormat.NewFormatFound + } + $highmap = 0xffffffff << 32; + $higher = ( $value & $highmap ) >> 32; + } else { + /* + * 32bit PHP can't shift 32 bits like that, so we have to assume 0 for the higher + * and not pack anything beyond it's limits. + */ + $higher = 0; + } + + $lowmap = 0xffffffff; + $lower = $value & $lowmap; + + return pack( 'NN', $higher, $lower ); + } + + /** + * Calculate a valid code given the shared secret key + * + * @param string $key The shared secret key to use for calculating code. + * @param mixed $step_count The time step used to calculate the code, which is the floor of time() divided by step size. + * @param int $digits The number of digits in the returned code. + * @param string $hash The hash used to calculate the code. + * @param int $time_step The size of the time step. + * + * @return string The totp code + */ + public static function calc_totp( $key, $step_count = false, $digits = self::DEFAULT_DIGIT_COUNT, $hash = self::DEFAULT_CRYPTO, $time_step = self::DEFAULT_TIME_STEP_SEC ) { + $secret = self::base32_decode( $key ); + + if ( false === $step_count ) { + $step_count = floor( time() / $time_step ); + } + + $timestamp = self::pack64( $step_count ); + + $hash = hash_hmac( $hash, $timestamp, $secret, true ); + + $offset = ord( $hash[19] ) & 0xf; + + $code = ( + ( ( ord( $hash[ $offset + 0 ] ) & 0x7f ) << 24 ) | + ( ( ord( $hash[ $offset + 1 ] ) & 0xff ) << 16 ) | + ( ( ord( $hash[ $offset + 2 ] ) & 0xff ) << 8 ) | + ( ord( $hash[ $offset + 3 ] ) & 0xff ) + ) % pow( 10, $digits ); + + return str_pad( $code, $digits, '0', STR_PAD_LEFT ); + } + + /** + * Whether this Two Factor provider is configured and available for the user specified. + * + * @param WP_User $user WP_User object of the logged-in user. + * + * @return boolean + */ + public function is_available_for_user( $user ) { + // Only available if the secret key has been saved for the user. + $key = $this->get_user_totp_key( $user->ID ); + + return ! empty( $key ); + } + + /** + * Prints the form that prompts the user to authenticate. + * + * @param WP_User $user WP_User object of the logged-in user. + * + * @codeCoverageIgnore + */ + public function authentication_page( $user ) { + require_once ABSPATH . '/wp-admin/includes/template.php'; + ?> +

        + +

        +

        + + +

        + + = 8 ) { + $j -= 8; + $binary .= chr( ( $n & ( 0xFF << $j ) ) >> $j ); + } + } + + return $binary; + } + + /** + * Used with usort to sort an array by distance from 0 + * + * @param int $a First array element. + * @param int $b Second array element. + * + * @return int -1, 0, or 1 as needed by usort + */ + private static function abssort( $a, $b ) { + $a = abs( $a ); + $b = abs( $b ); + if ( $a === $b ) { + return 0; + } + return ( $a < $b ) ? -1 : 1; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css new file mode 100644 index 00000000..96ca78aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/css/fido-u2f-admin.css @@ -0,0 +1,12 @@ +#security-keys-section .wp-list-table { + margin-bottom: 2em; +} + +#security-keys-section .register-security-key .spinner { + float: none; +} + +#security-keys-section .security-key-status { + vertical-align: middle; + font-style: italic; +} diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js new file mode 100644 index 00000000..b7b0123e --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-admin-inline-edit.js @@ -0,0 +1,150 @@ +/* global window, document, jQuery, inlineEditL10n, ajaxurl */ +var inlineEditKey; + +( function( $ ) { + inlineEditKey = { + + init: function() { + var t = this, + row = $( '#security-keys-section #inline-edit' ); + + t.what = '#key-'; + + $( '#security-keys-section #the-list' ).on( 'click', 'a.editinline', function() { + inlineEditKey.edit( this ); + return false; + } ); + + // Prepare the edit row. + row.keyup( function( event ) { + if ( 27 === event.which ) { + return inlineEditKey.revert(); + } + } ); + + $( 'a.cancel', row ).click( function() { + return inlineEditKey.revert(); + } ); + + $( 'a.save', row ).click( function() { + return inlineEditKey.save( this ); + } ); + + $( 'input, select', row ).keydown( function( event ) { + if ( 13 === event.which ) { + return inlineEditKey.save( this ); + } + } ); + }, + + toggle: function( el ) { + var t = this; + + if ( 'none' === $( t.what + t.getId( el ) ).css( 'display' ) ) { + t.revert(); + } else { + t.edit( el ); + } + }, + + edit: function( id ) { + var editRow, rowData, val, + t = this; + t.revert(); + + if ( 'object' === typeof id ) { + id = t.getId( id ); + } + + editRow = $( '#inline-edit' ).clone( true ); + rowData = $( '#inline_' + id ); + + $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '#security-keys-section .widefat thead' ).length ); + + $( t.what + id ).hide().after( editRow ).after( '' ); + + val = $( '.name', rowData ); + val.find( 'img' ).replaceWith( function() { + return this.alt; + } ); + val = val.text(); + $( ':input[name="name"]', editRow ).val( val ); + + $( editRow ).attr( 'id', 'edit-' + id ).addClass( 'inline-editor' ).show(); + $( '.ptitle', editRow ).eq( 0 ).focus(); + + return false; + }, + + save: function( id ) { + var params, fields; + + if ( 'object' === typeof id ) { + id = this.getId( id ); + } + + $( '#security-keys-section table.widefat .spinner' ).addClass( 'is-active' ); + + params = { + action: 'inline-save-key', + keyHandle: id, + user_id: window.u2fL10n.user_id + }; + + fields = $( '#edit-' + id ).find( ':input' ).serialize(); + params = fields + '&' + $.param( params ); + + // Make ajax request. + $.post( ajaxurl, params, + function( r ) { + var row, newID; + $( '#security-keys-section table.widefat .spinner' ).removeClass( 'is-active' ); + + if ( r ) { + if ( -1 !== r.indexOf( '' )[0].submit.call( $( '#your-profile' )[0] ); + } ); + } ); +}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js new file mode 100644 index 00000000..28295307 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/providers/js/fido-u2f-login.js @@ -0,0 +1,16 @@ +/* global window, u2f, u2fL10n, jQuery */ +( function( $ ) { + if ( ! window.u2fL10n ) { + window.console.error( 'u2fL10n is not defined' ); + return; + } + + u2f.sign( u2fL10n.request[0].appId, u2fL10n.request[0].challenge, u2fL10n.request, function( data ) { + if ( data.errorCode ) { + window.console.error( 'Registration Failed', data.errorCode ); + } else { + $( '#u2f_response' ).val( JSON.stringify( data ) ); + $( '#loginform' ).submit(); + } + } ); +}( jQuery ) ); diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt b/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt new file mode 100644 index 00000000..0aa252cb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/readme.txt @@ -0,0 +1,52 @@ +=== Two-Factor === +Contributors: georgestephanis, valendesigns, stevenkword, extendwings, sgrant, aaroncampbell, johnbillion, stevegrunwell, netweb, kasparsd, alihusnainarshad, passoniate +Tags: two factor, two step, authentication, login, totp, fido u2f, u2f, email, backup codes, 2fa, yubikey +Requires at least: 4.3 +Tested up to: 6.0 +Requires PHP: 5.6 +Stable tag: 0.8.1 + +Enable Two-Factor Authentication using time-based one-time passwords (OTP, Google Authenticator), Universal 2nd Factor (FIDO U2F, YubiKey), email and backup verification codes. + +== Description == + +Use the "Two-Factor Options" section under "Users" → "Your Profile" to enable and configure one or multiple two-factor authentication providers for your account: + +- Email codes +- Time Based One-Time Passwords (TOTP) +- FIDO Universal 2nd Factor (U2F) +- Backup Codes +- Dummy Method (only for testing purposes) + +For more history, see [this post](https://georgestephanis.wordpress.com/2013/08/14/two-cents-on-two-factor/). + += Actions & Filters = + +Here is a list of action and filter hooks provided by the plugin: + +- `two_factor_providers` filter overrides the available two-factor providers such as email and time-based one-time passwords. Array values are PHP classnames of the two-factor providers. +- `two_factor_enabled_providers_for_user` filter overrides the list of two-factor providers enabled for a user. First argument is an array of enabled provider classnames as values, the second argument is the user ID. +- `two_factor_user_authenticated` action which receives the logged in `WP_User` object as the first argument for determining the logged in user right after the authentication workflow. +- `two_factor_token_ttl` filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the `WP_User` object being authenticated. + +== Frequently Asked Questions == + += How can I send feedback or get help with a bug? = + +The best place to report bugs, feature suggestions, or any other (non-security) feedback is at the Two Factor GitHub issues page. Before submitting a new issue, please search the existing issues to check if someone else has reported the same feedback. + += Where can I report security bugs? = + +The plugin contributors and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, please visit the [WordPress HackerOne](https://hackerone.com/wordpress) program. + +== Screenshots == + +1. Two-factor options under User Profile. +2. U2F Security Keys section under User Profile. +3. Email Code Authentication during WordPress Login. + +== Changelog == + +See the [release history](https://github.com/wordpress/two-factor/releases). diff --git a/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php b/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php new file mode 100644 index 00000000..c4a64c09 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/two-factor/two-factor.php @@ -0,0 +1,48 @@ +_config = Dispatcher::config(); + $this->_config_master = Dispatcher::config_master(); + $this->_page = Util_Admin::get_current_page(); + } + + /** + * Render header. + */ + public function options() { + $this->view(); + } + + /** + * Render footer. + */ + public function render_footer() { + include W3TC_INC_OPTIONS_DIR . '/common/footer.php'; + } + + /** + * Returns true if config section is sealed. + * + * @param string $section Config section. + * + * @return boolean + */ + protected function is_sealed( $section ) { + return true; + } + + /** + * Returns true if we edit master config. + * + * @return boolean + */ + protected function is_master() { + return $this->_config->is_master(); + } + + /** + * Prints checkbox with config option value. + * + * @param string $option_id Option ID. + * @param bool $disabled Disabled flag. + * @param string $class_prefix Class prefix. + * @param bool $label Label. + * @param bool $force_value Override value. + */ + protected function checkbox( $option_id, $disabled = false, $class_prefix = '', $label = true, $force_value = null ) { + $disabled = $disabled || $this->_config->is_sealed( $option_id ); + $name = Util_Ui::config_key_to_http_name( $option_id ); + + if ( ! $disabled ) { + echo ''; + } + + if ( $label ) { + echo '
        + + '; + } else { + $opportunities .= ' +
        + ' . esc_html( $opportunity['title'] ) . ( isset( $opportunity['displayValue'] ) ? ' - ' . esc_html( $opportunity['displayValue'] ) : '' ) . ' +
        +

        ' . $opportunity['description'] . '

        +
        + + ' . $headers . '' . $items . ' +
        +
        +
        + +
        + Total Cache + : + ' . esc_html__( 'Tips', 'w3-total-cache' ) . ' +
        +
        +
        ' . $opportunity['instructions'] . '
        +
        +
        +
        +
        '; + } + } + + foreach ( $data['diagnostics'] as $diagnostic ) { + if ( empty( $diagnostic['details'] ) ) { + continue; + } + + $diagnostic['score'] *= 100; + + $notice = 'notice notice-info inline'; + $grade = 'w3tcps_blank'; + if ( isset( $diagnostic['score'] ) ) { + $notice = self::get_breakdown_bg( $diagnostic['score'] ); + $grade = self::get_breakdown_grade( $diagnostic['score'] ); + } + + $audit_classes = ''; + foreach ( $opportunity['type'] as $type ) { + $audit_classes .= ' ' . $type; + } + + $diagnostic['description'] = preg_replace( '/(.*?)(\[.*?\])\((.*?)\)(.*?[,.?!]*)/', '$1$2$4', esc_html( $diagnostic['description'] ) ); + + $headers = ''; + $items = ''; + foreach ( $diagnostic['details'] as $item ) { + $headers = ''; + $items .= ''; + if ( isset( $item['url'] ) ) { + $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ''; + if ( filter_var( $item['url'], FILTER_VALIDATE_URL ) !== false ) { + // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value. + $items .= ' ...' . esc_url( wp_parse_url( $item['url'] )['path'] ) . ''; + } else { + // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text. + $items .= '' . esc_html( $item['url'] ) . ''; + } + } + if ( isset( $item['source'] ) ) { + $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ''; + if ( filter_var( $item['source']['url'], FILTER_VALIDATE_URL ) !== false ) { + // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value. + $items .= ' ...' . esc_url( wp_parse_url( $item['source']['url'] )['path'] ) . ''; + } else { + // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text. + $items .= '' . esc_html( $item['source']['url'] ) . ''; + } + } + if ( isset( $item['totalBytes'] ) ) { + $headers .= '' . esc_html__( 'Total Bytes', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['totalBytes'] ) . ''; + } + if ( isset( $item['wastedBytes'] ) ) { + $headers .= '' . esc_html__( 'Wasted Bytes', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['wastedBytes'] ) . ''; + } + if ( isset( $item['wastedPercent'] ) ) { + $headers .= '' . esc_html__( 'Wasted Percentage', 'w3-total-cache' ) . ''; + $items .= '' . round( $item['wastedPercent'], 2 ) . '%'; + } + if ( isset( $item['wastedMs'] ) ) { + $headers .= '' . esc_html__( 'Wasted Miliseconds', 'w3-total-cache' ) . ''; + $items .= '' . round( $item['wastedMs'], 2 ) . ''; + } + if ( isset( $item['label'] ) ) { + $headers .= '' . esc_html__( 'Type', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['label'] ) . ''; + } + if ( isset( $item['groupLabel'] ) ) { + $headers .= '' . esc_html__( 'Group', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['groupLabel'] ) . ''; + } + if ( isset( $item['requestCount'] ) ) { + $headers .= '' . esc_html__( 'Requests', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['requestCount'] ) . ''; + } + if ( isset( $item['transferSize'] ) ) { + $headers .= '' . esc_html__( 'Transfer Size', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['transferSize'] ) . ''; + } + if ( isset( $item['startTime'] ) ) { + $headers .= '' . esc_html__( 'Start Time', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['startTime'] ) . ''; + } + if ( isset( $item['duration'] ) ) { + $headers .= '' . esc_html__( 'Duration', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['duration'] ) . ''; + } + if ( isset( $item['scriptParseCompile'] ) ) { + $headers .= '' . esc_html__( 'Parse/Compile Time', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['scriptParseCompile'] ) . ''; + } + if ( isset( $item['scripting'] ) ) { + $headers .= '' . esc_html__( 'Execution Time', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['scripting'] ) . ''; + } + if ( isset( $item['total'] ) ) { + $headers .= '' . esc_html__( 'Total', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['total'] ) . ''; + } + if ( isset( $item['cacheLifetimeMs'] ) ) { + $headers .= '' . esc_html__( 'Cache Lifetime Miliseconds', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['cacheLifetimeMs'] ) . ''; + } + if ( isset( $item['cacheHitProbability'] ) ) { + $headers .= '' . esc_html__( 'Cache Hit Probability', 'w3-total-cache' ) . ''; + $items .= '' . ( esc_html( $item['cacheHitProbability'] ) * 100 ) . '%'; + } + if ( isset( $item['value'] ) && isset( $item['statistic'] ) ) { + $headers .= '' . esc_html__( 'Statistic', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['statistic'] ) . ''; + + $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ''; + $items .= ''; + if ( isset( $item['node'] ) ) { + $items .= '

        ' . esc_html( $item['node']['snippet'] ) . '

        '; + $items .= '

        ' . esc_html( $item['node']['selector'] ) . '

        '; + } + $items .= ''; + + $headers .= '' . esc_html__( 'Value', 'w3-total-cache' ) . ''; + $items .= '' . esc_html( $item['value'] ) . ''; + } elseif ( isset( $item['node'] ) ) { + $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ''; + $items .= ''; + $items .= '

        ' . esc_html( $item['node']['snippet'] ) . '

        '; + $items .= '

        ' . esc_html( $item['node']['selector'] ) . '

        '; + $items .= ''; + } + $items .= ''; + } + + $items = ( isset( $items ) ? $items : '

        ' . esc_html__( 'No identified items were provided by Google PageSpeed Insights API for this metric', 'w3-total-cache' ) . '

        ' ); + + if ( $diagnostic['score'] >= 90 ) { + $passed_audits .= ' +
        + ' . esc_html( $diagnostic['title'] ) . ( isset( $diagnostic['displayValue'] ) ? ' - ' . esc_html( $diagnostic['displayValue'] ) : '' ) . ' +
        +

        ' . $diagnostic['description'] . '

        +
        + + ' . $headers . '' . $items . ' +
        +
        +
        + +
        + Total Cache + : + ' . esc_html__( 'Tips', 'w3-total-cache' ) . ' +
        +
        +
        ' . $diagnostic['instructions'] . '
        +
        +
        +
        +
        '; + } else { + $diagnostics .= ' +
        + ' . esc_html( $diagnostic['title'] ) . ( isset( $diagnostic['displayValue'] ) ? ' - ' . esc_html( $diagnostic['displayValue'] ) : '' ) . ' +
        +

        ' . $diagnostic['description'] . '

        +
        + + ' . $headers . '' . $items . ' +
        +
        +
        + +
        + Total Cache + : + ' . esc_html__( 'Tips', 'w3-total-cache' ) . ' +
        +
        +
        ' . $diagnostic['instructions'] . '
        +
        +
        +
        +
        '; + } + } + + $allowed_tags = self::get_allowed_tags(); + + echo wp_kses( + '
        +

        ' . esc_html__( 'Opportunities', 'w3-total-cache' ) . '

        ' . $opportunities . '
        +

        ' . esc_html__( 'Diagnostics', 'w3-total-cache' ) . '

        ' . $diagnostics . '
        +

        ' . esc_html__( 'Passed Audits', 'w3-total-cache' ) . '

        ' . $passed_audits . '
        +
        ', + $allowed_tags + ); + } + + /** + * Recursively get value based on series of key decendents. + * + * @param array $data PageSpeed data. + * @param array $elements Array of key decendents. + * + * @return object | null + */ + public static function get_value_recursive( $data, $elements ) { + if ( empty( $elements ) ) { + return $data; + } + + $key = array_shift( $elements ); + if ( ! isset( $data[ $key ] ) ) { + return null; + } + + return self::get_value_recursive( $data[ $key ], $elements ); + } + + /** + * Return wp_kses allowed HTML tags/attributes. + * + * @return array + */ + public static function get_allowed_tags() { + return array( + 'div' => array( + 'id' => array(), + 'class' => array(), + ), + 'span' => array( + 'id' => array(), + 'class' => array(), + 'title' => array(), + 'gatitle' => array(), + 'copyurl' => array(), + ), + 'p' => array( + 'id' => array(), + 'class' => array(), + ), + 'table' => array( + 'id' => array(), + 'class' => array(), + ), + 'tr' => array( + 'id' => array(), + 'class' => array(), + ), + 'td' => array( + 'id' => array(), + 'class' => array(), + ), + 'th' => array( + 'id' => array(), + 'class' => array(), + ), + 'b' => array( + 'id' => array(), + 'class' => array(), + ), + 'br' => array(), + 'a' => array( + 'id' => array(), + 'class' => array(), + 'href' => array(), + 'target' => array(), + 'rel' => array(), + 'title' => array(), + ), + 'link' => array( + 'id' => array(), + 'class' => array(), + 'href' => array(), + 'rel' => array(), + 'as' => array(), + 'type' => array(), + ), + 'code' => array( + 'id' => array(), + 'class' => array(), + ), + 'img' => array( + 'id' => array(), + 'class' => array(), + 'srcset' => array(), + 'src' => array(), + 'alt' => array(), + ), + 'ul' => array( + 'id' => array(), + 'class' => array(), + ), + 'ol' => array( + 'id' => array(), + 'class' => array(), + ), + 'li' => array( + 'id' => array(), + 'class' => array(), + ), + 'h3' => array( + 'id' => array(), + 'class' => array(), + ), + ); + } + + /** + * Get cache life time. + * + * @return int + */ + public static function get_cache_life() { + return 3600; + } + + /** + * Conver seconds into string breaking down days/hours/minutes/seconds. + * + * @param int $seconds Seconds. + * + * @return string + */ + public static function seconds_to_str( $seconds ) { + $buffer = ''; + if ( $seconds >= 86400 ) { + $days = floor( $seconds / 86400 ); + $seconds = $seconds % 86400; + $buffer .= $days . ' day' . ( $days > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' ); + } + if ( $seconds >= 3600 ) { + $hours = floor( $seconds / 3600 ); + $seconds = $seconds % 3600; + $buffer .= $hours . ' hour' . ( $hours > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' ); + } + if ( $seconds >= 60 ) { + $minutes = floor( $seconds / 60 ); + $seconds = $seconds % 60; + $buffer .= $minutes . ' minute' . ( $minutes > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' ); + } + if ( $seconds > 0 ) { + $buffer .= $seconds . ' second' . ( $seconds > 1 ? 's' : '' ); + } + return $buffer; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php new file mode 100644 index 00000000..d1871cb3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php @@ -0,0 +1,874 @@ +post_type; + $archive_link = get_post_type_archive_link($post_type); + $posts_page_uri = str_replace( home_url(), '', $archive_link ); + + if ( $posts_page_uri ) { + $full_urls[] = $archive_link; + $full_urls = array_merge( $full_urls, self::get_older_pages( $posts_page_uri, $limit_post_pages, $post_type ) ); + } + + $cpt_archive_urls[$limit_post_pages] = $full_urls; + } + + return $cpt_archive_urls[$limit_post_pages]; + } + + /** + * Return older pages listing posts + * + * @param unknown $posts_page_uri + * @param int $limit_post_pages default is 10 + * @param string $post_type default is post + * @return array + */ + static private function get_older_pages( $posts_page_uri, $limit_post_pages = 10, $post_type = 'post' ) { + $full_urls = array(); + $count_posts = wp_count_posts($post_type); + $posts_number = $count_posts->publish; + $posts_per_page = get_option( 'posts_per_page' ); + $posts_pages_number = @ceil( $posts_number / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + for ( $pagenum = 2; $pagenum <= $posts_pages_number; $pagenum++ ) { + $home_pagenum_link = self::get_pagenum_link( $posts_page_uri, $pagenum ); + $full_urls[] = $home_pagenum_link; + } + return $full_urls; + } + + /** + * Returns all urls related to a post + * + * @param unknown $post_id + * @return array + */ + static public function get_post_urls( $post_id ) { + static $post_urls = array(); + + if ( !isset( $post_urls[$post_id] ) ) { + $full_urls = array(); + $post_link = get_permalink( $post_id ); + $post_uri = str_replace( Util_Environment::home_domain_root_url(), '', $post_link ); + + $full_urls[] = $post_link; + $uris[] = $post_uri; + $post = get_post( $post_id ); + $matches =array(); + if ( $post && ( $post_pages_number = preg_match_all( '/\<\!\-\-nextpage\-\-\>/', $post->post_content, $matches ) )>0 ) { + global $wp_rewrite; + $post_pages_number++; + for ( $pagenum = 2; $pagenum <= $post_pages_number; $pagenum++ ) { + if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) + $post_pagenum_link = trailingslashit( $post_link ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $pagenum, 'single_paged' ); + else + $post_pagenum_link = trailingslashit( $post_link ) . user_trailingslashit( $pagenum, 'single_paged' ); + $full_urls[] = $post_pagenum_link; + } + } + + $post_urls[$post_id] = $full_urls; + } + return $post_urls[$post_id]; + } + + /** + * Return full urls for the posts comment pages + * + * @param unknown $post_id + * @return array + */ + static public function get_post_comments_urls( $post_id ) { + static $post_comments_urls = array(); + + if ( !isset( $post_comments_urls[$post_id] ) ) { + $full_urls = array(); + $comments_number = get_comments_number( $post_id ); + $comments_per_page = get_option( 'comments_per_page' ); + $comments_pages_number = @ceil( $comments_number / $comments_per_page ); + + for ( $pagenum = 1; $pagenum <= $comments_pages_number; $pagenum++ ) { + $comments_pagenum_link = self::get_comments_pagenum_link( $post_id, $pagenum ); + + $full_urls[] = $comments_pagenum_link; + } + $post_comments_urls[$post_id] = $full_urls; + } + return $post_comments_urls[$post_id]; + } + + /** + * Return full urls for the authors pages + * + * @param unknown $post_author + * @param int $limit_post_pages default is 10 + * @return array + */ + static public function get_post_author_urls( $post_author, $limit_post_pages = 10 ) { + static $feed_author_urls = array(); + + $key = md5( $post_author . ',' . $limit_post_pages ); + if ( !isset( $post_author_urls[$key] ) ) { + $full_urls = array(); + $posts_number = count_user_posts( $post_author ); + $posts_per_page = get_option( 'posts_per_page' ); + $posts_pages_number = @ceil( $posts_number / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + $author_link = get_author_posts_url( $post_author ); + $author_uri = str_replace( Util_Environment::home_domain_root_url(), '', $author_link ); + + for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) { + $author_pagenum_link = self::get_pagenum_link( $author_uri, $pagenum ); + $full_urls[] = $author_pagenum_link; + } + $post_author_urls[$key] = $full_urls; + } + return $post_author_urls[$key]; + } + + /** + * Returns full urls to post terms pages + * + * @param unknown $terms + * @param int $limit_post_pages default is 10 + * @return array + */ + static public function get_post_terms_urls( $terms, $limit_post_pages = 10 ) { + static $post_terms_urls = array(); + + $key = md5( self::_term_hash( $terms ) . ',' . $limit_post_pages ); + if ( !isset( $post_terms_urls[$key] ) ) { + $full_urls = array(); + $posts_per_page = get_option( 'posts_per_page' ); + + foreach ( $terms as $term ) { + $term_link = get_term_link( $term, $term->taxonomy ); + $term_uri = str_replace( Util_Environment::home_domain_root_url(), '', $term_link ); + $posts_pages_number = @ceil( $term->count / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) { + $term_pagenum_link = self::get_pagenum_link( $term_uri, $pagenum ); + $full_urls[] = $term_pagenum_link; + } + } + $post_terms_urls[$key] = $full_urls; + } + return $post_terms_urls[$key]; + + } + + /** + * Return full urls for daily archive pages based on provided post + * + * @param unknown $post + * @param int $limit_post_pages default is 10 + * @return array + */ + static public function get_daily_archive_urls( $post, $limit_post_pages = 10 ) { + static $daily_archive_urls = array(); + + $post_type = $post->post_type; + $archive_slug = self::_get_archive_slug( $post ); + + $key = md5( $post->ID . ',' . $limit_post_pages ); + if ( !isset( $daily_archive_urls[$key] ) ) { + $full_urls = array(); + $post_date = strtotime( $post->post_date ); + $post_year = gmdate( 'Y', $post_date ); + $post_month = gmdate( 'm', $post_date ); + $post_day = gmdate( 'd', $post_date ); + $posts_per_page = get_option( 'posts_per_page' ); + $posts_number = self::get_archive_posts_count( $post_year, $post_month, $post_day, $post_type ); + $posts_pages_number = @ceil( $posts_number / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + $day_link = get_day_link( $post_year, $post_month, $post_day ); + $day_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $day_link ); + + for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) { + $day_pagenum_link = self::get_pagenum_link( $day_uri, $pagenum ); + $full_urls[] = $day_pagenum_link; + } + $daily_archive_urls[$key] = $full_urls; + } + return $daily_archive_urls[$key]; + } + + /** + * Return full urls for montly archive pages based on provided post + * + * @param unknown $post + * @param int $limit_post_pages default is 10 + * @return array + */ + static public function get_monthly_archive_urls( $post, $limit_post_pages = 10 ) { + static $monthly_archive_urls = array(); + + $post_type = $post->post_type; + $archive_slug = self::_get_archive_slug( $post ); + + $key = md5( $post->ID . ',' . $limit_post_pages ); + if ( !isset( $monthly_archive_urls[$key] ) ) { + $full_urls = array(); + $post_date = strtotime( $post->post_date ); + $post_year = gmdate( 'Y', $post_date ); + $post_month = gmdate( 'm', $post_date ); + + $posts_per_page = get_option( 'posts_per_page' ); + $posts_number = self::get_archive_posts_count( $post_year, $post_month, '', $post_type ); + $posts_pages_number = @ceil( $posts_number / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + $month_link = get_month_link( $post_year, $post_month ); + $month_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $month_link ); + + for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) { + $month_pagenum_link = self::get_pagenum_link( $month_uri, $pagenum ); + $full_urls[] = $month_pagenum_link; + } + + $monthly_archive_urls[$key] = $full_urls; + } + return $monthly_archive_urls[$key]; + } + + /** + * Return full urls for yearly archive pages based on provided post + * + * @param unknown $post + * @param int $limit_post_pages default is 10 + * @return array + */ + static public function get_yearly_archive_urls( $post, $limit_post_pages = 10 ) { + static $yearly_archive_urls = array(); + + $post_type = $post->post_type; + $archive_slug = self::_get_archive_slug( $post ); + + $key = md5( $post->ID . ',' . $limit_post_pages ); + if ( !isset( $yearly_archive_urls[$key] ) ) { + + $full_urls = array(); + $post_date = strtotime( $post->post_date ); + $post_year = gmdate( 'Y', $post_date ); + + $posts_per_page = get_option( 'posts_per_page' ); + $posts_number =self::get_archive_posts_count( $post_year, '', '', $post_type ); + $posts_pages_number = @ceil( $posts_number / $posts_per_page ); + + if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) { + $posts_pages_number = $limit_post_pages; + } + + $year_link = get_year_link( $post_year ); + $year_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $year_link ); + + for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) { + $year_pagenum_link = self::get_pagenum_link( $year_uri, $pagenum ); + $full_urls[] = $year_pagenum_link; + } + $yearly_archive_urls[$key] = $full_urls; + } + return $yearly_archive_urls[$key]; + } + + /** + * Return full urls for the provided feed types + * + * @param unknown $feeds + * @param string|null $post_type + * @return array + */ + static public function get_feed_urls( $feeds, $post_type = null ) { + static $feed_urls = array(); + + $key = md5( implode( ',', $feeds ) . $post_type ); + if ( !isset( $feed_urls[$key] ) ) { + $full_urls = array(); + foreach ( $feeds as $feed ) { + $feed_link = self::get_feed_link( $feed, $post_type ); + + $full_urls[] = $feed_link; + } + $feed_urls[$key] = $full_urls; + } + return $feed_urls[$key]; + } + + /** + * Return full urls for the provided post id and feed types + * + * @param unknown $post_id + * @param unknown $feeds + * @return array + */ + static public function get_feed_comments_urls( $post_id, $feeds ) { + static $feed_comments_urls = array(); + + $key = md5( implode( ',', $feeds ) . $post_id ); + if ( !isset( $feed_comments_urls[$key] ) ) { + $full_urls = array(); + foreach ( $feeds as $feed ) { + $post_comments_feed_link = self::get_post_comments_feed_link( $post_id, $feed ); + $full_urls[] = $post_comments_feed_link; + } + $feed_comments_urls[$key] = $full_urls; + } + return $feed_comments_urls[$key]; + } + + /** + * Returns full urls for the provided post author and feed types + * + * @param unknown $post_author + * @param unknown $feeds + * @return array + */ + static public function get_feed_author_urls( $post_author, $feeds ) { + static $post_author_urls = array(); + + $key = md5( implode( ',', $feeds ) . $post_author ); + if ( !isset( $feed_author_urls[$key] ) ) { + $full_urls = array(); + foreach ( $feeds as $feed ) { + $author_feed_link = self::get_author_feed_link( $post_author, $feed ); + $full_urls[] = $author_feed_link; + } + $feed_author_urls[$key] = $full_urls; + } + return $feed_author_urls[$key]; + } + + /** + * Returns full urls for the provided terms and feed types + * + * @param unknown $terms + * @param unknown $feeds + * @return array + */ + static public function get_feed_terms_urls( $terms, $feeds ) { + static $feed_terms_urls = array(); + + $key = md5( implode( ',', $feeds ) . self::_term_hash( $terms ) ); + if ( !isset( $feed_terms_urls[$key] ) ) { + $full_urls = array(); + foreach ( $terms as $term ) { + foreach ( $feeds as $feed ) { + $term_feed_link = self::get_term_feed_link( $term->term_id, $term->taxonomy, $feed ); + $full_urls[] = $term_feed_link; + } + } + $feed_terms_urls[$key] = $full_urls; + } + return $feed_terms_urls[$key]; + } + + /** + * Returns full urls for the provided url path based pages, ie /some/page. + * + * @param unknown $pages + * @return array + */ + static public function get_pages_urls( $pages ) { + static $pages_urls = array(); + + $key = md5( implode( ',', $pages ) ); + if ( !isset( $pages_urls[$key] ) ) { + $full_urls = array(); + foreach ( $pages as $uri ) { + if ( $uri ) { + $page_link = get_home_url() . '/' . trim( $uri, '/' ) . + ( strpos( $uri, '?' ) !== FALSE ? '': '/' ); + $full_urls[] = $page_link; + } + } + $pages_urls[$key] = $full_urls; + } + return $pages_urls[$key]; + } + + /** + * Workaround for get_pagenum_link function + * + * @param string $url + * @param int $pagenum + * @return string + */ + public static function get_pagenum_link( $url, $pagenum = 1 ) { + $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; + $_SERVER['REQUEST_URI'] = $url; + + if ( is_admin() ) { + $link = self::get_pagenum_link_admin( $pagenum ); + } else { + $link = get_pagenum_link( $pagenum ); + } + + $_SERVER['REQUEST_URI'] = $request_uri; + + return $link; + } + + + /** + * Workaround for get_pagenum_link static public function when in admin + * + * @param unknown $pagenum + * @return string + */ + static public function get_pagenum_link_admin( $pagenum ) { + global $wp_rewrite; + + $pagenum = (int) $pagenum; + + $request = remove_query_arg( 'paged' ); + + $home_root = parse_url( home_url() ); + $home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : ''; + $home_root = preg_quote( trailingslashit( $home_root ), '|' ); + + $request = preg_replace( '|^'. $home_root . '|', '', $request ); + $request = preg_replace( '|^/+|', '', $request ); + $qs_regex = '|\?.*?$|'; + preg_match( $qs_regex, $request, $qs_match ); + + if ( !empty( $qs_match[0] ) ) { + $query_string = $qs_match[0]; + $request = preg_replace( $qs_regex, '', $request ); + } else { + $query_string = ''; + } + + $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request ); + $request = preg_replace( '|^index\.php|', '', $request ); + $request = ltrim( $request, '/' ); + + $base = trailingslashit( get_bloginfo( 'url' ) ); + + if ( !is_null( $wp_rewrite ) && + $wp_rewrite->using_index_permalinks() && + ( $pagenum > 1 || '' != $request ) ) + $base .= 'index.php/'; + + if ( $pagenum > 1 ) { + $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' ); + } + + $result = $base . $request . $query_string; + $result = apply_filters( 'get_pagenum_link', $result, $pagenum ); + return $result; + } + + /** + * Workaround for get_comments_pagenum_link function + * + * @param integer $post_id + * @param integer $pagenum + * @param integer $max_page + * @return string + */ + static public function get_comments_pagenum_link( $post_id, $pagenum = 1, $max_page = 0 ) { + if ( isset( $GLOBALS['post'] ) && is_object( $GLOBALS['post'] ) ) { + $old_post = &$GLOBALS['post']; + } else { + $GLOBALS['post'] = new \stdClass(); + $old_post = null; + } + + $GLOBALS['post']->ID = $post_id; + + $link = get_comments_pagenum_link( $pagenum, $max_page ); + + if ( $old_post ) { + $GLOBALS['post'] = &$old_post; + } + + return $link; + } + + /** + * Returns number of posts in the archive. + * + * @global $wpdb + * + * @param int $year Year. + * @param int $month Month. + * @param int $day Day number. + * @param string $post_type Post type. + * @return int + */ + public static function get_archive_posts_count( $year = 0, $month = 0, $day = 0, $post_type = 'post' ) { + global $wpdb; + + $filters = array( + 'post_type = "' . $post_type .'"', + 'post_status = "publish"' + ); + + if ( $year ) { + $filters[] = sprintf( 'YEAR(post_date) = %d', $year ); + } + + if ( $month ) { + $filters[] = sprintf( 'MONTH(post_date) = %d', $month ); + } + + if ( $day ) { + $filters[] = sprintf( 'DAY(post_date) = %d', $day ); + } + + $where = implode( ' AND ', $filters ); + + $sql = sprintf( 'SELECT COUNT(*) FROM %s WHERE %s', $wpdb->posts, $where ); + + $count = (int) $wpdb->get_var( $sql ); + + return $count; + } + + /** + * Workaround for get_feed_link function, remove filtering. + * + * @param string $feed + * @param null|string $post_type + * @return mixed + */ + static public function get_feed_link( $feed = '', $post_type=null ) { + /** + * + * + * @var $wp_rewrite WP_Rewrite + */ + global $wp_rewrite; + + if ( $post_type ) + return get_post_type_archive_feed_link( $post_type, $feed ); + + $permalink = $wp_rewrite->get_feed_permastruct(); + if ( '' != $permalink ) { + if ( false !== strpos( $feed, 'comments_' ) ) { + $feed = str_replace( 'comments_', '', $feed ); + $permalink = $wp_rewrite->get_comment_feed_permastruct(); + } + + if ( get_default_feed() == $feed ) + $feed = ''; + + $permalink = str_replace( '%feed%', $feed, $permalink ); + $permalink = preg_replace( '#/+#', '/', "/$permalink" ); + $output = home_url( user_trailingslashit( $permalink, 'feed' ) ); + } else { + if ( empty( $feed ) ) + $feed = get_default_feed(); + + if ( false !== strpos( $feed, 'comments_' ) ) + $feed = str_replace( 'comments_', 'comments-', $feed ); + + $output = home_url( "?feed={$feed}" ); + } + + return $output; + } + + /** + * Workaround for get_post_comments_feed_link function, remove filtering. + * + * @param int $post_id + * @param string $feed + * @return string + */ + static public function get_post_comments_feed_link( $post_id = 0, $feed = '' ) { + $post_id = absint( $post_id ); + + if ( ! $post_id ) + $post_id = get_the_ID(); + + if ( empty( $feed ) ) + $feed = get_default_feed(); + + if ( '' != get_option( 'permalink_structure' ) ) { + if ( 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) ) + $url = _get_page_link( $post_id ); + else + $url = get_permalink( $post_id ); + + $url = trailingslashit( $url ) . 'feed'; + if ( $feed != get_default_feed() ) + $url .= "/$feed"; + $url = user_trailingslashit( $url, 'single_feed' ); + } else { + $type = get_post_field( 'post_type', $post_id ); + if ( 'page' == $type ) + $url = home_url( "?feed=$feed&page_id=$post_id" ); + else + $url = home_url( "?feed=$feed&p=$post_id" ); + } + + return $url; + } + + /** + * Workaround for get_author_feed_link function, remove filtering. + * + * @param unknown $author_id + * @param string $feed + * @return string + */ + static public function get_author_feed_link( $author_id, $feed = '' ) { + $author_id = (int) $author_id; + $permalink_structure = get_option( 'permalink_structure' ); + + if ( empty( $feed ) ) + $feed = get_default_feed(); + + if ( '' == $permalink_structure ) { + $link = home_url( "?feed=$feed&author=" . $author_id ); + } else { + $link = get_author_posts_url( $author_id ); + if ( $feed == get_default_feed() ) + $feed_link = 'feed'; + else + $feed_link = "feed/$feed"; + + $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' ); + } + + return $link; + } + + /** + * Workaround for get_term_feed_link function, remove filtering. + * + * @param unknown $term_id + * @param string $taxonomy + * @param string $feed + * @return bool|string + */ + static public function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) { + $term_id = ( int ) $term_id; + + $term = get_term( $term_id, $taxonomy ); + + if ( empty( $term ) || is_wp_error( $term ) ) + return false; + + if ( empty( $feed ) ) + $feed = get_default_feed(); + + $permalink_structure = get_option( 'permalink_structure' ); + + if ( '' == $permalink_structure ) { + if ( 'category' == $taxonomy ) { + $link = home_url( "?feed=$feed&cat=$term_id" ); + } + elseif ( 'post_tag' == $taxonomy ) { + $link = home_url( "?feed=$feed&tag=$term->slug" ); + } else { + $t = get_taxonomy( $taxonomy ); + $link = home_url( "?feed=$feed&$t->query_var=$term->slug" ); + } + } else { + $link = get_term_link( $term_id, $term->taxonomy ); + if ( $feed == get_default_feed() ) + $feed_link = 'feed'; + else + $feed_link = "feed/$feed"; + + $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' ); + } + + return $link; + } + + static public function get_rest_posts_urls() { + static $posts_urls = array(); + + if ( empty( $posts_urls ) ) { + $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); + $wp_json_base = self::wp_json_base(); + + foreach ( $types as $post_type ) { + $rest_base = ( !empty( $post_type->rest_base ) ? + $post_type->rest_base : $post_type->name ); + + $posts_urls[] = $wp_json_base . $rest_base; + } + } + + return $posts_urls; + } + + static public function get_rest_post_urls( $post_id ) { + static $post_urls = array(); + + if ( !isset( $post_urls[$post_id] ) ) { + $post = get_post( $post_id ); + $urls = array(); + $wp_json_base = self::wp_json_base(); + + if ( $post ) { + $post_type = get_post_type_object( $post->post_type ); + $rest_base = ( !empty( $post_type->rest_base ) ? + $post_type->rest_base : $post_type->name ); + + $urls[] = $wp_json_base . $rest_base . '/' . $post->ID; + } + + $post_urls[$post_id] = $urls; + } + + return $post_urls[$post_id]; + } + + static private function wp_json_base() { + $wp_json_base = rtrim( get_home_url(), '/' ) . W3TC_WP_JSON_URI; + $wp_json_base = apply_filters( 'w3tc_pageurls_wp_json_base', $wp_json_base ); + return $wp_json_base; + } + + static public function complement_with_mirror_urls( $queued_urls ) { + $config = Dispatcher::config(); + + if ( !$config->get_boolean( 'pgcache.mirrors.enabled' ) || + Util_Environment::is_wpmu_subdomain() ) + return $queued_urls; + + $home_urls = $config->get_array( 'pgcache.mirrors.home_urls' ); + + $url_prefix = trailingslashit( get_home_url() ); + $mirror_urls = array(); + + foreach ( $queued_urls as $url ) { + if ( substr( $url, 0, strlen( $url_prefix ) ) != $url_prefix ) + continue; + + foreach ( $home_urls as $home ) { + if ( !empty( $home ) ) { + $mirror_urls[] = trailingslashit( $home ) . + substr( $url, strlen( $url_prefix ) ); + } + } + } + + return array_merge( $queued_urls, $mirror_urls ); + } + + static private function _term_hash( $terms ) { + $term_hash = array(); + foreach ( $terms as $term ) + $term_hash[] = $term->term_id; + $term_hashed = md5( implode( ',', $term_hash ) ); + return $term_hashed; + } + + /** + * + * + * @param unknown $post + * @return string + */ + static private function _get_archive_slug( $post ) { + $archive_slug = ''; + global $wp_post_types; + $args = $wp_post_types[$post->post_type]; + if ( $args->has_archive ) { + global $wp_rewrite; + $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive; + if ( $args->rewrite['with_front'] ) + $archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug; + else + $archive_slug = $wp_rewrite->root . $archive_slug; + } + return $archive_slug; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php new file mode 100644 index 00000000..dd500d66 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php @@ -0,0 +1,154 @@ + $value ) { + if ( strpos( $key, $prefix ) === 0 || strpos( $key, str_replace( '.', '_', $prefix ) ) === 0 ) { + $array[ substr( $key, strlen( $prefix ) ) ] = $value; + } + } + return $array; + } + + /** + * Returns request array. + * + * @return array + */ + public static function get_request() { + if ( ! isset( $_GET ) ) { + $_GET = array(); + } + + if ( ! isset( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing + $_POST = array(); + } + + return array_merge( $_GET, $_POST ); // phpcs:ignore + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php new file mode 100644 index 00000000..4c1263d7 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php @@ -0,0 +1,492 @@ += 0; $n-- ) { + if ( empty( $a[$n] ) ) + array_splice( $a, $n, 1 ); + } + } + + /** + * Returns nginx rules path + * + * @return string + */ + static public function get_nginx_rules_path() { + $config = Dispatcher::config(); + + $path = $config->get_string( 'config.path' ); + + if ( !$path ) { + $path = Util_Environment::site_path() . 'nginx.conf'; + } + + return $path; + } + + /** + * Returns litespeed rules path + * + * @return string + */ + static public function get_litespeed_rules_path() { + $config = Dispatcher::config(); + + $path = $config->get_string( 'config.path' ); + + if ( !$path ) { + $path = Util_Environment::site_path() . 'litespeed.conf'; + } + + return $path; + } + + /** + * Returns path of apache's primary rules file + * + * @return string + */ + static public function get_apache_rules_path() { + return Util_Environment::site_path() . '.htaccess'; + } + + /** + * Returns path of pagecache core rules file + * + * @return string + */ + static public function get_pgcache_rules_core_path() { + switch ( true ) { + case Util_Environment::is_apache(): + case Util_Environment::is_litespeed(): + return Util_Rule::get_apache_rules_path(); + + case Util_Environment::is_nginx(): + return Util_Rule::get_nginx_rules_path(); + } + + return false; + } + + /** + * Returns path of browsercache cache rules file + * + * @return string + */ + static public function get_browsercache_rules_cache_path() { + if ( Util_Environment::is_litespeed() ) { + return Util_Rule::get_litespeed_rules_path(); + } + + return Util_Rule::get_pgcache_rules_core_path(); + } + + /** + * Returns path of minify rules file + * + * @return string + */ + static public function get_minify_rules_core_path() { + switch ( true ) { + case Util_Environment::is_apache(): + case Util_Environment::is_litespeed(): + return W3TC_CACHE_MINIFY_DIR . DIRECTORY_SEPARATOR . '.htaccess'; + + case Util_Environment::is_nginx(): + return Util_Rule::get_nginx_rules_path(); + } + + return false; + } + + /** + * Returns path of minify rules file + * + * @return string + */ + static public function get_minify_rules_cache_path() { + switch ( true ) { + case Util_Environment::is_apache(): + case Util_Environment::is_litespeed(): + return W3TC_CACHE_MINIFY_DIR . DIRECTORY_SEPARATOR . '.htaccess'; + + case Util_Environment::is_nginx(): + return Util_Rule::get_nginx_rules_path(); + } + + return false; + } + + /** + * Returns path of CDN rules file + * + * @return string + */ + static public function get_cdn_rules_path() { + switch ( true ) { + case Util_Environment::is_apache(): + case Util_Environment::is_litespeed(): + return '.htaccess'; + + case Util_Environment::is_nginx(): + return 'nginx.conf'; + } + + return false; + } + + static public function get_new_relic_rules_core_path() { + return Util_Rule::get_pgcache_rules_core_path(); + } + + /** + * Returns true if we can modify rules + * + * @param string $path + * @return boolean + */ + static public function can_modify_rules( $path ) { + if ( Util_Environment::is_wpmu() ) { + if ( Util_Environment::is_apache() || Util_Environment::is_litespeed() || Util_Environment::is_nginx() ) { + switch ( $path ) { + case Util_Rule::get_pgcache_rules_cache_path(): + case Util_Rule::get_minify_rules_core_path(): + case Util_Rule::get_minify_rules_cache_path(): + return true; + } + } + + return false; + } + + return true; + } + + /** + * Trim rules + * + * @param string $rules + * @return string + */ + static public function trim_rules( $rules ) { + $rules = trim( $rules ); + + if ( $rules != '' ) { + $rules .= "\n"; + } + + return $rules; + } + + /** + * Cleanup rewrite rules + * + * @param string $rules + * @return string + */ + static public function clean_rules( $rules ) { + $rules = preg_replace( '~[\r\n]+~', "\n", $rules ); + $rules = preg_replace( '~^\s+~m', '', $rules ); + $rules = Util_Rule::trim_rules( $rules ); + + return $rules; + } + + /** + * Erases text from start to end + * + * @param string $rules + * @param string $start + * @param string $end + * @return string + */ + static public function erase_rules( $rules, $start, $end ) { + $r = '~' . Util_Environment::preg_quote( $start ) . "\n.*?" . Util_Environment::preg_quote( $end ) . "\n*~s"; + + $rules = preg_replace( $r, '', $rules ); + $rules = Util_Rule::trim_rules( $rules ); + + return $rules; + } + + /** + * Check if rules exist + * + * @param string $rules + * @param string $start + * @param string $end + * @return int + */ + static public function has_rules( $rules, $start, $end ) { + return preg_match( '~' . Util_Environment::preg_quote( $start ) . "\n.*?" . Util_Environment::preg_quote( $end ) . "\n*~s", $rules ); + } + + /** + * + * + * @param Util_Environment_Exceptions $exs exceptions to fill on error + * @param string $path filename of rules file to modify + * @param string $rules rules to add + * @param string $start start marker + * @param string $end end marker + * @param array $order order where to place if some marker exists + * @param boolean $remove_wpsc if WPSC rules should be removed to avoid + * inconsistent rules generation + */ + static public function add_rules( $exs, $path, $rules, $start, $end, $order, + $remove_wpsc = false ) { + if ( empty( $path ) ) { + return; + } + + $data = @file_get_contents( $path ); + if ( empty( $data ) ) { + $data = ''; + } + + $modified = false; + if ( $remove_wpsc ) { + if ( Util_Rule::has_rules( + $data, + W3TC_MARKER_BEGIN_PGCACHE_WPSC, + W3TC_MARKER_END_PGCACHE_WPSC ) ) { + $data = Util_Rule::erase_rules( + $data, + W3TC_MARKER_BEGIN_PGCACHE_WPSC, + W3TC_MARKER_END_PGCACHE_WPSC ); + $modified = true; + } + } + + if ( empty( $rules ) ) { + // rules removal mode + $rules_present = ( strpos( $data, $start ) !== false ); + if ( !$modified && !$rules_present ) { + return; + } + } else { + // rules creation mode + $rules_missing = ( strstr( Util_Rule::clean_rules( $data ), Util_Rule::clean_rules( $rules ) ) === false ); + if ( !$modified && !$rules_missing ) { + return; + } + } + + $replace_start = strpos( $data, $start ); + $replace_end = strpos( $data, $end ); + + if ( $replace_start !== false && $replace_end !== false && $replace_start < $replace_end ) { + // old rules exists, replace mode + $replace_length = $replace_end - $replace_start + strlen( $end ) + 1; + } else { + $replace_start = false; + $replace_length = 0; + + $search = $order; + + foreach ( $search as $string => $length ) { + $replace_start = strpos( $data, $string ); + + if ( $replace_start !== false ) { + $replace_start += $length; + break; + } + } + } + + if ( $replace_start !== false ) { + $data = Util_Rule::trim_rules( substr_replace( $data, $rules, $replace_start, $replace_length ) ); + } else { + $data = Util_Rule::trim_rules( rtrim( $data ) . "\n" . $rules ); + } + + if ( strpos( $path, W3TC_CACHE_DIR ) === false || Util_Environment::is_nginx() ) { + // writing to system rules file, may be potentially write-protected + try { + Util_WpFile::write_to_file( $path, $data ); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + if ( $replace_start !== false ) { + $message = sprintf( __( 'Edit file %s and replace all lines between and including %s and %s markers with:', + 'w3-total-cache' ), $path, $start, $end ); + } else { + $message = sprintf( __( 'Edit file %s and add the following rules above the WordPress directives:', + 'w3-total-cache' ), $path ); + } + + $ex = new Util_WpFile_FilesystemModifyException( + $ex->getMessage(), $ex->credentials_form(), + $message, $path, $rules ); + + $exs->push( $ex ); + return; + } + } else { + // writing to own rules file in cache folder + if ( !@file_exists( dirname( $path ) ) ) { + Util_File::mkdir_from( dirname( $path ), W3TC_CACHE_DIR ); + } + + if ( !@file_put_contents( $path, $data ) ) { + try { + Util_WpFile::delete_folder( + dirname( $path ), + '', + isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '' + ); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + $exs->push( $ex ); + return; + } + } + } + + Util_Rule::after_rules_modified(); + } + + + + /** + * Called when rules are modified, sets notification + */ + static public function after_rules_modified() { + if ( Util_Environment::is_nginx() ) { + $state = Dispatcher::config_state_master(); + $state->set( 'common.show_note.nginx_restart_required', true ); + $state->save(); + } + } + + + + /** + * Remove rules + */ + static public function remove_rules( $exs, $path, $start, $end ) { + if ( !file_exists( $path ) ) + return; + + $data = @file_get_contents( $path ); + if ( $data === false ) + return; + if ( strstr( $data, $start ) === false ) + return; + + $data = Util_Rule::erase_rules( $data, $start, + $end ); + + try { + Util_WpFile::write_to_file( $path, $data ); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + $exs->push( new Util_WpFile_FilesystemModifyException( + $ex->getMessage(), $ex->credentials_form(), + sprintf( __( 'Edit file %s and remove all lines between and including %s + and %s markers.', 'w3-total-cache' ), $path, $start, $end ), $path ) ); + } + } + + /** + * Returns path of pgcache cache rules file + * Moved to separate file to not load rule.php for each disk enhanced request + * + * @return string + */ + static public function get_pgcache_rules_cache_path() { + switch ( true ) { + case Util_Environment::is_apache(): + case Util_Environment::is_litespeed(): + if ( Util_Environment::is_wpmu() ) { + $url = get_home_url(); + $match = null; + if ( preg_match( '~http(s)?://(.+?)(/)?$~', $url, $match ) ) { + $home_path = $match[2]; + + return W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR . + $home_path . DIRECTORY_SEPARATOR . '.htaccess'; + } + } + + return W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR . '.htaccess'; + + case Util_Environment::is_nginx(): + return Util_Rule::get_nginx_rules_path(); + } + + return false; + } + + /** + * Returns true if we can check rules + * + * @return bool + */ + static public function can_check_rules() { + return Util_Environment::is_apache() || + Util_Environment::is_litespeed() || + Util_Environment::is_nginx() || + Util_Environment::is_iis(); + } + + /** + * Support for GoDaddy servers configuration which uses. + * SUBDOMAIN_DOCUMENT_ROOT variable. + */ + public static function apache_docroot_variable() { + $document_root = isset( $_SERVER['DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['DOCUMENT_ROOT'] ) ) : ''; + $subdomain_document_root = isset( $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] ) ) : ''; + $php_document_root = isset( $_SERVER['PHP_DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['PHP_DOCUMENT_ROOT'] ) ) : ''; + if ( ! empty( $subdomain_document_root ) && $subdomain_document_root !== $document_root ) { + return '%{ENV:SUBDOMAIN_DOCUMENT_ROOT}'; + } elseif ( ! empty( $php_document_root ) && $php_document_root !== $document_root ) { + return '%{ENV:PHP_DOCUMENT_ROOT}'; + } else { + return '%{DOCUMENT_ROOT}'; + } + } + + + + /** + * Takes an array of extensions single per row and/or extensions delimited by | + * + * @param unknown $extensions + * @param unknown $ext + * @return array + */ + static public function remove_extension_from_list( $extensions, $ext ) { + for ( $i = 0; $i < sizeof( $extensions ); $i++ ) { + if ( $extensions[$i] == $ext ) { + unset( $extensions[$i] ); + return $extensions; + } elseif ( strpos( $extensions[$i], $ext ) !== false && + strpos( $extensions[$i], '|' ) !== false ) { + $exts = explode( '|', $extensions[$i] ); + $key = array_search( $ext, $exts ); + unset( $exts[$key] ); + $extensions[$i] = implode( '|', $exts ); + return $extensions; + } + } + return $extensions; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php new file mode 100644 index 00000000..4753329c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php @@ -0,0 +1,161 @@ +get( 'Name' ); + } + + static public function get_current_theme() { + return wp_get_theme(); + } + + static public function get_themes() { + global $wp_themes; + if ( isset( $wp_themes ) ) + return $wp_themes; + + $themes = wp_get_themes(); + $wp_themes = array(); + + foreach ( $themes as $theme ) { + $name = $theme->get( 'Name' ); + if ( isset( $wp_themes[$name] ) ) + $wp_themes[$name . '/' . $theme->get_stylesheet()] = $theme; + else + $wp_themes[$name] = $theme; + } + + return $wp_themes; + } + + /** + * Returns theme key + * + * @param string $theme_root + * @param string $template + * @param string $stylesheet + * @return string + */ + static public function get_theme_key( $theme_root, $template, $stylesheet ) { + $theme_path = ltrim( str_replace( WP_CONTENT_DIR, '', + Util_Environment::normalize_path( $theme_root ) ), '/' ); + + return substr( md5( $theme_path . $template . $stylesheet ), 0, 5 ); + } + + /** + * Returns themes array + * + * @return array + */ + static public function get_themes_by_key() { + $themes = array(); + $wp_themes = Util_Theme::get_themes(); + + foreach ( $wp_themes as $wp_theme ) { + $theme_key = Util_Theme::get_theme_key( $wp_theme['Theme Root'], $wp_theme['Template'], $wp_theme['Stylesheet'] ); + $themes[$theme_key] = $wp_theme['Name']; + } + + return $themes; + } + + /** + * Returns minify groups + * + * @param string $theme_name + * @return array + */ + static public function get_theme_templates( $theme_name ) { + $groups = array( + 'default' => __( 'All Templates', 'w3-total-cache' ) + ); + + $templates = Util_Theme::get_theme_files( $theme_name ); + + foreach ( $templates as $template ) { + $basename = basename( $template, '.php' ); + + $groups[$basename] = ucfirst( $basename ); + } + + return $groups; + } + + + /** + * Returns array of theme groups + * + * @param string $theme_name + * @return array + */ + static public function get_theme_files( $theme_name ) { + $patterns = array( + '404', + 'search', + 'taxonomy((-|_).*)?', + 'front-page', + 'home', + 'index', + '(image|video|text|audio|application).*', + 'attachment', + 'single((-|_).*)?', + 'page((-|_).*)?', + 'category((-|_).*)?', + 'tag((-|_).*)?', + 'author((-|_).*)?', + 'date', + 'archive', + 'comments-popup', + 'paged' + ); + + $templates = array(); + $theme = Util_Theme::get( $theme_name ); + + if ( $theme && isset( $theme['Template Files'] ) ) { + $template_files = (array) $theme['Template Files']; + + foreach ( $template_files as $template_file ) { + /** + * Check file name + */ + $template = basename( $template_file, '.php' ); + + foreach ( $patterns as $pattern ) { + $regexp = '~^' . $pattern . '$~'; + + if ( preg_match( $regexp, $template ) ) { + $templates[] = $template_file; + continue 2; + } + } + + /** + * Check get_header function call + */ + $template_content = @file_get_contents( $template_file ); + + if ( $template_content && preg_match( '~\s*get_header[0-9_]*\s*\(~', $template_content ) ) { + $templates[] = $template_file; + } + } + + sort( $templates ); + reset( $templates ); + } + + return $templates; + } + + +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php new file mode 100644 index 00000000..5b0e03bd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php @@ -0,0 +1,1267 @@ +'; + } + + /** + * Returns button link html. + * + * @param string $text Text. + * @param string $url URL. + * @param bool $new_window Open link in a new window. + * @param string $class Class. + * @param string $name Name. + * @return string + */ + public static function button_link( $text, $url, $new_window = false, $class = 'button', $name = '' ) { + $url = str_replace( '&', '&', $url ); + + if ( $new_window ) { + $onclick = sprintf( 'window.open(\'%s\');', addslashes( $url ) ); + } else { + $onclick = ''; + + if ( strpos( $class, 'w3tc-button-ignore-change' ) >= 0 ) { + $onclick .= 'w3tc_beforeupload_unbind(); '; + } + + $onclick .= sprintf( 'document.location.href=\'%s\';', addslashes( $url ) ); + } + + return self::button( $text, $onclick, $class, $name ); + } + + public static function url( $addon ) { + if ( ! isset( $addon['page'] ) ) { + $addon['page'] = Util_Request::get_string( 'page', 'w3tc_dashboard' ); + } + + $url = 'admin.php'; + $amp = '?'; + foreach ( $addon as $key => $value ) { + $url .= $amp . rawurlencode( $key ) . '=' . rawurlencode( $value ); + $amp = '&'; + } + + $url = wp_nonce_url( $url, 'w3tc' ); + + return $url; + } + + /** + * Returns hide note button html + * + * @param string $text + * @param string $note + * @param string $redirect + * @param boolean $admin if to use config admin. + * @param string $page + * @param string $custom_method + * @return string + */ + public static function button_hide_note( $text, $note, $redirect = '', + $admin = false, $page = '', + $custom_method = 'w3tc_default_hide_note' ) { + if ( '' === $page ) { + $page = Util_Request::get_string( 'page', 'w3tc_dashboard' ); + } + + $url = sprintf( 'admin.php?page=%s&%s¬e=%s', $page, $custom_method, $note ); + + if ( $admin ) { + $url .= '&admin=1'; + } + + if ( '' !== $redirect ) { + $url .= '&redirect=' . rawurlencode( $redirect ); + } + + $url = wp_nonce_url( $url, 'w3tc' ); + + return self::button_link( $text, $url, false, 'button', 'w3tc_hide_' . $custom_method ); + } + + public static function button_hide_note2( $parameters ) { + return self::button_link( + __( 'Hide this message', 'w3-total-cache' ), + self::url( $parameters ), + false, + 'button', + 'w3tc_hide_' . self::config_key_to_http_name( $parameters['key'] ) + ); + } + + public static function action_button( $action, $url, $class = '', + $new_window = false ) { + return self::button_link( $action, $url, $new_window, $class ); + } + /** + * Returns popup button html + * + * @param string $text + * @param string $action + * @param string $params + * @param integer $width + * @param integer $height + * @return string + */ + public static function button_popup( $text, $action, $params = '', $width = 800, $height = 600 ) { + $url = wp_nonce_url( sprintf( 'admin.php?page=w3tc_dashboard&w3tc_%s%s', $action, ( '' !== $params ? '&' . $params : '' ) ), 'w3tc' ); + $url = str_replace( '&', '&', $url ); + + $onclick = sprintf( 'window.open(\'%s\', \'%s\', \'width=%d,height=%d,status=no,toolbar=no,menubar=no,scrollbars=yes\');', $url, $action, $width, $height ); + + return self::button( $text, $onclick ); + } + + /** + * Returns label string for a config key. + * + * @param string $config_key + * @param string $area + */ + public static function config_label( $config_key ) { + static $config_labels = null; + if ( is_null( $config_labels ) ) { + $config_labels = apply_filters( 'w3tc_config_labels', array() ); + } + + if ( isset( $config_labels[ $config_key ] ) ) { + return $config_labels[ $config_key ]; + } + + return ''; + } + + /** + * Prints the label string for a config key. + * + * @param string $config_key + * @param string $area + */ + public static function e_config_label( $config_key ) { + $config_label = self::config_label( $config_key ); + echo wp_kses( + $config_label, + self::get_allowed_html_for_wp_kses_from_content( $config_label ) + ); + } + + /** + * Returns postbox header + * + * WordPress 5.5 introduced .postbox-header, which broke the styles of our postboxes. This was + * resolved by adding additional css to /pub/css/options.css and pub/css/widget.css tagged with + * a "WP 5.5" comment. + * + * @todo Add .postbox-header to our postboxes and cleanup css. + * @link https://github.com/BoldGrid/w3-total-cache/issues/237 + * + * @param string $title + * @param string $class + * @param string $id + * @return void + */ + public static function postbox_header( $title, $class = '', $id = '' ) { + if ( ! empty( $id ) ) { + $id = ' id="' . esc_attr( $id ) . '"'; + } + echo ' +

        +

        ' . wp_kses( $title, self::get_allowed_html_for_wp_kses_from_content( $title ) ) . '

        +
        '; + } + + /** + * Returns postbox footer + * + * @return void + */ + public static function postbox_footer() { + echo '
        '; + } + + public static function button_config_save( $id = '', $extra = '' ) { + $b1_id = 'w3tc_save_options_' . $id; + $b2_id = 'w3tc_default_save_and_flush_' . $id; + + ?> +

        + + + + + + +

        + is_sealed( $key ) ) { + echo 'disabled="disabled" '; + } + } + + /** + * Returns nonce field HTML + * + * @param string $action + * @param string $name + * @param bool $referer + * @internal param bool $echo + * @return string + */ + public static function nonce_field( $action = -1, $name = '_wpnonce', $referer = true ) { + $return = ''; + + if ( $referer ) { + $return .= wp_referer_field( false ); + } + + return $return; + } + + /** + * Returns an notification box + * + * @param string $message + * @param string $id adds an id to the notification box. + * @return string + */ + public static function get_notification_box( $message, $id = '' ) { + $page_val = Util_Request::get_string( 'page' ); + + if ( empty( $page_val ) || ( ! empty( $page_val ) && 'w3tc_' !== substr( $page_val, 0, 5 ) ) ) { + $logo = sprintf( + 'W3 Total Cache"', + esc_url( plugins_url( '/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE ) ) . '' + ); + } else { + $logo = ''; + } + return sprintf( + '
        %s
        ', + $id ? 'id="' . esc_attr( $id ) . '"' : '', + $logo . wp_kses( $message, self::get_allowed_html_for_wp_kses_from_content( $message ) ) + ); + } + + /** + * Echos an notification box + * + * @param string $message + * @param string $id adds an id to the notification box. + */ + public static function e_notification_box( $message, $id = '' ) { + $notification_box = self::get_notification_box( $message, $id ); + echo wp_kses( + $notification_box, + self::get_allowed_html_for_wp_kses_from_content( $notification_box ) + ); + } + + /** + * Echos an error box. + * + * @param string $message Message. + * @param string $id Id. + */ + public static function error_box( $message, $id = '' ) { + $page_val = Util_Request::get_string( 'page' ); + + if ( empty( $page_val ) || ( ! empty( $page_val ) && 'w3tc_' !== substr( $page_val, 0, 5 ) ) ) { + $logo = sprintf( + 'W3 Total Cache', + esc_url( plugins_url( '/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE ) . '' ) + ); + } else { + $logo = ''; + } + + $v = sprintf( + '
        %s
        ', + $id ? 'id="' . esc_attr( $id ) . '"' : '', + $logo . wp_kses( $message, self::get_allowed_html_for_wp_kses_from_content( $message ) ) + ); + + echo wp_kses( + $v, + self::get_allowed_html_for_wp_kses_from_content( $v ) + ); + } + + /** + * Format bytes into B, KB, MB, GB and TB + * + * @param unknown $bytes + * @param int $precision + * @return string + */ + public static function format_bytes( $bytes, $precision = 2 ) { + $units = array( 'B', 'KB', 'MB', 'GB', 'TB' ); + + $bytes = max( $bytes, 0 ); + $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) ); + $pow = min( $pow, count( $units ) - 1 ); + + // Uncomment one of the following alternatives. + $bytes /= pow( 1024, $pow ); + // $bytes /= ( 1 << ( 10 * $pow ) ); + + return round( $bytes, $precision ) . ' ' . $units[ $pow ]; + } + + public static function format_mbytes( $bytes, $precision = 2 ) { + $units = array( 'B', 'KB', 'MB', 'GB', 'TB' ); + + $bytes = max( $bytes, 0 ); + $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) ); + $pow = min( $pow, count( $units ) - 1 ); + + // Uncomment one of the following alternatives. + $bytes /= pow( 1024, $pow ); + // $bytes /= ( 1 << ( 10 * $pow ) ); + + return round( $bytes, $precision ) . ' ' . $units[ $pow + 2 ]; + } + + /** + * Returns an input text element + * + * @param string $id + * @param string $name + * @param string $value + * @param bool $disabled + * @param int $size + */ + public static function r_hidden( $id, $name, $value ) { + return ''; + } + + /** + * Echos an input text element + * + * @param string $id + * @param string $name + * @param string $value + * @param bool $disabled + * @param int $size + */ + public static function hidden( $id, $name, $value ) { + $hidden = self::r_hidden( $id, $name, $value ); + echo wp_kses( + $hidden, + self::get_allowed_html_for_wp_kses_from_content( $hidden ) + ); + } + + /** + * Echos an label element + * + * @param string $id + * @param string $text + */ + public static function label( $id, $text ) { + $label = ''; + echo wp_kses( + $label, + self::get_allowed_html_for_wp_kses_from_content( $label ) + ); + } + + /** + * Echos an input text element + * + * @param string $id + * @param string $name + * @param string $value + * @param bool $disabled + * @param int $size + */ + public static function textbox( $id, $name, $value, $disabled = false, + $size = 40, $type = 'text', $placeholder = '' ) { + echo ''; + } + + /** + * Echos an input password element + * + * @param string $id + * @param string $name + * @param string $value + * @param bool $disabled + * @param int $size + */ + public static function passwordbox( $id, $name, $value, $disabled = false, $size = 40 ) { + echo ''; + } + + /** + * Echos an select element + * + * @param string $id + * @param string $name + * @param bool $state whether checked or not. + * @param bool $disabled + * @param array $optgroups + */ + public static function selectbox( $id, $name, $value, $values, + $disabled = false, $optgroups = null ) { + echo ''; + } + + private static function option( $key, $selected_value, $descriptor ) { + if ( ! is_array( $descriptor ) ) { + $label = $descriptor; + $disabled = false; + } else { + $label = $descriptor['label']; + $disabled = ! empty( $descriptor['disabled'] ); + } + + echo '' . "\n"; + } + + /** + * Echos a group of radio elements + * values: value => label pair or + * value => array(label, disabled, postfix). + */ + public static function radiogroup( $name, $value, $values, + $disabled = false, $separator = '' ) { + $first = true; + foreach ( $values as $key => $label_or_array ) { + if ( $first ) { + $first = false; + } else { + echo wp_kses( + $separator, + self::get_allowed_html_for_wp_kses_from_content( $separator ) + ); + } + + $label = ''; + $item_disabled = false; + $postfix = ''; + $pro_feature = false; + + if ( ! is_array( $label_or_array ) ) { + $label = $label_or_array; + } else { + $label = $label_or_array['label']; + $item_disabled = $label_or_array['disabled']; + $postfix = isset( $label_or_array['postfix'] ) ? $label_or_array['postfix'] : ''; + $pro_feature = isset( $label_or_array['pro_feature'] ) ? $label_or_array['pro_feature'] : false; + } + + if ( $pro_feature ) { + self::pro_wrap_maybe_start(); + } + echo '' . wp_kses( $postfix, self::get_allowed_html_for_wp_kses_from_content( $postfix ) ) . "\n"; + if ( $pro_feature ) { + self::pro_wrap_description( + $label_or_array['pro_excerpt'], + $label_or_array['pro_description'], + $name . '__' . $key + ); + + self::pro_wrap_maybe_end( $name . '__' . $key ); + } + } + } + + /** + * Echos an input text element + * + * @param string $id + * @param string $name + * @param string $value + * @param bool $disabled + */ + public static function textarea( $id, $name, $value, $disabled = false ) { + ?> + + '; + } + + echo '' . "\n"; + echo ' '; + + if ( ! is_null( $label ) ) { + echo wp_kses( $label, self::get_allowed_html_for_wp_kses_from_content( $label ) ) . ''; + } + } + + /** + * Echos an element + * + * @param string $type + * @param string $id + * @param string $name + * @param mixed $value + * @param bool $disabled + */ + public static function element( $type, $id, $name, $value, $disabled = false ) { + switch ( $type ) { + case 'textbox': + self::textbox( $id, $name, $value, $disabled ); + break; + case 'password': + self::passwordbox( $id, $name, $value, $disabled ); + break; + case 'textarea': + self::textarea( $id, $name, $value, $disabled ); + break; + case 'checkbox': + default: + self::checkbox( $id, $name, $value, $disabled ); + break; + } + } + + public static function checkbox2( $e ) { + self::checkbox( + $e['name'], + $e['name'], + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( isset( $e['label'] ) ? $e['label'] : null ) + ); + } + + public static function radiogroup2( $e ) { + self::radiogroup( + $e['name'], + $e['value'], + $e['values'], + $e['disabled'], + $e['separator'] + ); + } + + public static function selectbox2( $e ) { + self::selectbox( + $e['name'], + $e['name'], + $e['value'], + $e['values'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( isset( $e['optgroups'] ) ? $e['optgroups'] : null ) + ); + } + + public static function textbox2( $e ) { + self::textbox( + $e['name'], + $e['name'], + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( ! empty( $e['size'] ) ? $e['size'] : 20 ), + ( ! empty( $e['type'] ) ? $e['type'] : 'text' ), + ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' ) + ); + } + + public static function textarea2( $e ) { + self::textarea( + $e['name'], + $e['name'], + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ) + ); + } + + public static function control2( $a ) { + if ( 'checkbox' === $a['control'] ) { + self::checkbox2( + array( + 'name' => $a['control_name'], + 'value' => $a['value'], + 'disabled' => $a['disabled'], + 'label' => $a['checkbox_label'], + ) + ); + } elseif ( 'radiogroup' === $a['control'] ) { + self::radiogroup2( + array( + 'name' => $a['control_name'], + 'value' => $a['value'], + 'disabled' => $a['disabled'], + 'values' => $a['radiogroup_values'], + 'separator' => isset( $a['radiogroup_separator'] ) ? $a['radiogroup_separator'] : '', + ) + ); + } elseif ( 'selectbox' === $a['control'] ) { + self::selectbox2( + array( + 'name' => $a['control_name'], + 'value' => $a['value'], + 'disabled' => $a['disabled'], + 'values' => $a['selectbox_values'], + 'optgroups' => isset( $a['selectbox_optgroups'] ) ? $a['selectbox_optgroups'] : null, + ) + ); + } elseif ( 'textbox' === $a['control'] ) { + self::textbox2( + array( + 'name' => $a['control_name'], + 'value' => $a['value'], + 'disabled' => $a['disabled'], + 'type' => isset( $a['textbox_type'] ) ? $a['textbox_type'] : null, + 'size' => isset( $a['textbox_size'] ) ? $a['textbox_size'] : null, + 'placeholder' => isset( $a['textbox_placeholder'] ) ? $a['textbox_placeholder'] : null, + ) + ); + } elseif ( 'textarea' === $a['control'] ) { + self::textarea2( + array( + 'name' => $a['control_name'], + 'value' => $a['value'], + 'disabled' => $a['disabled'], + ) + ); + } elseif ( 'none' === $a['control'] ) { + echo wp_kses( $a['none_label'], self::get_allowed_html_for_wp_kses_from_content( $a['none_label'] ) ); + } elseif ( 'button' === $a['control'] ) { + echo ''; + } + } + + /** + * Get table classes for tables including pro features. + * + * When on the free version, tables with pro features have additional classes added to help highlight + * the premium feature. If the user is on pro, this class is omitted. + * + * @since 0.14.3 + * + * @return string + */ + public static function table_class() { + $table_class[] = 'form-table'; + + if ( ! Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { + $table_class[] = 'w3tc-pro-feature'; + } + + return implode( ' ', $table_class ); + } + + /** + * Renders element with controls + * id => + * label => + * label_class => + * => details + * style - default is label,controls view, + * alternative is one-column view + */ + public static function table_tr( $a ) { + $id = isset( $a['id'] ) ? $a['id'] : ''; + $a = apply_filters( 'w3tc_ui_settings_item', $a ); + + echo ''; + if ( isset( $a['label'] ) ) { + self::label( $id, $a['label'] ); + } + + echo "\n\n"; + + foreach ( $a as $key => $e ) { + if ( 'checkbox' === $key ) { + self::checkbox( + $id, + isset( $e['name'] ) ? $e['name'] : null, + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( isset( $e['label'] ) ? $e['label'] : null ) + ); + } elseif ( 'description' === $key ) { + echo '

        ' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '

        '; + } elseif ( 'hidden' === $key ) { + self::hidden( '', $e['name'], $e['value'] ); + } elseif ( 'html' === $key ) { + echo wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ); + } elseif ( 'radiogroup' === $key ) { + self::radiogroup( + $e['name'], + $e['value'], + $e['values'], + $e['disabled'], + $e['separator'] + ); + } elseif ( 'selectbox' === $key ) { + self::selectbox( + $id, + $e['name'], + $e['value'], + $e['values'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( isset( $e['optgroups'] ) ? $e['optgroups'] : null ) + ); + } elseif ( 'textbox' === $key ) { + self::textbox( + $id, + $e['name'], + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ), + ( ! empty( $e['size'] ) ? $e['size'] : 20 ), + ( ! empty( $e['type'] ) ? $e['type'] : 'text' ), + ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' ) + ); + } elseif ( 'textarea' === $key ) { + self::textarea( + $id, + $e['name'], + $e['value'], + ( isset( $e['disabled'] ) ? $e['disabled'] : false ) + ); + } + } + + echo "\n"; + } + + /** + * Prints configuration item UI based on description + * key => configuration key + * label => configuration key's as its introduced to the user + * value => it's value + * disabled => if disabled + * + * control => checkbox | radiogroup | selectbox | textbox + * checkbox_label => text shown after the textbox + * radiogroup_values => array of possible values for radiogroup + * selectbox_values => array of possible values for dropdown + * selectbox_optgroups => + * textbox_size => + * + * control_after => something after control to add + * description => description shown to the user below + */ + public static function config_item( $a ) { + /* + * Some items we do not want shown in the free edition. + * + * By default, they will show in free, unless 'show_in_free' is specifically passed in as false. + */ + $is_w3tc_free = ! Util_Environment::is_w3tc_pro( Dispatcher::config() ); + $show_in_free = ! isset( $a['show_in_free'] ) || (bool) $a['show_in_free']; + if ( ! $show_in_free && $is_w3tc_free ) { + return; + } + + $a = self::config_item_preprocess( $a ); + + if ( 'w3tc_single_column' === $a['label_class'] ) { + echo ''; + } else { + echo ''; + + if ( ! empty( $a['label'] ) ) { + self::label( $a['control_name'], $a['label'] ); + } + + echo "\n\n"; + } + + self::control2( $a ); + + if ( isset( $a['control_after'] ) ) { + echo wp_kses( + $a['control_after'], + self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] ) + ); + } + if ( isset( $a['description'] ) ) { + echo wp_kses( + sprintf( + '%1$s%2$s%3$s', + '

        ', + $a['description'], + '

        ' + ), + array( + 'p' => array( + 'class' => array(), + ), + 'acronym' => array( + 'title' => array(), + ), + ) + ); + } + + echo ( isset( $a['style'] ) ? '' : '' ); + echo "\n"; + } + + public static function config_item_extension_enabled( $a ) { + echo "\n\n"; + + $c = Dispatcher::config(); + self::checkbox2( + array( + 'name' => 'extension__' . self::config_key_to_http_name( $a['extension_id'] ), + 'value' => $c->is_extension_active_frontend( $a['extension_id'] ), + 'label' => $a['checkbox_label'], + ) + ); + + if ( isset( $a['description'] ) ) { + echo '

        ' . wp_kses( $a['description'], self::get_allowed_html_for_wp_kses_from_content( $a['description'] ) ) . '

        '; + } + + echo "\n"; + } + + public static function config_item_pro( $a ) { + $a = self::config_item_preprocess( $a ); + + if ( 'w3tc_no_trtd' !== $a['label_class'] ) { + echo ''; + + if ( ! empty( $a['label'] ) ) { + self::label( $a['control_name'], $a['label'] ); + } + + echo "\n\n"; + } + + self::pro_wrap_maybe_start(); + + self::control2( $a ); + + if ( isset( $a['control_after'] ) ) { + echo wp_kses( $a['control_after'], self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] ) ); + } + + if ( isset( $a['description'] ) ) { + self::pro_wrap_description( $a['excerpt'], $a['description'], $a['control_name'] ); + } + + self::pro_wrap_maybe_end( $a['control_name'] ); + + if ( 'w3tc_no_trtd' !== $a['label_class'] ) { + echo "\n"; + } + } + + public static function config_item_preprocess( $a ) { + $c = Dispatcher::config(); + + if ( ! isset( $a['value'] ) || is_null( $a['value'] ) ) { + $a['value'] = $c->get( $a['key'] ); + if ( is_array( $a['value'] ) ) { + $a['value'] = implode( "\n", $a['value'] ); + } + } + + if ( ! isset( $a['disabled'] ) || is_null( $a['disabled'] ) ) { + $a['disabled'] = $c->is_sealed( $a['key'] ); + } + + if ( empty( $a['label'] ) ) { + $a['label'] = self::config_label( $a['key'] ); + } + + $a['control_name'] = self::config_key_to_http_name( $a['key'] ); + $a['label_class'] = empty( $a['label_class'] ) ? '' : $a['label_class']; + if ( empty( $a['label_class'] ) && 'checkbox' === $a['control'] ) { + $a['label_class'] = 'w3tc_config_checkbox'; + } + + $action_key = $a['key']; + if ( is_array( $action_key ) ) { + $action_key = 'extension.' . $action_key[0] . '.' . $action_key[1]; + } + + return apply_filters( 'w3tc_ui_config_item_' . $action_key, $a ); + } + + /** + * Displays config item - caching engine selectbox + */ + public static function config_item_engine( $a ) { + if ( isset( $a['empty_value'] ) && $a['empty_value'] ) { + $values[''] = array( + 'label' => 'Please select a method', + ); + } + + $values['file'] = array( + 'label' => __( 'Disk', 'w3-total-cache' ), + 'optgroup' => 0, + ); + $values['apc'] = array( + 'disabled' => ! Util_Installed::apc(), + 'label' => __( 'Opcode: Alternative PHP Cache (APC / APCu)', 'w3-total-cache' ), + 'optgroup' => 1, + ); + $values['eaccelerator'] = array( + 'disabled' => ! Util_Installed::eaccelerator(), + 'label' => __( 'Opcode: eAccelerator', 'w3-total-cache' ), + 'optgroup' => 1, + ); + $values['xcache'] = array( + 'disabled' => ! Util_Installed::xcache(), + 'label' => __( 'Opcode: XCache', 'w3-total-cache' ), + 'optgroup' => 1, + ); + $values['wincache'] = array( + 'disabled' => ! Util_Installed::wincache(), + 'label' => __( 'Opcode: WinCache', 'w3-total-cache' ), + 'optgroup' => 1, + ); + $values['memcached'] = array( + 'disabled' => ! Util_Installed::memcached(), + 'label' => __( 'Memcached', 'w3-total-cache' ), + 'optgroup' => 2, + ); + $values['redis'] = array( + 'disabled' => ! Util_Installed::redis(), + 'label' => __( 'Redis', 'w3-total-cache' ), + 'optgroup' => 2, + ); + + self::config_item( + array( + 'key' => $a['key'], + 'label' => ( isset( $a['label'] ) ? $a['label'] : null ), + 'disabled' => ( isset( $a['disabled'] ) ? $a['disabled'] : null ), + 'control' => 'selectbox', + 'selectbox_values' => $values, + 'selectbox_optgroups' => array( + __( 'Shared Server:', 'w3-total-cache' ), + __( 'Dedicated / Virtual Server:', 'w3-total-cache' ), + __( 'Multiple Servers:', 'w3-total-cache' ), + ), + 'control_after' => isset( $a['control_after'] ) ? $a['control_after'] : null, + ) + ); + } + + public static function pro_wrap_maybe_start() { + if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { + return; + } + + ?> +
        +
        + ' . wp_kses( $excerpt_clean, self::get_allowed_html_for_wp_kses_from_content( $excerpt_clean ) ) . '

        '; + + if ( ! empty( $description ) ) { + $d = array_map( + function( $e ) { + return '

        ' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '

        '; + }, + $description + ); + + $descriptions = implode( "\n", $d ); + + echo '
        ' . wp_kses( $descriptions, self::get_allowed_html_for_wp_kses_from_content( $descriptions ) ) . '
        '; + echo '' . esc_html( __( 'Show More', 'w3-total-cache' ) ) . ''; + } + } + + public static function pro_wrap_maybe_end( $button_data_src ) { + if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) { + return; + } + + ?> +
        +
        + +
        +
        + +
        +

        + +

        +
        + +
        +
        + is_master() ) { + return; + } + + if ( $c->get_boolean( $a['key'] ) ) { + $name = 'w3tc_config_overloaded_disable~' . self::config_key_to_http_name( $a['key'] ); + $value = __( 'Use common settings', 'w3-total-cache' ); + } else { + $name = 'w3tc_config_overloaded_enable~' . self::config_key_to_http_name( $a['key'] ); + $value = __( 'Use specific settings', 'w3-total-cache' ); + } + + echo '
        '; + echo ''; + echo '
        '; + } + + /** + * Get the admin URL based on the path and the interface (network or site). + * + * @param string $path Admin path/URI. + * @return string + */ + public static function admin_url( $path ) { + return is_network_admin() ? network_admin_url( $path ) : admin_url( $path ); + } + + /** + * Returns a preview link with current state + * + * @return string + */ + public static function preview_link() { + return self::button_link( + __( 'Preview', 'w3-total-cache' ), + self::url( array( 'w3tc_default_previewing' => 'y' ) ), + true + ); + } + + /** + * Takes seconds and converts to array('Nh ','Nm ', 'Ns ', 'Nms ') or "Nh Nm Ns Nms" + * + * @param unknown $input + * @param bool $string + * @return array|string + */ + public static function secs_to_time( $input, $string = true ) { + $input = (float) $input; + $time = array(); + $msecs = floor( $input * 1000 % 1000 ); + $seconds = $input % 60; + + $minutes = floor( $input / 60 ) % 60; + $hours = floor( $input / 60 / 60 ) % 60; + + if ( $hours ) { + $time[] = $hours; + } + if ( $minutes ) { + $time[] = sprintf( '%dm', $minutes ); + } + if ( $seconds ) { + $time[] = sprintf( '%ds', $seconds ); + } + if ( $msecs ) { + $time[] = sprintf( '%dms', $msecs ); + } + + if ( empty( $time ) ) { + $time[] = sprintf( '%dms', 0 ); + } + if ( $string ) { + return implode( ' ', $time ); + } + return $time; + } + + /** + * Returns option name accepted by W3TC as http paramter + * from it's id (full name from config file) + */ + public static function config_key_to_http_name( $id ) { + if ( is_array( $id ) ) { + $id = $id[0] . '___' . $id[1]; + } + + return str_replace( '.', '__', $id ); + } + + /* + * Converts configuration key returned in http _GET/_POST + * to configuration key + */ + public static function config_key_from_http_name( $http_key ) { + $a = explode( '___', $http_key ); + if ( count( $a ) === 2 ) { + $a[0] = self::config_key_from_http_name( $a[0] ); + $a[1] = self::config_key_from_http_name( $a[1] ); + return $a; + } + + return str_replace( '__', '.', $http_key ); + } + + public static function get_allowed_html_for_wp_kses_from_content( $content ) { + $allowed_html = array(); + + if( empty( $content ) ) { + return $allowed_html; + } + + $dom = new DOMDocument(); + @$dom->loadHTML( $content ); + foreach ( $dom->getElementsByTagName( '*' ) as $tag ) { + $tagname = $tag->tagName; + foreach ( $tag->attributes as $attribute_name => $attribute_val ) { + $allowed_html[ $tagname ][ $attribute_name ] = array(); + } + $allowed_html[ $tagname ] = empty( $allowed_html[ $tagname ] ) ? array() : $allowed_html[ $tagname ]; + } + return $allowed_html; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_UsageStatistics.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_UsageStatistics.php new file mode 100644 index 00000000..d1c18922 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_UsageStatistics.php @@ -0,0 +1,218 @@ + 500000000 ) + return sprintf( '%.1f GB', $v / 1024 /*KB*/ / 1024 /*MB*/ / 1024/*GB*/ ); + if ( $v > 500000 ) + return sprintf( '%.1f MB', $v / 1024 /*KB*/ / 1024 /*MB*/ ); + else + return sprintf( '%.1f KB', $v / 1024 /*KB*/ ); + } + + + + static public function bytes_to_size2( $a, $p1, $p2 = null, $p3 = null ) { + $v = self::v( $a, $p1, $p2, $p3 ); + if ( is_null( $v ) ) + return 'n/a'; + + return self::bytes_to_size( $v ); + } + + + + static public function percent( $v1, $v2 ) { + if ( $v2 == 0 ) { + return '0 %'; + } elseif ($v1 > $v2 ) { + return '100 %'; + } else { + return sprintf( '%d', $v1 / $v2 * 100 ) . ' %'; + } + } + + + + static public function percent2( $a, $property1, $property2 ) { + if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) ) + return 'n/a'; + else if ( $a[$property2] == 0 ) + return '0 %'; + else + return sprintf( '%d', $a[$property1] / $a[$property2] * 100 ) . ' %'; + } + + + + static public function sum( $history, $property ) { + $v = 0; + foreach ( $history as $i ) { + $item_value = self::v3( $i, $property ); + if ( !empty( $item_value ) ) { + $v += $item_value; + } + } + return $v; + } + + + + static public function avg( $history, $property ) { + $v = 0; + $count = 0; + foreach ( $history as $i ) { + $item_value = self::v3( $i, $property ); + if ( !empty( $item_value ) ) { + $v += $item_value; + $count++; + } + } + return ( $count <= 0 ? 0 : $v / $count ); + } + + + + /** + * Sum up all positive metric values which names start with specified prefix + **/ + static public function sum_by_prefix_positive( &$output, $history, $property_prefix ) { + $property_prefix_len = strlen( $property_prefix ); + + foreach ( $history as $i ) { + foreach ( $i as $key => $value ) { + if ( substr( $key, 0, $property_prefix_len ) == $property_prefix && + $value > 0 ) { + if ( !isset( $output[$key] ) ) { + $output[$key] = 0; + } + + $output[$key] += $value; + } + } + } + } + + + + static public function time_mins( $timestamp ) { + return date( 'm/d/Y H:i', $timestamp ); + } + + + + static public function integer( $v ) { + return number_format( $v ); + } + + + + static public function integer_divideby( $v, $divide_by ) { + if ( $divide_by == 0 ) { + return 'n/a'; + } + + return self::integer( $v / $divide_by ); + } + + + + static public function integer2( $a, $p1, $p2 = null, $p3 = null ) { + $v = self::v( $a, $p1, $p2, $p3 ); + if ( is_null( $v ) ) + return 'n/a'; + else + return number_format( $v ); + } + + + + static public function v( $a, $p1, $p2 = null, $p3 = null ) { + if ( !isset( $a[$p1] ) ) + return null; + + $v = $a[$p1]; + if ( is_null( $p2 ) ) + return $v; + if ( !isset( $v[$p2] ) ) + return null; + + $v = $v[$p2]; + if ( is_null( $p3 ) ) + return $v; + if ( !isset( $v[$p3] ) ) + return null; + + return $v[$p3]; + } + + + + static public function v3( $a, $p ) { + if ( !is_array( $p ) ) { + $p = array( $p ); + } + + $actual = &$a; + for ( $i = 0; $i < count( $p ); $i++) { + $property = $p[$i]; + + if ( !isset( $actual[$property] ) ) { + return null; + } + + $actual = &$actual[$property]; + } + + return $actual; + } + + + + static public function value_per_second( $a, $property1, $property2 ) { + if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) ) + return 'n/a'; + else if ( $a[$property2] == 0 ) + return '0'; + else + return sprintf( '%.1f', $a[$property1] / $a[$property2] * 100 ); + } + + + + static public function value_per_period_seconds( $total, $summary ) { + if ( empty( $summary['period']['seconds'] ) ) + return 'n/a'; + + $period_seconds = $summary['period']['seconds']; + + return sprintf( '%.1f', $total / $period_seconds ); + } + + + + /** + * Special shared code for cache size counting + */ + static public function get_or_init_size_transient( $transient, $summary ) { + $should_count = false; + + $v = get_transient( $transient ); + if ( is_array( $v ) && isset( $v['timestamp_end'] ) && + $v['timestamp_end'] == $summary['period']['timestamp_end'] ) { + return array( $v, false ); + } + + // limit number of processing counting it at the same time + $v = array( + 'timestamp_end' => $summary['period']['timestamp_end'], + 'size_used' => '...counting', + 'items' => '...counting' + ); + set_transient( $transient, $v, 120 ); + return array( $v, true ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php new file mode 100644 index 00000000..320e8b04 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php @@ -0,0 +1,269 @@ +" . __( 'View all', 'w3-total-cache' ) . ''; + self::add( $widget_id, $name, $w3tc_registered_widgets[ $widget_id ]['callback'], $w3tc_registered_widget_controls[ $widget_id ]['callback'] ); + } + + if ( 'POST' === isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) : '' && ! empty( Util_Request::get_string( 'widget_id' ) ) ) { + check_admin_referer( 'edit-dashboard-widget_' . Util_Request::get_string( 'widget_id' ), 'dashboard-widget-nonce' ); + ob_start(); // The same hack "wp-admin/widgets.php" uses. + self::trigger_widget_control( Util_Request::get_string( 'widget_id' ) ); + ob_end_clean(); + } + + if ( $update ) { + update_option( 'w3tc_dashboard_widget_options', $widget_options ); + } + + do_action( 'do_meta_boxes', $screen->id, 'normal', '' ); + do_action( 'do_meta_boxes', $screen->id, 'side', '' ); + } + + /** + * Add 2. + * + * @static + * + * @param string $widget_id Widget id. + * @param int $priority Prioroty. + * @param string $widget_name Widget name. + * @param callable $callback Callback. + * @param callable $control_callback Control callback. + * @param string $location Location. + * @param string $header_text Header text. + * @param string $header_class Header class. + */ + public static function add2( $widget_id, $priority, $widget_name, $callback, + $control_callback = null, $location = 'normal', $header_text = null, + $header_class = '' ) { + $o = new _Util_Widget_Postponed( + array( + 'widget_id' => $widget_id, + 'widget_name' => $widget_name, + 'callback' => $callback, + 'control_callback' => $control_callback, + 'location' => $location, + 'header_text' => $header_text, + 'header_class' => $header_class, + ) + ); + + add_action( + 'w3tc_widget_setup', + array( $o, 'wp_dashboard_setup' ), + $priority + ); + + add_action( + 'w3tc_network_dashboard_setup', + array( $o, 'wp_dashboard_setup' ), + $priority + ); + + self::$w3tc_dashboard_widgets[ $widget_id ] = '*'; + } + + /** + * Registers widget. + * + * @static + * + * @param string $widget_id Widget id. + * @param string $widget_name Widget name. + * @param callable $callback Callback. + * @param callable $control_callback Control callback. + * @param string $location Location. + * @param string $header_text Header text. + * @param string $header_class Header class. + */ + public static function add( $widget_id, $widget_name, $callback, + $control_callback = null, $location = 'normal', $header_text = null, + $header_class = '' ) { + $screen = get_current_screen(); + + global $w3tc_dashboard_control_callbacks; + + if ( substr( $widget_name, 0, 1 ) !== '<' ) { + $widget_name = '
        ' . $widget_name . '
        '; + } + + // Link. + if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_string( $control_callback ) ) { + if ( ! $header_text ) { + $header_text = __( 'Configure' ); + } + + $widget_name .= ' ' . + '' . $header_text . ''; + } + + // Ajax callback. + if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) { + $w3tc_dashboard_control_callbacks[ $widget_id ] = $control_callback; + $edit_val = Util_Request::get_string( 'edit' ); + + if ( ! empty( $edit_val ) && $widget_id === $edit_val ) { + list( $url ) = explode( '#', add_query_arg( 'edit', false ), 2 ); + $widget_name .= ' ' . __( 'Cancel', 'w3-total-cache' ) . ''; + + $callback = array( + '\W3TC\Util_Widget', + '_dashboard_control_callback', + ); + } else { + list( $url ) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 ); + $widget_name .= ' ' . __( 'Configure' ) . ''; + } + } + + $side_widgets = array(); + + $priority = 'core'; + + add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority ); + } + + /** + * Dashboard Widgets Controls. + * + * @static + * + * @param string $dashboard Dashboard id. + * @param array $meta_box Meta box info. + */ + public static function _dashboard_control_callback( $dashboard, $meta_box ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore + echo '
        '; + self::trigger_widget_control( $meta_box['id'] ); + wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' ); + echo ''; + submit_button( __( 'Submit' ) ); + echo '
        '; + } + + /** + * List widgets. + * + * @static + * + * @return string + */ + public static function list_widgets() { + return implode( ',', array_keys( self::$w3tc_dashboard_widgets ) ); + } + + /** + * Calls widget control callback. + * + * @since 0.9.2.6 + * @static + * + * @param int|bool $widget_control_id Registered widget id. + */ + public static function trigger_widget_control( $widget_control_id = false ) { + global $w3tc_dashboard_control_callbacks; + + if ( is_scalar( $widget_control_id ) && $widget_control_id && + isset( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) && + is_callable( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) ) { + call_user_func( + $w3tc_dashboard_control_callbacks[ $widget_control_id ], + '', + array( + 'id' => $widget_control_id, + 'callback' => $w3tc_dashboard_control_callbacks[ $widget_control_id ], + ) + ); + } + } +} + +/** + * Class: Util_Widget_Postponed + */ +class _Util_Widget_Postponed { // phpcs:ignore + /** + * Data. + * + * @var array + * @access private + */ + private $data = array(); + + /** + * Constructor. + * + * @param array $data Data. + */ + public function __construct( $data ) { + $this->data = $data; + } + + /** + * Dashboard setup. + */ + public function wp_dashboard_setup() { + Util_Widget::add( + $this->data['widget_id'], + $this->data['widget_name'], + $this->data['callback'], + $this->data['control_callback'], + $this->data['location'], + $this->data['header_text'], + $this->data['header_class'] + ); + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php new file mode 100644 index 00000000..c71e0c79 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php @@ -0,0 +1,356 @@ +errors ) && + $wp_filesystem->errors->has_errors() ) { + $status['error'] = esc_html( $wp_filesystem->errors->get_error_message() ); + } + + wp_send_json_error( $status ); + } + } + + /** + * Tries to write file content + * + * @param string $filename path to file + * @param string $content data to write + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context folder in which to write file + * @throws Util_WpFile_FilesystemWriteException + * @return void + */ + static public function write_to_file( $filename, $content ) { + if ( @file_put_contents( $filename, $content ) ) + return; + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemWriteException( $ex->getMessage(), + $ex->credentials_form(), $filename, $content ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->put_contents( $filename, $content ) ) { + throw new Util_WpFile_FilesystemWriteException( + 'FTP credentials don\'t allow to write to file ' . + $filename . '', self::get_filesystem_credentials_form(), + $filename, $content ); + } + } + + /** + * Copy file using WordPress filesystem functions. + * + * @param unknown $source_filename + * @param unknown $destination_filename + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context folder to copy files too + * @throws Util_WpFile_FilesystemCopyException + */ + static public function copy_file( $source_filename, $destination_filename ) { + $contents = @file_get_contents( $source_filename ); + if ( $contents ) { + @file_put_contents( $destination_filename, $contents ); + } + if ( @file_exists( $destination_filename ) ) { + if ( @file_get_contents( $destination_filename ) == $contents ) + return; + } + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemCopyException( $ex->getMessage(), + $ex->credentials_form(), + $source_filename, $destination_filename ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->put_contents( $destination_filename, $contents, + FS_CHMOD_FILE ) ) { + throw new Util_WpFile_FilesystemCopyException( + 'FTP credentials don\'t allow to copy to file ' . + $destination_filename . '', + self::get_filesystem_credentials_form(), + $source_filename, $destination_filename ); + } + } + + /** + * + * + * @param unknown $folder + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context folder to create folder in + * @throws Util_WpFile_FilesystemMkdirException + */ + static private function create_folder( $folder, $from_folder ) { + if ( @is_dir( $folder ) ) + return; + + if ( Util_File::mkdir_from_safe( $folder, $from_folder ) ) + return; + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemMkdirException( $ex->getMessage(), + $ex->credentials_form(), $folder ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->mkdir( $folder, FS_CHMOD_DIR ) ) { + throw new Util_WpFile_FilesystemMkdirException( + 'FTP credentials don\'t allow to create folder ' . + $folder . '', + self::get_filesystem_credentials_form(), + $folder ); + } + } + + /** + * + * + * @param unknown $folder + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context folder to create folder in + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials + * @throws FileOperationException + */ + static public function create_writeable_folder( $folder, $from_folder ) { + self::create_folder( $folder, $from_folder ); + + $permissions = array( 0755, 0775, 0777 ); + + for ( $set_index = 0; $set_index < count( $permissions ); $set_index++ ) { + if ( is_writable( $folder ) ) + break; + + self::chmod( $folder, $permissions[$set_index] ); + } + } + + /** + * + * + * @param unknown $folder + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context path folder where delete folders resides + * @throws Util_WpFile_FilesystemRmdirException + */ + static public function delete_folder( $folder ) { + if ( !@is_dir( $folder ) ) + return; + + Util_File::rmdir( $folder ); + if ( !@is_dir( $folder ) ) + return; + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemRmdirException( $ex->getMessage(), + $ex->credentials_form(), $folder ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->rmdir( $folder ) ) { + throw new Util_WpFile_FilesystemRmdirException( + __( 'FTP credentials don\'t allow to delete folder ', 'w3-total-cache' ) . + '' . $folder . '', + self::get_filesystem_credentials_form(), + $folder ); + } + } + + /** + * + * + * @param string $filename + * @param int $permission + * @return void + * @throws Util_WpFile_FilesystemChmodException + */ + static private function chmod( $filename, $permission ) { + if ( @chmod( $filename, $permission ) ) + return; + + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemChmodException( $ex->getMessage(), + $ex->credentials_form(), $filename, $permission ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->chmod( $filename, $permission, true ) ) { + throw new Util_WpFile_FilesystemChmodException( + __( 'FTP credentials don\'t allow to chmod ', 'w3-total-cache' ) . + '' . $filename . '', + self::get_filesystem_credentials_form(), + $filename, $permission ); + } + + return true; + } + + /** + * + * + * @param unknown $file + * @param string $method + * @param string $url + * @param bool|string $context folder where file to be deleted resides + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials + */ + static public function delete_file( $filename ) { + if ( !@file_exists( $filename ) ) + return; + if ( @unlink( $filename ) ) + return; + + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemRmException( $ex->getMessage(), + $ex->credentials_form(), $filename ); + } + + global $wp_filesystem; + if ( !$wp_filesystem->delete( $filename ) ) { + throw new Util_WpFile_FilesystemRmException( + __( 'FTP credentials don\'t allow to delete ', 'w3-total-cache' ) . + '' . $filename . '', + self::get_filesystem_credentials_form(), + $filename ); + } + } + + /** + * Get WordPress filesystems credentials. Required for WP filesystem usage. + * + * @param string $method Which method to use when creating + * @param string $url Where to redirect after creation + * @param bool|string $context path to folder that should be have filesystem credentials. + * If false WP_CONTENT_DIR is assumed + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials + */ + private static function request_filesystem_credentials( $method = '', $url = '', $context = false ) { + if ( strlen( $url ) <= 0 ) { + $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; + } + + $url = preg_replace( '/&w3tc_note=([^&]+)/', '', $url ); + + // Ensure request_filesystem_credentials() is available. + require_once ABSPATH . 'wp-admin/includes/file.php'; + require_once ABSPATH . 'wp-admin/includes/template.php'; + + $success = true; + ob_start(); + if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, $context, array() ) ) ) { + $success = false; + } + $form = ob_get_contents(); + ob_end_clean(); + + ob_start(); + // If first check failed try again and show error message + if ( !WP_Filesystem( $creds ) && $success ) { + request_filesystem_credentials( $url, $method, true, false, array() ); + $success = false; + $form = ob_get_contents(); + } + ob_end_clean(); + + $error = ''; + if ( preg_match( "/(.+)<\/div>/", $form, $matches ) ) { + $error = $matches[2]; + $form = str_replace( $matches[0], '', $form ); + } + + if ( !$success ) { + throw new Util_WpFile_FilesystemOperationException( $error, $form ); + } + } + + /** + * + * + * @param string $method + * @param string $url + * @param bool|string $context + * @return Util_WpFile_FilesystemOperationException with S/FTP form + */ + static private function get_filesystem_credentials_form( $method = '', $url = '', + $context = false ) { + // Ensure request_filesystem_credentials() is available. + require_once ABSPATH . 'wp-admin/includes/file.php'; + require_once ABSPATH . 'wp-admin/includes/template.php'; + + ob_start(); + // If first check failed try again and show error message + request_filesystem_credentials( $url, $method, true, false, array() ); + $success = false; + $form = ob_get_contents(); + + ob_end_clean(); + + $error = ''; + if ( preg_match( "/(.+)<\/div>/", $form, $matches ) ) { + $form = str_replace( $matches[0], '', $form ); + } + + $form = str_replace( 'filename = $filename; + $this->permission = $permission; + } + + public function filename() { + return $this->filename; + } + + public function permission() { + return $this->permission; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php new file mode 100644 index 00000000..3ebd9816 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php @@ -0,0 +1,23 @@ +source_filename = $source_filename; + $this->destination_filename = $destination_filename; + } + + public function source_filename() { + return $this->source_filename; + } + + public function destination_filename() { + return $this->destination_filename; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php new file mode 100644 index 00000000..4b33cd3b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php @@ -0,0 +1,16 @@ +folder = $folder; + } + + public function folder() { + return $this->folder; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php new file mode 100644 index 00000000..154eb4ed --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php @@ -0,0 +1,29 @@ +modification_description = $modification_description; + $this->filename = $filename; + $this->file_contents = $file_contents; + } + + function modification_description() { + return $this->modification_description; + } + + public function filename() { + return $this->filename; + } + + public function file_contents() { + return $this->file_contents; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php new file mode 100644 index 00000000..ccd495eb --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php @@ -0,0 +1,19 @@ +credentials_form = $credentials_form; + } + + public function credentials_form() { + return $this->credentials_form; + + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php new file mode 100644 index 00000000..c98cb124 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php @@ -0,0 +1,16 @@ +filename = $filename; + } + + public function filename() { + return $this->filename; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php new file mode 100644 index 00000000..764228fd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php @@ -0,0 +1,16 @@ +folder = $folder; + } + + public function folder() { + return $this->folder; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php new file mode 100644 index 00000000..c89337aa --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php @@ -0,0 +1,23 @@ +filename = $filename; + $this->file_contents = $file_contents; + } + + public function filename() { + return $this->filename; + } + + public function file_contents() { + return $this->file_contents; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php new file mode 100644 index 00000000..48c370b5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php @@ -0,0 +1,157 @@ +blog mapfile + */ + static public function register_new_item( $config ) { + if ( !isset( $GLOBALS['current_blog'] ) ) { + return false; + } + + + // find blog_home_url + if ( Util_Environment::is_wpmu_subdomain() ) { + $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; + } else { + $home_url = rtrim( get_home_url(), '/' ); + if ( substr( $home_url, 0, 7 ) == 'http://' ) { + $home_url = substr( $home_url, 7 ); + } else if ( substr( $home_url, 0, 8 ) == 'https://' ) { + $home_url = substr( $home_url, 8 ); + } + + if ( substr( $GLOBALS['w3tc_blogmap_register_new_item'], 0, + strlen( $home_url ) ) == $home_url ) { + $blog_home_url = $home_url; + } else { + $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; + } + } + + + // write contents + $filename = Util_WpmuBlogmap::blogmap_filename_by_home_url( $blog_home_url ); + + if ( !@file_exists( $filename ) ) { + $blog_ids = array(); + } else { + $data = @file_get_contents( $filename ); + $blog_ids = @json_decode( $data, true ); + if ( !is_array( $blog_ids ) ) { + $blog_ids = array(); + } + } + + if ( isset( $blog_ids[$blog_home_url] ) ) { + return false; + } + + $data = $config->get_boolean( 'common.force_master' ) ? 'm' : 'c'; + $blog_home_url = preg_replace( '/[^a-zA-Z0-9\+\.%~!:()\/\-\_]/', '', $blog_home_url ); + $blog_ids[$blog_home_url] = $data . $GLOBALS['current_blog']->blog_id; + + $data = json_encode( $blog_ids ); + + try { + Util_File::file_put_contents_atomic( $filename, $data ); + } catch ( \Exception $ex ) { + return false; + } + + unset( self::$content_by_filename[$filename] ); + unset( $GLOBALS['w3tc_blogmap_register_new_item'] ); + + return true; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php new file mode 100644 index 00000000..6660d759 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php @@ -0,0 +1,430 @@ +_config = Dispatcher::config(); + + $this->_debug = $this->_config->get_boolean( 'varnish.debug' ); + $this->_servers = $this->_config->get_array( 'varnish.servers' ); + $this->_timeout = $this->_config->get_integer( 'timelimit.varnish_purge' ); + } + + /** + * Purge URI + * + * @param string $url + * @return boolean + */ + protected function _purge( $url ) { + @set_time_limit( $this->_timeout ); + $return = true; + + foreach ( (array) $this->_servers as $server ) { + $response = $this->_request( $server, $url ); + + if ( is_wp_error( $response ) ) { + $this->_log( $url, sprintf( 'Unable to send request: %s.', implode( '; ', $response->get_error_messages() ) ) ); + $return = false; + } elseif ( $response['response']['code'] !== 200 ) { + $this->_log( $url, 'Bad response: ' . $response['response']['status'] ); + $return = false; + } else { + $this->_log( $url, 'PURGE OK' ); + } + } + + return $return; + } + + /* + * Sends purge request. Cannt use default wp HTTP implementation + * if we send request to different host than specified in $url + * + * @param $url string + */ + function _request( $varnish_server, $url ) { + $parse_url = @parse_url( $url ); + + if ( !$parse_url || !isset( $parse_url['host'] ) ) + return new \WP_Error( 'http_request_failed', 'Unrecognized URL format ' . $url ); + + $host = $parse_url['host']; + $port = ( isset( $parse_url['port'] ) ? (int) $parse_url['port'] : 80 ); + $path = ( !empty( $parse_url['path'] ) ? $parse_url['path'] : '/' ); + $query = ( isset( $parse_url['query'] ) ? $parse_url['query'] : '' ); + $request_uri = $path . ( $query != '' ? '?' . $query : '' ); + + list( $varnish_host, $varnish_port ) = + Util_Content::endpoint_to_host_port( $varnish_server, 80 ); + + // if url host is the same as varnish server - we can use regular + // wordpress http infrastructure, otherwise custom request should be + // sent using fsockopen, since we send request to other server than + // specified by $url + if ( $host == $varnish_host && $port == $varnish_port ) + return Util_Http::request( $url, array( 'method' => 'PURGE' ) ); + + $request_headers_array = array( + sprintf( 'PURGE %s HTTP/1.1', $request_uri ), + sprintf( 'Host: %s', $host ), + sprintf( 'User-Agent: %s', W3TC_POWERED_BY ), + 'Connection: close' + ); + + $request_headers = implode( "\r\n", $request_headers_array ); + $request = $request_headers . "\r\n\r\n"; + + // log what we are about to do + $this->_log( $url, sprintf( 'Connecting to %s ...', $varnish_host ) ); + $this->_log( $url, sprintf( 'PURGE %s HTTP/1.1', $request_uri ) ); + $this->_log( $url, sprintf( 'Host: %s', $host ) ); + + $errno = null; + $errstr = null; + $fp = @fsockopen( $varnish_host, $varnish_port, $errno, $errstr, 10 ); + if ( !$fp ) + return new \WP_Error( 'http_request_failed', $errno . ': ' . $errstr ); + + @stream_set_timeout( $fp, 60 ); + + @fputs( $fp, $request ); + + $response = ''; + while ( !@feof( $fp ) ) + $response .= @fgets( $fp, 4096 ); + + @fclose( $fp ); + + list( $response_headers, $contents ) = explode( "\r\n\r\n", $response, 2 ); + $matches = null; + if ( preg_match( '~^HTTP/1.[01] (\d+)~', $response_headers, $matches ) ) { + $code = (int)$matches[1]; + $a = explode( "\n", $response_headers ); + $status = ( count( $a ) >= 1 ? $a[0] : '' ); + $return = array( + 'response' => array( + 'code' => $code, + 'status' => $status + ) + ); + return $return; + } + + return new \WP_Error( 'http_request_failed', + 'Unrecognized response header' . $response_headers ); + } + + /** + * Write log entry + * + * @param string $url + * @param string $msg + * @return bool|int + */ + function _log( $url, $msg ) { + if ( $this->_debug ) { + $data = sprintf( "[%s] [%s] %s\n", date( 'r' ), $url, $msg ); + $data = strtr( $data, '<>', '' ); + + $filename = Util_Debug::log_filename( 'varnish' ); + + return @file_put_contents( $filename, $data, FILE_APPEND ); + } + + return true; + } + + + + /** + * Flush varnish cache + */ + function flush() { + $this->flush_operation_requested = true; + return true; + } + + private function do_flush() { + if ( !is_network_admin() ) { + $full_urls = array( get_home_url() . '/.*' ); + $full_urls = Util_PageUrls::complement_with_mirror_urls( + $full_urls ); + + foreach ( $full_urls as $url ) + $this->_purge( $url ); + } else { + // todo: remove. doesnt work for all caches. + // replace with tool to flush network + global $wpdb; + $protocall = Util_Environment::is_https() ? 'https://' : 'http://'; + + // If WPMU Domain Mapping plugin is installed and active + if ( defined( 'SUNRISE_LOADED' ) && SUNRISE_LOADED && isset( $wpdb->dmtable ) && !empty( $wpdb->dmtable ) ) { + $blogs = $wpdb->get_results( " + SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain + FROM {$wpdb->dmtable} + RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id + WHERE site_id = {$wpdb->siteid} + AND spam = 0 + AND deleted = 0 + AND archived = '0'" ); + foreach ( $blogs as $blog ) { + if ( !isset( $blog->mapped_domain ) ) + $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*'; + else + $url = $protocall . $blog->mapped_domain . '/.*'; + $this->_purge( $url ); + } + + }else { + if ( !Util_Environment::is_wpmu_subdomain() ) { + $this->_purge( get_home_url().'/.*' ); + } else { + $blogs = $wpdb->get_results( " + SELECT domain, path + FROM {$wpdb->blogs} + WHERE site_id = '{$wpdb->siteid}' + AND spam = 0 + AND deleted = 0 + AND archived = '0'" ); + + foreach ( $blogs as $blog ) { + $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*'; + $this->_purge( $url ); + } + } + } + } + } + + /** + * Flushes varnish post cache + * + * @param integer $post_id Post ID. + * @param boolean $force Force flag (optional). + * + * @return boolean + */ + function flush_post( $post_id, $force ) { + if ( !$post_id ) { + $post_id = Util_Environment::detect_post_id(); + } + + if ( $post_id ) { + $full_urls = array(); + + $post = null; + $terms = array(); + + $feeds = $this->_config->get_array( 'pgcache.purge.feed.types' ); + $limit_post_pages = $this->_config->get_integer( 'pgcache.purge.postpages_limit' ); + + if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) || $this->_config->get_boolean( 'varnish.pgcache.feed.terms' ) ) { + $taxonomies = get_post_taxonomies( $post_id ); + $terms = wp_get_post_terms( $post_id, $taxonomies ); + } + + switch ( true ) { + case $this->_config->get_boolean( 'pgcache.purge.author' ): + case $this->_config->get_boolean( 'pgcache.purge.archive.daily' ): + case $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ): + case $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ): + case $this->_config->get_boolean( 'pgcache.purge.feed.author' ): + $post = get_post( $post_id ); + } + + $front_page = get_option( 'show_on_front' ); + + /** + * Home (Frontpage) URL + */ + if ( ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page == 'posts' )|| + $this->_config->get_boolean( 'pgcache.purge.front_page' ) ) { + $full_urls = array_merge( $full_urls, + Util_PageUrls::get_frontpage_urls( $limit_post_pages ) ); + } + + /** + * Home (Post page) URL + */ + if ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page != 'posts' ) { + $full_urls = array_merge( $full_urls, + Util_PageUrls::get_postpage_urls( $limit_post_pages ) ); + } + + /** + * Post URL + */ + if ( $this->_config->get_boolean( 'pgcache.purge.post' ) || $force ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_urls( $post_id ) ); + } + + /** + * Post comments URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.comments' ) && function_exists( 'get_comments_pagenum_link' ) ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_comments_urls( $post_id ) ); + } + + /** + * Post author URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.author' ) && $post ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_author_urls( $post->post_author, $limit_post_pages ) ); + } + + /** + * Post terms URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_terms_urls( $terms, $limit_post_pages ) ); + } + + /** + * Daily archive URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.archive.daily' ) && $post ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_daily_archive_urls( $post, $limit_post_pages ) ); + } + + /** + * Monthly archive URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ) && $post ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_monthly_archive_urls( $post, $limit_post_pages ) ); + } + + /** + * Yearly archive URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ) && $post ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_yearly_archive_urls( $post, $limit_post_pages ) ); + } + + /** + * Feed URLs + */ + if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) ) { + $full_urls = array_merge( $full_urls, + Util_PageUrls::get_feed_urls( $feeds ) ); + } + + if ( $this->_config->get_boolean( 'pgcache.purge.feed.comments' ) ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_comments_urls( $post_id, $feeds ) ); + } + + if ( $this->_config->get_boolean( 'pgcache.purge.feed.author' ) && $post ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_author_urls( $post->post_author, $feeds ) ); + } + + if ( $this->_config->get_boolean( 'pgcache.purge.feed.terms' ) ) { + $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_terms_urls( $terms, $feeds ) ); + } + + /** + * Purge selected pages + */ + if ( $this->_config->get_array( 'pgcache.purge.pages' ) ) { + $pages = $this->_config->get_array( 'pgcache.purge.pages' ); + $full_urls = array_merge( $full_urls, Util_PageUrls::get_pages_urls( $pages ) ); + } + + if ( $this->_config->get_string( 'pgcache.purge.sitemap_regex' ) ) { + $sitemap_regex = $this->_config->get_string( 'pgcache.purge.sitemap_regex' ); + $full_urls[] = Util_Environment::home_domain_root_url() . '/' . trim( $sitemap_regex, "^$" ); + } + + // add mirror urls + $full_urls = Util_PageUrls::complement_with_mirror_urls( + $full_urls ); + + $full_urls = apply_filters( 'varnish_flush_post_queued_urls', + $full_urls ); + + /** + * Queue flush + */ + if ( count( $full_urls ) ) { + foreach ( $full_urls as $url ) + $this->queued_urls[$url] = '*'; + } + + return true; + } + + return false; + } + + /** + * Flush a single url + * + * @param unknown $url + */ + function flush_url( $url ) { + $this->_purge( $url ); + } + + /** + * Flushes global and repeated urls + */ + function flush_post_cleanup() { + if ( $this->flush_operation_requested ) { + $this->do_flush(); + $count = 999; + + $this->flush_operation_requested = false; + $this->queued_urls = array(); + } else { + $count = count( $this->queued_urls ); + if ( $count > 0 ) { + foreach ( $this->queued_urls as $url => $nothing ) + $this->flush_url( $url ); + + $this->queued_urls = array(); + } + } + + return $count; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php new file mode 100644 index 00000000..8bcaaddd --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php @@ -0,0 +1,89 @@ +flush(); + + return $v; + } + + /** + * Purges post from varnish + * + * @param integer $post_id Post ID. + * @param boolean $force Force flag (optional). + * + * @return mixed + */ + public function varnish_flush_post( $post_id, $force = false ) { + $varnishflush = Dispatcher::component( 'Varnish_Flush' ); + $v = $varnishflush->flush_post( $post_id, $force ); + + return $v; + } + + /** + * Purges post from varnish + * + * @param string $url + * @return mixed + */ + public function varnish_flush_url( $url ) { + $varnishflush = Dispatcher::component( 'Varnish_Flush' ); + $v = $varnishflush->flush_url( $url ); + + return $v; + } + + public function w3tc_admin_bar_menu( $menu_items ) { + $menu_items['20610.varnish'] = array( + 'id' => 'w3tc_flush_varnish', + 'parent' => 'w3tc_flush', + 'title' => __( 'Reverse Proxy', 'w3-total-cache' ), + 'href' => wp_nonce_url( admin_url( + 'admin.php?page=w3tc_dashboard&w3tc_flush_varnish' ), + 'w3tc' ) + ); + + return $menu_items; + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php new file mode 100644 index 00000000..3b0b4c31 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php @@ -0,0 +1,51 @@ +config = w3tc_config(); + + // get value of config option and use it + if ( $this->config->get_boolean( array( 'example' , 'is_title_postfix' ) ) ) + add_filter( 'the_title', array( $this, 'the_title' ), 10, 2 ); + } + + + + /** + * the_title filter handler. + * This extension adds specified postfix to each post title if extensions + * is configured so on its settings page + */ + public function the_title( $title, $id ) { + return $title . + $this->config->get_string( array( 'example' , 'title_postfix' ) ); + } +} + + + +/* +This file is simply loaded by W3 Total Cache in a case if extension is active. +Its up to extension what will it do or which way will it do. +*/ +$p = new Extension_Example(); +$p->run(); + +if ( is_admin() ) { + $p = new Extension_Example_Admin(); + $p->run(); +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php new file mode 100644 index 00000000..562ddcbf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php @@ -0,0 +1,120 @@ + 'Example Extension', + 'author' => 'W3 EDGE', + 'description' => __( 'Example extension' ), + 'author_uri' => 'https://www.w3-edge.com/', + 'extension_uri' => 'https://www.w3-edge.com/', + 'extension_id' => 'example', + 'settings_exists' => true, + 'version' => '1.0', + 'enabled' => true, + 'requirements' => '', + 'path' => 'w3-total-cache-example/Extension_Example.php' + ); + + return $extensions; + } + + + + /** + * Entry point of extension for wp-admin/ requests + * Called from Extension_Example.php + */ + public function run() { + // handle settings page of this extension + add_action( 'w3tc_extension_page_example', array( + $this, + 'w3tc_extension_page' + ) ); + + // get control when configuration is changed by user + add_action( 'w3tc_config_ui_save', array( + $this, + 'w3tc_config_ui_save' + ), 10, 2 ); + + // Register widget on W3 Total Cache Dashboard page + add_action( 'w3tc_widget_setup', array( + $this, + 'w3tc_widget_setup' + ) ); + + // get control when extension is deactivated + add_action( 'w3tc_deactivate_extension_example', array( + $this, 'w3tc_deactivate_extension' ) ); + + } + + + + /** + * Show settings page + */ + public function w3tc_extension_page() { + include dirname( __FILE__ ) . '/Extension_Example_Page_View.php'; + } + + + + /** + * Get control when configuration is changed by user + */ + public function w3tc_config_ui_save( $config, $old_config ) { + if ( $config->get( array( 'example', 'is_title_postfix' ) ) != + $old_config->get( array( 'example', 'is_title_postfix' ) ) || + $config->get( array( 'example', 'title_postfix' ) ) != + $old_config->get( array( 'example', 'title_postfix' ) ) ) { + // flush all content caches, since our extension will now alter + // content + w3tc_flush_posts(); + } + } + + + + /** + * Registers widget on W3 Total Cache Dashboard page + */ + public function w3tc_widget_setup() { + $screen = get_current_screen(); + add_meta_box( 'example', 'example', array( $this, 'widget_content' ), + $screen, 'normal', 'core' ); + } + + + + /** + * Renders content of widget + */ + public function widget_content() { + echo "Example extension's widget"; + } + + + + /** + * Called when extension is deactivated. + * Perform a cleanup here + */ + public function w3tc_deactivate_extension() { + } +} diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php new file mode 100644 index 00000000..03f7d798 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php @@ -0,0 +1,47 @@ + +

        + + | + +

        +

        + +
        + + + array( 'example', 'is_title_postfix' ), + 'control' => 'checkbox', + 'label' => __( 'Add postfix to page titles', 'w3-total-cache' ), + 'checkbox_label' => __( 'Enable', 'w3-total-cache' ), + 'description' => __( 'Check if you want to add postfix to each post title.', 'w3-total-cache' ), + ) + ); + \W3TC\Util_Ui::config_item( + array( + 'key' => array( 'example', 'title_postfix' ), + 'control' => 'textbox', + 'label' => __( 'Postfix to page titles', 'w3-total-cache' ), + ) + ); + ?> +
        + +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php new file mode 100644 index 00000000..4fdc6600 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php @@ -0,0 +1,59 @@ + + + W3 Total Cache is distributed under the GNU General Public License, Version 2, + June 1991. Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110, USA + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +if ( !defined( 'ABSPATH' ) ) { + die(); +} + +/** + * Class autoloader + * + * @param string $class Classname + */ +function w3tc_example_class_autoload( $class ) { + if ( substr( $class, 0, 12 ) == 'W3TCExample\\' ) { + $filename = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . + substr( $class, 12 ) . '.php'; + + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + if ( !file_exists( $filename ) ) { + debug_print_backtrace(); + } + } + + require $filename; + } +} + +spl_autoload_register( 'w3tc_example_class_autoload' ); + +add_action( 'w3tc_extensions', array( + '\W3TCExample\Extension_Example_Admin', + 'w3tc_extensions' + ), 10, 2 ); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php new file mode 100644 index 00000000..24557bcc --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php @@ -0,0 +1,25 @@ + + + +

        Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.

        +

        Thanks for using W3 Total Cache.

        + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php new file mode 100644 index 00000000..5afe70bf --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php @@ -0,0 +1,7 @@ + + + +

        Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.

        +

        Thanks for using W3 Total Cache.

        + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php new file mode 100644 index 00000000..a8e8f5e3 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php @@ -0,0 +1,50 @@ + + + + +

        + '; + echo esc_html__( 'Version: ', 'w3-total-cache' ) . esc_html( W3TC_VERSION ) . '
        '; + echo esc_html__( 'URL: ', 'w3-total-cache' ) . '' . esc_html( $url ) . '
        '; + echo esc_html__( 'Name: ', 'w3-total-cache' ) . esc_html( $name ) . '
        '; + echo esc_html__( 'E-Mail: ', 'w3-total-cache' ) . '' . esc_html( $email ) . '
        '; + + if ( $twitter ) { + echo esc_html__( 'Twitter: ', 'w3-total-cache' ) . '' . esc_html( $twitter ) . '
        '; + } + + if ( $phone ) { + echo esc_html__( 'Phone: ', 'w3-total-cache' ) . esc_html( $phone ) . '
        '; + } + + if ( $forum_url ) { + echo esc_html__( 'Forum Topic URL: ', 'w3-total-cache' ) . '' . esc_url( $forum_url ) . '
        '; + } + + if ( $request_data_url ) { + echo esc_html__( 'Request data: ', 'w3-total-cache' ) . '' . esc_url( $request_data_url ) . '
        '; + } + + echo esc_html__( 'Subject: ', 'w3-total-cache' ) . esc_html( $subject ); + ?> +

        + +

        + +

        + +
        + + + '; + echo esc_html__( 'User Agent: ', 'w3-total-cache' ) . esc_html( $_SERVER['HTTP_USER_AGENT'] ); + ?> + + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php new file mode 100644 index 00000000..94d057c5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php @@ -0,0 +1,14 @@ + + + > + + + Error + + + +

        + +

        + + \ No newline at end of file diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html new file mode 100644 index 00000000..e69de29b diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html new file mode 100644 index 00000000..e69de29b diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php new file mode 100644 index 00000000..d3022825 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php @@ -0,0 +1,160 @@ + +

        Minify: Help Wizard

        + +

        + + + +

        + +
        +

        JavaScript:

        + +
          + $js_files ) : + foreach ( $js_files as $js_file ) : + $index++; + ?> +
        • + + + + + + + + + + + + + + + + +
           
          + /> + . + + + + + + + + +
          +
        • + + +
        +

        + +

        + +

        + + +

        + + +
          + $css_files ) : + foreach ( $css_files as $css_file ) : + $index++; + ?> +
        • + + + + + + + + + + + + + + +
           
          + /> + . + + + + + +
          +
        • + + +
        +

        + +

        + +

        No files found.

        + +
        + +
        +

        + +

        + +
        + + +
          +
        • +
        • + ', + '' + ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ); + ?> +
        • +
        +
        +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php new file mode 100644 index 00000000..879d54c9 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php @@ -0,0 +1,4 @@ +
        + +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php new file mode 100644 index 00000000..95aaa801 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php @@ -0,0 +1,520 @@ + +

        + +
        + + +

        + ', + '', + '
        ' + ), + array( + 'span' => array( + 'style' => array(), + ), + 'br' => array(), + ) + ); + echo wp_kses( + sprintf( + // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag. + __( + '%1$sNot detected/Not available/Off%2$s: May be installed, but cannot be automatically confirmed. Functionality may be limited.%3$s', + 'w3-total-cache' + ), + '', + '', + '
        ' + ), + array( + 'span' => array( + 'style' => array(), + ), + 'br' => array(), + ) + ); + echo wp_kses( + sprintf( + // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag. + __( + '%1$sNot installed/Error/No/False%2$s: Plugin or some functions may not work.%3$s', + 'w3-total-cache' + ), + '', + '', + '
        ' + ), + array( + 'span' => array( + 'style' => array(), + ), + 'br' => array(), + ) + ); + ?> +

        +
        + +
        +

        + +
          +
        • + +
        • + +
        • + + ; +
        • + +
        • + Web Server: + + Apache + + Lite Speed + + nginx + + lighttpd + + Microsoft IIS + + Not detected + +
        • + +
        • + FTP functions: + + Installed + + Not detected + + + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + +
        • + +
        • + + + + + + + +
        • + +
        • + + + + + + + +
        • + +
        • + zlib extension: + + + + + + +
        • + +
        • + brotli extension: + + + + + + +
        • + +
        • + Opcode cache: + + + + + + + + + = 6 ) : ?> + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + + +
        • + +
        • + + + + + + + + + + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + +
        • + +
        • + + + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + SSH2 extension: + + + + + + + ', + '', + '', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + +
        • + + +
          + +
        • + : + + + + + + + + + + +
        • + + +
        + +

        +
          + ' . wp_kses( $check, Util_Ui::get_allowed_html_for_wp_kses_from_content( $check ) ) . ''; + endforeach; + ?> +
        + + +

        + +
          + + +
        • + : + + + + + + + + + + + + + +
        • + + +
        • + : + + + + + +
        • + +
        • + + : + + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + + + + + + +
        • + +
        • + + + + + + +
        • + +
        • + + + () + + + +
        • +
        +
        + +
        + +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php new file mode 100644 index 00000000..101f208b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php @@ -0,0 +1,152 @@ + +
        + +
        +
        +

        Frederick Townes

        +

        CEO, W3 EDGE

        +
        +
        +
        + +
        +
        + + +
        +
        + +
        + + +
        +
        +
        +
        + +
        +

        + +
          +
        • + +
        • +
        • + +
        • +
        +

        +
        + + +

        + get_string( 'license.community_terms' ) !== 'accept' ) : ?> +

        + + +

        + +
        + +
        +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php new file mode 100644 index 00000000..bc465e4b --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php @@ -0,0 +1,40 @@ + +
        + +
        + +
        +
        + W3 TOTAL CACHE
        + +
        +
        + +
        + + + + + + + +
        + +
        + +
        + +
        + +
        diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php new file mode 100644 index 00000000..a2bd34e6 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php @@ -0,0 +1,630 @@ + 'application/vnd.lotus-1-2-3', + '3dml' => 'text/vnd.in3d.3dml', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gpp', + 'aab|x32|u32|vox' => 'application/x-authorware-bin', + 'aac' => 'audio/x-aac', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'adp' => 'audio/adpcm', + 'aep' => 'application/vnd.audiograph', + 'afp|listafp|list3820' => 'application/vnd.ibm.modcap', + 'aif|aiff|aifc' => 'audio/x-aiff', + 'air' => 'application/vnd.adobe.air-application-installer-package+zip', + 'ai|eps|ps' => 'application/postscript', + 'ami' => 'application/vnd.amiga.ami', + 'apk' => 'application/vnd.android.package-archive', + 'application' => 'application/x-ms-application', + 'apr' => 'application/vnd.lotus-approach', + 'asc|sig' => 'application/pgp-signature', + 'asf|asx' => 'video/x-ms-asf', + 'aso' => 'application/vnd.accpac.simply.aso', + 'atc|acutc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au|snd' => 'audio/basic', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'avifs' => 'image/avif-sequence', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azw' => 'application/vnd.amazon.ebook', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin|dms|lha|lrf|lzh|so|iso|dmg|dist|distz|pkg|bpk|dump|elc|deploy' => 'application/octet-stream', + 'bmi' => 'application/vnd.bmi', + 'bmp' => 'image/bmp', + 'box' => 'application/vnd.previewsystems.box', + 'btif' => 'image/prs.btif', + 'bz' => 'application/x-bzip', + 'bz2|boz' => 'application/x-bzip2', + 'c4g|c4d|c4f|c4p|c4u' => 'application/vnd.clonk.c4group', + 'cab' => 'application/vnd.ms-cab-compressed', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/java-vm', + 'clkk' => 'application/vnd.crick.clicker.keyboard', + 'clkp' => 'application/vnd.crick.clicker.palette', + 'clkt' => 'application/vnd.crick.clicker.template', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'cpio' => 'application/x-cpio', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'csh' => 'application/x-csh', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cww' => 'application/prs.cww', + 'c|cc|cxx|cpp|h|hh|dic' => 'text/x-c', + 'daf' => 'application/vnd.mobius.daf', + 'davmount' => 'application/davmount+xml', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'deb|udeb' => 'application/x-debian-package', + 'der|crt' => 'application/x-x509-ca-cert', + 'df' => 'application/x-deflate', + 'dfac' => 'application/vnd.dreamfactory', + 'dir|dcr|dxr|cst|cct|cxt|w3d|fgd|swa' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'djvu|djv' => 'image/vnd.djvu', + 'dna' => 'application/vnd.dna', + 'docm' => 'application/vnd.ms-word.document.macroenabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'doc|dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dp' => 'application/vnd.osgi.dp', + 'dpg' => 'application/vnd.dpgraph', + 'dsc' => 'text/prs.lines.tag', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dvi' => 'application/x-dvi', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'eml|all' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'epub' => 'application/epub+zip', + 'es3|et3' => 'application/vnd.eszigno3+xml', + 'esf' => 'application/vnd.epson.esf', + 'etx' => 'text/x-setext', + 'exe|dll|com|bat|msi' => 'application/x-msdownload', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f4v' => 'video/x-f4v', + 'fbs' => 'image/vnd.fastbidsheet', + 'fdf' => 'application/vnd.fdf', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fh|fhc|fh4|fh5|fh7' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm|frame|maker|book' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fpx' => 'image/vnd.fpx', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fzs' => 'application/vnd.fuzzysheet', + 'f|for|f77|f90' => 'text/x-fortran', + 'g3' => 'image/g3fax', + 'gac' => 'application/vnd.groove-account', + 'gdl' => 'model/vnd.gdl', + 'geo' => 'application/vnd.dynageo', + 'gex|gre' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gph' => 'application/vnd.flographit', + 'gqf|gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gz' => 'application/x-gzip', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hbci' => 'application/vnd.hbci', + 'hdf' => 'application/x-hdf', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'html|htm' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'icc|icm' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'ico' => 'image/x-icon', + 'ics|ifb' => 'text/calendar', + 'ief' => 'image/ief', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'igl' => 'application/vnd.igloader', + 'igs|iges' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'java' => 'text/x-java-source', + 'jisp' => 'application/vnd.jisp', + 'jlt' => 'application/vnd.hp-jlyt', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jpeg|jpg|jpe' => 'image/jpeg', + 'jpgv' => 'video/jpeg', + 'jpm|jpgm' => 'video/jpm', + 'js' => 'application/x-javascript', + 'json' => 'application/json', + 'karbon' => 'application/vnd.kde.karbon', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne|knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr|kpt' => 'application/vnd.kde.kpresenter', + 'ksp' => 'application/vnd.kde.kspread', + 'ktz|ktr' => 'application/vnd.kahootz', + 'kwd|kwt' => 'application/vnd.kde.kword', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'link66' => 'application/vnd.route66.link66+xml', + 'lostxml' => 'application/lost+xml', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'm3u' => 'audio/x-mpegurl', + 'm4v' => 'video/x-m4v', + 'mag' => 'application/vnd.ecowin.chart', + 'mathml' => 'application/mathml+xml', + 'ma|nb|mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mfm' => 'application/vnd.mfmp', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid|midi|kar|rmi' => 'audio/midi', + 'mif' => 'application/vnd.mif', + 'mj2|mjp2' => 'video/mj2', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mny' => 'application/x-msmoney', + 'movie' => 'video/x-sgi-movie', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4|mp4v|mpg4' => 'video/mp4', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpeg|mpg|mpe|m1v|m2v' => 'video/mpeg', + 'mpga|mp2|mp2a|mp3|m2a|m3a' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp|mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + 'msh|mesh|silo' => 'model/mesh', + 'msl' => 'application/vnd.mobius.msl', + 'msty' => 'application/vnd.muvee.style', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb|m13|m14' => 'application/x-msmediaview', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxml|xhvml|xvml|xvm' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu|m4u' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'ncx' => 'application/x-dtbncx+xml', + 'nc|cdf' => 'application/x-netcdf', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nsf' => 'application/vnd.lotus-notes', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga|ogg|spx' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'org' => 'application/vnd.lotus-organizer', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => array( 'application/x-font-otf', 'application/vnd.ms-opentype' ), + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otm' => 'application/vnd.oasis.opendocument.text-master', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p10' => 'application/pkcs10', + 'p12|pfx' => 'application/x-pkcs12', + 'p7b|spc' => 'application/x-pkcs7-certificates', + 'p7m|p7c' => 'application/pkcs7-all', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb|pqa|oprc' => 'application/vnd.palm', + 'pdf' => 'application/pdf', + 'pfa|pfb|pfm|afm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp-encrypted', + 'pic|pct' => 'image/x-pict', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ppt|pps|pot' => 'application/vnd.ms-powerpoint', + 'prc|mobi' => 'application/x-mobipocket-ebook', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'image/vnd.adobe.photoshop', + 'psf' => 'application/x-font-linux-psf', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + 'pvb' => 'application/vnd.3gpp.pic-bw-var', + 'pwn' => 'application/vnd.3m.post-it-notes', + 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyv' => 'video/vnd.ms-playready.media.pyv', + 'p|pas' => 'text/x-pascal', + 'qam' => 'application/vnd.epson.quickanime', + 'qbo' => 'application/vnd.intu.qbo', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt|mov' => 'video/quicktime', + 'qxd|qxt|qwd|qwt|qxl|qxb' => 'application/vnd.quark.quarkxpress', + 'ram|ra' => 'audio/x-pn-realaudio', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'application/vnd.rn-realmedia', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsd' => 'application/rsd+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'rtx' => 'text/richtext', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkm|sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'see' => 'application/vnd.seemail', + 'seed|dataless' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgml|sgm' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shf' => 'application/shf+xml', + 'sis|sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'skp|skd|skt|skm' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slt' => 'application/vnd.epson.salt', + 'smf' => 'application/vnd.stardivision.math', + 'smi|smil' => 'application/smil+xml', + 'snf' => 'application/x-font-snf', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'src' => 'application/x-wais-source', + 'srx' => 'application/sparql-results+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'application/vnd.ms-pki.stl', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'sus|susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svd' => 'application/vnd.svd', + 'svg|svgz' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.arastra.swi', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 's|asm' => 'text/x-asm', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'teacher' => 'application/vnd.smart.teacher', + 'tex' => 'application/x-tex', + 'texinfo|texi' => 'application/x-texinfo', + 'tfm' => 'application/x-tex-tfm', + 'tiff|tif' => 'image/tiff', + 'tmo' => 'application/vnd.tmobile-livetv', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tra' => 'application/vnd.trueapp', + 'trm' => 'application/x-msterminal', + 'tsv' => 'text/tab-separated-values', + 'ttf|ttc' => array( 'application/x-font-ttf', 'application/vnd.ms-opentype' ), + 'twd|twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt|text|conf|def|list|log|in' => 'text/plain', + 't|tr|roff|man|me|ms' => 'text/troff', + 'ufd|ufdl' => 'application/vnd.ufdl', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uoml' => 'application/vnd.uoml+xml', + 'uri|uris|urls' => 'text/uri-list', + 'ustar' => 'application/x-ustar', + 'utz' => 'application/vnd.uiq.theme', + 'uu' => 'text/x-uuencode', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vor' => 'application/vnd.stardivision.writer', + 'vsd|vst|vss|vsw' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'wad' => 'application/x-doom', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/vnd.wap.wbxml', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'application/x-msmetafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-ms-wmz', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps|wks|wcm|wdb' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl|vrml' => 'model/vrml', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'application/vnd.hzn-3d-crossword', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + 'xfdf' => 'application/vnd.adobe.xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xhtml|xht' => 'application/xhtml+xml', + 'xif' => 'image/vnd.xiff', + 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xls|xlm|xla|xlc|xlt|xlw' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xml|xsl' => 'application/xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw|xpx' => 'application/vnd.intercon.formnet', + 'xslt' => 'application/xslt+xml', + 'xsm' => 'application/vnd.syncml+xml', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir|zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml' +); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php new file mode 100644 index 00000000..5a3bb414 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php @@ -0,0 +1,15 @@ + 'text/css', + 'htc' => 'text/x-component', + 'less' => 'text/css', + //JS - varieties + 'js' => 'application/x-javascript', + 'js2' => 'application/javascript', + 'js3' => 'text/javascript', + 'js4' => 'text/x-js', +); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php new file mode 100644 index 00000000..191d59c5 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php @@ -0,0 +1,13 @@ + 'text/html', + 'rtf|rtx' => 'text/richtext', + 'txt' => 'text/plain', + 'xsd' => 'text/xsd', + 'xsl' => 'text/xsl', + 'xml' => 'text/xml' +); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html new file mode 100644 index 00000000..e69de29b diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php new file mode 100644 index 00000000..f254c337 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php @@ -0,0 +1,59 @@ + 'video/asf', + 'avi' => 'video/avi', + 'avif' => 'image/avif', + 'avifs' => 'image/avif-sequence', + 'bmp' => 'image/bmp', + 'class' => 'application/java', + 'divx' => 'video/divx', + 'doc|docx' => 'application/msword', + 'eot' => 'application/vnd.ms-fontobject', + 'exe' => 'application/x-msdownload', + 'gif' => 'image/gif', + 'gz|gzip' => 'application/x-gzip', + 'ico' => 'image/x-icon', + 'jpg|jpeg|jpe' => 'image/jpeg', + 'webp' => 'image/webp', + 'json' => 'application/json', + 'mdb' => 'application/vnd.ms-access', + 'mid|midi' => 'audio/midi', + 'mov|qt' => 'video/quicktime', + 'mp3|m4a' => 'audio/mpeg', + 'mp4|m4v' => 'video/mp4', + 'mpeg|mpg|mpe' => 'video/mpeg', + 'webm' => 'video/webm', + 'mpp' => 'application/vnd.ms-project', + 'otf' => 'application/x-font-otf', + '_otf' => 'application/vnd.ms-opentype', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'pdf' => 'application/pdf', + 'png' => 'image/png', + 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint', + 'ra|ram' => 'audio/x-realaudio', + 'svg|svgz' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif|tiff' => 'image/tiff', + 'ttf|ttc' => 'application/x-font-ttf', + '_ttf' => 'application/vnd.ms-opentype', + 'wav' => 'audio/wav', + 'wma' => 'audio/wma', + 'wri' => 'application/vnd.ms-write', + 'woff' => 'application/font-woff', + 'woff2' => 'application/font-woff2', + 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel', + 'zip' => 'application/zip' +); diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php new file mode 100644 index 00000000..220b2b0f --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php @@ -0,0 +1,263 @@ + + + +
        +

        + memcached', + '', + '' + ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + ), + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
          +
        • +
        • +
        • +
        • + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • + ', + '', + '', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • +
        • + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ) + ?> +
        • +
        • + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • +
        • +
        • +
        • + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • +
        • + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        • + ', + '' + ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ); + ?> +
        • +
        • +
        • + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        + +

        + +

        + +

        + + + +

        +
        + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php new file mode 100644 index 00000000..366e4d38 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php @@ -0,0 +1,730 @@ + 'Default', + 'on' => 'Enable', + 'off' => 'Disable', +); + +?> + + +
        +

        + ' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . '' + ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ); + ?> +

        +

        + array( + 'type' => array(), + 'name' => array(), + 'value' => array(), + ), + ) + ); + ?> + + ' + ), + array( + 'input' => array( + 'type' => array(), + 'name' => array(), + 'value' => array(), + 'disabled' => array(), + 'class' => array(), + ), + ) + ); + ?> +

        +
        +
        +
        + +

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'browsercache.rewrite', + 'disabled' => Util_Ui::sealing_disabled( 'browsercache.' ), + 'control' => 'checkbox', + 'checkbox_label' => wp_kses( + sprintf( + // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. + __( + 'Rewrite %1$sURL%2$s structure of objects', + 'w3-total-cache' + ), + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ), + 'description' => wp_kses( + sprintf( + // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. + __( + 'Generate unique %1$sURI%2$s for each file protected from caching by browser.', + 'w3-total-cache' + ), + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ), + 'label_class' => 'w3tc_single_column', + ) + ); + ?> +
        + +

        +
        + +

        +
        + +

        +
        + +

        +
        + +

        +
        + +

        +
        + +

        +
        + +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +

        +
        + checkbox( 'browsercache.no404wp', ! Util_Rule::can_check_rules() ); ?> +

        +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + + + + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ), + '', + 'css_js' + ); + ?> +

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + checkbox( 'browsercache.cssjs.last_modified' ); ?> +

        +
        + checkbox( 'browsercache.cssjs.expires' ); ?> +

        +
        + + + + name="browsercache__cssjs__lifetime" value="_config->get_integer( 'browsercache.cssjs.lifetime' ) ); ?>" size="8" /> +
        + checkbox( 'browsercache.cssjs.cache.control' ); ?> +

        +
        + + + + +

        + +
        + checkbox( 'browsercache.cssjs.etag' ); ?> +

        +
        + checkbox( 'browsercache.cssjs.w3tc' ); ?> +

        +
        + checkbox( 'browsercache.cssjs.compression' ); ?> +

        +
        + checkbox( 'browsercache.cssjs.brotli', ! function_exists( 'brotli_compress' ) ); ?> +

        +
        + checkbox( 'browsercache.cssjs.replace' ); ?> +

        +
        + checkbox( 'browsercache.cssjs.querystring' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'browsercache.cssjs.nocookies' ); ?> +

        +
        + + + + + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ), + '', + 'html_xml' + ); + ?> +

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + checkbox( 'browsercache.html.last_modified' ); ?> +

        +
        + checkbox( 'browsercache.html.expires' ); ?> +

        +
        + + + + value="_config->get_integer( 'browsercache.html.lifetime' ) ); ?>" + size="8" /> +
        + checkbox( 'browsercache.html.cache.control' ); ?> +

        +
        + + + + +

        + +
        + checkbox( 'browsercache.html.etag' ); ?> +

        +
        + checkbox( 'browsercache.html.w3tc' ); ?> +

        +
        + checkbox( 'browsercache.html.compression' ); ?> +

        +
        + checkbox( 'browsercache.html.brotli', ! function_exists( 'brotli_compress' ) ); ?> +

        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + checkbox( 'browsercache.other.last_modified' ); ?> +

        +
        + checkbox( 'browsercache.other.expires' ); ?> +

        +
        + + + + name="browsercache__other__lifetime" value="_config->get_integer( 'browsercache.other.lifetime' ) ); ?>" size="8" /> +
        + checkbox( 'browsercache.other.cache.control' ); ?> +

        +
        + + + + +

        + +
        + checkbox( 'browsercache.other.etag' ); ?> +

        +
        + checkbox( 'browsercache.other.w3tc' ); ?> +

        +
        + checkbox( 'browsercache.other.compression' ); ?> +

        +
        + checkbox( 'browsercache.other.brotli', ! function_exists( 'brotli_compress' ) ); ?> +

        +
        + checkbox( 'browsercache.other.replace' ); ?> +

        +
        + checkbox( 'browsercache.other.querystring' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'browsercache.other.nocookies' ); ?> +

        +
        + + + + + +
        +
        + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php new file mode 100644 index 00000000..b2fe4a88 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php @@ -0,0 +1,902 @@ + + +

        + + | + | + | + | + +

        + +

        + ' . Cache::engine_name( $this->_config->get_string( 'cdn.engine' ) ) . '', + '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . '' + ), + array( + 'strong' => array(), + 'span' => array( + 'class' => array(), + ), + ) + ); + ?> +

        +
        +

        + + Maximize CDN usage by or + . + + objects from the CDN using this tool + + + or + + + . + + + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + . + Check + + + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + + + + array( + 'type' => array(), + 'name' => array(), + 'value' => array(), + ), + ) + ); + ?> + class="button" /> +

        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        > + checkbox( + 'cdn.uploads.enable', + ! $upload_blogfiles_enabled, + '', + true, + $force_value + ); + ?> + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + if ( ! $upload_blogfiles_enabled ) : + echo wp_kses( + sprintf( + // translators: 1 HTML line break. + __( + '%1$sTo enable that, switch off "Use single network configuration file for all sites" option at General settings page and use specific settings for each blog.', + 'w3-total-cache' + ), + '
        ' + ), + array( + 'br' => array(), + ) + ); + endif; + ?> +

        +
        + /> +
        > + checkbox( 'cdn.includes.enable' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +
        > + checkbox( 'cdn.theme.enable' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +
        > + checkbox( 'cdn.minify.enable', ! $minify_enabled ); ?> +

        + ', + '', + '', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + /> +
        > + checkbox( 'cdn.custom.enable' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + /> +
        + checkbox( 'cdn.force.rewrite' ); ?> +

        +
        + checkbox( 'cdn.canonical_header' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + checkbox( 'cdn.flush_manually' ); + echo wp_kses( + sprintf( + // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag. + __( + 'Only purge %1$sCDN%2$s manually', + 'w3-total-cache' + ), + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +

        +
        + checkbox( 'cdn.reject.ssl' ); ?> +

        + ', + '', + '', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'cdn.admin.media_library' ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'cdn.cors_header' ); ?> Add CORS header +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'cdn.reject.logged_roles' ); ?> +

        + +
        + _config->get_array( 'cdn.reject.roles' ); ?> +
        + $role_data ) : ?> + id="role_" /> + + +
        +
        + +

        + ', + '', + '', + '' + ), + array( + 'a' => array( + 'href' => array(), + ), + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + checkbox( 'minify.upload', $this->_config->get_boolean( 'minify.auto' ) ); ?> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + _config->get_string( 'cdn.engine' ) ) { + $disabled = true; + $force_value = false; + } + + $this->checkbox( + 'cdn.autoupload.enabled', + $disabled, + '', + true, + $force_value + ); + ?> + +

        +
        + + value="_config->get_integer( 'cdn.autoupload.interval' ) ); ?>" size="8" /> +

        +
        + + name="cdn__queue__interval" value="_config->get_integer( 'cdn.queue.interval' ) ); ?>" size="10" /> +

        +
        + + name="cdn__queue__limit" value="_config->get_integer( 'cdn.queue.limit' ) ); ?>" size="10" /> +

        +
        + + name="cdn__includes__files" value="_config->get_string( 'cdn.includes.files' ) ); ?>" size="100" /> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + value="_config->get_string( 'cdn.theme.files' ) ); ?>" size="100" /> +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + value="_config->get_string( 'cdn.import.files' ) ); ?>" size="100" /> +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> + +
        + + +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + +

        + ', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + + +

        + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        +
        + + + + + + + + + +
        +
          +
        • +
        • + ', + '', + '', + '', + '', + '' + ), + array( + 'a' => array( + 'href' => array(), + ), + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +
        • +
        +
        + +
        +
        + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php new file mode 100644 index 00000000..0f98972c --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php @@ -0,0 +1,138 @@ + + + + + name="cdn__akamai__username" value="_config->get_string( 'cdn.akamai.username' ) ); ?>" size="60" /> + + + + + + type="password" name="cdn__akamai__password" value="_config->get_string( 'cdn.akamai.password' ) ); ?>" size="60" /> + + + + + + +

        + + + + + + + + + + + + + + + + + + + + +

        + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        + + + + + + _config->get_array( 'cdn.akamai.domain' ); + require W3TC_INC_DIR . '/options/cdn/common/cnames.php'; + ?> +

        + ', + '', + '', + '' + ), + array( + 'acronym' => array( + 'title' => array(), + ), + ) + ); + ?> +

        + + + + + + + diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php new file mode 100644 index 00000000..8ab59997 --- /dev/null +++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php @@ -0,0 +1,112 @@ + + + + + name="cdn__att__account" value="_config->get_string( 'cdn.att.account' ) ); ?>" size="60" /> + + + +