From 6dfbf23c40646167bd959b806a73eac34c80c200 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Tue, 29 Oct 2024 12:32:37 +0000 Subject: [PATCH] Allow PCH performance panel to show stats for trackable statuses --- build/content-helper/editor-sidebar.asset.php | 2 +- build/content-helper/editor-sidebar.js | 4 +- src/@types/assets/window.d.ts | 1 + src/class-parsely.php | 39 +++++++++++++------ .../editor-sidebar/class-editor-sidebar.php | 10 ++++- .../performance-stats/provider.ts | 15 ++++--- 6 files changed, 50 insertions(+), 21 deletions(-) diff --git a/build/content-helper/editor-sidebar.asset.php b/build/content-helper/editor-sidebar.asset.php index e2025f33a6..98c0e2a0da 100644 --- a/build/content-helper/editor-sidebar.asset.php +++ b/build/content-helper/editor-sidebar.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url', 'wp-wordcount'), 'version' => 'd6febeb9486e0cff901d'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url', 'wp-wordcount'), 'version' => 'e582fe60e9900e132791'); diff --git a/build/content-helper/editor-sidebar.js b/build/content-helper/editor-sidebar.js index 80fb506362..d5e0089aec 100644 --- a/build/content-helper/editor-sidebar.js +++ b/build/content-helper/editor-sidebar.js @@ -12,8 +12,8 @@ /* translators: %s: percentage value */,{ /* translators: %s: percentage value */ text:"".concat(c(t)," - ").concat((0,x.sprintf)((0,x.__)("%s%%","wp-parsely"),n.viewsPercentage)),delay:150,children:(0,f.jsx)("div",{"aria-label":r,className:"bar-fill "+t,style:{width:n.viewsPercentage+"%"}})},t)}))}),(0,f.jsx)("div",{className:"percentage-bar-labels",children:Object.entries(t.referrers.types).map((function(e){var t=e[0],n=e[1];return(0,f.jsxs)("div",{className:"single-label "+t,children:[(0,f.jsx)("div",{className:"label-color "+t}),(0,f.jsx)("div",{className:"label-text",children:c(t)}),(0,f.jsx)("div",{className:"label-value",children:nn(n.views)})]},t)}))})]})]})},on=(0,f.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,f.jsx)(k.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}),sn=(0,f.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,f.jsx)(k.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.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 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),an=(0,f.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,f.jsx)(k.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),ln=(0,f.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,f.jsx)(k.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})}),cn=function(){return cn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]1?[2,Promise.reject(new te((0,x.sprintf)(/* translators: URL of the published post */ /* translators: URL of the published post */ +/* translators: %s: Percentage value, %%: Escaped percent sign */;var i=(0,x.sprintf)((0,x.__)("%s%%","wp-parsely"),n.viewsPercentage);return(0,f.jsxs)("div",{className:"referrers-row",children:[(0,f.jsx)("div",{className:"referrers-row-title",children:(0,f.jsx)("span",{children:r})}),(0,f.jsx)("div",{className:"referrers-row-bar",children:(0,f.jsx)("div",{"aria-label":i,className:"percentage-bar",style:{"--bar-fill":n.viewsPercentage+"%"}})}),(0,f.jsx)("div",{className:"referrers-row-value",children:(0,f.jsx)("span",{children:n.views})})]},t)}))})]})};function mn(e){return{period_start:e,period_end:""}}(0,x.__)("Date N/A","wp-parsely");var wn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),bn=function(){return bn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]%s has 0 views, or the Parse.ly API returned no data.","wp-parsely"),r),U.ParselyApiReturnedNoData,""))]):n.length>1?[2,Promise.reject(new te((0,x.sprintf)(/* translators: URL of the published post */ /* translators: URL of the published post */ (0,x.__)("Multiple results were returned for the post %d by the Parse.ly API.","wp-parsely"),t),U.ParselyApiReturnedTooManyResults))]:[2,n[0]]}}))}))},t.prototype.fetchReferrerDataFromWpEndpoint=function(e,t,n){return xn(this,void 0,void 0,(function(){return kn(this,(function(r){switch(r.label){case 0:return[4,this.fetch({path:(0,ne.addQueryArgs)("/wp-parsely/v2/stats/post/".concat(t,"/referrers"),bn(bn({},mn(e)),{itm_source:this.itmSource,total_views:n}))})];case 1:return[2,r.sent()]}}))}))},t}(re),jn=function(){return jn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,n(r-1)];case 2:return t.sent(),[3,4];case 3:a(e),i(!1),t.label=4;case 4:return[2]}}))}))})),[2]}))}))};return i(!0),n(1),function(){a(void 0)}}),[t]),(0,f.jsxs)("div",{className:"wp-parsely-performance-panel",children:[(0,f.jsx)(tn,{title:(0,x.__)("Performance Stats","wp-parsely"),icon:en,dropdownChildren:function(e){var t=e.onClose;return(0,f.jsx)(Nn,{onClose:t})},children:(0,f.jsx)("div",{className:"panel-settings",children:(0,f.jsx)(h.SelectControl,{size:"__unstable-large",value:d.PerformanceStats.Period,prefix:(0,f.jsx)(h.__experimentalInputControlPrefixWrapper,{children:(0,x.__)("Period:","wp-parsely")}),onChange:function(e){F(e,m)&&(v({PerformanceStats:jn(jn({},d.PerformanceStats),{Period:e})}),P.trackEvent("editor_sidebar_performance_period_changed",{period:e}))},children:Object.values(m).map((function(e){return(0,f.jsx)("option",{value:e,children:V(e)},e)}))})})}),s?s.Message():(0,f.jsxs)(f.Fragment,{children:[Cn(d,"overview")&&(0,f.jsx)(gn,{data:c,isLoading:r}),Cn(d,"categories")&&(0,f.jsx)(rn,{data:c,isLoading:r}),Cn(d,"referrers")&&(0,f.jsx)(yn,{data:c,isLoading:r})]}),window.wpParselyPostUrl&&(0,f.jsx)(h.Button,{className:"wp-parsely-view-post",variant:"primary",onClick:function(){P.trackEvent("editor_sidebar_view_post_pressed")},href:window.wpParselyPostUrl,rel:"noopener",target:"_blank",children:(0,x.__)("View this in Parse.ly","wp-parsely")})]})},On=function(e){var t=e.period;return(0,f.jsx)(h.Panel,{children:(0,f.jsx)(Ie,{children:(0,f.jsx)(An,{period:t})})})},In=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=1&&(0,f.jsx)(h.__experimentalToggleGroupControlOption,{value:b.Tag,label:(0,x.__)("Tag","wp-parsely")}),r.categories.length>=1&&(0,f.jsx)(h.__experimentalToggleGroupControlOption,{value:b.Section,label:(0,x.__)("Section","wp-parsely")}),r.authors.length>=1&&(0,f.jsx)(h.__experimentalToggleGroupControlOption,{value:b.Author,label:(0,x.__)("Author","wp-parsely")})]})})},Bn=function(e){var t=e.filter,n=e.label,r=e.postData,i=In(e,["filter","label","postData"]);return(0,f.jsx)("div",{className:"related-posts-filter-values",children:(0,f.jsx)(h.ComboboxControl,{__next40pxDefaultSize:!0,allowReset:!0,label:n,onChange:function(e){return i.onFilterValueChange(e)},options:b.Tag===t.type?r.tags.map((function(e){return{value:e,label:e}})):b.Section===t.type?r.categories.map((function(e){return{value:e,label:e}})):b.Author===t.type?r.authors.map((function(e){return{value:e,label:e}})):[],value:t.value})})},Mn=function(e){var t=e.filter,n=e.postData,r=e.label,i=In(e,["filter","postData","label"]),o=function(){return n.authors.length>0&&n.categories.length>0||n.authors.length>0&&n.tags.length>0||n.tags.length>0&&n.categories.length>0},s=function(){return b.Tag===t.type&&n.tags.length>1||b.Section===t.type&&n.categories.length>1||b.Author===t.type&&n.authors.length>1};return o()||s()?(0,f.jsxs)("div",{className:"related-posts-filter-settings",children:[o()&&(0,f.jsx)(Rn,{filter:t,label:r,onFilterTypeChange:i.onFilterTypeChange,postData:n}),s()&&(0,f.jsx)(Bn,{filter:t,label:o()?void 0:r,onFilterValueChange:i.onFilterValueChange,postData:n})]}):null},Dn=(0,f.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,f.jsx)(k.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),Fn=(0,f.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,f.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})}),Vn=function(){return(0,f.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"1",height:"40",viewBox:"0 0 1 40",fill:"none",children:(0,f.jsx)(h.Rect,{width:"1",height:"40",fill:"#cccccc"})})};function Gn(e){var t=e.metric,n=e.post,r=e.avgEngagedIcon,i=e.viewsIcon;return"views"===t?(0,f.jsxs)("span",{className:"parsely-post-metric-data",children:[(0,f.jsx)("span",{className:"screen-reader-text",children:(0,x.__)("Number of Views","wp-parsely")}),i,nn(n.views.toString())]}):"avg_engaged"===t?(0,f.jsxs)("span",{className:"parsely-post-metric-data",children:[(0,f.jsx)("span",{className:"screen-reader-text",children:(0,x.__)("Average Time","wp-parsely")}),r,n.avgEngaged]}):(0,f.jsx)("span",{className:"parsely-post-metric-data",children:"-"})}var Hn,zn=function(e){var t,n,r=e.metric,i=e.post,o=e.postContent,s=(0,v.useDispatch)("core/notices").createNotice,a=o&&(t=o,n=Ae(i.rawUrl),new RegExp("]*href=[\"'](http://|https://)?.*".concat(n,".*[\"'][^>]*>"),"i").test(t));return(0,f.jsxs)("div",{className:"related-post-single","data-testid":"related-post-single",children:[(0,f.jsx)("div",{className:"related-post-title",children:(0,f.jsxs)("a",{href:i.url,target:"_blank",rel:"noreferrer",children:[(0,f.jsx)("span",{className:"screen-reader-text",children:(0,x.__)("View on website (opens new tab)","wp-parsely")}),i.title]})}),(0,f.jsx)("div",{className:"related-post-actions",children:(0,f.jsxs)("div",{className:"related-post-info",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"related-post-metric",children:(0,f.jsx)(Gn,{metric:r,post:i,viewsIcon:(0,f.jsx)(le,{icon:on}),avgEngagedIcon:(0,f.jsx)(h.Dashicon,{icon:"clock",size:24})})}),a&&(0,f.jsx)("div",{className:"related-post-linked",children:(0,f.jsx)(h.Tooltip,{text:(0,x.__)("This post is linked in the content","wp-parsely"),children:(0,f.jsx)(le,{icon:Dn,size:24})})})]}),(0,f.jsx)(Vn,{}),(0,f.jsxs)("div",{children:[(0,f.jsx)(h.Button,{icon:Fn,iconSize:24,onClick:function(){navigator.clipboard.writeText(i.rawUrl).then((function(){s("success",(0,x.__)("URL copied to clipboard","wp-parsely"),{type:"snackbar"})}))},label:(0,x.__)("Copy URL to clipboard","wp-parsely")}),(0,f.jsx)(h.Button,{icon:(0,f.jsx)(E,{}),iconSize:18,href:i.dashUrl,target:"_blank",label:(0,x.__)("View in Parse.ly","wp-parsely")})]})]})})]})},Un=window.wp.coreData,qn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),$n=function(){return $n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]allow_parsely_remote_requests(); } + /** + * Gets the allowed post statuses for tracking. + * + * Uses the `wp_parsely_trackable_statuses` filter to determine which post statuses are allowed to be tracked. + * + * @since 3.17.0 + * + * @param WP_Post|int|null $post The post object. + * @return array The allowed post statuses. + */ + public static function get_trackable_statuses( $post = null ): array { + /** + * Filters the statuses that are permitted to be tracked. + * + * By default, the only status tracked is 'publish'. Use this filter if + * you have other published content that has a different (custom) status. + * + * @since 2.5.0 + * @since 3.17.0 Filter extracted to a separate method. + * + * @param string[] $trackable_statuses The list of post statuses that are allowed to be tracked. + * @param WP_Post|int|null $post Which post object or ID is being checked. + */ + return apply_filters( 'wp_parsely_trackable_statuses', array( 'publish' ), $post ); + } + /** * Registers action and filter hook callbacks, and immediately upgrades * options if needed. @@ -394,18 +420,7 @@ public static function post_has_trackable_status( $post ): bool { return false; } - /** - * Filters the statuses that are permitted to be tracked. - * - * By default, the only status tracked is 'publish'. Use this filter if - * you have other published content that has a different (custom) status. - * - * @since 2.5.0 - * - * @param string[] $trackable_statuses The list of post statuses that are allowed to be tracked. - * @param int|WP_Post $post Which post object or ID is being checked. - */ - $statuses = apply_filters( 'wp_parsely_trackable_statuses', array( 'publish' ), $post ); + $statuses = self::get_trackable_statuses( $post ); $cache[ $post_id ] = in_array( get_post_status( $post ), $statuses, true ); return $cache[ $post_id ]; } diff --git a/src/content-helper/editor-sidebar/class-editor-sidebar.php b/src/content-helper/editor-sidebar/class-editor-sidebar.php index 42912085bc..aa97567a42 100644 --- a/src/content-helper/editor-sidebar/class-editor-sidebar.php +++ b/src/content-helper/editor-sidebar/class-editor-sidebar.php @@ -165,11 +165,19 @@ public function run(): void { if ( null !== $parsely_post_url ) { wp_add_inline_script( static::get_script_id(), - 'wpParselyPostUrl = ' . wp_json_encode( $parsely_post_url ) . ';', + 'window.wpParselyPostUrl = ' . wp_json_encode( $parsely_post_url ) . ';', 'before' ); } + // Inject the trackable statuses. + $trackable_statuses = Parsely::get_trackable_statuses(); + wp_add_inline_script( + static::get_script_id(), + 'window.wpParselyTrackableStatuses = ' . wp_json_encode( $trackable_statuses ) . ';', + 'before' + ); + wp_enqueue_style( static::get_style_id(), $built_assets_url . 'editor-sidebar.css', diff --git a/src/content-helper/editor-sidebar/performance-stats/provider.ts b/src/content-helper/editor-sidebar/performance-stats/provider.ts index df8293aca9..7219385e6b 100644 --- a/src/content-helper/editor-sidebar/performance-stats/provider.ts +++ b/src/content-helper/editor-sidebar/performance-stats/provider.ts @@ -58,8 +58,12 @@ export class PerformanceStatsProvider extends BaseProvider { public async getPerformanceStats( period: Period ): Promise { const editor = select( 'core/editor' ); - // We cannot show data for non-published posts. - if ( false === editor.isCurrentPostPublished() ) { + // Get the current post's status. + const currentPostStatus = editor.getEditedPostAttribute( 'status' ) ?? 'draft'; + const trackableStatuses = window.wpParselyTrackableStatuses ?? [ 'publish' ]; + + // We cannot show data for non-published posts that are not in the trackable statuses. + if ( ! editor.isCurrentPostPublished() && ! trackableStatuses.includes( currentPostStatus ) ) { return Promise.reject( new ContentHelperError( __( 'This post is not published, so its details are unavailable.', @@ -118,11 +122,12 @@ export class PerformanceStatsProvider extends BaseProvider { // No data was returned. if ( response.length === 0 ) { + const postTitle = select( 'core/editor' ).getEditedPostAttribute( 'title' ) ?? ''; return Promise.reject( new ContentHelperError( sprintf( - /* translators: URL of the published post */ - __( 'The post %d has 0 views, or the Parse.ly API returned no data.', - 'wp-parsely' ), postId + /* translators: Title of the published post */ + __( '%s has 0 views, or the Parse.ly API returned no data.', + 'wp-parsely' ), postTitle ), ContentHelperErrorCode.ParselyApiReturnedNoData, '' ) ); }