diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index b8b1a5fd0..15f8b70a4 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -96,9 +96,6 @@ jobs: npx wp-env run cli "wp core version" npx wp-env run cli "php --version" - - name: Copy .htaccess - run: npm run copy-htaccess - - name: Test run: npm run cypress:run diff --git a/CHANGELOG.md b/CHANGELOG.md index 651ca48d8..adc753703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [2.0.2] - 2023-11-29 +### Added +- New snippet detailing how to disable automatic content updates (props [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1145](https://github.com/10up/distributor/pull/1145)). + +### Changed +- Show proper external connection status error messages when the status is checked (props [@theskinnyghost](https://github.com/theskinnyghost), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1140](https://github.com/10up/distributor/pull/1140)). +- Updated our docs around how to connect two pieces of existing content (props [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1145](https://github.com/10up/distributor/pull/1145)). +- Bump WordPress "tested up to" version 6.4 (props [@severine-pozzo](https://github.com/severine-pozzo), [@QAharshalkadu](https://github.com/QAharshalkadu), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#1151](https://github.com/10up/distributor/pull/1151)). + +### Fixed +- Copy the htaccess file when initilizing the E2E test environment (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@theskinnyghost](https://github.com/theskinnyghost), [@dkotter](https://github.com/dkotter) via [#1143](https://github.com/10up/distributor/pull/1143)). +- Prevent early publishing of scheduled posts when pulled internally (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@maxledoux](https://github.com/maxledoux), [@pcrumm](https://github.com/pcrumm) via [#1156](https://github.com/10up/distributor/pull/1156)). +- Avoid a PHP fatal error when pulling content that has previously been pulled into a different network site (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1159](https://github.com/10up/distributor/pull/1159)). + +### Security +- Bump `postcss` from 8.4.24 to 8.4.31 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@ravinderk](https://github.com/ravinderk) via [#1141](https://github.com/10up/distributor/pull/1141)). +- Bump `@babel/traverse` from 7.22.5 to 7.23.2 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1147](https://github.com/10up/distributor/pull/1147)). + ## [2.0.1] - 2023-09-18 ### Changed - Update from Cypress v10 to v13 (props [@dkotter](https://github.com/dkotter), [@iamdharmesh](https://github.com/iamdharmesh), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1128](https://github.com/10up/distributor/pull/1128)). @@ -486,6 +504,7 @@ This adds a post type selector when viewing the Pull Content list for both exter - Initial closed release. [Unreleased]: https://github.com/10up/distributor/compare/trunk...develop +[2.0.2]: https://github.com/10up/distributor/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/10up/distributor/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/10up/distributor/compare/1.9.1...2.0.0 [1.9.1]: https://github.com/10up/distributor/compare/1.9.0...1.9.1 diff --git a/README.md b/README.md index 613482d23..a8757470b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ > Distributor is a WordPress plugin that makes it easy to distribute and reuse content across your websites — whether in a single multisite or across the web. -[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level) [![Tests](https://github.com/10up/distributor/actions/workflows/test.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/test.yml) [![Linting](https://github.com/10up/distributor/actions/workflows/lint.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/lint.yml) [![Code scanning](https://github.com/10up/distributor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/codeql-analysis.yml) [![Release Version](https://img.shields.io/github/release/10up/distributor.svg)](https://github.com/10up/distributor/releases/latest) ![WordPress tested up to version](https://img.shields.io/badge/WordPress-v6.3%20tested-success.svg) [![License](https://img.shields.io/github/license/10up/distributor.svg)](https://github.com/10up/distributor/blob/develop/LICENSE.md) +[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level) [![Tests](https://github.com/10up/distributor/actions/workflows/test.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/test.yml) [![Linting](https://github.com/10up/distributor/actions/workflows/lint.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/lint.yml) [![Code scanning](https://github.com/10up/distributor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/distributor/actions/workflows/codeql-analysis.yml) [![Release Version](https://img.shields.io/github/release/10up/distributor.svg)](https://github.com/10up/distributor/releases/latest) ![WordPress tested up to version](https://img.shields.io/badge/WordPress-v6.4%20tested-success.svg) [![License](https://img.shields.io/github/license/10up/distributor.svg)](https://github.com/10up/distributor/blob/develop/LICENSE.md) *You can learn more about Distributor's features at [DistributorPlugin.com](https://distributorplugin.com) and documentation at the [Distributor documentation site](https://10up.github.io/distributor/).* diff --git a/dist/css/admin-external-connection.min.css b/dist/css/admin-external-connection.min.css index 86548c01a..19992c314 100644 --- a/dist/css/admin-external-connection.min.css +++ b/dist/css/admin-external-connection.min.css @@ -1 +1 @@ -#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;box-shadow:none}.dt-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#dt_external_connection_details .dt-roles-allowed label:first-child{display:inline-block;font-weight:700;margin-bottom:5px}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{cursor:pointer;font-weight:700}.description{display:block}#dt_external_connection_details .card,#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details .dt-roles-allowed,#dt_external_connection_details .post-types-permissions,#dt_external_connection_details p{margin-bottom:2em}#dt_external_connection_details .card p{margin-bottom:1em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{font-style:italic;padding-left:15px}.endpoint-errors li:before{content:"-";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{animation:load8 1.1s linear infinite;border:.5em solid #cfcfcf;border-left-color:#666;border-radius:50%;content:" ";display:inline-block;font-size:9px;height:.8em;margin-right:8px;position:relative;text-indent:-9999em;top:-.25em;transform:translateZ(0);vertical-align:middle;width:.8em}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before,.endpoint-result[data-endpoint-state=warning]:before{background-color:red;border:1px solid #999;border-radius:50%;content:" ";display:inline-block;height:10px;margin-right:5px;position:relative;top:-2px;vertical-align:middle;width:10px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result[data-endpoint-state=warning]:before{background-color:#ffe000}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@keyframes load8{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{color:green;font-size:16px;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-left:0;margin-top:0}.dt-wizard-error{color:#a00} +#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;box-shadow:none}.dt-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#dt_external_connection_details .dt-roles-allowed label:first-child{display:inline-block;font-weight:700;margin-bottom:5px}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{cursor:pointer;font-weight:700}.description{display:block}#dt_external_connection_details .card,#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details .dt-roles-allowed,#dt_external_connection_details .post-types-permissions,#dt_external_connection_details p{margin-bottom:2em}#dt_external_connection_details .card p{margin-bottom:1em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{font-style:italic;padding-left:15px}.endpoint-errors li:before{content:"-";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{animation:load8 1.1s linear infinite;border:.5em solid #cfcfcf;border-left-color:#666;border-radius:50%;content:" ";display:inline-block;font-size:9px;height:.8em;margin-right:8px;position:relative;text-indent:-9999em;top:-.25em;transform:translateZ(0);vertical-align:middle;width:.8em}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before{background-color:red;border:1px solid #999;border-radius:50%;content:" ";display:inline-block;height:10px;margin-right:5px;position:relative;top:-2px;vertical-align:middle;width:10px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@keyframes load8{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{color:green;font-size:16px;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-left:0;margin-top:0}.dt-wizard-error{color:#a00} diff --git a/dist/css/admin-external-connections.min.css b/dist/css/admin-external-connections.min.css index 5f977210c..372d56e36 100644 --- a/dist/css/admin-external-connections.min.css +++ b/dist/css/admin-external-connections.min.css @@ -1 +1 @@ -.network-connections-notice{font-style:italic;margin-bottom:.5em}.connection-status{background-color:red;border:1px solid #999;border-radius:50%;content:" ";display:inline-block;height:10px;margin-right:5px;position:relative;top:-2px;vertical-align:middle;width:10px}.connection-status.valid{background-color:#62ff00}.connection-status.warning{background-color:#ffe000} +.network-connections-notice{font-style:italic;margin-bottom:.5em}.connection-status{background-color:red;border:1px solid #999;border-radius:50%;content:" ";display:inline-block;height:10px;margin-right:5px;position:relative;top:-2px;vertical-align:middle;width:10px}.connection-status.valid{background-color:#62ff00} diff --git a/dist/js/admin-external-connection.min.asset.php b/dist/js/admin-external-connection.min.asset.php index 4519beb54..01d6911aa 100644 --- a/dist/js/admin-external-connection.min.asset.php +++ b/dist/js/admin-external-connection.min.asset.php @@ -1 +1 @@ - array('jquery', 'underscore', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '242ebe5472159cee23d3'); + array('jquery', 'underscore', 'wp-a11y', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '8a2789fb0a0fc6da4bb3'); diff --git a/dist/js/admin-external-connection.min.js b/dist/js/admin-external-connection.min.js index 60a418b51..17c290514 100644 --- a/dist/js/admin-external-connection.min.js +++ b/dist/js/admin-external-connection.min.js @@ -1 +1 @@ -(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.jQuery;var n=t.n(e);const a=window._;var i=t.n(a);const r=window.wp.url,o=window.wp.a11y,s=window.wp.i18n;function l(t,e){const n=c(t),a=c(e),i=n.pop(),r=a.pop(),o=b(n,a);return 0!==o?o:i&&r?b(i.split("."),r.split(".")):i||r?i?-1:1:0}const d=(t,e,n)=>{y(n);const a=l(t,e);return g[n].includes(a)};l.validate=t=>"string"==typeof t&&/^[v\d]/.test(t)&&u.test(t),l.compare=d,l.satisfies=(t,e)=>{const n=e.match(/^([<>=~^]+)/),a=n?n[1]:"=";if("^"!==a&&"~"!==a)return d(t,e,a);const[i,r,o]=c(t),[s,l,u]=c(e);return 0===h(i,s)&&("^"===a?b([r,o],[l,u])>=0:0===h(r,l)&&h(o,u)>=0)};const u=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,c=t=>{if("string"!=typeof t)throw new TypeError("Invalid argument expected string");const e=t.match(u);if(!e)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return e.shift(),e},p=t=>"*"===t||"x"===t||"X"===t,_=t=>{const e=parseInt(t,10);return isNaN(e)?t:e},h=(t,e)=>{if(p(t)||p(e))return 0;const[n,a]=((t,e)=>typeof t!=typeof e?[String(t),String(e)]:[t,e])(_(t),_(e));return n>a?1:n{for(let n=0;n":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},m=Object.keys(g),y=t=>{if("string"!=typeof t)throw new TypeError("Invalid operator type, expected string but got "+typeof t);if(-1===m.indexOf(t))throw new Error(`Invalid operator, expected one of ${m.join("|")}`)},{ajaxurl:v,alert:f,document:w,dt:x,history:E}=window,{body:I}=w,k=w.getElementById("dt_external_connection_url"),B=w.getElementById("dt_external_connection_details"),T=w.getElementById("dt_external_connection_type"),A=w.getElementsByClassName("auth-field"),$=w.getElementsByClassName("dt-roles-allowed"),C=w.getElementById("title"),D=w.querySelector(".endpoint-result"),O=w.querySelector(".endpoint-errors"),j=w.getElementById("post_ID"),z=w.getElementById("create-connection"),P=w.getElementById("wpbody"),N=w.getElementById("dt_external_site_url"),L=w.getElementsByClassName("dt-wizard-error"),[S]=w.getElementsByClassName("dt-wizard-status"),q=w.getElementsByClassName("establish-connection-button"),R=w.getElementById("begin-authorization"),U=w.getElementById("create-oauth-connection"),Q=w.getElementsByClassName("manual-setup-button"),F=w.getElementById("#title-prompt-text"),H=T.value;let M=!1;function W(){if(!1!==M&&M.abort(),""===k.value)return O.innerText="",D.innerText="",void D.removeAttribute("data-endpoint-state");D.setAttribute("data-endpoint-state","loading"),D.innerText=(0,s.__)("Checking endpoint…","distributor"),O.innerText="";const t={};i().each(A,(e=>{if(e.disabled)return;const n=e.getAttribute("data-auth-field");n&&(t[n]=e.value)}));let e=0;j&&j.value&&(e=j.value),M=n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_verify_external_connection",auth:t,url:k.value,type:T.value,endpointId:e}}).done((t=>{if(t.success)if(t.data.errors.no_external_connection)if(D.setAttribute("data-endpoint-state","error"),t.data.endpoint_suggestion){D.innerText=`${(0,s.__)("Did you mean: ","distributor")} `;const e=w.createElement("button");e.classList.add("suggest"),e.classList.add("button-link"),e.setAttribute("type","button"),e.innerText=t.data.endpoint_suggestion,D.appendChild(e),(0,o.speak)(`${(0,s.__)("Did you mean: ","distributor")} ${t.data.endpoint_suggestion}`,"polite")}else D.innerText=(0,s.__)("No connection found.","distributor"),(0,o.speak)((0,s.__)("No connection found.","distributor"),"polite");else if(t.data.errors.no_distributor||!t.data.can_post.length){D.setAttribute("data-endpoint-state","warning"),D.innerText=(0,s.__)("Limited connection established.","distributor");const e=[];t.data.errors.no_distributor?(D.innerText+=` ${(0,s.__)("Distributor not installed on remote site.","distributor")}`,(0,o.speak)(`${(0,s.__)("Limited connection established.","distributor")} ${(0,s.__)("Distributor not installed on remote site.","distributor")}`,"polite")):(0,o.speak)(`${(0,s.__)("Limited connection established.","distributor")}`,"polite"),"no"===t.data.is_authenticated&&e.push((0,s.__)("Authentication failed due to invalid credentials.","distributor")),"yes"===t.data.is_authenticated&&e.push((0,s.__)("Authentication succeeded but your account does not have permissions to create posts on the external site.","distributor")),e.push((0,s.__)("Push distribution unavailable.","distributor")),e.push((0,s.__)("Pull distribution limited to basic content, i.e. title and content body.","distributor")),e.forEach((t=>{const e=w.createElement("li");e.innerText=t,O.append(e)}))}else D.setAttribute("data-endpoint-state","valid"),D.innerText=(0,s.__)("Connection established.","distributor"),(0,o.speak)((0,s.__)("Connection established.","distributor"),"polite");else D.setAttribute("data-endpoint-state","error")})).always((()=>{D.classList.remove("loading")}))}P.className=H,n()("#post").on("keypress",(function(t){return!(13===t.which&&!I.classList.contains("post-php")&&("wp"===n()(T).val()&&n()(q).trigger("click"),"wpdotcom"===n()(T).val()&&(it(R)||n()(R).trigger("click"),it(U)||n()(U).trigger("click")),1))})),n()(q).on("click",(t=>{t.preventDefault(),n()(L[0]).text("");const e=tt(n()(C),t),a=tt(n()(N),t);if(!e||!a)return t.preventDefault(),!1;let i=(0,r.prependHTTP)(N.value);return(0,r.isURL)(i)?(S.style.display="block",i=i.replace(/wp-json(\/)*/,""),i=i.replace(/\/?$/,"/"),n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_get_remote_info",url:i}}).done((t=>{if(S.style.display="none",!t.success)return Object.prototype.hasOwnProperty.call(t,"data")&&Object.prototype.hasOwnProperty.call(t.data,"rest_url")&&!Object.prototype.hasOwnProperty.call(t.data,"version")?void n()(L[0]).text((0,s.__)("Distributor not installed on remote site.","distributor")):(n()(L[0]).text((0,s.__)("Distributor not installed on remote site.","distributor")),void(Object.prototype.hasOwnProperty.call(t,"data")&&Array.isArray(t.data)&&0"),t.data.forEach((t=>{n()(L[0]).append(`${t.message} ${t.code?`(${t.code})`:""}
`)})))));if(l.compare(t.data.version,"1.6.0","<"))return void n()(L[0]).text((0,s.__)("Remote site requires Distributor version 1.6.0 or greater. Upgrade Distributor on the remote site to use the Authentication Wizard.","distributor"));if("core_application_passwords_available"in t.data&&!t.data.core_application_passwords_available)return void n()(L[0]).text((0,s.__)("Application Passwords is not available on the remote site. Please set up connection manually!","distributor"));const e=(0,r.addQueryArgs)(w.location.href,{setupStatus:"success",titleField:C.value,externalSiteUrlField:i,restRoot:t.data.rest_url}),a=(0,r.addQueryArgs)(w.location.href,{setupStatus:"failure"}),o="core_has_application_passwords"in t.data&&t.data.core_has_application_passwords?"authorize-application.php":"admin.php?page=auth_app";let d;d="core_application_passwords_endpoint"in t.data&&t.data.core_application_passwords_available?t.data.core_application_passwords_endpoint:`${i}wp-admin/${o}`;const u=(0,r.addQueryArgs)(d,{app_name:(0,s.sprintf)((0,s.__)("Distributor on %1$s (%2$s)","distributor"),x.blog_name,x.home_url),success_url:encodeURI(e),reject_url:encodeURI(a)});w.location=u})),!1):(n()(L[0]).text((0,s.__)("Please enter a valid URL, including the HTTP(S).","distributor")),!1)})),n()(Q).on("click",(t=>{t.preventDefault(),n()(".external-connection-wizard").hide(),n()(".external-connection-setup, .hide-until-authed").show()})),setTimeout((()=>{const{wizard_return:t}=x;t&&(""===C.value&&(n()(C).val(t.titleField).focus().blur(),n()(F).empty()),n()(G).val(t.user_login),n()(X).val(t.password),n()(k).val(t.restRoot),P.className="wizard-return",z.click()),W()}),300),n()(B).on("click",".suggest",(t=>{k.value=t.currentTarget.innerText,n()(k).trigger("input")})),n()(k).on("focus click",(t=>{t.target.setAttribute("initial-url",t.target.value)})),n()(k).on("keyup input",i().debounce((()=>{k.value.replace(/\/$/,"")!==k.getAttribute("initial-url").replace(/\/$/,"")&&(k.setAttribute("initial-url",k.value),W())}),250)),n()(k).on("blur",(t=>{""===C.value&&""!==t.currentTarget.value&&(C.value=t.currentTarget.value.replace(/https?:\/\//i,""),C.focus(),C.blur())}));const X=w.getElementById("dt_password"),G=w.getElementById("dt_username"),J=w.querySelector(".change-password");n()(G).on("focus click",(t=>{t.target.setAttribute("initial-username",t.target.value)})),n()(G).on("keyup input",i().debounce((()=>{G.getAttribute("initial-username")!==G.value&&J&&(X.disabled=!1,X.value="",J.style.display="none")}),250)),n()(X).on("keyup input",i().debounce((()=>{W()}),250)),n()(J).on("click",(t=>{t.preventDefault(),X.disabled?(X.disabled=!1,X.value="",t.currentTarget.innerText=(0,s.__)("Cancel","distributor")):(X.disabled=!0,X.value="sdfdsfsdfdsfdsfsd",t.currentTarget.innerText=(0,s.__)("Change","distributor")),W()})),n()($).on("click",".dt-role-checkbox",(t=>{t.target.classList.contains("dt-role-checkbox")&&t.target.checked&&"administrator"!==t.target.value&&"editor"!==t.target.value&&f((0,s.__)("Be careful assigning less trusted roles push privileges as they will inherit the capabilities of the user on the remote site.","distributor"))}));const K=n()(".hide-until-authed"),V=n()(w.getElementById("dt_client_secret")),Y=n()(w.getElementById("dt_client_id")),Z=()=>{0===w.getElementsByClassName("oauth-connection-established").length&&K.hide()},tt=(t,e)=>""===t.val()?(e.preventDefault(),t.addClass("error-required"),!1):(t.removeClass("error-required"),!0);n()(T).on("change",(()=>{const t=T.value;P.className=t,"wp"===t?n()(".external-connection-wizard").show():n()(".external-connection-setup, .hide-until-authed").hide()})),"wpdotcom"===T.value&&Z(),U&&n()(U).on("click",(t=>{const e=tt(V,t),n=tt(Y,t);if(!e||!n)return t.preventDefault(),!1}));const et=w.getElementById("oauth-authentication-change-credentials"),nt=n()(".oauth-authentication-details-wrapper");et&&n()(et).on("click",(function(){nt.show(),V.val(""),n()(".oauth-connection-established").remove(),Z()}));const at=w.getElementById("begin-authorization");function it(t){return null===t.offsetParent}at&&n()(at).on("click",(t=>{const e=n()(C),a=e.val();tt(e,t)&&(n()(at).addClass("disabled"),e.removeClass("error-required"),n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_begin_authorization",title:a,id:n()(w.getElementById("post_ID")).val()}}).done((t=>{if(t.success&&t.data.id){const e=`${x.admin_url}post.php?post=${t.data.id}&action=edit`;E.pushState({},"Oauth Authorize Details",e),n()(w.getElementById("dt_redirect_uri")).val(e),n()(w.getElementById("dt_created_post_id")).val(t.data.id),n()(w.getElementById("original_post_status")).val("publish"),n()(".oauth-begin-authentication-wrapper").hide(),nt.show()}})).always((()=>{n()(at).removeClass("disabled")})))}))})(); \ No newline at end of file +(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.jQuery;var n=t.n(e);const a=window._;var r=t.n(a);const i=window.wp.url,o=window.wp.a11y,s=window.wp.i18n;function l(t,e){const n=c(t),a=c(e),r=n.pop(),i=a.pop(),o=h(n,a);return 0!==o?o:r&&i?h(r.split("."),i.split(".")):r||i?r?-1:1:0}const d=(t,e,n)=>{y(n);const a=l(t,e);return b[n].includes(a)};l.validate=t=>"string"==typeof t&&/^[v\d]/.test(t)&&u.test(t),l.compare=d,l.satisfies=(t,e)=>{const n=e.match(/^([<>=~^]+)/),a=n?n[1]:"=";if("^"!==a&&"~"!==a)return d(t,e,a);const[r,i,o]=c(t),[s,l,u]=c(e);return 0===g(r,s)&&("^"===a?h([i,o],[l,u])>=0:0===g(i,l)&&g(o,u)>=0)};const u=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,c=t=>{if("string"!=typeof t)throw new TypeError("Invalid argument expected string");const e=t.match(u);if(!e)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return e.shift(),e},p=t=>"*"===t||"x"===t||"X"===t,_=t=>{const e=parseInt(t,10);return isNaN(e)?t:e},g=(t,e)=>{if(p(t)||p(e))return 0;const[n,a]=((t,e)=>typeof t!=typeof e?[String(t),String(e)]:[t,e])(_(t),_(e));return n>a?1:n{for(let n=0;n":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},m=Object.keys(b),y=t=>{if("string"!=typeof t)throw new TypeError("Invalid operator type, expected string but got "+typeof t);if(-1===m.indexOf(t))throw new Error(`Invalid operator, expected one of ${m.join("|")}`)},{ajaxurl:v,alert:f,document:w,dt:x,history:E}=window,{body:I}=w,k=w.getElementById("dt_external_connection_url"),B=w.getElementById("dt_external_connection_details"),T=w.getElementById("dt_external_connection_type"),A=w.getElementsByClassName("auth-field"),C=w.getElementsByClassName("dt-roles-allowed"),D=w.getElementById("title"),O=w.querySelector(".endpoint-result"),$=w.querySelector(".endpoint-errors"),j=w.getElementById("post_ID"),z=w.getElementById("create-connection"),N=w.getElementById("wpbody"),P=w.getElementById("dt_external_site_url"),S=w.getElementsByClassName("dt-wizard-error"),[q]=w.getElementsByClassName("dt-wizard-status"),L=w.getElementsByClassName("establish-connection-button"),R=w.getElementById("begin-authorization"),U=w.getElementById("create-oauth-connection"),Q=w.getElementsByClassName("manual-setup-button"),F=w.getElementById("#title-prompt-text"),H=T.value;let M=!1;function W(){if(!1!==M&&M.abort(),""===k.value)return $.innerText="",O.innerText="",void O.removeAttribute("data-endpoint-state");O.setAttribute("data-endpoint-state","loading"),O.innerText=(0,s.__)("Checking endpoint…","distributor"),$.innerText="";const t={};r().each(A,(e=>{if(e.disabled)return;const n=e.getAttribute("data-auth-field");n&&(t[n]=e.value)}));let e=0;j&&j.value&&(e=j.value),M=n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_verify_external_connection",auth:t,url:k.value,type:T.value,endpointId:e}}).done((t=>{if(t.success)if(t.data.errors.no_external_connection||"no"===t.data.is_authenticated||t.data.errors.no_distributor||!t.data.can_post.length)if(O.setAttribute("data-endpoint-state","error"),t.data.endpoint_suggestion){O.innerText=`${(0,s.__)("Did you mean: ","distributor")} `;const e=w.createElement("button");e.classList.add("suggest"),e.classList.add("button-link"),e.setAttribute("type","button"),e.innerText=t.data.endpoint_suggestion,O.appendChild(e),(0,o.speak)(`${(0,s.__)("Did you mean: ","distributor")} ${t.data.endpoint_suggestion}`,"polite")}else t.data.errors.no_distributor?(O.innerText=(0,s.__)("Distributor not installed on remote site.","distributor"),(0,o.speak)((0,s.__)("Distributor not installed on remote site.","distributor"),"polite")):"no"===t.data.is_authenticated||t.data.errors.no_types?(O.innerText=(0,s.__)("Authentication failed due to insufficient or invalid credentials.","distributor"),(0,o.speak)((0,s.__)("Authentication failed due to insufficient or invalid credentials.","distributor"),"polite")):(O.innerText=(0,s.__)("No connection found.","distributor"),(0,o.speak)((0,s.__)("No connection found.","distributor"),"polite"));else O.setAttribute("data-endpoint-state","valid"),O.innerText=(0,s.__)("Connection established.","distributor"),(0,o.speak)((0,s.__)("Connection established.","distributor"),"polite");else O.setAttribute("data-endpoint-state","error")})).always((()=>{O.classList.remove("loading")}))}N.className=H,n()("#post").on("keypress",(function(t){return!(13===t.which&&!I.classList.contains("post-php")&&("wp"===n()(T).val()&&n()(L).trigger("click"),"wpdotcom"===n()(T).val()&&(rt(R)||n()(R).trigger("click"),rt(U)||n()(U).trigger("click")),1))})),n()(L).on("click",(t=>{t.preventDefault(),n()(S[0]).text("");const e=tt(n()(D),t),a=tt(n()(P),t);if(!e||!a)return t.preventDefault(),!1;let r=(0,i.prependHTTP)(P.value);return(0,i.isURL)(r)?(q.style.display="block",r=r.replace(/wp-json(\/)*/,""),r=r.replace(/\/?$/,"/"),n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_get_remote_info",url:r}}).done((t=>{if(q.style.display="none",!t.success)return Object.prototype.hasOwnProperty.call(t,"data")&&Object.prototype.hasOwnProperty.call(t.data,"rest_url")&&!Object.prototype.hasOwnProperty.call(t.data,"version")?void n()(S[0]).text((0,s.__)("Distributor not installed on remote site.","distributor")):(n()(S[0]).text((0,s.__)("Distributor not installed on remote site.","distributor")),void(Object.prototype.hasOwnProperty.call(t,"data")&&Array.isArray(t.data)&&0"),t.data.forEach((t=>{n()(S[0]).append(`${t.message} ${t.code?`(${t.code})`:""}
`)})))));if(l.compare(t.data.version,"1.6.0","<"))return void n()(S[0]).text((0,s.__)("Remote site requires Distributor version 1.6.0 or greater. Upgrade Distributor on the remote site to use the Authentication Wizard.","distributor"));if("core_application_passwords_available"in t.data&&!t.data.core_application_passwords_available)return void n()(S[0]).text((0,s.__)("Application Passwords is not available on the remote site. Please set up connection manually!","distributor"));const e=(0,i.addQueryArgs)(w.location.href,{setupStatus:"success",titleField:D.value,externalSiteUrlField:r,restRoot:t.data.rest_url}),a=(0,i.addQueryArgs)(w.location.href,{setupStatus:"failure"}),o="core_has_application_passwords"in t.data&&t.data.core_has_application_passwords?"authorize-application.php":"admin.php?page=auth_app";let d;d="core_application_passwords_endpoint"in t.data&&t.data.core_application_passwords_available?t.data.core_application_passwords_endpoint:`${r}wp-admin/${o}`;const u=(0,i.addQueryArgs)(d,{app_name:(0,s.sprintf)((0,s.__)("Distributor on %1$s (%2$s)","distributor"),x.blog_name,x.home_url),success_url:encodeURI(e),reject_url:encodeURI(a)});w.location=u})),!1):(n()(S[0]).text((0,s.__)("Please enter a valid URL, including the HTTP(S).","distributor")),!1)})),n()(Q).on("click",(t=>{t.preventDefault(),n()(".external-connection-wizard").hide(),n()(".external-connection-setup, .hide-until-authed").show()})),setTimeout((()=>{const{wizard_return:t}=x;t&&(""===D.value&&(n()(D).val(t.titleField).focus().blur(),n()(F).empty()),n()(G).val(t.user_login),n()(X).val(t.password),n()(k).val(t.restRoot),N.className="wizard-return",z.click()),W()}),300),n()(B).on("click",".suggest",(t=>{k.value=t.currentTarget.innerText,n()(k).trigger("input")})),n()(k).on("focus click",(t=>{t.target.setAttribute("initial-url",t.target.value)})),n()(k).on("keyup input",r().debounce((()=>{k.value.replace(/\/$/,"")!==k.getAttribute("initial-url").replace(/\/$/,"")&&(k.setAttribute("initial-url",k.value),W())}),250)),n()(k).on("blur",(t=>{""===D.value&&""!==t.currentTarget.value&&(D.value=t.currentTarget.value.replace(/https?:\/\//i,""),D.focus(),D.blur())}));const X=w.getElementById("dt_password"),G=w.getElementById("dt_username"),J=w.querySelector(".change-password");n()(G).on("focus click",(t=>{t.target.setAttribute("initial-username",t.target.value)})),n()(G).on("keyup input",r().debounce((()=>{G.getAttribute("initial-username")!==G.value&&J&&(X.disabled=!1,X.value="",J.style.display="none")}),250)),n()(X).on("keyup input",r().debounce((()=>{W()}),250)),n()(J).on("click",(t=>{t.preventDefault(),X.disabled?(X.disabled=!1,X.value="",t.currentTarget.innerText=(0,s.__)("Cancel","distributor")):(X.disabled=!0,X.value="sdfdsfsdfdsfdsfsd",t.currentTarget.innerText=(0,s.__)("Change","distributor")),W()})),n()(C).on("click",".dt-role-checkbox",(t=>{t.target.classList.contains("dt-role-checkbox")&&t.target.checked&&"administrator"!==t.target.value&&"editor"!==t.target.value&&f((0,s.__)("Be careful assigning less trusted roles push privileges as they will inherit the capabilities of the user on the remote site.","distributor"))}));const K=n()(".hide-until-authed"),V=n()(w.getElementById("dt_client_secret")),Y=n()(w.getElementById("dt_client_id")),Z=()=>{0===w.getElementsByClassName("oauth-connection-established").length&&K.hide()},tt=(t,e)=>""===t.val()?(e.preventDefault(),t.addClass("error-required"),!1):(t.removeClass("error-required"),!0);n()(T).on("change",(()=>{const t=T.value;N.className=t,"wp"===t?n()(".external-connection-wizard").show():n()(".external-connection-setup, .hide-until-authed").hide()})),"wpdotcom"===T.value&&Z(),U&&n()(U).on("click",(t=>{const e=tt(V,t),n=tt(Y,t);if(!e||!n)return t.preventDefault(),!1}));const et=w.getElementById("oauth-authentication-change-credentials"),nt=n()(".oauth-authentication-details-wrapper");et&&n()(et).on("click",(function(){nt.show(),V.val(""),n()(".oauth-connection-established").remove(),Z()}));const at=w.getElementById("begin-authorization");function rt(t){return null===t.offsetParent}at&&n()(at).on("click",(t=>{const e=n()(D),a=e.val();tt(e,t)&&(n()(at).addClass("disabled"),e.removeClass("error-required"),n().ajax({url:v,method:"post",data:{nonce:x.nonce,action:"dt_begin_authorization",title:a,id:n()(w.getElementById("post_ID")).val()}}).done((t=>{if(t.success&&t.data.id){const e=`${x.admin_url}post.php?post=${t.data.id}&action=edit`;E.pushState({},"Oauth Authorize Details",e),n()(w.getElementById("dt_redirect_uri")).val(e),n()(w.getElementById("dt_created_post_id")).val(t.data.id),n()(w.getElementById("original_post_status")).val("publish"),n()(".oauth-begin-authentication-wrapper").hide(),nt.show()}})).always((()=>{n()(at).removeClass("disabled")})))}))})(); \ No newline at end of file diff --git a/dist/js/admin-external-connections-css.min.asset.php b/dist/js/admin-external-connections-css.min.asset.php index 2e809caa4..3ce0ef5e7 100644 --- a/dist/js/admin-external-connections-css.min.asset.php +++ b/dist/js/admin-external-connections-css.min.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '923ad403e2e8f1273111'); + array('wp-polyfill'), 'version' => '5f626f0e158c7ddb90cb'); diff --git a/distributor.php b/distributor.php index 15130d8e1..95b8d2894 100644 --- a/distributor.php +++ b/distributor.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/10up/distributor * Update URI: https://distributorplugin.com * Description: Makes it easy to distribute and reuse content across your websites, whether inside of a multisite or across the web. - * Version: 2.0.1 + * Version: 2.0.2 * Requires at least: 5.7 * Requires PHP: 7.4 * Author: 10up Inc. @@ -28,7 +28,7 @@ exit; // Exit if accessed directly. } -define( 'DT_VERSION', '2.0.1' ); +define( 'DT_VERSION', '2.0.2' ); define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) ); define( 'DT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'DT_PLUGIN_FULL_FILE', __FILE__ ); diff --git a/includes/classes/DistributorPost.php b/includes/classes/DistributorPost.php index ce440013e..d1b5c3645 100644 --- a/includes/classes/DistributorPost.php +++ b/includes/classes/DistributorPost.php @@ -782,6 +782,9 @@ protected function post_data() { 'excerpt' => $this->post->post_excerpt, 'parent' => ! empty( $this->post->post_parent ) ? (int) $this->post->post_parent : 0, 'status' => $this->post->post_status, + 'date' => $this->post->post_date, + 'date_gmt' => $this->post->post_date_gmt, + 'distributor_media' => $this->get_media(), 'distributor_terms' => $this->get_terms(), 'distributor_meta' => $this->get_meta(), @@ -857,11 +860,19 @@ protected function to_insert( $args = array() ) { if ( ! empty( $args['remote_post_id'] ) ) { // Updating an existing post. $insert['ID'] = (int) $args['remote_post_id']; + // Never update the post status when updating a post. unset( $insert['post_status'] ); + } elseif ( ! empty( $args['post_status'] ) ) { + $insert['post_status'] = $args['post_status']; } - if ( ! empty( $args['post_status'] ) ) { - $insert['post_status'] = $args['post_status']; + if ( + isset( $insert['post_status'] ) + && 'future' === $insert['post_status'] + ) { + // Set the post date to the future date. + $insert['post_date'] = $post_data['date']; + $insert['post_date_gmt'] = $post_data['date_gmt']; } // Post meta used by wp_insert_post, wp_update_post. @@ -921,6 +932,15 @@ protected function to_pull_list( $args = array() ) { protected function to_rest( $rest_args = array() ) { $post_data = $this->post_data(); + /* + * Unset dates. + * + * External connections do not allow for the pulling or pushing of + * scheduled posts so these can be ignored. + */ + unset( $post_data['date'] ); + unset( $post_data['date_gmt'] ); + if ( ! empty( $post_data['parent'] ) ) { $post_data['distributor_original_post_parent'] = (int) $post_data['parent']; } diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index bed72a97f..ac424d647 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -279,10 +279,10 @@ public function pull( $items ) { $current_blog_id = get_current_blog_id(); if ( ! empty( $post_props['meta']['dt_connection_map'] ) ) { - foreach ( $post_props['meta']['dt_connection_map'] as $distributed ) { + foreach ( $post_props['meta']['dt_connection_map'] as $connection_type => $distributed ) { $distributed = maybe_unserialize( $distributed ); - if ( array_key_exists( $current_blog_id, $distributed['internal'] ) ) { + if ( 'internal' === $connection_type && array_key_exists( $current_blog_id, $distributed ) ) { $dt_pull_messages['duplicated'] = 1; continue 2; } diff --git a/includes/debug-info.php b/includes/debug-info.php index 9ebd28e7c..fb4206f0b 100644 --- a/includes/debug-info.php +++ b/includes/debug-info.php @@ -267,7 +267,7 @@ function get_external_connection_status( $external_connection_status ) { } if ( empty( $external_connection_status['can_post'] ) ) { - $status = __( 'warning', 'distributor' ); + $status = __( 'error', 'distributor' ); } } diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index 1e2fb01f8..4396414f7 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -78,7 +78,7 @@ function output_status_column( $column_name, $post_id ) { } if ( empty( $external_connection_status['can_post'] ) ) { - $status = 'warning'; + $status = 'error'; } } diff --git a/includes/rest-api.php b/includes/rest-api.php index ac3bcaaa7..41dceed42 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -600,8 +600,11 @@ function check_post_types_permissions() { ); foreach ( $types as $type ) { - $caps = $type->cap; - $response['can_get'][] = $type->name; + $caps = $type->cap; + + if ( current_user_can( $caps->edit_posts ) ) { + $response['can_get'][] = $type->name; + } if ( current_user_can( $caps->edit_posts ) && current_user_can( $caps->create_posts ) && current_user_can( $caps->publish_posts ) ) { $response['can_post'][] = $type->name; diff --git a/lang/distributor.pot b/lang/distributor.pot index da64fdeca..ff9915170 100644 --- a/lang/distributor.pot +++ b/lang/distributor.pot @@ -2,16 +2,16 @@ # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Distributor 2.0.1\n" +"Project-Id-Version: Distributor 2.0.2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-09-19T05:46:47+00:00\n" +"POT-Creation-Date: 2023-11-29T21:39:26+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.8.1\n" +"X-Generator: WP-CLI 2.9.0\n" "X-Domain: distributor\n" #. Plugin Name of the plugin @@ -130,24 +130,24 @@ msgid "No post data for update." msgstr "" #: includes/classes/API/SubscriptionsController.php:339 -#: release/includes/classes/API/SubscriptionsController.php:336 +#: release/includes/classes/API/SubscriptionsController.php:339 msgid "Sorry, you are not allowed to create subscriptions." msgstr "" #: includes/classes/API/SubscriptionsController.php:354 -#: release/includes/classes/API/SubscriptionsController.php:351 +#: release/includes/classes/API/SubscriptionsController.php:354 msgid "Cannot create existing subscription." msgstr "" #: includes/classes/API/SubscriptionsController.php:358 -#: release/includes/classes/API/SubscriptionsController.php:355 +#: release/includes/classes/API/SubscriptionsController.php:358 msgid "Subscription post does not exist." msgstr "" #: includes/classes/API/SubscriptionsController.php:410 #: includes/classes/API/SubscriptionsController.php:433 -#: release/includes/classes/API/SubscriptionsController.php:407 -#: release/includes/classes/API/SubscriptionsController.php:430 +#: release/includes/classes/API/SubscriptionsController.php:410 +#: release/includes/classes/API/SubscriptionsController.php:433 msgid "Invalid post ID." msgstr "" @@ -350,7 +350,7 @@ msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:256 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:654 #: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:256 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:653 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:654 msgid "Could not connect to API endpoint." msgstr "" @@ -364,9 +364,9 @@ msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:606 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:660 #: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:271 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:502 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:605 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:659 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:503 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:606 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:660 msgid "Response body is empty." msgstr "" @@ -387,25 +387,25 @@ msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:473 #: includes/classes/InternalConnections/NetworkSiteConnection.php:75 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:472 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:473 #: release/includes/classes/InternalConnections/NetworkSiteConnection.php:75 msgid "Post ID required to push." msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:477 #: includes/classes/InternalConnections/NetworkSiteConnection.php:79 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:476 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:477 #: release/includes/classes/InternalConnections/NetworkSiteConnection.php:79 msgid "Post does not exist." msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:511 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:510 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:511 msgid "Could not determine remote post type endpoint." msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:612 -#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:611 +#: release/includes/classes/ExternalConnections/WordPressExternalConnection.php:612 msgid "Could not determine remote post ID." msgstr "" @@ -606,39 +606,18 @@ msgstr "" msgid "Did you mean: " msgstr "" -#: dist/js/admin-external-connection.min.js:1 -#: release/dist/js/admin-external-connection.min.js:1 -msgid "No connection found." -msgstr "" - -#: dist/js/admin-external-connection.min.js:1 -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Limited connection established." -msgstr "" - #: dist/js/admin-external-connection.min.js:1 #: release/dist/js/admin-external-connection.min.js:1 msgid "Distributor not installed on remote site." msgstr "" #: dist/js/admin-external-connection.min.js:1 -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Authentication failed due to invalid credentials." -msgstr "" - -#: dist/js/admin-external-connection.min.js:1 -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Authentication succeeded but your account does not have permissions to create posts on the external site." -msgstr "" - -#: dist/js/admin-external-connection.min.js:1 -#: release/dist/js/admin-external-connection.min.js:1 -msgid "Push distribution unavailable." +msgid "Authentication failed due to insufficient or invalid credentials." msgstr "" #: dist/js/admin-external-connection.min.js:1 #: release/dist/js/admin-external-connection.min.js:1 -msgid "Pull distribution limited to basic content, i.e. title and content body." +msgid "No connection found." msgstr "" #: dist/js/admin-external-connection.min.js:1 @@ -770,3 +749,23 @@ msgid "Selected connection (%d)" msgid_plural "Selected connections (%d)" msgstr[0] "" msgstr[1] "" + +#: release/dist/js/admin-external-connection.min.js:1 +msgid "Limited connection established." +msgstr "" + +#: release/dist/js/admin-external-connection.min.js:1 +msgid "Authentication failed due to invalid credentials." +msgstr "" + +#: release/dist/js/admin-external-connection.min.js:1 +msgid "Authentication succeeded but your account does not have permissions to create posts on the external site." +msgstr "" + +#: release/dist/js/admin-external-connection.min.js:1 +msgid "Push distribution unavailable." +msgstr "" + +#: release/dist/js/admin-external-connection.min.js:1 +msgid "Pull distribution limited to basic content, i.e. title and content body." +msgstr "" diff --git a/readme.txt b/readme.txt index a81a98a9b..aa38668b9 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: 10up Tags: content, distribution, syndication, management Requires at least: 5.7 -Tested up to: 6.3 +Tested up to: 6.4 Requires PHP: 7.4 -Stable tag: 2.0.1 +Stable tag: 2.0.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html