Platinum SEO Pack - Version 2.0.1

Version Description

  • 2020-02-06 - Fixed an issue that does not pull description for existing users of the plugin, in respect of posts where they had filled them (description) in the older version of Platinum SEO Pack.
Download this release

Release Info

Developer Rajesh Babu
Plugin Icon 128x128 Platinum SEO Pack
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

Changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
= 2.0.0 =
2
- * 2013-12-06 - Techblissonline Platinum SEO Wordpress plugin has been completely rewritten in this latest version and offers several new features in adiition to fixing the bugs in the earlier version.
3
4
= 1.3.8 =
5
* 2013-09-12 - Fixed a security issue (thanks to James Pearson)
1
+ = 2.0.1 =
2
+ * 2020-02-06 - Fixed an issue that does not pull description for existing users of the plugin, in respect of posts where they had filled them (description) in the older version of Platinum SEO Pack.
3
+
4
= 2.0.0 =
5
+ * 2020-02-03 - Techblissonline Platinum SEO Wordpress plugin has been completely rewriiten and offers several new features in adiition to fixing the bugs in the earlier version and improving Plugin Security.
6
7
= 1.3.8 =
8
* 2013-09-12 - Fixed a security issue (thanks to James Pearson)
platinum-seo-pack.php CHANGED
@@ -4,8 +4,8 @@
4
Plugin Name: Platinum SEO Pack
5
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
- Version: 2.0
8
- Author: Techblissonline (Rajesh)
9
Author URI: https://techblissonline.com/
10
Text Domain: platinum-seo-pack
11
License: GPLv2 or later
4
Plugin Name: Platinum SEO Pack
5
Plugin URI: https://techblissonline.com/platinum-wordpress-seo-plugin/
6
Description: Complete SEO and Social optimization solution for your Wordpress blog/site. It is Simple, Uncomplicated and User friendly with several useful features.
7
+ Version: 2.0.1
8
+ Author: Techblissonline.com
9
Author URI: https://techblissonline.com/
10
Text Domain: platinum-seo-pack
11
License: GPLv2 or later
psp-include/generators/psp_pts_seo_metas.php CHANGED
@@ -398,7 +398,7 @@ class PspPtsSeoMetas {
398
//if ($psp_nogendescription) return "";
399
400
401
- if (empty($psp_post_meta)) {
402
$description = trim(stripcslashes($this->psp_helper->internationalize(get_post_meta($post->ID, "description", true))));// post_description
403
404
if(empty($description)) {
@@ -416,7 +416,7 @@ class PspPtsSeoMetas {
416
417
if (!$description) {
418
419
- $description = $this->psp_helper->trim_excerpt_without_filters($this->psp_helper->internationalize($post->post_excerpt));
420
421
if (!$description && !$psp_nogendescription && isset($psp_settings['autogenerate_description']) && $psp_settings['autogenerate_description']) {
422
$description = $this->psp_helper->trim_excerpt_without_filters($this->psp_helper->internationalize($post->post_content));
@@ -808,8 +808,10 @@ class PspPtsSeoMetas {
808
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
809
***********/
810
$psp_post_meta_data['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? $wp_post_meta_data_arr['_techblissonline_psp_title'][0] : '';
811
if(isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
812
$psp_post_meta_data['titleformat'] = $wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0];
813
}
814
if(isset($wp_post_meta_data_arr['_techblissonline_psp_descformat'][0])) {
815
$psp_post_meta_data['descformat'] = $wp_post_meta_data_arr['_techblissonline_psp_descformat'][0];
@@ -902,7 +904,7 @@ class PspPtsSeoMetas {
902
$title = htmlspecialchars(stripcslashes($this->psp_helper->internationalize($post->post_title)));
903
}
904
//get other seo plugins title here
905
- if (empty($title)) {
906
//$title = htmlspecialchars(stripcslashes($this->psp_helper->internationalize(get_post_meta($post->ID, "title", true))));
907
$title = get_post_meta($post->ID, "title", true);
908
if (isset($title) && !empty($title)) {
@@ -1189,8 +1191,10 @@ class PspPtsSeoMetas {
1189
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
1190
***********/
1191
$psp_post_meta_data['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? $wp_post_meta_data_arr['_techblissonline_psp_title'][0] : '';
1192
if(isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
1193
$psp_post_meta_data['titleformat'] = $wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0];
1194
}
1195
if(isset($wp_post_meta_data_arr['_techblissonline_psp_descformat'][0])) {
1196
$psp_post_meta_data['descformat'] = $wp_post_meta_data_arr['_techblissonline_psp_descformat'][0];
398
//if ($psp_nogendescription) return "";
399
400
401
+ if (empty($description) && empty($psp_post_meta['useolddata'])) {
402
$description = trim(stripcslashes($this->psp_helper->internationalize(get_post_meta($post->ID, "description", true))));// post_description
403
404
if(empty($description)) {
416
417
if (!$description) {
418
419
+ //$description = $this->psp_helper->trim_excerpt_without_filters($this->psp_helper->internationalize($post->post_excerpt));
420
421
if (!$description && !$psp_nogendescription && isset($psp_settings['autogenerate_description']) && $psp_settings['autogenerate_description']) {
422
$description = $this->psp_helper->trim_excerpt_without_filters($this->psp_helper->internationalize($post->post_content));
808
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
809
***********/
810
$psp_post_meta_data['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? $wp_post_meta_data_arr['_techblissonline_psp_title'][0] : '';
811
+ $psp_post_meta_data['useolddata'] = '';
812
if(isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
813
$psp_post_meta_data['titleformat'] = $wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0];
814
+ $psp_post_meta_data['useolddata'] = 'none';
815
}
816
if(isset($wp_post_meta_data_arr['_techblissonline_psp_descformat'][0])) {
817
$psp_post_meta_data['descformat'] = $wp_post_meta_data_arr['_techblissonline_psp_descformat'][0];
904
$title = htmlspecialchars(stripcslashes($this->psp_helper->internationalize($post->post_title)));
905
}
906
//get other seo plugins title here
907
+ if (empty($title) && empty($psp_post_meta['useolddata'])) {
908
//$title = htmlspecialchars(stripcslashes($this->psp_helper->internationalize(get_post_meta($post->ID, "title", true))));
909
$title = get_post_meta($post->ID, "title", true);
910
if (isset($title) && !empty($title)) {
1191
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
1192
***********/
1193
$psp_post_meta_data['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? $wp_post_meta_data_arr['_techblissonline_psp_title'][0] : '';
1194
+ $psp_post_meta_data['useolddata'] = '';
1195
if(isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
1196
$psp_post_meta_data['titleformat'] = $wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0];
1197
+ $psp_post_meta_data['useolddata'] = 'none';
1198
}
1199
if(isset($wp_post_meta_data_arr['_techblissonline_psp_descformat'][0])) {
1200
$psp_post_meta_data['descformat'] = $wp_post_meta_data_arr['_techblissonline_psp_descformat'][0];
psp-include/settings/js/snippetpreview.js CHANGED
@@ -1 +1 @@
1
- function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\amp;")}function wordCount(e){var t=e.match(/\S+/g);return t?t.length:0}function pspSortArray(e,t){var r=[],i=[];for(let n=0;n<e.length;n++)i=[],void 0!==(i=wp.data.select("core").getEntityRecord("taxonomy",t,e[n]))&&(r[n]=i.name);return r?(r.sort(),r[0]):"%"+t+"%"}function pspSortClassicArray(e,t){var r=[];return jQuery('input[name="'+e+'"]:checked').each(function(){r.push(jQuery(this).parent("label").text())}),r&&r.length?(r.sort(),r[0]):"%"+t+"%"}function boldWords(e){var t=e,r=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(r)for(i=0;i<r.length;i++)t=(t=t.replace(new RegExp("(^|[\\W])("+escapeRegExp(r[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3")).replace(new RegExp("(^|[\\W])("+escapeRegExp(r[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3");return t}function boldText(e){var t=e,r=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(r)for(i=0;i<r.length;i++)t=t.replace(new RegExp("("+escapeRegExp(r[i])+")","gi"),"<b>$1</b>");return t}function htmlEncode(e){return jQuery("<div/>").text(e).html()}function setGtbUrlPreview(e){var t=htmlEncode(e);t=t.replace(/\/#x2F;,"");var r=t=t.replace(/([^https?:\/\/])(\/)/g,"$1 > ");jQuery("#urlSizer").html(t),jQuery("#murlSizer").html(r);var i=new RegExp("W(.*)quot;);for(trimmed=!1;jQuery("#urlSizer").width()>566;){var n=t;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>#x2F;,"")).trim(),jQuery("#urlSizer").html(n),t=n,trimmed=!0}trimmed&&(t+=" ...",jQuery("#urlSizer").html(t)),info=t.length+" characters, ",jQuery("#urlInfo").html(t.length+" characters, "+jQuery("#urlSizer").width()+" pixels"),jQuery("#urlSizer").width()<=584?jQuery("#urlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"):jQuery("#urlInfo").html(info+'<span style="color:red;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetUrl").html(t),mtrimmed=!1;for(var l=r;r.length>42;)r=jQuery.trim(r.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(i,""))).trim()).replace(/\>#x2F;,"")).length>=42&&(l=(l=jQuery.trim(r.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),r=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(r),info=r.length+" characters, ",jQuery("#murlInfo").html(r.length+" characters, "+jQuery("#murlSizer").width()+" pixels"),jQuery("#murlSizer").width()<=282?jQuery("#murlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+" pixels</span>"):jQuery("#murlInfo").html(info+'<span style="color:red;">'+jQuery("#murlSizer").width()+" pixels</span>"),jQuery("#techblissonlineMSnippetUrl").html(r)}function setUrlPreview(){var e="",t=!1;if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=wpEditorL10n.tinymce.settings),jQuery("#editable-post-name").length){e=jQuery.trim(jQuery("#sample-permalink").text());var r=jQuery.trim(jQuery("#editable-post-name").text());e=(e=e.replace(r,"")).replace(/\/#x2F;g,"")}else jQuery("#name").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):jQuery("#slug").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):t&&wp.data&&wp.data.select&&(e=wp.data.select("core/editor").getPermalink(),wp.data.subscribe(function(){setGtbUrlPreview(wp.data.select("core/editor").getPermalink())}));jQuery("#new-post-slug").length>0&&(e+=jQuery("#new-post-slug").val());jQuery("#editable-post-name").length&&(e+=jQuery("#editable-post-name").text());var i=htmlEncode(e);e=i=i.replace(/\/#x2F;,"");var n=i=i.replace(/([^https?:\/\/])(\/)/g,"$1 > ");jQuery("#urlSizer").html(i),jQuery("#murlSizer").html(n);var l=new RegExp("W(.*)quot;);for(trimmed=!1;jQuery("#urlSizer").width()>584;){var s=i;s=(s=(s=(s=s.substring(0,s.length-1)).trim()).replace(/\>#x2F;,"")).trim(),jQuery("#urlSizer").html(s),i=s,trimmed=!0}trimmed&&(i+=" ..."),info=i.length+" characters, ",jQuery("#urlInfo").html(i.length+" characters, "+jQuery("#urlSizer").width()+" pixels"),jQuery("#urlSizer").width()<=584?jQuery("#urlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"):jQuery("#urlInfo").html(info+'<span style="color:red;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetUrl").html(i),mtrimmed=!1;for(var o=n;o.length>42;)n=jQuery.trim(n.replace(" ...","")),(o=(o=(o=jQuery.trim(o.replace(l,""))).trim()).replace(/\>#x2F;,"")).length>=42&&(o=(o=jQuery.trim(n.replace(" ...",""))).substring(0,o.length-1)),o=o.trim(),n=o+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(n),info=n.length+" characters, ",jQuery("#murlInfo").html(n.length+" characters, "+jQuery("#murlSizer").width()+" pixels"),jQuery("#murlSizer").width()<=282?jQuery("#murlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+" pixels</span>"):jQuery("#murlInfo").html(info+'<span style="color:red;">'+jQuery("#murlSizer").width()+" pixels</span>"),jQuery("#techblissonlineMSnippetUrl").html(n)}function stripTrailingSlash(e){return"/"==e.substr(-1)?e.substr(0,e.length-1):e}function setGtbTitlePreview(e,t){var r=jQuery("#pspPostTypeArrayFormat").text(),i=JSON.parse(r),n=jQuery("#psp_seo_meta\\[titleformat\\]").val(),l=jQuery("#psp_seo_meta\\[title\\]"),s=n.replace("%seo_title%",e);if(s=(s=(s=(s=(s=s.replace("%wp_title%",i.wp_title)).replace("%site_name%",i.site_name)).replace("%site_description%",i.site_description)).replace("%taxonomy%",t)).replace(/%sep%/g,i.sep),""!==(s=(s=jQuery.trim(s)).trim(i.sep))){placeholder_title=e,l.attr("placeholder",placeholder_title);var o=htmlEncode(s),a=o;jQuery("#titleSizer").html(o);var p=new RegExp("sw+(.*)quot;);trimmed=!1;for(var u=o;jQuery("#titleSizer").width()>584;)o=jQuery.trim(o.replace(" ...","")),(u=jQuery.trim(u.replace(p,""))).length>=o.length&&(u=u.substring(0,u.length-1)),o=u+" ...",jQuery("#titleSizer").html(o),trimmed=!0;trimmed,jQuery("#titleSizer").html(o),mtrimmed=!1;for(var c=a;c.length>78;)a=jQuery.trim(a.replace(" ...","")),(c=jQuery.trim(c.replace(p,""))).length>=78&&(c=(c=jQuery.trim(c.replace(" ...",""))).substring(0,c.length-1)),a=c+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").html(a),info=o.length+" characters, "+wordCount(o)+" words ",jQuery("#titleInfo").html(o.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(o)+" words"),jQuery("#titleSizer").width()<=584?jQuery("#titleInfo").html(info+'<span style="color:green;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"):jQuery("#titleInfo").html(info+'<span style="color:red;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"),minfo=a.length+" characters/ 78 characters "+wordCount(a)+" words ",jQuery("#mtitleInfo").html(a.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(a)+" words"),a.length<=78?jQuery("#mtitleInfo").html('<span style="color:green;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"):jQuery("#mtitleInfo").html('<span style="color:red;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"),jQuery("#techblissonlineSnippetTitle").html(o),jQuery("#techblissonlineMSnippetTitle").html(a)}}function setTitlePreview(){var e,t,r,i="",n="",l="",s=!1,o="";window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(s=wpEditorL10n.tinymce.settings);var a=jQuery("#pspPostTypeArrayFormat").text(),p=JSON.parse(a),u=jQuery("#psp_seo_meta\\[titleformat\\]").val(),c=!1,m=!1,y=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(c=!0),jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(m=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(y=!0);o=p.category,u.toLowerCase().indexOf("%wp_title%");var h=jQuery("#title"),d=jQuery("#psp_seo_meta\\[title\\]"),j=jQuery("#psp_seo_meta\\[preferred_tax\\]"),Q="categories",g="post_category[]",w="category";if(j&&j.val()&&"category"!==(w=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(Q=w,g="tax_input["+w+"][]"),h&&(o=pspSortClassicArray(g,w)),!d.val()||m||y?(jQuery("#title").val()?n=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?n=jQuery.trim(jQuery("#name").val()):s&&wp.data&&wp.data.select&&(n=wp.data.select("core/editor").getEditedPostAttribute("title"),r=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==r&&r.length>0&&(o=pspSortArray(r,w)),wp.data.subscribe(function(){n=wp.data.select("core/editor").getEditedPostAttribute("title"),r=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==r&&r.length>0&&(o=pspSortArray(r,w)),n&&o&&setGtbTitlePreview(n,o)})),i=n,(c||y)&&(u="%wp_title%"),i=(i=(i=(i=(i=(i=u.replace("%seo_title%",n)).replace("%wp_title%",n)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",o)).replace(/%sep%/g,p.sep),i=(i=jQuery.trim(i)).trim(p.sep)):(i=d.val(),l=d.val(),jQuery("#title").val()?n=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?n=jQuery.trim(jQuery("#name").val()):s&&wp.data&&wp.data.select&&(n=wp.data.select("core/editor").getEditedPostAttribute("title"),t=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==t&&t.length>0&&(o=pspSortArray(t,w)),wp.data.subscribe(function(){n=wp.data.select("core/editor").getEditedPostAttribute("title"),t=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==t&&t.length>0&&(o=pspSortArray(t,w)),l&&o&&setGtbTitlePreview(l,o)})),c&&(u="%seo_title%"),i=(i=(i=(i=(i=(i=u.replace("%seo_title%",l)).replace("%wp_title%",n)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",o)).replace(/%sep%/g,p.sep),i=(i=jQuery.trim(i)).trim(p.sep)),""!==i){e=n,d.attr("placeholder",e);var f=htmlEncode(i),v=f;jQuery("#titleSizer").html(f);var _=new RegExp("sw+(.*)quot;),S=f;for(trimmed=!1;jQuery("#titleSizer").width()>584;)f=jQuery.trim(f.replace(" ...","")),(S=jQuery.trim(S.replace(_,""))).length>=f.length&&(S=S.substring(0,S.length-1)),f=S+" ...",jQuery("#titleSizer").text(f),trimmed=!0;trimmed,jQuery("#titleSizer").text(f),jQuery("body").append(jQuery("#titleSizer")).width(),jQuery("body#titleSizer").remove(),info=f.length+" characters, "+wordCount(f)+" words ",jQuery("#titleInfo").html(f.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(f)+" words"),jQuery("#titleSizer").width()<=584?jQuery("#titleInfo").html(info+'<span style="color:green;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"):jQuery("#titleInfo").html(info+'<span style="color:red;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetTitle").html(f);var b=v;for(mtrimmed=!1;b.length>78;)v=jQuery.trim(v.replace(" ...","")),(b=jQuery.trim(b.replace(_,""))).length>=78&&(b=(b=jQuery.trim(b.replace(" ...",""))).substring(0,b.length-1)),v=b+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").text(v),jQuery("body").append(jQuery("#mtitleSizer")).width(),jQuery("body#mtitleSizer").remove(),minfo=v.length+" characters/ 78 characters "+wordCount(v)+" words ",jQuery("#mtitleInfo").html(v.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(v)+" words"),v.length<=78?jQuery("#mtitleInfo").html('<span style="color:green;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"):jQuery("#mtitleInfo").html('<span style="color:red;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"),jQuery("#techblissonlineMSnippetTitle").html(v)}}function setDescriptionPreview(){var e=!1,t=jQuery("#psp_seo_meta\\[description\\]");window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(e=wpEditorL10n.tinymce.settings);var r=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),i=r;jQuery.inArray(parseInt(r),[-1,0,1,2,3,4])>-1&&(r=230,i=285),""===r&&(r=230,i=285),r=parseInt(r),i=parseInt(i);var n="",l=!1,s=!1;if(jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(l=!0),jQuery("#psp_seo_meta\\[disable_description\\]:checked").length>0&&(s=!0),""!==n||l||s||(n=jQuery.trim(jQuery("#psp_seo_meta\\[description\\]").val())),""===n)if(""===n&&e&&wp.data&&wp.data.select){var o=wp.data.select("core/editor").getEditedPostContent();n=(n=o.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),wp.data.subscribe(function(){var e=wp.data.select("core/editor").getEditedPostContent();t.val()||(n=(n=e.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),setGTBDescPreview(n))})}else{var a=jQuery.trim(jQuery("#content").val());if(!t.val()||l||s)return n=(n=a.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),void setGTBDescPreview(n)}var p=htmlEncode(n),u=p+=" ...";jQuery("#descriptionSizer").html(p),jQuery("#mdescriptionSizer").html(u);for(var c=new RegExp("sw+(.*)quot;),m=p;m.length>r;)p=jQuery.trim(p.replace(" ...","")),m=jQuery.trim(m.replace(c,"")),n=jQuery.trim(n.replace(c,"")),m.length>=r&&(m=(m=jQuery.trim(m.replace(" ...",""))).substring(0,m.length-1),n=n.substring(0,n.length-1)),m+=" ...";p=m,jQuery("#descriptionSizer").html(p);for(var y=u;y.length>i;)u=jQuery.trim(u.replace(" ...","")),(y=jQuery.trim(y.replace(c,""))).length>=i&&(y=(y=jQuery.trim(y.replace(" ...",""))).substring(0,y.length-1)),y+=" ...";u=y,jQuery("#mdescriptionSizer").html(u),jQuery("#descriptionInfo").html(p.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(p)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(p)+" words ",jQuery("#mdescriptionInfo").html(u.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(u)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(u)+" words ",p.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+p.length+"/~170 characters"):p.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+p.length+"/~170 characters</span>"):p.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+p.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+p.length+"/~170 characters</span>"),u.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+u.length+"/~170 characters"):u.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+u.length+"/~170 characters</span>"):u.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+u.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+u.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(p),jQuery("#techblissonlineMSnippetDescription").html(u)}function setGTBDescPreview(e){var t=jQuery("#psp_seo_meta\\[description\\]"),r=e;placeholder_desc=e,t.attr("placeholder",placeholder_desc);var i=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),n=i;jQuery.inArray(parseInt(i),[-1,0,1,2,3,4])>-1&&(i=230,n=285),""===i&&(i=230,n=285),i=parseInt(i),n=parseInt(n);var l=htmlEncode(r),s=l+=" ...";jQuery("#descriptionSizer").html(l),jQuery("#mdescriptionSizer").html(s);for(var o=new RegExp("sw+(.*)quot;),a=l;a.length>i;)l=jQuery.trim(l.replace(" ...","")),a=jQuery.trim(a.replace(o,"")),r=jQuery.trim(r.replace(o,"")),a.length>=i&&(a=(a=jQuery.trim(a.replace(" ...",""))).substring(0,a.length-1),r=r.substring(0,r.length-1)),a+=" ...";l=a,jQuery("#descriptionSizer").html(l);for(var p=s;p.length>n;)s=jQuery.trim(s.replace(" ...","")),(p=jQuery.trim(p.replace(o,""))).length>=n&&(p=(p=jQuery.trim(p.replace(" ...",""))).substring(0,p.length-1)),p+=" ...";s=p,jQuery("#descriptionSizer").html(s),jQuery("body").append(jQuery("#descriptionSizer")).width(),jQuery("body").append(jQuery("#mdescriptionSizer")).width(),jQuery("body").remove("#descriptionSizer"),jQuery("body").remove("#mdescriptionSizer"),jQuery("#descriptionInfo").html(l.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(l)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(l)+" words ",jQuery("#mdescriptionInfo").html(s.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(s)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(s)+" words ",l.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+l.length+"/~170 characters"):l.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+l.length+"/~170 characters</span>"):l.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+l.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+l.length+"/~170 characters</span>"),s.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+s.length+"/~170 characters"):s.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+s.length+"/~170 characters</span>"):s.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+s.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+s.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(l),jQuery("#techblissonlineMSnippetDescription").html(s)}function updateDateText(){var e=htmlEncode(jQuery.trim(jQuery("#DateText").val()));e.length>0?jQuery("#resultDateText").html(e+" - "):jQuery("#resultDateText").html("")}function updateAll(){setUrlPreview(),setTitlePreview(),setDescriptionPreview(),updateDateText()}String.prototype.trimEnd=function(e){e=e||" ";for(var t=this.length-1;t>=0&&this.charAt(t)==e;t--);return this.substring(0,t+1)},jQuery(document).ready(function(){jQuery("#URL").keyup(function(){setUrlPreview()}),jQuery(document).on("keyup","#new-post-slug",function(){setUrlPreview()}),jQuery(document).on("click",".cancel, .save",function(){setUrlPreview()}),jQuery('input[name="post_category[]"]').click(function(){setTitlePreview()}),jQuery("input[name^='tax_input[']").click(function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[title\\]").keyup(function(){setTitlePreview()}),jQuery("#title").keyup(function(){setTitlePreview()}),jQuery("#name").keyup(function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[titleformat\\]").bind("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[titleformat\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[preferred_tax\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_title_format\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_title\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_psp\\]").on("change",function(){setTitlePreview(),setDescriptionPreview()}),jQuery("#psp_seo_meta\\[disable_description\\]").on("change",function(){setDescriptionPreview()}),jQuery("#psp_seo_meta\\[description\\]").keyup(function(){setDescriptionPreview()}),jQuery("#content").keyup(function(){setDescriptionPreview()}),jQuery("#psp_seo_meta\\[maxsnippet\\]").on("change",function(){setDescriptionPreview()}),jQuery("#DateText").keyup(function(){updateDateText()}),jQuery("#psp_seo_meta[keywords]").keyup(function(){updateAll()}),updateAll()});
1
+ function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\amp;")}function wordCount(e){var t=e.match(/\S+/g);return t?t.length:0}function pspSortArray(e,t){var r=[],i=[];for(let n=0;n<e.length;n++)i=[],void 0!==(i=wp.data.select("core").getEntityRecord("taxonomy",t,e[n]))&&(r[n]=i.name);return r?(r.sort(),r[0]):"%"+t+"%"}function pspSortClassicArray(e,t){var r=[];return jQuery('input[name="'+e+'"]:checked').each(function(){r.push(jQuery(this).parent("label").text())}),r&&r.length?(r.sort(),r[0]):"%"+t+"%"}function boldWords(e){var t=e,r=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(r)for(i=0;i<r.length;i++)t=(t=t.replace(new RegExp("(^|[\\W])("+escapeRegExp(r[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3")).replace(new RegExp("(^|[\\W])("+escapeRegExp(r[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3");return t}function boldText(e){var t=e,r=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(r)for(i=0;i<r.length;i++)t=t.replace(new RegExp("("+escapeRegExp(r[i])+")","gi"),"<b>$1</b>");return t}function htmlEncode(e){return jQuery("<div/>").text(e).html()}function setGtbUrlPreview(e){var t=htmlEncode(e);t=t.replace(/\/#x2F;,"");var r=t=t.replace(/([^https?:\/\/])(\/)/g,"$1 > ");jQuery("#urlSizer").html(t),jQuery("#murlSizer").html(r);var i=new RegExp("W(.*)quot;);for(trimmed=!1;jQuery("#urlSizer").width()>566;){var n=t;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>#x2F;,"")).trim(),jQuery("#urlSizer").html(n),t=n,trimmed=!0}trimmed&&(t+=" ...",jQuery("#urlSizer").html(t)),info=t.length+" characters, ",jQuery("#urlInfo").html(t.length+" characters, "+jQuery("#urlSizer").width()+" pixels"),jQuery("#urlSizer").width()<=584?jQuery("#urlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"):jQuery("#urlInfo").html(info+'<span style="color:red;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetUrl").html(t),mtrimmed=!1;for(var l=r;r.length>42;)r=jQuery.trim(r.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(i,""))).trim()).replace(/\>#x2F;,"")).length>=42&&(l=(l=jQuery.trim(r.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),r=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(r),info=r.length+" characters, ",jQuery("#murlInfo").html(r.length+" characters, "+jQuery("#murlSizer").width()+" pixels"),jQuery("#murlSizer").width()<=282?jQuery("#murlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+" pixels</span>"):jQuery("#murlInfo").html(info+'<span style="color:red;">'+jQuery("#murlSizer").width()+" pixels</span>"),jQuery("#techblissonlineMSnippetUrl").html(r)}function setUrlPreview(){var e="",t=!1;if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=wpEditorL10n.tinymce.settings),jQuery("#editable-post-name").length){e=jQuery.trim(jQuery("#sample-permalink").text());var r=jQuery.trim(jQuery("#editable-post-name").text());e=(e=e.replace(r,"")).replace(/\/#x2F;g,"")}else jQuery("#name").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):jQuery("#slug").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):t&&wp.data&&wp.data.select&&(e=wp.data.select("core/editor").getPermalink(),wp.data.subscribe(function(){setGtbUrlPreview(wp.data.select("core/editor").getPermalink())}));jQuery("#new-post-slug").length>0&&(e+=jQuery("#new-post-slug").val());jQuery("#editable-post-name").length&&(e+=jQuery("#editable-post-name").text());var i=htmlEncode(e);e=i=i.replace(/\/#x2F;,"");var n=i=i.replace(/([^https?:\/\/])(\/)/g,"$1 > ");jQuery("#urlSizer").html(i),jQuery("#murlSizer").html(n);var l=new RegExp("W(.*)quot;);for(trimmed=!1;jQuery("#urlSizer").width()>584;){var s=i;s=(s=(s=(s=s.substring(0,s.length-1)).trim()).replace(/\>#x2F;,"")).trim(),jQuery("#urlSizer").html(s),i=s,trimmed=!0}trimmed&&(i+=" ..."),info=i.length+" characters, ",jQuery("#urlInfo").html(i.length+" characters, "+jQuery("#urlSizer").width()+" pixels"),jQuery("#urlSizer").width()<=584?jQuery("#urlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"):jQuery("#urlInfo").html(info+'<span style="color:red;">'+jQuery("#urlSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetUrl").html(i),mtrimmed=!1;for(var o=n;o.length>42;)n=jQuery.trim(n.replace(" ...","")),(o=(o=(o=jQuery.trim(o.replace(l,""))).trim()).replace(/\>#x2F;,"")).length>=42&&(o=(o=jQuery.trim(n.replace(" ...",""))).substring(0,o.length-1)),o=o.trim(),n=o+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(n),info=n.length+" characters, ",jQuery("#murlInfo").html(n.length+" characters, "+jQuery("#murlSizer").width()+" pixels"),jQuery("#murlSizer").width()<=282?jQuery("#murlInfo").html(info+'<span style="color:green;">'+jQuery("#urlSizer").width()+" pixels</span>"):jQuery("#murlInfo").html(info+'<span style="color:red;">'+jQuery("#murlSizer").width()+" pixels</span>"),jQuery("#techblissonlineMSnippetUrl").html(n)}function stripTrailingSlash(e){return"/"==e.substr(-1)?e.substr(0,e.length-1):e}function setGtbTitlePreview(e,t){var r=jQuery("#pspPostTypeArrayFormat").text(),i=JSON.parse(r),n=jQuery("#psp_seo_meta\\[titleformat\\]").val(),l=jQuery("#psp_seo_meta\\[title\\]"),s=n.replace("%seo_title%",e);if(s=(s=(s=(s=(s=s.replace("%wp_title%",i.wp_title)).replace("%site_name%",i.site_name)).replace("%site_description%",i.site_description)).replace("%taxonomy%",t)).replace(/%sep%/g,i.sep),""!==(s=(s=jQuery.trim(s)).trim(i.sep))){placeholder_title=e,l.attr("placeholder",placeholder_title);var o=htmlEncode(s),a=o;jQuery("#titleSizer").html(o);var p=new RegExp("sw+(.*)quot;);trimmed=!1;for(var u=o;jQuery("#titleSizer").width()>584;)o=jQuery.trim(o.replace(" ...","")),(u=jQuery.trim(u.replace(p,""))).length>=o.length&&(u=u.substring(0,u.length-1)),o=u+" ...",jQuery("#titleSizer").html(o),trimmed=!0;trimmed,jQuery("#titleSizer").html(o),mtrimmed=!1;for(var c=a;c.length>78;)a=jQuery.trim(a.replace(" ...","")),(c=jQuery.trim(c.replace(p,""))).length>=78&&(c=(c=jQuery.trim(c.replace(" ...",""))).substring(0,c.length-1)),a=c+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").html(a),info=o.length+" characters, "+wordCount(o)+" words ",jQuery("#titleInfo").html(o.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(o)+" words"),jQuery("#titleSizer").width()<=584?jQuery("#titleInfo").html(info+'<span style="color:green;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"):jQuery("#titleInfo").html(info+'<span style="color:red;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"),minfo=a.length+" characters/ 78 characters "+wordCount(a)+" words ",jQuery("#mtitleInfo").html(a.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(a)+" words"),a.length<=78?jQuery("#mtitleInfo").html('<span style="color:green;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"):jQuery("#mtitleInfo").html('<span style="color:red;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"),jQuery("#techblissonlineSnippetTitle").html(o),jQuery("#techblissonlineMSnippetTitle").html(a)}}function setTitlePreview(){var e,t,r,i="",n="",l="",s=!1,o="";window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(s=wpEditorL10n.tinymce.settings);var a=jQuery("#pspPostTypeArrayFormat").text(),p=JSON.parse(a),u=jQuery("#psp_seo_meta\\[titleformat\\]").val(),c=!1,m=!1,y=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(c=!0),jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(m=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(y=!0);o=p.category,u.toLowerCase().indexOf("%wp_title%");var h=jQuery("#title"),d=jQuery("#psp_seo_meta\\[title\\]"),j=jQuery("#psp_seo_meta\\[preferred_tax\\]"),Q="categories",g="post_category[]",w="category";if(j&&j.val()&&"category"!==(w=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(Q=w,g="tax_input["+w+"][]"),h&&(o=pspSortClassicArray(g,w)),!d.val()||m||y?(jQuery("#title").val()?n=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?n=jQuery.trim(jQuery("#name").val()):s&&wp.data&&wp.data.select&&(n=wp.data.select("core/editor").getEditedPostAttribute("title"),r=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==r&&r.length>0&&(o=pspSortArray(r,w)),wp.data.subscribe(function(){n=wp.data.select("core/editor").getEditedPostAttribute("title"),r=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==r&&r.length>0&&(o=pspSortArray(r,w)),n&&o&&setGtbTitlePreview(n,o)})),i=n,(c||y)&&(u="%wp_title%"),i=(i=(i=(i=(i=(i=u.replace("%seo_title%",n)).replace("%wp_title%",n)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",o)).replace(/%sep%/g,p.sep),i=(i=jQuery.trim(i)).trim(p.sep)):(i=d.val(),l=d.val(),jQuery("#title").val()?n=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?n=jQuery.trim(jQuery("#name").val()):s&&wp.data&&wp.data.select&&(n=wp.data.select("core/editor").getEditedPostAttribute("title"),t=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==t&&t.length>0&&(o=pspSortArray(t,w)),wp.data.subscribe(function(){n=wp.data.select("core/editor").getEditedPostAttribute("title"),t=wp.data.select("core/editor").getEditedPostAttribute(Q),o="%"+w+"%",void 0!==t&&t.length>0&&(o=pspSortArray(t,w)),l&&o&&setGtbTitlePreview(l,o)})),c&&(u="%seo_title%"),i=(i=(i=(i=(i=(i=u.replace("%seo_title%",l)).replace("%wp_title%",n)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",o)).replace(/%sep%/g,p.sep),i=(i=jQuery.trim(i)).trim(p.sep)),""!==i){e=n,d.attr("placeholder",e);var f=htmlEncode(i),v=f;jQuery("#titleSizer").html(f);var _=new RegExp("sw+(.*)quot;),S=f;for(trimmed=!1;jQuery("#titleSizer").width()>584;)f=jQuery.trim(f.replace(" ...","")),(S=jQuery.trim(S.replace(_,""))).length>=f.length&&(S=S.substring(0,S.length-1)),f=S+" ...",jQuery("#titleSizer").text(f),trimmed=!0;trimmed,jQuery("#titleSizer").text(f),jQuery("body").append(jQuery("#titleSizer")).width(),jQuery("body#titleSizer").remove(),info=f.length+" characters, "+wordCount(f)+" words ",jQuery("#titleInfo").html(f.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(f)+" words"),jQuery("#titleSizer").width()<=584?jQuery("#titleInfo").html(info+'<span style="color:green;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"):jQuery("#titleInfo").html(info+'<span style="color:red;">'+jQuery("#titleSizer").width()+"/584 pixels</span>"),jQuery("#techblissonlineSnippetTitle").html(f);var b=v;for(mtrimmed=!1;b.length>78;)v=jQuery.trim(v.replace(" ...","")),(b=jQuery.trim(b.replace(_,""))).length>=78&&(b=(b=jQuery.trim(b.replace(" ...",""))).substring(0,b.length-1)),v=b+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").text(v),jQuery("body").append(jQuery("#mtitleSizer")).width(),jQuery("body#mtitleSizer").remove(),minfo=v.length+" characters/ 78 characters "+wordCount(v)+" words ",jQuery("#mtitleInfo").html(v.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(v)+" words"),v.length<=78?jQuery("#mtitleInfo").html('<span style="color:green;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"):jQuery("#mtitleInfo").html('<span style="color:red;">'+minfo+"</span> "+jQuery("#mtitleSizer").width()+" pixels"),jQuery("#techblissonlineMSnippetTitle").html(v)}}function setDescriptionPreview(){var e=!1,t=jQuery("#psp_seo_meta\\[description\\]");window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(e=wpEditorL10n.tinymce.settings);var r=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),i=r;parseInt(r)<0&&(r=230,i=285),jQuery.inArray(parseInt(r),[-1,0,1,2,3,4])>-1&&(r=230,i=285),""===r&&(r=230,i=285),r=parseInt(r),i=parseInt(i);var n="",l=!1,s=!1;if(jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(l=!0),jQuery("#psp_seo_meta\\[disable_description\\]:checked").length>0&&(s=!0),""!==n||l||s||(n=jQuery.trim(jQuery("#psp_seo_meta\\[description\\]").val())),""===n)if(""===n&&e&&wp.data&&wp.data.select){var o=wp.data.select("core/editor").getEditedPostContent();n=(n=o.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),wp.data.subscribe(function(){var e=wp.data.select("core/editor").getEditedPostContent();t.val()||(n=(n=e.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),setGTBDescPreview(n))})}else{var a=jQuery.trim(jQuery("#content").val());if(!t.val()||l||s)return n=(n=a.replace(/(<([^>]+)>)/gi,"")).substring(0,i),t.attr("placeholder",n),void setGTBDescPreview(n)}var p=htmlEncode(n),u=p+=" ...";jQuery("#descriptionSizer").html(p),jQuery("#mdescriptionSizer").html(u);for(var c=new RegExp("sw+(.*)quot;),m=p;m.length>r;)p=jQuery.trim(p.replace(" ...","")),m=jQuery.trim(m.replace(c,"")),n=jQuery.trim(n.replace(c,"")),m.length>=r&&(m=(m=jQuery.trim(m.replace(" ...",""))).substring(0,m.length-1),n=n.substring(0,n.length-1)),m+=" ...";p=m,jQuery("#descriptionSizer").html(p);for(var y=u;y.length>i;)u=jQuery.trim(u.replace(" ...","")),(y=jQuery.trim(y.replace(c,""))).length>=i&&(y=(y=jQuery.trim(y.replace(" ...",""))).substring(0,y.length-1)),y+=" ...";u=y,jQuery("#mdescriptionSizer").html(u),jQuery("#descriptionInfo").html(p.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(p)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(p)+" words ",jQuery("#mdescriptionInfo").html(u.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(u)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(u)+" words ",p.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+p.length+"/~170 characters"):p.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+p.length+"/~170 characters</span>"):p.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+p.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+p.length+"/~170 characters</span>"),u.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+u.length+"/~170 characters"):u.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+u.length+"/~170 characters</span>"):u.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+u.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+u.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(p),jQuery("#techblissonlineMSnippetDescription").html(u)}function setGTBDescPreview(e){var t=jQuery("#psp_seo_meta\\[description\\]"),r=e;placeholder_desc=e,t.attr("placeholder",placeholder_desc);var i=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),n=i;jQuery.inArray(parseInt(i),[-1,0,1,2,3,4])>-1&&(i=230,n=285),""===i&&(i=230,n=285),i=parseInt(i),n=parseInt(n);var l=htmlEncode(r),s=l+=" ...";jQuery("#descriptionSizer").html(l),jQuery("#mdescriptionSizer").html(s);for(var o=new RegExp("sw+(.*)quot;),a=l;a.length>i;)l=jQuery.trim(l.replace(" ...","")),a=jQuery.trim(a.replace(o,"")),r=jQuery.trim(r.replace(o,"")),a.length>=i&&(a=(a=jQuery.trim(a.replace(" ...",""))).substring(0,a.length-1),r=r.substring(0,r.length-1)),a+=" ...";l=a,jQuery("#descriptionSizer").html(l);for(var p=s;p.length>n;)s=jQuery.trim(s.replace(" ...","")),(p=jQuery.trim(p.replace(o,""))).length>=n&&(p=(p=jQuery.trim(p.replace(" ...",""))).substring(0,p.length-1)),p+=" ...";s=p,jQuery("#descriptionSizer").html(s),jQuery("body").append(jQuery("#descriptionSizer")).width(),jQuery("body").append(jQuery("#mdescriptionSizer")).width(),jQuery("body").remove("#descriptionSizer"),jQuery("body").remove("#mdescriptionSizer"),jQuery("#descriptionInfo").html(l.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(l)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(l)+" words ",jQuery("#mdescriptionInfo").html(s.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(s)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(s)+" words ",l.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+l.length+"/~170 characters"):l.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+l.length+"/~170 characters</span>"):l.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+l.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+l.length+"/~170 characters</span>"),s.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+s.length+"/~170 characters"):s.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+s.length+"/~170 characters</span>"):s.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+s.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+s.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(l),jQuery("#techblissonlineMSnippetDescription").html(s)}function updateDateText(){var e=htmlEncode(jQuery.trim(jQuery("#DateText").val()));e.length>0?jQuery("#resultDateText").html(e+" - "):jQuery("#resultDateText").html("")}function updateAll(){setUrlPreview(),setTitlePreview(),setDescriptionPreview(),updateDateText()}String.prototype.trimEnd=function(e){e=e||" ";for(var t=this.length-1;t>=0&&this.charAt(t)==e;t--);return this.substring(0,t+1)},jQuery(document).ready(function(){jQuery("#URL").keyup(function(){setUrlPreview()}),jQuery(document).on("keyup","#new-post-slug",function(){setUrlPreview()}),jQuery(document).on("click",".cancel, .save",function(){setUrlPreview()}),jQuery('input[name="post_category[]"]').click(function(){setTitlePreview()}),jQuery("input[name^='tax_input[']").click(function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[title\\]").keyup(function(){setTitlePreview()}),jQuery("#title").keyup(function(){setTitlePreview()}),jQuery("#name").keyup(function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[titleformat\\]").bind("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[titleformat\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[preferred_tax\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_title_format\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_title\\]").on("change",function(){setTitlePreview()}),jQuery("#psp_seo_meta\\[disable_psp\\]").on("change",function(){setTitlePreview(),setDescriptionPreview()}),jQuery("#psp_seo_meta\\[disable_description\\]").on("change",function(){setDescriptionPreview()}),jQuery("#psp_seo_meta\\[description\\]").keyup(function(){setDescriptionPreview()}),jQuery("#content").keyup(function(){setDescriptionPreview()}),jQuery("#psp_seo_meta\\[maxsnippet\\]").on("change",function(){setDescriptionPreview()}),jQuery("#DateText").keyup(function(){updateDateText()}),jQuery("#psp_seo_meta[keywords]").keyup(function(){updateAll()}),updateAll()});
psp-include/settings/psp_settings.php CHANGED
@@ -2382,7 +2382,7 @@ class PspSettings {
2382
function section_empty_desc() {echo ''; }
2383
function section_archives_desc() {echo ''; }
2384
function section_breadcrumb_desc() { echo esc_html__('These breadcrumb settings are for displaying breadcrumbs on the Post. It is built on top of Justin Tadlock\'s @BreadcrumbTrail package. Place the code', 'platinum-seo-pack').' <code>&lt;?php if ( function_exists( \'psp_breadcrumb_trail\' ) ) { psp_breadcrumb_trail(); } ?&gt;</code> '.esc_html__(' in your theme\'s single.php, at an apppropriate location, to display the generated breadcrumb trail. You may add the breadcrumb Json-LD schema (along with other schemas) in the Techblissonline Platinum SEO metabox for the Post.', 'platinum-seo-pack'); }
2385
- function section_schema_desc() {echo esc_html__('The following settings are not necessary if you had added these schemas in the Home page JSOM Schema Editor settings of this plugin.', 'platinum-seo-pack'). ' i.e. <br /> 1. '.esc_html__('Schema for enabling Sitelink Search Box in Google and', 'platinum-seo-pack').' <br /> 2. '. esc_html__('Schema for Knowledge Graph', 'platinum-seo-pack'); }
2386
2387
/*
2388
* Callback for adding a textfield.
@@ -3096,11 +3096,11 @@ class PspSettings {
3096
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
3097
*************/
3098
$psp_post_meta['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) : '';
3099
- if (empty($psp_post_meta['title'])) {
3100
$psp_old_title = !empty($wp_post_meta_data_arr['title'][0]) ? esc_attr($wp_post_meta_data_arr['title'][0]) : '';
3101
$psp_post_meta['title'] = $psp_old_title;
3102
}
3103
- if (empty($psp_post_meta['title'])) {
3104
$yoast_title = !empty($wp_post_meta_data_arr['_yoast_wpseo_title'][0]) ? esc_attr($wp_post_meta_data_arr['_yoast_wpseo_title'][0]) : '';
3105
if (!empty($yoast_title)) {
3106
$yoast_title = preg_replace('/%%[^%]+%%/', '', $yoast_title);
@@ -3111,11 +3111,11 @@ class PspSettings {
3111
$psp_post_meta['titleformat'] = isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0]) : $psp_p_settings['title'];
3112
3113
$psp_post_meta['description'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_description'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_description'][0]) : '';
3114
- if (empty($psp_post_meta['description'])) {
3115
$psp_old_desc = !empty($wp_post_meta_data_arr['description'][0]) ? esc_attr($wp_post_meta_data_arr['description'][0]) : '';
3116
$psp_post_meta['description'] = $psp_old_desc;
3117
}
3118
- if (empty($psp_post_meta['description'])) {
3119
$yoast_desc = !empty($wp_post_meta_data_arr['_yoast_wpseo_metadesc'][0]) ? esc_attr($wp_post_meta_data_arr['_yoast_wpseo_metadesc'][0]) : '';
3120
//$psp_post_meta['description'] = $yoast_desc;
3121
if (!empty($yoast_desc)) {
2382
function section_empty_desc() {echo ''; }
2383
function section_archives_desc() {echo ''; }
2384
function section_breadcrumb_desc() { echo esc_html__('These breadcrumb settings are for displaying breadcrumbs on the Post. It is built on top of Justin Tadlock\'s @BreadcrumbTrail package. Place the code', 'platinum-seo-pack').' <code>&lt;?php if ( function_exists( \'psp_breadcrumb_trail\' ) ) { psp_breadcrumb_trail(); } ?&gt;</code> '.esc_html__(' in your theme\'s single.php, at an apppropriate location, to display the generated breadcrumb trail. You may add the breadcrumb Json-LD schema (along with other schemas) in the Techblissonline Platinum SEO metabox for the Post.', 'platinum-seo-pack'); }
2385
+ function section_schema_desc() {echo esc_html__('The following settings are not necessary if you had added these schemas in the Home page and/or Contacts Page JSON Schema Editor settings of this plugin.', 'platinum-seo-pack'). ' i.e. <br /> 1. '.esc_html__('Schema for enabling Sitelink Search Box in Google and', 'platinum-seo-pack').' <br /> 2. '. esc_html__('Schema for Knowledge Graph', 'platinum-seo-pack'); }
2386
2387
/*
2388
* Callback for adding a textfield.
3096
$psp_post_disablers = unserialize($wp_post_meta_data['_techblissonline_psp_disable_flags']);
3097
*************/
3098
$psp_post_meta['title'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_title'][0]) : '';
3099
+ if (empty($psp_post_meta['title']) && !isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
3100
$psp_old_title = !empty($wp_post_meta_data_arr['title'][0]) ? esc_attr($wp_post_meta_data_arr['title'][0]) : '';
3101
$psp_post_meta['title'] = $psp_old_title;
3102
}
3103
+ if (empty($psp_post_meta['title']) && !isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
3104
$yoast_title = !empty($wp_post_meta_data_arr['_yoast_wpseo_title'][0]) ? esc_attr($wp_post_meta_data_arr['_yoast_wpseo_title'][0]) : '';
3105
if (!empty($yoast_title)) {
3106
$yoast_title = preg_replace('/%%[^%]+%%/', '', $yoast_title);
3111
$psp_post_meta['titleformat'] = isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0]) : $psp_p_settings['title'];
3112
3113
$psp_post_meta['description'] = !empty($wp_post_meta_data_arr['_techblissonline_psp_description'][0]) ? esc_attr($wp_post_meta_data_arr['_techblissonline_psp_description'][0]) : '';
3114
+ if (empty($psp_post_meta['description']) && !isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
3115
$psp_old_desc = !empty($wp_post_meta_data_arr['description'][0]) ? esc_attr($wp_post_meta_data_arr['description'][0]) : '';
3116
$psp_post_meta['description'] = $psp_old_desc;
3117
}
3118
+ if (empty($psp_post_meta['description']) && !isset($wp_post_meta_data_arr['_techblissonline_psp_titleformat'][0])) {
3119
$yoast_desc = !empty($wp_post_meta_data_arr['_yoast_wpseo_metadesc'][0]) ? esc_attr($wp_post_meta_data_arr['_yoast_wpseo_metadesc'][0]) : '';
3120
//$psp_post_meta['description'] = $yoast_desc;
3121
if (!empty($yoast_desc)) {
psp_main.php CHANGED
@@ -81,7 +81,7 @@ class PspMain {
81
82
$psp_credits = isset($psp_settings['credits']) ? $psp_settings['credits'] : '';
83
84
- if ($psp_credits) {
85
add_action('wp_footer', 'PspSettings::add_credits');
86
}
87
81
82
$psp_credits = isset($psp_settings['credits']) ? $psp_settings['credits'] : '';
83
84
+ if ($psp_credits || get_option('psp_link_home')) {
85
add_action('wp_footer', 'PspSettings::add_credits');
86
}
87
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
=== Platinum SEO Pack ===
2
Contributors: Rajesh Babu
3
Tags: seo, wordpress seo, plugin, google seo, schema markup, Json schema
4
- Requires at least: wordpress 5.3
5
Tested up to: wordpress 5.3
6
- Requires PHP: 5.6
7
Stable tag: trunk
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
11
- The all new Techblissonline's Platinum wordpress SEO Plugin offers Complete onpage SEO solution for your Wordpress blog or website.The latest version of Techblissonline Platinum SEO Plugin has been completely rewritten from scratch and offers every feature you want to do SEO to your blog or website. This is backward compatible and you don't have to change anything.
12
13
== Description ==
14
15
- The all new **[Techblissonline's wordpress SEO Plugin], (https://techblissonline.com/platinum-wordpress-seo-plugin/)** , Platinum SEO plugin, offers Complete onpage SEO solution for your Wordpress blog or website.The latest version the plugin has been completely rewritten from scratch and offers every feature you want to do SEO to your blog or website.
16
17
**[Download now!](http://downloads.wordpress.org/plugin/platinum-seo-pack.zip)**
18
@@ -61,8 +61,11 @@ Please read these **[FAQs](https://techblissonline.com/platinum-seo-pack-faq/)**
61
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
62
63
== Changelog ==
64
= 2.0.0 =
65
- * 2013-11-21 - Techblissonline Platinum SEO Wordpress plugin has been completely rewriiten and offers several new features in adiition to fixing the bugs in the earlier version and improving Plugin Security.
66
67
= 1.3.8 =
68
* 2013-09-12 - Fixed a security issue (Many thanks to James Pearson)
1
=== Platinum SEO Pack ===
2
Contributors: Rajesh Babu
3
Tags: seo, wordpress seo, plugin, google seo, schema markup, Json schema
4
+ Requires at least: wordpress 5.0
5
Tested up to: wordpress 5.3
6
+ Requires PHP: 5.6 or later
7
Stable tag: trunk
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
11
+ The all new Techblissonline's Platinum wordpress SEO Plugin offers Complete onpage SEO solution for your Wordpress blog or website.The latest version of Techblissonline Platinum SEO Plugin has been completely rewritten from scratch and offers every feature you want to do SEO to your blog or website. This is backward compatible and you don't have to change anything. If you are upgrading from an older version of Platinum SEO Pack (versions earlier than 2.0), make sure that you deactivate and activate the plugin once after upgrading to the latest version.
12
13
== Description ==
14
15
+ The all new Techblissonline's **[ WordPress SEO Plugin](https://techblissonline.com/platinum-wordpress-seo-plugin/)** , [Platinum SEO Pack](https://techblissonline.com/platinum-seo-pack/) offers Complete onpage SEO solution for your Wordpress blog or website.The latest version the plugin has been completely rewritten from scratch and offers every feature you want to do SEO to your blog or website.
16
17
**[Download now!](http://downloads.wordpress.org/plugin/platinum-seo-pack.zip)**
18
61
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
62
63
== Changelog ==
64
+ = 2.0.1 =
65
+ * 2020-02-06 - Fixed an issue that does not pull description for existing users of the plugin, in respect of posts where they had filled them (description) in the older version of Platinum SEO Pack.
66
+
67
= 2.0.0 =
68
+ * 2020-02-03 - Techblissonline Platinum SEO Wordpress plugin has been completely rewriiten and offers several new features in adiition to fixing the bugs in the earlier version and improving Plugin Security.
69
70
= 1.3.8 =
71
* 2013-09-12 - Fixed a security issue (Many thanks to James Pearson)