Version Description
- 2020-07-13 - Fixed bugs in JS files to be compliant with the proposed JQuery versions in WordPress 5.5 and beyond. Since WordPress sitemap files is proposed to be integrated into the Core in V5.5, made the necessary changes in the plugin's version of the files.
Download this release
Release Info
Developer | Rajesh Babu |
Plugin | Platinum SEO Pack |
Version | 2.1.7 |
Comparing to | |
See all releases |
Code changes from version 2.1.6 to 2.1.7
- Changelog.txt +3 -0
- platinum-seo-pack.php +1 -1
- psp-include/settings/js/pspinputtypetoggler.js +4 -1
- psp-include/settings/js/pspmediauploader.js +1 -1
- psp-include/settings/js/snippetpreview.js +1 -1
- psp-include/settings/psp_basic_metabox_renderer.php +1 -0
- psp-include/settings/psp_pre_settings.php +6 -3
- psp-include/settings/psp_settings.php +8 -6
- psp-include/settings/psp_social_settings.php +7 -4
- psp-include/settings/psp_tools_settings.php +68 -74
- psp-include/sitemap/inc/class-wp-sitemaps-index.php +9 -9
- psp-include/sitemap/inc/class-wp-sitemaps-provider.php +5 -5
- psp-include/sitemap/inc/class-wp-sitemaps-registry.php +7 -7
- psp-include/sitemap/inc/class-wp-sitemaps-renderer.php +9 -9
- psp-include/sitemap/inc/class-wp-sitemaps-stylesheet.php +6 -6
- psp-include/sitemap/inc/class-wp-sitemaps.php +23 -22
- psp-include/sitemap/inc/functions.php +18 -18
- psp-include/sitemap/inc/providers/class-wp-sitemaps-posts.php +11 -11
- psp-include/sitemap/inc/providers/class-wp-sitemaps-taxonomies.php +12 -12
- psp-include/sitemap/inc/providers/class-wp-sitemaps-users.php +10 -10
- psp-include/sitemap/psp_sitemap.php +19 -18
- psp-include/sitemap/psp_sitemap_settings.php +20 -5
- psp-include/sitemap/sitemap-image.xsl +5 -1
- psp-include/sitemap/sitemap-index.xsl +1 -1
- psp-include/sitemap/sitemap-post.xsl +5 -1
- psp-include/sitemap/sitemap.xsl +5 -1
- psp-include/utilities/psp_helper.php +1 -1
- psp_main.php +9 -6
- readme.txt +4 -1
Changelog.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
= 2.1.6 =
|
2 |
* 2020-07-07 - Fixed a bug in rendering of static Front page Platinum SEO settings (i.e. meta description and canonical tags) when multiple Static pages are used as front page by multilingual plugins like Polylang. This bug had an impact only on users of multilingual plugins.
|
3 |
|
1 |
+
= 2.1.7 =
|
2 |
+
* 2020-07-13 - Fixed bugs in JS files to be compliant with the proposed JQuery versions in WordPress 5.5 and beyond. Since WordPress sitemap files is proposed to be integrated into the Core in V5.5, made the necessary changes in the plugin's version of the files.
|
3 |
+
|
4 |
= 2.1.6 =
|
5 |
* 2020-07-07 - Fixed a bug in rendering of static Front page Platinum SEO settings (i.e. meta description and canonical tags) when multiple Static pages are used as front page by multilingual plugins like Polylang. This bug had an impact only on users of multilingual plugins.
|
6 |
|
platinum-seo-pack.php
CHANGED
@@ -4,7 +4,7 @@
|
|
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.1.
|
8 |
Author: Techblissonline.com (Rajesh)
|
9 |
Author URI: https://techblissonline.com/
|
10 |
Text Domain: platinum-seo-pack
|
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.1.7
|
8 |
Author: Techblissonline.com (Rajesh)
|
9 |
Author URI: https://techblissonline.com/
|
10 |
Text Domain: platinum-seo-pack
|
psp-include/settings/js/pspinputtypetoggler.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
jQuery(document).ready(function(){
|
2 |
/* Toggle Visibility of OAUTH2 ID/Client Secret and API Keys (for viewing/troubleshooting) */
|
3 |
//jQuery( 'body' ).on( 'click' , '.view-obfuscated-text' , function() {
|
4 |
-
jQuery('.view-obfuscated-text').
|
|
|
|
|
5 |
event.preventDefault();
|
6 |
//alert "Type ".Query(this).prev().attr("type");
|
7 |
if( jQuery( this ).prev().attr( 'type' ) == 'password' ) {
|
@@ -17,4 +19,5 @@ jQuery(document).ready(function(){
|
|
17 |
jQuery( this ).addClass('dashicons-hidden');
|
18 |
}
|
19 |
});
|
|
|
20 |
});
|
1 |
jQuery(document).ready(function(){
|
2 |
/* Toggle Visibility of OAUTH2 ID/Client Secret and API Keys (for viewing/troubleshooting) */
|
3 |
//jQuery( 'body' ).on( 'click' , '.view-obfuscated-text' , function() {
|
4 |
+
if (jQuery('.view-obfuscated-text').length) {
|
5 |
+
//jQuery('.view-obfuscated-text').live('click', function(event){
|
6 |
+
jQuery('body').on( 'click', '.view-obfuscated-text', function (event) {
|
7 |
event.preventDefault();
|
8 |
//alert "Type ".Query(this).prev().attr("type");
|
9 |
if( jQuery( this ).prev().attr( 'type' ) == 'password' ) {
|
19 |
jQuery( this ).addClass('dashicons-hidden');
|
20 |
}
|
21 |
});
|
22 |
+
}
|
23 |
});
|
psp-include/settings/js/pspmediauploader.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(e){var t;jQuery(".upload_image_button").
|
1 |
+
jQuery(document).ready(function(e){var t;jQuery(".upload_image_button").length&&jQuery("body").on("click",".upload_image_button",function(a){a.preventDefault(),imagetextID=jQuery(this).prev().attr("id"),t?t.open():((t=wp.media.frames.file_frame=wp.media({title:"Techblissonline Platinum SEO and Social Pack Media Uploader:",button:{text:"Select Image"},multiple:!1})).on("select",function(){attachment=t.state().get("selection").first().toJSON(),0>e.trim(attachment.url.length)||(imagedetail=attachment.url,jQuery("#"+imagetextID).val(imagedetail))}),t.open())})});
|
psp-include/settings/js/snippetpreview.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function wordCount(e){var t=e.match(/\S+/g);return t?t.length:0}function arraysEqual(e,t){if(void 0===e||void 0===t)return!1;if(e===t)return!0;if(null===e||null===t)return!1;if(e.length!=t.length)return!1;e=e.sort(),t=t.sort();for(var s=0;s<e.length;++s)if(e[s]!==t[s])return!1;return!0}function pspContainsPT(e){if(jQuery("#psp_seo_meta\\[preferred_term\\]").val()>0){var t=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text();return!(e&&jQuery.inArray(t,e)>-1)&&(alert("Make sure that you change the preferred term before saving as you have deselected "+t),jQuery("#psp_seo_meta\\[preferred_term\\]").val(""),!0)}}function pspSelectedTerms(e,t){var s,r=[],i=jQuery("#psp_terms_json_str").val(),a=JSON.parse(i);return jQuery.each(a,function(i,a){i===t&&(s=0,jQuery.each(a,function(t,i){jQuery.inArray(parseInt(i.id),e)>-1&&(r[s]=i.name.trim(),s++)}))}),r.sort(),r}function pspSelectedTermsClassic(e){var t=[];return jQuery('input[name="'+e+'"]:checked').each(function(){t.push(jQuery(this).parent("label").text().trim())}),t.sort(),t}function isTermSelected(){var e=jQuery("#psp_seo_meta\\[preferred_tax\\]"),t=jQuery("#psp_seo_meta\\[preferred_term\\]"),s=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text(),r=jQuery("#psp_seo_meta\\[preferred_term\\]").val();if(r){var i,a="categories",n="post_category[]",l="category",o=t.attr("oldValue"),p=!1;window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(p=wpEditorL10n.tinymce.settings),e&&e.val()&&"category"!==(l=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(a=l,n="tax_input["+l+"][]"),p&&wp.data&&wp.data.select?(taxarray=wp.data.select("core/editor").getEditedPostAttribute(a),i=pspSelectedTerms(taxarray,l)):i=pspSelectedTermsClassic(n),r&&(i.length>0?jQuery.inArray(s.trim(),i)>-1||""===r||(alert("Select this Term "+s+" if you want to set it as preferred term"),t.val(o)):(alert("Select this Term "+s+" if you want to set it as preferred term"),t.val("")))}}function pspPopulateTerms(){preferredTaxElem=jQuery("#psp_seo_meta\\[preferred_tax\\]"),preferredTermElem=jQuery("#psp_seo_meta\\[preferred_term\\]");var e=preferredTaxElem.val();jQuery("#psp_seo_meta\\[preferred_term\\]").html("");var t=jQuery("#psp_terms_json_str").val(),s=JSON.parse(t);preferredTermElem.append('<option value="">Select a Term</option>'),jQuery.each(s,function(t,s){t===e&&jQuery.each(s,function(e,t){preferredTermElem.append('<option value="'+t.id+'">'+t.name+"</option>")})})}function boldWords(e){var t=e,s=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(s)for(i=0;i<s.length;i++)t=(t=t.replace(new RegExp("(^|[\\W])("+escapeRegExp(s[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3")).replace(new RegExp("(^|[\\W])("+escapeRegExp(s[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3");return t}function boldText(e){var t=e,s=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(s)for(i=0;i<s.length;i++)t=t.replace(new RegExp("("+escapeRegExp(s[i])+")","gi"),"<b>$1</b>");return t}function htmlEncode(e){return jQuery("<div/>").text(e).html()}function setGtbUrlPreview(e){var t="";(t=e)&&(t=t.replace(/^https?\:\/\//i,""));var s=htmlEncode(t),r=(s=s.replace(/\/$/,"")).length;jQuery("#permalinkSizer").html(s);var i=s=s.replace(/([^https?:\/\/])(\/)/g,"$1 > ");t=s,jQuery("#urlSizer").html(s),jQuery("#murlSizer").html(i);var a=new RegExp("W(.*)$");for(trimmed=!1;jQuery("#urlSizer").width()>566;){var n=s;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>$/,"")).trim(),jQuery("#urlSizer").html(n),s=n,trimmed=!0}trimmed&&(s+=" ...",jQuery("#urlSizer").html(s)),info=r+" characters, ",jQuery("#urlInfo").html(s.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(s),mtrimmed=!1;for(var l=i;i.length>42;)i=jQuery.trim(i.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(a,""))).trim()).replace(/\>$/,"")).length>=42&&(l=(l=jQuery.trim(i.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),i=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(i),info=i.length+" characters, ",jQuery("#murlInfo").html(i.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(i)}function setUrlPreview(){var e=jQuery.trim(jQuery("#pspHomePermalink").text())+"slug-name/";if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&wpEditorL10n.tinymce.settings,jQuery("#editable-post-name").length){e=jQuery.trim(jQuery("#sample-permalink").text());var t=jQuery.trim(jQuery("#editable-post-name").text());e=(e=e.replace(t,"")).replace(/\/$/g,"")}else jQuery("#name").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):jQuery("#slug").length&&(e=jQuery.trim(jQuery("#pspPostPermalink").text()));if(jQuery("#new-post-slug").length>0)e+=jQuery("#new-post-slug").val();else if(jQuery("#editable-post-name-full").length){e+=jQuery("#editable-post-name-full").text()}e&&(e=e.replace(/^https?\:\/\//i,""));var s=htmlEncode(e),r=s.length;r=(s=s.replace(/\/$/,"")).length;jQuery("#permalinkSizer").html(s);var i=s=s.replace(/([^https?:\/\/])(\/)/g,"$1 > ");e=s,jQuery("#urlSizer").html(s),jQuery("#murlSizer").html(i);var a=new RegExp("W(.*)$");for(trimmed=!1;jQuery("#urlSizer").width()>584;){var n=s;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>$/,"")).trim(),jQuery("#urlSizer").html(n),s=n,trimmed=!0}trimmed&&(s+=" ..."),info=r+" characters, ",jQuery("#urlInfo").html(r+" 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(s),mtrimmed=!1;for(var l=i;l.length>42;)i=jQuery.trim(i.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(a,""))).trim()).replace(/\>$/,"")).length>=42&&(l=(l=jQuery.trim(i.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),i=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(i),info=i.length+" characters, ",jQuery("#murlInfo").html(i.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(i)}function stripTrailingSlash(e){return"/"==e.substr(-1)?e.substr(0,e.length-1):e}function setGtbTitlePreview(e,t){var s=jQuery("#psp_seo_meta\\[titleformat\\]").val(),r=!1,i=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(r=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(i=!0),r&&(s="%seo_title%"),i&&(s="%wp_title%");var a=jQuery("#pspPostTypeArrayFormat").text(),n=JSON.parse(a),l=jQuery("#psp_seo_meta\\[title\\]"),o=s.replace("%seo_title%",e);if(""===e&&(o=o.replace("%seo_title%",l.attr("placeholder"))),o=(o=(o=(o=(o=(o=o.replace("%wp_title%",n.wp_title)).replace("%site_name%",n.site_name)).replace("%site_description%",n.site_description)).replace("%category%",t)).replace("%taxonomy%",t)).replace(/%sep%/g,n.sep),""!==(o=(o=jQuery.trim(o)).trim(n.sep))){var p=htmlEncode(o),c=p;jQuery("#titleSizer").html(p),jQuery("#actualTitleSizer").html(p);var d=new RegExp("sw+(.*)$");trimmed=!1;for(var u=p;jQuery("#titleSizer").width()>584;)p=jQuery.trim(p.replace(" ...","")),(u=jQuery.trim(u.replace(d,""))).length>=p.length&&(u=u.substring(0,u.length-1)),p=u+" ...",jQuery("#titleSizer").html(p),trimmed=!0;trimmed,jQuery("#titleSizer").html(p),mtrimmed=!1;for(var h=c;h.length>78;)c=jQuery.trim(c.replace(" ...","")),(h=jQuery.trim(h.replace(d,""))).length>=78&&(h=(h=jQuery.trim(h.replace(" ...",""))).substring(0,h.length-1)),c=h+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").html(c),info=jQuery("<textarea />").html(p).text().length+" characters, "+wordCount(p)+" words ",jQuery("#titleInfo").html(p.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(p)+" 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=jQuery("<textarea />").html(c).text().length+" characters/ 78 characters "+wordCount(c)+" words ",jQuery("#mtitleInfo").html(c.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(c)+" words"),c.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(p),jQuery("#techblissonlineMSnippetTitle").html(c),setPSPSeoAnalysis()}}function setTitlePreview(){var e,t,s="",r="",i="",a=!1,n="",l=[];window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(a=wpEditorL10n.tinymce.settings);var o=jQuery("#pspPostTypeArrayFormat").text(),p=JSON.parse(o),c=jQuery("#psp_seo_meta\\[titleformat\\]").val(),d=!1,u=!1,h=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(d=!0),jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(u=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(h=!0);n=p.category,c.toLowerCase().indexOf("%wp_title%");var m=jQuery("#title"),y=jQuery("#psp_seo_meta\\[title\\]");r=y.attr("placeholder");var g=jQuery("#psp_seo_meta\\[preferred_tax\\]"),j=jQuery("#psp_seo_meta\\[preferred_term\\]"),Q="categories",f="post_category[]",v="category";if(g&&g.val()&&"category"!==(v=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(Q=v,f="tax_input["+v+"][]"),!a&&m&&(pspContainsPT(l=pspSelectedTermsClassic(f)),n=j&&j.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l&&l.length>0?l[0]:"%"+v+"%"),!y.val()||u||h?(jQuery("#title").val()?r=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?r=jQuery.trim(jQuery("#name").val()):a&&wp.data&&wp.data.select&&(n=p.category,j&&j.val()&&(n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text()),""===(r=wp.data.select("core/editor").getEditedPostAttribute("title"))&&(r=y.attr("placeholder")),n||(n="%"+v+"%"),void 0===(t=wp.data.select("core/editor").getEditedPostAttribute(Q))&&(n="%"+v+"%"),void 0!==t&&0===t.length&&(n="%"+v+"%",pspContainsPT(t)),void 0!==t&&t.length>0&&(pspContainsPT(l=pspSelectedTerms(t,v)),n=j&&j.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l[0])),s=r,(d||h)&&(c="%wp_title%"),s=(s=(s=(s=(s=(s=(s=c.replace("%seo_title%",r)).replace("%wp_title%",r)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",n)).replace("%category%",n)).replace(/%sep%/g,p.sep),s=(s=jQuery.trim(s)).trim(p.sep)):(s=y.val(),i=y.val(),jQuery("#title").val()?r=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?r=jQuery.trim(jQuery("#name").val()):a&&wp.data&&wp.data.select&&(n=p.category,j&&j.val()&&(n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text()),r=wp.data.select("core/editor").getEditedPostAttribute("title"),n||(n="%"+v+"%"),void 0===(e=wp.data.select("core/editor").getEditedPostAttribute(Q))&&(n="%"+v+"%"),void 0!==e&&0===e.length&&(n="%"+v+"%",pspContainsPT(l)),void 0!==e&&e.length>0&&(pspContainsPT(l=pspSelectedTerms(e,v)),j&&j.val()?n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l.length>0&&(n=l[0]))),d&&(c="%seo_title%"),s=(s=(s=(s=(s=(s=(s=c.replace("%seo_title%",i)).replace("%wp_title%",r)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",n)).replace("%category%",n)).replace(/%sep%/g,p.sep),s=(s=jQuery.trim(s)).trim(p.sep)),""!==s){""===r||a||r;var w=htmlEncode(s),_=w;jQuery("#titleSizer").html(w),jQuery("#actualTitleSizer").html(w);var S=new RegExp("sw+(.*)$"),x=w;for(trimmed=!1;jQuery("#titleSizer").width()>584;)w=jQuery.trim(w.replace(" ...","")),(x=jQuery.trim(x.replace(S,""))).length>=w.length&&(x=x.substring(0,x.length-1)),w=x+" ...",jQuery("#titleSizer").text(w),trimmed=!0;trimmed,jQuery("#titleSizer").text(w),jQuery("body").append(jQuery("#titleSizer")).width(),jQuery("body#titleSizer").remove(),info=jQuery("<textarea />").html(w).text().length+" characters, "+wordCount(w)+" words ",jQuery("#titleInfo").html(w.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(w)+" 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(w);var b=_;for(mtrimmed=!1;b.length>78;)_=jQuery.trim(_.replace(" ...","")),(b=jQuery.trim(b.replace(S,""))).length>=78&&(b=(b=jQuery.trim(b.replace(" ...",""))).substring(0,b.length-1)),_=b+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").text(_),jQuery("body").append(jQuery("#mtitleSizer")).width(),jQuery("body#mtitleSizer").remove(),minfo=jQuery("<textarea />").html(_).text().length+" characters/ 78 characters "+wordCount(_)+" words ",jQuery("#mtitleInfo").html(_.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(_)+" words"),_.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(_),setPSPSeoAnalysis()}}function setDescriptionPreview(){var e,t=!1,s=jQuery("#psp_seo_meta\\[description\\]");window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=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 a="",n=!1,l=!1,o=jQuery("#pspPostTypeArrayFormat").text();if(e=JSON.parse(o).autogendesc,jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(n=!0),jQuery("#psp_seo_meta\\[disable_description\\]:checked").length>0&&(l=!0),""!==a||n||l||(a=jQuery.trim(jQuery("#psp_seo_meta\\[description\\]").val())),""===a){if(""===a&&t&&wp.data&&wp.data.select){var p=wp.data.select("core/editor").getEditedPostContent();return""!==e&&(a=(a=p.replace(/(<([^>]+)>)/gi,"")).substring(0,i)),a||(a=s.attr("placeholder")),void setGTBDescPreview(a)}var c=jQuery.trim(jQuery("#content").val());if(!s.val()||n||l)return""!==e&&(a=(a=c.replace(/(<([^>]+)>)/gi,"")).substring(0,i)),a||(a=s.attr("placeholder")),void setGTBDescPreview(a)}return a?void setGTBDescPreview(a):void 0}function setGTBDescPreview(e){jQuery("#psp_seo_meta\\[description\\]");var t=e;placeholder_desc=e;var s=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),r=s;parseInt(s)<0&&(s=230,r=285),jQuery.inArray(parseInt(s),[-1,0,1,2,3,4])>-1&&(s=230,r=285),""===s&&(s=230,r=285),s=parseInt(s),r=parseInt(r);var i=htmlEncode(t),a=i+=" ...";jQuery("#descriptionSizer").html(i),jQuery("#mdescriptionSizer").html(a);for(var n=new RegExp("sw+(.*)$"),l=i;l.length>s;)i=jQuery.trim(i.replace(" ...","")),l=jQuery.trim(l.replace(n,"")),t=jQuery.trim(t.replace(n,"")),l.length>=s&&(l=(l=jQuery.trim(l.replace(" ...",""))).substring(0,l.length-1),t=t.substring(0,t.length-1)),l+=" ...";i=l,jQuery("#descriptionSizer").html(i);for(var o=a;o.length>r;)a=jQuery.trim(a.replace(" ...","")),(o=jQuery.trim(o.replace(n,""))).length>=r&&(o=(o=jQuery.trim(o.replace(" ...",""))).substring(0,o.length-1)),o+=" ...";a=o,jQuery("#descriptionSizer").html(a),jQuery("body").append(jQuery("#descriptionSizer")).width(),jQuery("body").append(jQuery("#mdescriptionSizer")).width(),jQuery("body").remove("#descriptionSizer"),jQuery("body").remove("#mdescriptionSizer"),jQuery("#descriptionInfo").html(i.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(i)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(i)+" words ",jQuery("#mdescriptionInfo").html(a.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(a)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(a)+" words ",i.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+i.length+"/~170 characters"):i.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+i.length+"/~170 characters</span>"):i.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+i.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+i.length+"/~170 characters</span>"),a.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+a.length+"/~170 characters"):a.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+a.length+"/~170 characters</span>"):a.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+a.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+a.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(i),jQuery("#techblissonlineMSnippetDescription").html(a)}function pspSubscribe(){var e=!1;if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(e=wpEditorL10n.tinymce.settings),e){var t,s=jQuery("#psp_seo_meta\\[title\\]"),r=jQuery("#psp_seo_meta\\[preferred_tax\\]"),i=jQuery("#psp_seo_meta\\[preferred_term\\]"),a=!1,n=!1,l="",o="",p=[],c=[],d="category",u="categories",h=!0,m=!0,y=jQuery.trim(jQuery("#pspHomePermalink").text())+"slug-name/",g="",j=!1,Q="",f=[];wp.data.subscribe(function(){if(l=s.val(),g=wp.data.select("core/editor").getPermalink(),permalink_change=!0,y===g&&(permalink_change=!1),y=g,g&&permalink_change)setGtbUrlPreview(g);else if(jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(a=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(n=!0),r&&r.val()?(d=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text(),u="category"!==d?d:"categories"):u="categories",c=wp.data.select("core/editor").getEditedPostAttribute(u),arraysEqual(p,c)&&(h=!1),!l||a||n||h){if(!l||a||n){if(o=wp.data.select("core/editor").getEditedPostAttribute("title"),t===o&&(m=!1),!m&&!h)return m=!0,void(h=!0);t=o,m=!0}h=!0,p=c,Q="%"+d+"%",j||void 0===c||0!==c.length||(j=pspContainsPT(c)),void 0!==c&&c.length>0&&(f=pspSelectedTerms(c,d),j=pspContainsPT(f),Q=i&&i.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():f[0]),(!l||a||n)&&(void 0===o&&(s=jQuery("#psp_seo_meta\\[title\\]"),o=s.attr("placeholder")),""===o&&(s=jQuery("#psp_seo_meta\\[title\\]"),o=s.attr("placeholder")),o&&Q&&setGtbTitlePreview(o,Q)),!l||a||n||Q&&setGtbTitlePreview(l,Q)}else h=!0})}}function updateDateText(){var e=htmlEncode(jQuery.trim(jQuery("#DateText").val()));e.length>0?jQuery("#resultDateText").html(e+" - "):jQuery("#resultDateText").html("")}function setPSPSeoAnalysis(){var e,t=!1,s="",r="";window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=wpEditorL10n.tinymce.settings),t&&wp.data&&wp.data.select?(""==(r=wp.data.select("core/editor").getEditedPostContent())&&(r=wp.data.select("core/editor").getEditedPostAttribute("content")),s=wp.data.select("core/editor").getEditedPostAttribute("title")):(r=jQuery.trim(jQuery("#content").val()),s=jQuery.trim(jQuery("#title").val()));var i=[],a=0;e=r,""!=r&&(r=(r=(r=(r=r.replace(/(<([^>]+)>)/gi,"")).replace(/['"]+/g,"")).replace(/[^a-zA-Z]+/g," ")).toLowerCase(),i=r.split(/[\/\s]+/),a=i.length);var n,l=window.location.hostname,o=!1,p=!1;n=jQuery("<div />",{html:e}).find("a").map(function(){if(jQuery(this).attr("href")&&(-1==jQuery(this).attr("href").indexOf(l)&&(o=!0),-1!==jQuery(this).attr("href").indexOf(l)&&(p=!0)),""!==jQuery(this).text())return jQuery(this).text()}).get();var c;c=jQuery(e).find("img").map(function(){if(jQuery(this).attr("alt")&&""!==jQuery(this).attr("alt"))return jQuery(this).attr("alt")}).get();var d=!1,u=jQuery(e).find("img");void 0!==u&&u.length>0&&(d=!0);var h=!1,m=jQuery("<div />",{html:e}).find("h2, h3, h4, h5, h6");void 0!==m&&m.length>0&&(h=!0);var y;y=jQuery("<div />",{html:e}).find("h1").map(function(){if(""!==jQuery(this).text())return jQuery(this).text()}).get();var g;g=jQuery("<div />",{html:e}).find("h2").map(function(){if(""!==jQuery(this).text())return jQuery(this).text()}).get();var j=jQuery("#urlSizer").html(),Q=jQuery("#techblissonlineSnippetTitle").html(),f=jQuery("#techblissonlineSnippetDescription").val(),v=jQuery("#psp_seo_meta\\[description\\]").val(),w=jQuery("#psp_seo_meta\\[schema_string\\]").val(),_=!1,S=!1;""!==v&&(S=!0),""!==w&&"Invalid JSON Schema"!==w&&(_=!0);var x=jQuery.trim(jQuery("#permalinkSizer").html()),b=jQuery.trim(jQuery("#actualTitleSizer").html());jQuery("#actualTitleSizers").html(b);var T=0,P=0,z=0;""!==x&&(T=x.length),""!==x&&jQuery("#permalinkSizer").width(),""!==b&&(P=jQuery("<textarea />").html(b).text().length),""!==b&&(z=jQuery("#actualTitleSizer").width()),0==z&&(z=jQuery("#actualTitleSizers").width()-1),""!==j&&(j=j.trim());var E=0,k=0,I=0,C=0,L="",A=[0,2,4],U=[1,3,4],D=[],O=jQuery("#psp_seo_meta\\[keywords\\]").val();if(void 0!==O&&(D=O.split(",")),L+='<div class="psp-bs">',L+='<div class="container-fluid">',L+="<h1>Platinum SEO Analysis</h1>",L+='<p>This is a basic content analysis of this page and your focus keywords. Assigning a score does not mean anything and so we do not do that. Rather, make sure that all these basic recommendations are adhered to. We also recommend you to try our <a href="https://techblissonline.com/tools/" target="_blank">Techblissonline SEO Tools</a> for a detailed analysis of your pages and your competitor pages for your focus keywords, co-occuring words (related entities) and improve your content accordingly. </p>',L+='<div class="panel-group">',L+='<div class="row"><div class="col-sm-12">',L+='<div class="panel panel-primary">',L+='<div class="panel-heading">General</div>',L+='<div class="panel-body">',L+="<ul>",T>0&&T<75?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> URL Length is '+T+" characters </li>":T>75&&(L=L+'<li><span class="psp-info dashicons dashicons-info"></span> URL lLength is '+T+' characters <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="URL might get truncated in Google SERPS if it is more than 75 characters wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),P>0&&P<70?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> SEO Title lLength is '+P+" characters </li>":P>70&&(L=L+'<li><span class="dashicons dashicons-dismiss"></span> Actual SEO Title lLength is '+P+' characters. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Title might get truncated in Google SERPS if it is more than 70 characters wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),z>0&&z<574?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> SEO Title pixel width is '+z+" pixels </li>":z>574&&(L=L+'<li><span class="dashicons dashicons-dismiss"></span> SEO Title pixel width is '+z+' pixels including Title format. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Title might get truncated in Google SERPS if it is more than 574 pixels wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),L+=S?'<li><span class="dashicons dashicons-yes-alt"></span> Platinum SEO Description is used </li>':'<li><span class="dashicons dashicons-dismiss"></span> Platinum SEO Description field is not filled in. You may have an auto-generated description. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using optimized description improves CTR from search and social engines"><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=_?'<li><span class="dashicons dashicons-yes-alt"></span> Json Schema is used on this page using Platinum SEO </li>':'<li><span class="dashicons dashicons-dismiss"></span> Json Schema is not used on this page using Platinum SEO <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using Json Schema has a positive impact on Google. Use our Schema generator tool to generate and add one in the Advanced SEO section."><sup><span class="dashicons dashicons-info"></span></sup></a></li>',""!=r&&(L=a>0&&a>500?L+'<li><span class="dashicons dashicons-yes-alt"></span> Total number of words in Content is '+a+' <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Content length does not matter as long as user intent is matched for the topic covered. Write related articles and link them internally "><sup><span class="dashicons dashicons-info"></span></sup></a></li>':L+'<li><span class="psp-info dashicons dashicons-info"></span> Total number of words in Content is '+a+' <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Content length does not matter as long as user intent is matched for the topic covered. Write related articles and link them internally "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=d?'<li><span class="dashicons dashicons-yes-alt"></span> Images used in Content </li>':'<li><span class="dashicons dashicons-dismiss"></span> Images not used in Content <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using relevant high quality images can increase user engagement and bring in more traffic"><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=p?'<li><span class="dashicons dashicons-yes-alt"></span> Internal links used in content. </li>':'<li><span class="dashicons dashicons-dismiss"></span> Internal links not used in Content <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Linking to other relevant internal resources improves Time on site. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=o?'<li><span class="dashicons dashicons-yes-alt"></span> External links found in content. Referring to an authoritative source on which the underlying research for the content was done or linking to the creator of the product the page is about, is always a good practice that improves trust. </li>':'<li><span class="psp-info dashicons dashicons-info"></span> External links not found in Content.Referring to an authoritative source on which the underlying research for the content was done or linking to the creator of the product this page is about, is always a good practice that improves trust. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Linking to other relevant external resources as references improves trust on content. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',h&&(L+='<li><span class="dashicons dashicons-yes-alt"></span> Subheaders like h2 are used in Content </li>')),L+="</ul>",L+="</div>",L+="</div>",L+="</div></div>",(void 0!==D||D.length<1)&&""==O)return L+="</div>",L+="</div></div>",void jQuery("#techblissonlineseoanalysis").html(L);jQuery.each(D,function(e,t){if(E=0,k=0,I=0,C=0,searchlc=t.toLowerCase().trim(),!(""==searchlc||e>4)){if(jQuery.each([y,g,c,n],function(e,t){jQuery.each(t,function(t,s){-1!==s.toLowerCase().trim().indexOf(searchlc)&&(0==e&&(E+=1),1==e&&(k+=1),2==e&&(I+=1),3==e&&(C+=1))})}),jQuery.inArray(parseInt(e),A)>-1&&(L+='<div class="row">'),L+='<div class="col-sm-6">',L=(L+='<div class="panel panel-primary">')+'<div class="panel-heading">'+t+"</div>",L+='<div class="panel-body">',L+="<ul>",j&&(searchlcurl=searchlc.replace(/ /g,"-"),-1!==j.search(searchlcurl)?L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in URL </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in URL </li>'),Q&&(psplctitle=Q.toLowerCase().trim(),-1!==psplctitle.search(searchlc)?(L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in Title </li>',psplctitle.indexOf(searchlc)<20?L+='<li><span class="dashicons dashicons-yes-alt"></span> Found in the beginning of Title </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not found in the beginning of Title </li>'):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Title </li>'),f&&(psplcdesc=f.toLowerCase().trim(),-1!==psplcdesc.search(searchlc)?(psplcdesc,L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in Meta Description </li>'):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Meta Description </li>'),s&&(psplcwptitle=s.toLowerCase().trim(),-1!==psplcwptitle.search(searchlc)?L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in h1 tag (Wordpress Title) </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in h1 tag (Wordpress Title) </li>'),L+="</ul>",""==r)return L+="</div>",L+="</div>",L+="</div>",void(jQuery.inArray(parseInt(e),U)>-1&&(L+="</div>"));var l,o=[];o=(l=pspGetCounOfIndices(searchlc,i,!1))[1],pspkd=0,pspkeycounter=0,a>0&&o&&(pspkd=o.length/a*100);var p=l[0];p&&(pspkeycounter=p.length),L+="<ul>",o.length>0?(L=pspkd.toFixed(2)<3?L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in content '+o.length+" time(s) </li>":L+'<li><span class="dashicons dashicons-dismiss"></span> Used in content '+o.length+" time(s) </li>",pspkeycounter>0&&pspkeycounter<6?L=L+'<li><li><span class="dashicons dashicons-yes-alt"></span> Found in first 100 words of content '+pspkeycounter+" time(s) </li>":0==pspkeycounter?L+='<li><span class="dashicons dashicons-dismiss"></span> Not found in first 100 words of content </li>':L=L+'<li><span class="dashicons dashicons-dismiss"></span> Found in first 100 words of content '+pspkeycounter+" time(s) </li>",L=pspkd.toFixed(2)<3?L+'<li><span class="dashicons dashicons-yes-alt"></span> Keyword Density of '+t+" is "+pspkd.toFixed(2):L+'<li><span class="dashicons dashicons-dismiss"></span> Keyword Density of '+t+" is "+pspkd.toFixed(2)):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Content </li>',E>0&&(L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in other h1 tags '+E+" time(s) </li>"),k>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in h2 tags '+k+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in h2 tags </li>',I>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in image alt attributes '+I+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in image alt attributes </li>',C>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in anchor texts '+C+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in anchor texts </li>',L+="</ul>",L+="</div>",L+="</div>",L+="</div>",jQuery.inArray(parseInt(e),U)>-1&&(L+="</div>")}}),L+="</div>",L+="</div></div>",jQuery("#techblissonlineseoanalysis").html(L)}function pspGetCounOfIndices(e,t,s){if(0==e.length)return[];var r,i=[],a=[],n=[];s||(e=e.toLowerCase()),r=t.length;for(let n=0;n<r;n++)str=t[n],str&&(s||(str=str.toLowerCase()),str.indexOf(e,0)>-1&&(a.push(str),n<100&&i.push(str)));return n.push(i),n.push(a),n}function updateAll(){setUrlPreview(),setTitlePreview(),setDescriptionPreview()}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(){pspPopulateTerms(),setTitlePreview()}),jQuery("#psp_seo_meta\\[preferred_term\\]").on("focus",function(){previousTerm=jQuery(this).val(),jQuery(this).attr("oldValue",previousTerm)}).on("change",function(){isTermSelected(),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(){setPSPSeoAnalysis()}),jQuery("#psp_analyse_btn").on("click",function(){setPSPSeoAnalysis()}),updateAll(),pspSubscribe()});
|
1 |
+
function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function wordCount(e){var t=e.match(/\S+/g);return t?t.length:0}function arraysEqual(e,t){if(void 0===e||void 0===t)return!1;if(e===t)return!0;if(null===e||null===t)return!1;if(e.length!=t.length)return!1;e=e.sort(),t=t.sort();for(var s=0;s<e.length;++s)if(e[s]!==t[s])return!1;return!0}function pspContainsPT(e){if(jQuery("#psp_seo_meta\\[preferred_term\\]").val()>0){var t=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text();return!(e&&jQuery.inArray(t,e)>-1)&&(alert("Make sure that you change the preferred term before saving as you have deselected "+t),jQuery("#psp_seo_meta\\[preferred_term\\]").val(""),!0)}}function pspSelectedTerms(e,t){var s,r=[],i=jQuery("#psp_terms_json_str").val(),a=JSON.parse(i);return jQuery.each(a,function(i,a){i===t&&(s=0,jQuery.each(a,function(t,i){jQuery.inArray(parseInt(i.id),e)>-1&&(r[s]=i.name.trim(),s++)}))}),r.sort(),r}function pspSelectedTermsClassic(e){var t=[];return jQuery('input[name="'+e+'"]:checked').each(function(){t.push(jQuery(this).parent("label").text().trim())}),t.sort(),t}function isTermSelected(){var e=jQuery("#psp_seo_meta\\[preferred_tax\\]"),t=jQuery("#psp_seo_meta\\[preferred_term\\]"),s=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text(),r=jQuery("#psp_seo_meta\\[preferred_term\\]").val();if(r){var i,a="categories",n="post_category[]",l="category",o=t.attr("oldValue"),p=!1;window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(p=wpEditorL10n.tinymce.settings),e&&e.val()&&"category"!==(l=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(a=l,n="tax_input["+l+"][]"),p&&wp.data&&wp.data.select?(taxarray=wp.data.select("core/editor").getEditedPostAttribute(a),i=pspSelectedTerms(taxarray,l)):i=pspSelectedTermsClassic(n),r&&(i.length>0?jQuery.inArray(s.trim(),i)>-1||""===r||(alert("Select this Term "+s+" if you want to set it as preferred term"),t.val(o)):(alert("Select this Term "+s+" if you want to set it as preferred term"),t.val("")))}}function pspPopulateTerms(){preferredTaxElem=jQuery("#psp_seo_meta\\[preferred_tax\\]"),preferredTermElem=jQuery("#psp_seo_meta\\[preferred_term\\]");var e=preferredTaxElem.val();jQuery("#psp_seo_meta\\[preferred_term\\]").html("");var t=jQuery("#psp_terms_json_str").val(),s=JSON.parse(t);preferredTermElem.append('<option value="">Select a Term</option>'),jQuery.each(s,function(t,s){t===e&&jQuery.each(s,function(e,t){preferredTermElem.append('<option value="'+t.id+'">'+t.name+"</option>")})})}function boldWords(e){var t=e,s=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(s)for(i=0;i<s.length;i++)t=(t=t.replace(new RegExp("(^|[\\W])("+escapeRegExp(s[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3")).replace(new RegExp("(^|[\\W])("+escapeRegExp(s[i])+")([\\W]|$)","gi"),"$1<b>$2</b>$3");return t}function boldText(e){var t=e,s=jQuery("#psp_seo_meta\\[keywords\\]").val().match(/\S+/g);if(s)for(i=0;i<s.length;i++)t=t.replace(new RegExp("("+escapeRegExp(s[i])+")","gi"),"<b>$1</b>");return t}function htmlEncode(e){return jQuery("<div/>").text(e).html()}function setGtbUrlPreview(e){var t="";(t=e)&&(t=t.replace(/^https?\:\/\//i,""));var s=htmlEncode(t),r=(s=s.replace(/\/$/,"")).length;jQuery("#permalinkSizer").html(s);var i=s=s.replace(/([^https?:\/\/])(\/)/g,"$1 > ");t=s,jQuery("#urlSizer").html(s),jQuery("#murlSizer").html(i);var a=new RegExp("W(.*)$");for(trimmed=!1;jQuery("#urlSizer").width()>566;){var n=s;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>$/,"")).trim(),jQuery("#urlSizer").html(n),s=n,trimmed=!0}trimmed&&(s+=" ...",jQuery("#urlSizer").html(s)),info=r+" characters, ",jQuery("#urlInfo").html(s.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(s),mtrimmed=!1;for(var l=i;i.length>42;)i=jQuery.trim(i.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(a,""))).trim()).replace(/\>$/,"")).length>=42&&(l=(l=jQuery.trim(i.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),i=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(i),info=i.length+" characters, ",jQuery("#murlInfo").html(i.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(i)}function setUrlPreview(){var e=jQuery.trim(jQuery("#pspHomePermalink").text())+"slug-name/";if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&wpEditorL10n.tinymce.settings,jQuery("#editable-post-name").length){e=jQuery.trim(jQuery("#sample-permalink").text());var t=jQuery.trim(jQuery("#editable-post-name").text());e=(e=e.replace(t,"")).replace(/\/$/g,"")}else jQuery("#name").length?e=jQuery.trim(jQuery("#pspPostPermalink").text()):jQuery("#slug").length&&(e=jQuery.trim(jQuery("#pspPostPermalink").text()));if(jQuery("#new-post-slug").length>0)e+=jQuery("#new-post-slug").val();else if(jQuery("#editable-post-name-full").length){e+=jQuery("#editable-post-name-full").text()}e&&(e=e.replace(/^https?\:\/\//i,""));var s=htmlEncode(e),r=s.length;r=(s=s.replace(/\/$/,"")).length;jQuery("#permalinkSizer").html(s);var i=s=s.replace(/([^https?:\/\/])(\/)/g,"$1 > ");e=s,jQuery("#urlSizer").html(s),jQuery("#murlSizer").html(i);var a=new RegExp("W(.*)$");for(trimmed=!1;jQuery("#urlSizer").width()>584;){var n=s;n=(n=(n=(n=n.substring(0,n.length-1)).trim()).replace(/\>$/,"")).trim(),jQuery("#urlSizer").html(n),s=n,trimmed=!0}trimmed&&(s+=" ..."),info=r+" characters, ",jQuery("#urlInfo").html(r+" 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(s),mtrimmed=!1;for(var l=i;l.length>42;)i=jQuery.trim(i.replace(" ...","")),(l=(l=(l=jQuery.trim(l.replace(a,""))).trim()).replace(/\>$/,"")).length>=42&&(l=(l=jQuery.trim(i.replace(" ...",""))).substring(0,l.length-1)),l=l.trim(),i=l+=" ...",mtrimmed=!0;mtrimmed&&jQuery("#murlSizer").html(i),info=i.length+" characters, ",jQuery("#murlInfo").html(i.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(i)}function stripTrailingSlash(e){return"/"==e.substr(-1)?e.substr(0,e.length-1):e}function setGtbTitlePreview(e,t){var s=jQuery("#psp_seo_meta\\[titleformat\\]").val(),r=!1,i=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(r=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(i=!0),r&&(s="%seo_title%"),i&&(s="%wp_title%");var a=jQuery("#pspPostTypeArrayFormat").text(),n=JSON.parse(a),l=jQuery("#psp_seo_meta\\[title\\]"),o=s.replace("%seo_title%",e);if(""===e&&(o=o.replace("%seo_title%",l.attr("placeholder"))),o=(o=(o=(o=(o=(o=o.replace("%wp_title%",n.wp_title)).replace("%site_name%",n.site_name)).replace("%site_description%",n.site_description)).replace("%category%",t)).replace("%taxonomy%",t)).replace(/%sep%/g,n.sep),""!==(o=(o=jQuery.trim(o)).trim(n.sep))){var p=htmlEncode(o),c=p;jQuery("#titleSizer").html(p),jQuery("#actualTitleSizer").html(p);var d=new RegExp("sw+(.*)$");trimmed=!1;for(var u=p;jQuery("#titleSizer").width()>584;)p=jQuery.trim(p.replace(" ...","")),(u=jQuery.trim(u.replace(d,""))).length>=p.length&&(u=u.substring(0,u.length-1)),p=u+" ...",jQuery("#titleSizer").html(p),trimmed=!0;trimmed,jQuery("#titleSizer").html(p),mtrimmed=!1;for(var h=c;h.length>78;)c=jQuery.trim(c.replace(" ...","")),(h=jQuery.trim(h.replace(d,""))).length>=78&&(h=(h=jQuery.trim(h.replace(" ...",""))).substring(0,h.length-1)),c=h+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").html(c),info=jQuery("<textarea />").html(p).text().length+" characters, "+wordCount(p)+" words ",jQuery("#titleInfo").html(p.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(p)+" 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=jQuery("<textarea />").html(c).text().length+" characters/ 78 characters "+wordCount(c)+" words ",jQuery("#mtitleInfo").html(c.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(c)+" words"),c.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(p),jQuery("#techblissonlineMSnippetTitle").html(c),setPSPSeoAnalysis()}}function setTitlePreview(){var e,t,s="",r="",i="",a=!1,n="",l=[];window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(a=wpEditorL10n.tinymce.settings);var o=jQuery("#pspPostTypeArrayFormat").text(),p=JSON.parse(o),c=jQuery("#psp_seo_meta\\[titleformat\\]").val(),d=!1,u=!1,h=!1;jQuery("#psp_seo_meta\\[disable_title_format\\]:checked").length>0&&(d=!0),jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(u=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(h=!0);n=p.category,c.toLowerCase().indexOf("%wp_title%");var m=jQuery("#title"),y=jQuery("#psp_seo_meta\\[title\\]");r=y.attr("placeholder");var g=jQuery("#psp_seo_meta\\[preferred_tax\\]"),j=jQuery("#psp_seo_meta\\[preferred_term\\]"),Q="categories",f="post_category[]",v="category";if(g&&g.val()&&"category"!==(v=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text())&&(Q=v,f="tax_input["+v+"][]"),!a&&m&&(pspContainsPT(l=pspSelectedTermsClassic(f)),n=j&&j.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l&&l.length>0?l[0]:"%"+v+"%"),!y.val()||u||h?(jQuery("#title").val()?r=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?r=jQuery.trim(jQuery("#name").val()):a&&wp.data&&wp.data.select&&(n=p.category,j&&j.val()&&(n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text()),""===(r=wp.data.select("core/editor").getEditedPostAttribute("title"))&&(r=y.attr("placeholder")),n||(n="%"+v+"%"),void 0===(t=wp.data.select("core/editor").getEditedPostAttribute(Q))&&(n="%"+v+"%"),void 0!==t&&0===t.length&&(n="%"+v+"%",pspContainsPT(t)),void 0!==t&&t.length>0&&(pspContainsPT(l=pspSelectedTerms(t,v)),n=j&&j.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l[0])),s=r,(d||h)&&(c="%wp_title%"),s=(s=(s=(s=(s=(s=(s=c.replace("%seo_title%",r)).replace("%wp_title%",r)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",n)).replace("%category%",n)).replace(/%sep%/g,p.sep),s=(s=jQuery.trim(s)).trim(p.sep)):(s=y.val(),i=y.val(),jQuery("#title").val()?r=jQuery.trim(jQuery("#title").val()):jQuery("#name").val()?r=jQuery.trim(jQuery("#name").val()):a&&wp.data&&wp.data.select&&(n=p.category,j&&j.val()&&(n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text()),r=wp.data.select("core/editor").getEditedPostAttribute("title"),n||(n="%"+v+"%"),void 0===(e=wp.data.select("core/editor").getEditedPostAttribute(Q))&&(n="%"+v+"%"),void 0!==e&&0===e.length&&(n="%"+v+"%",pspContainsPT(l)),void 0!==e&&e.length>0&&(pspContainsPT(l=pspSelectedTerms(e,v)),j&&j.val()?n=jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():l.length>0&&(n=l[0]))),d&&(c="%seo_title%"),s=(s=(s=(s=(s=(s=(s=c.replace("%seo_title%",i)).replace("%wp_title%",r)).replace("%site_name%",p.site_name)).replace("%site_description%",p.site_description)).replace("%taxonomy%",n)).replace("%category%",n)).replace(/%sep%/g,p.sep),s=(s=jQuery.trim(s)).trim(p.sep)),""!==s){""===r||a||r;var w=htmlEncode(s),_=w;jQuery("#titleSizer").html(w),jQuery("#actualTitleSizer").html(w);var S=new RegExp("sw+(.*)$"),x=w;for(trimmed=!1;jQuery("#titleSizer").width()>584;)w=jQuery.trim(w.replace(" ...","")),(x=jQuery.trim(x.replace(S,""))).length>=w.length&&(x=x.substring(0,x.length-1)),w=x+" ...",jQuery("#titleSizer").text(w),trimmed=!0;trimmed,jQuery("#titleSizer").text(w),jQuery("body").append(jQuery("#titleSizer")).width(),jQuery("body#titleSizer").remove(),info=jQuery("<textarea />").html(w).text().length+" characters, "+wordCount(w)+" words ",jQuery("#titleInfo").html(w.length+" characters, "+jQuery("#titleSizer").width()+" pixels, "+wordCount(w)+" 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(w);var b=_;for(mtrimmed=!1;b.length>78;)_=jQuery.trim(_.replace(" ...","")),(b=jQuery.trim(b.replace(S,""))).length>=78&&(b=(b=jQuery.trim(b.replace(" ...",""))).substring(0,b.length-1)),_=b+=" ...",mtrimmed=!0;mtrimmed,jQuery("#mtitleSizer").text(_),jQuery("body").append(jQuery("#mtitleSizer")).width(),jQuery("body#mtitleSizer").remove(),minfo=jQuery("<textarea />").html(_).text().length+" characters/ 78 characters "+wordCount(_)+" words ",jQuery("#mtitleInfo").html(_.length+" characters, "+jQuery("#mtitleSizer").width()+" pixels, "+wordCount(_)+" words"),_.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(_),setPSPSeoAnalysis()}}function setDescriptionPreview(){var e,t=!1,s=jQuery("#psp_seo_meta\\[description\\]");window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=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 a="",n=!1,l=!1,o=jQuery("#pspPostTypeArrayFormat").text();if(e=JSON.parse(o).autogendesc,jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(n=!0),jQuery("#psp_seo_meta\\[disable_description\\]:checked").length>0&&(l=!0),""!==a||n||l||(a=jQuery.trim(jQuery("#psp_seo_meta\\[description\\]").val())),""===a){if(""===a&&t&&wp.data&&wp.data.select){var p=wp.data.select("core/editor").getEditedPostContent();return""!==e&&(a=(a=p.replace(/(<([^>]+)>)/gi,"")).substring(0,i)),a||(a=s.attr("placeholder")),void setGTBDescPreview(a)}var c=jQuery.trim(jQuery("#content").val());if(!s.val()||n||l)return""!==e&&(a=(a=c.replace(/(<([^>]+)>)/gi,"")).substring(0,i)),a||(a=s.attr("placeholder")),void setGTBDescPreview(a)}return a?void setGTBDescPreview(a):void 0}function setGTBDescPreview(e){jQuery("#psp_seo_meta\\[description\\]");var t=e;placeholder_desc=e;var s=jQuery.trim(jQuery("#psp_seo_meta\\[maxsnippet\\]").val()),r=s;parseInt(s)<0&&(s=230,r=285),jQuery.inArray(parseInt(s),[-1,0,1,2,3,4])>-1&&(s=230,r=285),""===s&&(s=230,r=285),s=parseInt(s),r=parseInt(r);var i=htmlEncode(t),a=i+=" ...";jQuery("#descriptionSizer").html(i),jQuery("#mdescriptionSizer").html(a);for(var n=new RegExp("sw+(.*)$"),l=i;l.length>s;)i=jQuery.trim(i.replace(" ...","")),l=jQuery.trim(l.replace(n,"")),t=jQuery.trim(t.replace(n,"")),l.length>=s&&(l=(l=jQuery.trim(l.replace(" ...",""))).substring(0,l.length-1),t=t.substring(0,t.length-1)),l+=" ...";i=l,jQuery("#descriptionSizer").html(i);for(var o=a;o.length>r;)a=jQuery.trim(a.replace(" ...","")),(o=jQuery.trim(o.replace(n,""))).length>=r&&(o=(o=jQuery.trim(o.replace(" ...",""))).substring(0,o.length-1)),o+=" ...";a=o,jQuery("#descriptionSizer").html(a),jQuery("body").append(jQuery("#descriptionSizer")).width(),jQuery("body").append(jQuery("#mdescriptionSizer")).width(),jQuery("body").remove("#descriptionSizer"),jQuery("body").remove("#mdescriptionSizer"),jQuery("#descriptionInfo").html(i.length+" characters, "+jQuery("#descriptionSizer").width()+" pixels, "+wordCount(i)+" words"),info=jQuery("#descriptionSizer").width()+" pixels, "+wordCount(i)+" words ",jQuery("#mdescriptionInfo").html(a.length+" characters, "+jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(a)+" words"),minfo=jQuery("#mdescriptionSizer").width()+" pixels, "+wordCount(a)+" words ",i.length<=146?jQuery("#descriptionInfo").html(info+'<span style="color:green;">'+i.length+"/~170 characters"):i.length<=160?jQuery("#descriptionInfo").html(info+'<span style="color:orange;">'+i.length+"/~170 characters</span>"):i.length<=166?jQuery("#descriptionInfo").html(info+'<span style="color:purple;">'+i.length+"/~170 characters</span>"):jQuery("#descriptionInfo").html(info+'<span style="color:red;">'+i.length+"/~170 characters</span>"),a.length<=146?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:green;">'+a.length+"/~170 characters"):a.length<=160?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:orange;">'+a.length+"/~170 characters</span>"):a.length<=166?jQuery("#mdescriptionInfo").html(minfo+'<span style="color:purple;">'+a.length+"/~170 characters</span>"):jQuery("#mdescriptionInfo").html(minfo+'<span style="color:red;">'+a.length+"/~170 characters</span>"),jQuery("#techblissonlineSnippetDescription").html(i),jQuery("#techblissonlineMSnippetDescription").html(a)}function pspSubscribe(){var e=!1;if(window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(e=wpEditorL10n.tinymce.settings),e){var t,s=jQuery("#psp_seo_meta\\[title\\]"),r=jQuery("#psp_seo_meta\\[preferred_tax\\]"),i=jQuery("#psp_seo_meta\\[preferred_term\\]"),a=!1,n=!1,l="",o="",p=[],c=[],d="category",u="categories",h=!0,m=!0,y=jQuery.trim(jQuery("#pspHomePermalink").text())+"slug-name/",g="",j=!1,Q="",f=[];wp.data.subscribe(function(){if(l=s.val(),g=wp.data.select("core/editor").getPermalink(),permalink_change=!0,y===g&&(permalink_change=!1),y=g,g&&permalink_change)setGtbUrlPreview(g);else if(jQuery("#psp_seo_meta\\[disable_title\\]:checked").length>0&&(a=!0),jQuery("#psp_seo_meta\\[disable_psp\\]:checked").length>0&&(n=!0),r&&r.val()?(d=jQuery("#psp_seo_meta\\[preferred_tax\\] option:selected").text(),u="category"!==d?d:"categories"):u="categories",c=wp.data.select("core/editor").getEditedPostAttribute(u),arraysEqual(p,c)&&(h=!1),!l||a||n||h){if(!l||a||n){if(o=wp.data.select("core/editor").getEditedPostAttribute("title"),t===o&&(m=!1),!m&&!h)return m=!0,void(h=!0);t=o,m=!0}h=!0,p=c,Q="%"+d+"%",j||void 0===c||0!==c.length||(j=pspContainsPT(c)),void 0!==c&&c.length>0&&(f=pspSelectedTerms(c,d),j=pspContainsPT(f),Q=i&&i.val()?jQuery("#psp_seo_meta\\[preferred_term\\] option:selected").text():f[0]),(!l||a||n)&&(void 0===o&&(s=jQuery("#psp_seo_meta\\[title\\]"),o=s.attr("placeholder")),""===o&&(s=jQuery("#psp_seo_meta\\[title\\]"),o=s.attr("placeholder")),o&&Q&&setGtbTitlePreview(o,Q)),!l||a||n||Q&&setGtbTitlePreview(l,Q)}else h=!0})}}function updateDateText(){var e=htmlEncode(jQuery.trim(jQuery("#DateText").val()));e.length>0?jQuery("#resultDateText").html(e+" - "):jQuery("#resultDateText").html("")}function setPSPSeoAnalysis(){var e,t=!1,s="",r="";window.wpEditorL10n&&wpEditorL10n.tinymce&&wpEditorL10n.tinymce.settings&&(t=wpEditorL10n.tinymce.settings),t&&wp.data&&wp.data.select?(""==(r=wp.data.select("core/editor").getEditedPostContent())&&(r=wp.data.select("core/editor").getEditedPostAttribute("content")),s=wp.data.select("core/editor").getEditedPostAttribute("title")):(r=jQuery.trim(jQuery("#content").val()),s=jQuery.trim(jQuery("#title").val()));var i=[],a=0;e=r,""!=r&&(r=(r=(r=(r=r.replace(/(<([^>]+)>)/gi,"")).replace(/['"]+/g,"")).replace(/[^a-zA-Z]+/g," ")).toLowerCase(),i=r.split(/[\/\s]+/),a=i.length);var n,l=window.location.hostname,o=!1,p=!1;n=jQuery("<div />",{html:e}).find("a").map(function(){if(jQuery(this).attr("href")&&(-1==jQuery(this).attr("href").indexOf(l)&&(o=!0),-1!==jQuery(this).attr("href").indexOf(l)&&(p=!0)),""!==jQuery(this).text())return jQuery(this).text()}).get();var c;c=jQuery("<div />",{html:e}).find("img").map(function(){if(jQuery(this).attr("alt")&&""!==jQuery(this).attr("alt"))return jQuery(this).attr("alt")}).get();var d=!1,u=jQuery("<div />",{html:e}).find("img");void 0!==u&&u.length>0&&(d=!0);var h=!1,m=jQuery("<div />",{html:e}).find("h2, h3, h4, h5, h6");void 0!==m&&m.length>0&&(h=!0);var y;y=jQuery("<div />",{html:e}).find("h1").map(function(){if(""!==jQuery(this).text())return jQuery(this).text()}).get();var g;g=jQuery("<div />",{html:e}).find("h2").map(function(){if(""!==jQuery(this).text())return jQuery(this).text()}).get();var j=jQuery("#urlSizer").html(),Q=jQuery("#techblissonlineSnippetTitle").html(),f=jQuery("#techblissonlineSnippetDescription").val(),v=jQuery("#psp_seo_meta\\[description\\]").val(),w=jQuery("#psp_seo_meta\\[schema_string\\]").val(),_=!1,S=!1;""!==v&&(S=!0),""!==w&&"Invalid JSON Schema"!==w&&(_=!0);var x=jQuery.trim(jQuery("#permalinkSizer").html()),b=jQuery.trim(jQuery("#actualTitleSizer").html());jQuery("#actualTitleSizers").html(b);var T=0,P=0,z=0;""!==x&&(T=x.length),""!==x&&jQuery("#permalinkSizer").width(),""!==b&&(P=jQuery("<textarea />").html(b).text().length),""!==b&&(z=jQuery("#actualTitleSizer").width()),0==z&&(z=jQuery("#actualTitleSizers").width()-1),""!==j&&(j=j.trim());var E=0,k=0,I=0,C=0,L="",A=[0,2,4],U=[1,3,4],D=[],O=jQuery("#psp_seo_meta\\[keywords\\]").val();if(void 0!==O&&(D=O.split(",")),L+='<div class="psp-bs">',L+='<div class="container-fluid">',L+="<h1>Platinum SEO Analysis</h1>",L+='<p>This is a basic content analysis of this page and your focus keywords. Assigning a score does not mean anything and so we do not do that. Rather, make sure that all these basic recommendations are adhered to. We also recommend you to try our <a href="https://techblissonline.com/tools/" target="_blank">Techblissonline SEO Tools</a> for a detailed analysis of your pages and your competitor pages for your focus keywords, co-occuring words (related entities) and improve your content accordingly. </p>',L+='<div class="panel-group">',L+='<div class="row"><div class="col-sm-12">',L+='<div class="panel panel-primary">',L+='<div class="panel-heading">General</div>',L+='<div class="panel-body">',L+="<ul>",T>0&&T<75?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> URL Length is '+T+" characters </li>":T>75&&(L=L+'<li><span class="psp-info dashicons dashicons-info"></span> URL lLength is '+T+' characters <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="URL might get truncated in Google SERPS if it is more than 75 characters wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),P>0&&P<70?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> SEO Title lLength is '+P+" characters </li>":P>70&&(L=L+'<li><span class="dashicons dashicons-dismiss"></span> Actual SEO Title lLength is '+P+' characters. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Title might get truncated in Google SERPS if it is more than 70 characters wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),z>0&&z<574?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> SEO Title pixel width is '+z+" pixels </li>":z>574&&(L=L+'<li><span class="dashicons dashicons-dismiss"></span> SEO Title pixel width is '+z+' pixels including Title format. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Title might get truncated in Google SERPS if it is more than 574 pixels wide. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>'),L+=S?'<li><span class="dashicons dashicons-yes-alt"></span> Platinum SEO Description is used </li>':'<li><span class="dashicons dashicons-dismiss"></span> Platinum SEO Description field is not filled in. You may have an auto-generated description. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using optimized description improves CTR from search and social engines"><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=_?'<li><span class="dashicons dashicons-yes-alt"></span> Json Schema is used on this page using Platinum SEO </li>':'<li><span class="dashicons dashicons-dismiss"></span> Json Schema is not used on this page using Platinum SEO <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using Json Schema has a positive impact on Google. Use our Schema generator tool to generate and add one in the Advanced SEO section."><sup><span class="dashicons dashicons-info"></span></sup></a></li>',""!=r&&(L=a>0&&a>500?L+'<li><span class="dashicons dashicons-yes-alt"></span> Total number of words in Content is '+a+' <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Content length does not matter as long as user intent is matched for the topic covered. Write related articles and link them internally "><sup><span class="dashicons dashicons-info"></span></sup></a></li>':L+'<li><span class="psp-info dashicons dashicons-info"></span> Total number of words in Content is '+a+' <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Content length does not matter as long as user intent is matched for the topic covered. Write related articles and link them internally "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=d?'<li><span class="dashicons dashicons-yes-alt"></span> Images used in Content </li>':'<li><span class="dashicons dashicons-dismiss"></span> Images not used in Content <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Using relevant high quality images can increase user engagement and bring in more traffic"><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=p?'<li><span class="dashicons dashicons-yes-alt"></span> Internal links used in content. </li>':'<li><span class="dashicons dashicons-dismiss"></span> Internal links not used in Content <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Linking to other relevant internal resources improves Time on site. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',L+=o?'<li><span class="dashicons dashicons-yes-alt"></span> External links found in content. Referring to an authoritative source on which the underlying research for the content was done or linking to the creator of the product the page is about, is always a good practice that improves trust. </li>':'<li><span class="psp-info dashicons dashicons-info"></span> External links not found in Content.Referring to an authoritative source on which the underlying research for the content was done or linking to the creator of the product this page is about, is always a good practice that improves trust. <a href="#" class="psptip" data-toggle="tooltip" data-placement="top" title="Linking to other relevant external resources as references improves trust on content. "><sup><span class="dashicons dashicons-info"></span></sup></a></li>',h&&(L+='<li><span class="dashicons dashicons-yes-alt"></span> Subheaders like h2 are used in Content </li>')),L+="</ul>",L+="</div>",L+="</div>",L+="</div></div>",(void 0!==D||D.length<1)&&""==O)return L+="</div>",L+="</div></div>",void jQuery("#techblissonlineseoanalysis").html(L);jQuery.each(D,function(e,t){if(E=0,k=0,I=0,C=0,searchlc=t.toLowerCase().trim(),!(""==searchlc||e>4)){if(jQuery.each([y,g,c,n],function(e,t){jQuery.each(t,function(t,s){-1!==s.toLowerCase().trim().indexOf(searchlc)&&(0==e&&(E+=1),1==e&&(k+=1),2==e&&(I+=1),3==e&&(C+=1))})}),jQuery.inArray(parseInt(e),A)>-1&&(L+='<div class="row">'),L+='<div class="col-sm-6">',L=(L+='<div class="panel panel-primary">')+'<div class="panel-heading">'+t+"</div>",L+='<div class="panel-body">',L+="<ul>",j&&(searchlcurl=searchlc.replace(/ /g,"-"),-1!==j.search(searchlcurl)?L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in URL </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in URL </li>'),Q&&(psplctitle=Q.toLowerCase().trim(),-1!==psplctitle.search(searchlc)?(L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in Title </li>',psplctitle.indexOf(searchlc)<20?L+='<li><span class="dashicons dashicons-yes-alt"></span> Found in the beginning of Title </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not found in the beginning of Title </li>'):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Title </li>'),f&&(psplcdesc=f.toLowerCase().trim(),-1!==psplcdesc.search(searchlc)?(psplcdesc,L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in Meta Description </li>'):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Meta Description </li>'),s&&(psplcwptitle=s.toLowerCase().trim(),-1!==psplcwptitle.search(searchlc)?L+='<li><span class="dashicons dashicons-yes-alt"></span> Used in h1 tag (Wordpress Title) </li>':L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in h1 tag (Wordpress Title) </li>'),L+="</ul>",""==r)return L+="</div>",L+="</div>",L+="</div>",void(jQuery.inArray(parseInt(e),U)>-1&&(L+="</div>"));var l,o=[];o=(l=pspGetCounOfIndices(searchlc,i,!1))[1],pspkd=0,pspkeycounter=0,a>0&&o&&(pspkd=o.length/a*100);var p=l[0];p&&(pspkeycounter=p.length),L+="<ul>",o.length>0?(L=pspkd.toFixed(2)<3?L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in content '+o.length+" time(s) </li>":L+'<li><span class="dashicons dashicons-dismiss"></span> Used in content '+o.length+" time(s) </li>",pspkeycounter>0&&pspkeycounter<6?L=L+'<li><li><span class="dashicons dashicons-yes-alt"></span> Found in first 100 words of content '+pspkeycounter+" time(s) </li>":0==pspkeycounter?L+='<li><span class="dashicons dashicons-dismiss"></span> Not found in first 100 words of content </li>':L=L+'<li><span class="dashicons dashicons-dismiss"></span> Found in first 100 words of content '+pspkeycounter+" time(s) </li>",L=pspkd.toFixed(2)<3?L+'<li><span class="dashicons dashicons-yes-alt"></span> Keyword Density of '+t+" is "+pspkd.toFixed(2):L+'<li><span class="dashicons dashicons-dismiss"></span> Keyword Density of '+t+" is "+pspkd.toFixed(2)):L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in Content </li>',E>0&&(L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in other h1 tags '+E+" time(s) </li>"),k>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in h2 tags '+k+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in h2 tags </li>',I>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in image alt attributes '+I+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in image alt attributes </li>',C>0?L=L+'<li><span class="dashicons dashicons-yes-alt"></span> Used in anchor texts '+C+" time(s) </li>":L+='<li><span class="dashicons dashicons-dismiss"></span> Not used in anchor texts </li>',L+="</ul>",L+="</div>",L+="</div>",L+="</div>",jQuery.inArray(parseInt(e),U)>-1&&(L+="</div>")}}),L+="</div>",L+="</div></div>",jQuery("#techblissonlineseoanalysis").html(L)}function pspGetCounOfIndices(e,t,s){if(0==e.length)return[];var r,i=[],a=[],n=[];s||(e=e.toLowerCase()),r=t.length;for(let n=0;n<r;n++)str=t[n],str&&(s||(str=str.toLowerCase()),str.indexOf(e,0)>-1&&(a.push(str),n<100&&i.push(str)));return n.push(i),n.push(a),n}function updateAll(){setUrlPreview(),setTitlePreview(),setDescriptionPreview()}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(){pspPopulateTerms(),setTitlePreview()}),jQuery("#psp_seo_meta\\[preferred_term\\]").on("focus",function(){previousTerm=jQuery(this).val(),jQuery(this).attr("oldValue",previousTerm)}).on("change",function(){isTermSelected(),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(){setPSPSeoAnalysis()}),jQuery("#psp_analyse_btn").on("click",function(){setPSPSeoAnalysis()}),updateAll(),pspSubscribe()});
|
psp-include/settings/psp_basic_metabox_renderer.php
CHANGED
@@ -53,6 +53,7 @@ Author URI: http://techblissonline.com/
|
|
53 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
54 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
55 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
|
|
56 |
?></span>
|
57 |
<style>
|
58 |
label {
|
53 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
54 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
55 |
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
56 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
57 |
?></span>
|
58 |
<style>
|
59 |
label {
|
psp-include/settings/psp_pre_settings.php
CHANGED
@@ -121,7 +121,7 @@ class PspPreSettings extends PspSettings {
|
|
121 |
|
122 |
$tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
123 |
|
124 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
125 |
|
126 |
$this->register_pre_security_settings();
|
127 |
|
@@ -161,7 +161,8 @@ class PspPreSettings extends PspSettings {
|
|
161 |
$psp_pre_settings = get_option($psp_pre_settings_name);
|
162 |
if (!empty($psp_pre_settings)) $this->psp_pre_settings = $psp_pre_settings;
|
163 |
|
164 |
-
wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ) );
|
|
|
165 |
//register
|
166 |
register_setting( $this->psp_pre_security_settings_group, $psp_pre_settings_name, array( &$this, 'psp_sanitize_license' ) );
|
167 |
//add Section
|
@@ -842,7 +843,9 @@ class PspPreSettings extends PspSettings {
|
|
842 |
*/
|
843 |
function psp_pre_options_tabs() {
|
844 |
$current_tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
845 |
-
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
|
|
|
|
846 |
//screen_icon();
|
847 |
echo '<h2 class="nav-tab-wrapper">';
|
848 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
121 |
|
122 |
$tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
123 |
|
124 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
125 |
|
126 |
$this->register_pre_security_settings();
|
127 |
|
161 |
$psp_pre_settings = get_option($psp_pre_settings_name);
|
162 |
if (!empty($psp_pre_settings)) $this->psp_pre_settings = $psp_pre_settings;
|
163 |
|
164 |
+
//wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ) );
|
165 |
+
wp_enqueue_script( 'psp-input-toggler', plugins_url( '/js/pspinputtypetoggler.js', __FILE__ ), array( 'jquery' ), '2.1.7');
|
166 |
//register
|
167 |
register_setting( $this->psp_pre_security_settings_group, $psp_pre_settings_name, array( &$this, 'psp_sanitize_license' ) );
|
168 |
//add Section
|
843 |
*/
|
844 |
function psp_pre_options_tabs() {
|
845 |
$current_tab = isset( $_GET['psppretab'] ) ? Sanitize_key($_GET['psppretab']) : $this->psp_pre_security_settings_group;
|
846 |
+
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
847 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
848 |
+
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
849 |
//screen_icon();
|
850 |
echo '<h2 class="nav-tab-wrapper">';
|
851 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
psp-include/settings/psp_settings.php
CHANGED
@@ -210,7 +210,7 @@ class PspSettings {
|
|
210 |
$psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
|
211 |
if ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages)) {
|
212 |
|
213 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
214 |
|
215 |
}
|
216 |
|
@@ -1955,7 +1955,7 @@ class PspSettings {
|
|
1955 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
1956 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
1957 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
1958 |
-
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
1959 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
1960 |
|
1961 |
}
|
@@ -2862,7 +2862,7 @@ class PspSettings {
|
|
2862 |
wp_enqueue_media();
|
2863 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array( 'jquery-ui-tabs') );
|
2864 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
2865 |
-
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ),'', '2.1.
|
2866 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
2867 |
//wp_enqueue_script( 'psp-cm', plugins_url( '/js/cm.js', __FILE__ ), array(), false, true);
|
2868 |
|
@@ -3108,7 +3108,7 @@ class PspSettings {
|
|
3108 |
//wp_enqueue_media();
|
3109 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array( 'jquery-ui-tabs') );
|
3110 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
3111 |
-
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ), '', '2.1.
|
3112 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
3113 |
|
3114 |
$psp_cm_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
@@ -3350,7 +3350,7 @@ class PspSettings {
|
|
3350 |
//wp_enqueue_media();
|
3351 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array('jquery', 'jquery-ui-tabs' ) );
|
3352 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
3353 |
-
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ), '', '2.1.
|
3354 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
3355 |
|
3356 |
$psp_cm_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
@@ -5095,9 +5095,11 @@ class PspSettings {
|
|
5095 |
|
5096 |
|
5097 |
}
|
5098 |
-
|
|
|
5099 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
5100 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
|
|
5101 |
//screen_icon();
|
5102 |
echo '<h2 class="nav-tab-wrapper">';
|
5103 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
210 |
$psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
|
211 |
if ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages)) {
|
212 |
|
213 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
214 |
|
215 |
}
|
216 |
|
1955 |
wp_enqueue_script( 'psp-bs-toggler-js', plugins_url( '/js/pspbstoggler.js', __FILE__ ) );
|
1956 |
wp_enqueue_style("'psp-bs-toggler-css", plugins_url( '/css/psp-bs-toggle.css', __FILE__ ));
|
1957 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
1958 |
+
//wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
1959 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
1960 |
|
1961 |
}
|
2862 |
wp_enqueue_media();
|
2863 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array( 'jquery-ui-tabs') );
|
2864 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
2865 |
+
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ),'', '2.1.7');
|
2866 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
2867 |
//wp_enqueue_script( 'psp-cm', plugins_url( '/js/cm.js', __FILE__ ), array(), false, true);
|
2868 |
|
3108 |
//wp_enqueue_media();
|
3109 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array( 'jquery-ui-tabs') );
|
3110 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
3111 |
+
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ), '', '2.1.7');
|
3112 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
3113 |
|
3114 |
$psp_cm_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
3350 |
//wp_enqueue_media();
|
3351 |
wp_enqueue_script( 'psp-meta-box', plugins_url( '/js/pspmetabox.js', __FILE__ ), array('jquery', 'jquery-ui-tabs' ) );
|
3352 |
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
3353 |
+
wp_enqueue_script( 'psp-meta-box-snippet', plugins_url( '/js/snippetpreview.js', __FILE__ ), '', '2.1.7');
|
3354 |
//wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
3355 |
|
3356 |
$psp_cm_json_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'json', 'codemirror'=> array('autoRefresh' => true)));
|
5095 |
|
5096 |
|
5097 |
}
|
5098 |
+
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
5099 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
5100 |
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
5101 |
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
5102 |
+
|
5103 |
//screen_icon();
|
5104 |
echo '<h2 class="nav-tab-wrapper">';
|
5105 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
psp-include/settings/psp_social_settings.php
CHANGED
@@ -43,7 +43,7 @@ class PspSocialSettings extends PspSettings {
|
|
43 |
|
44 |
$tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
45 |
|
46 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
47 |
|
48 |
$this->register_social_settings();
|
49 |
//$this->register_social_share_settings();
|
@@ -66,7 +66,8 @@ class PspSocialSettings extends PspSettings {
|
|
66 |
wp_enqueue_media();
|
67 |
|
68 |
}
|
69 |
-
wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
|
|
70 |
wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
71 |
|
72 |
register_setting( $this->psp_social_settings_group, $psp_settings_name,array( &$this, 'sanitize_social_settings' ) );
|
@@ -472,8 +473,10 @@ class PspSocialSettings extends PspSettings {
|
|
472 |
function psp_social_tabs() {
|
473 |
$current_tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
474 |
//$current_tab = $active_tab;
|
475 |
-
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
476 |
-
wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
|
|
|
|
477 |
//screen_icon();
|
478 |
echo '<h2 class="nav-tab-wrapper">';
|
479 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
43 |
|
44 |
$tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
45 |
|
46 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
47 |
|
48 |
$this->register_social_settings();
|
49 |
//$this->register_social_share_settings();
|
66 |
wp_enqueue_media();
|
67 |
|
68 |
}
|
69 |
+
//wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ) );
|
70 |
+
wp_enqueue_script( 'psp-image-uploader', plugins_url( '/js/pspmediauploader.js', __FILE__ ), array( 'jquery' ), '2.1.7' );
|
71 |
wp_enqueue_script( 'psp-social', plugins_url( '/js/pspsocialhandler.js', __FILE__ ), array( 'jquery' ) );
|
72 |
|
73 |
register_setting( $this->psp_social_settings_group, $psp_settings_name,array( &$this, 'sanitize_social_settings' ) );
|
473 |
function psp_social_tabs() {
|
474 |
$current_tab = isset( $_GET['pspsocial'] ) ? Sanitize_key($_GET['pspsocial']) : $this->psp_social_settings_group;
|
475 |
//$current_tab = $active_tab;
|
476 |
+
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
477 |
+
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
478 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
479 |
+
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
480 |
//screen_icon();
|
481 |
echo '<h2 class="nav-tab-wrapper">';
|
482 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
psp-include/settings/psp_tools_settings.php
CHANGED
@@ -63,7 +63,7 @@ class PspToolSettings extends PspSettings {
|
|
63 |
|
64 |
$tab = isset( $_GET['psptools'] ) ? sanitize_key($_GET['psptools']) : $this->psp_ga_settings_group;
|
65 |
|
66 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
67 |
|
68 |
$this->robotstxt_file = get_home_path() . 'robots.txt';
|
69 |
$this->htaccess_file = get_home_path() . '.htaccess';
|
@@ -182,7 +182,7 @@ class PspToolSettings extends PspSettings {
|
|
182 |
'option_name' => $psp_robotstxt_settings_name.'[use_virtual_robots_file]',
|
183 |
'option_value' => $use_virtual_robots_file,
|
184 |
'checkbox_label' => esc_html__( 'Yes, use a virtual robots.txt file', 'platinum-seo-pack' ),
|
185 |
-
'option_description' => esc_html__( '
|
186 |
);
|
187 |
|
188 |
//$virtual_robots_field_id = 'psp_'.$setting_name.'_use_virtual_robots_file';
|
@@ -205,7 +205,7 @@ class PspToolSettings extends PspSettings {
|
|
205 |
$robotstxt_content = esc_textarea( $content );
|
206 |
//$psp_robotstxt_settings['content'] = esc_textarea( $content );
|
207 |
fclose( $robotstxt_file_handle );
|
208 |
-
}
|
209 |
|
210 |
$option_description = "";
|
211 |
if ( ! is_writable( $robotstxt_file ) ) {
|
@@ -213,7 +213,7 @@ class PspToolSettings extends PspSettings {
|
|
213 |
$option_description = esc_html__( 'Robots.txt file exists in the root but it is not writeable. Make sure that it is writeable for you to write into it here.', 'platinum-seo-pack' );
|
214 |
}
|
215 |
|
216 |
-
|
217 |
|
218 |
$content_field = array (
|
219 |
'label_for' => 'psp_robotstxt_content',
|
@@ -227,18 +227,49 @@ class PspToolSettings extends PspSettings {
|
|
227 |
|
228 |
}
|
229 |
|
230 |
-
function sanitize_robotstxt_settings($settings) {
|
231 |
|
|
|
232 |
if ( isset( $settings['use_virtual_robots_file'] ) ) {
|
233 |
-
$settings['use_virtual_robots_file'] = !is_null(filter_var($settings['use_virtual_robots_file'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_virtual_robots_file'] : '';
|
|
|
234 |
}
|
235 |
|
236 |
if( isset( $settings['content'] ) ) $settings['content'] = sanitize_textarea_field( $settings['content'] );
|
237 |
|
|
|
|
|
|
|
238 |
return $settings;
|
239 |
}
|
240 |
|
241 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$robotstxt_file = $this->robotstxt_file; //;
|
243 |
if ( ! file_exists( $robotstxt_file ) ) {
|
244 |
echo '<p style="color: orange">'.esc_html__('A physical robots.txt file does not exist in the root.', 'platinum-seo-pack') . '</p>';
|
@@ -374,15 +405,38 @@ class PspToolSettings extends PspSettings {
|
|
374 |
|
375 |
}
|
376 |
|
377 |
-
function sanitize_htaccess_settings($settings) {
|
378 |
|
379 |
if( isset( $settings['content'] ) ) $settings['content'] = sanitize_textarea_field( wp_slash(htmlentities($settings['content'])) );
|
380 |
|
|
|
|
|
|
|
|
|
381 |
return $settings;
|
382 |
}
|
383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
//function section_htaccess_desc() {echo ''; }
|
385 |
-
function section_htaccess_desc() {
|
386 |
$htaccess_file = $this->htaccess_file; //;
|
387 |
if ( ! file_exists( $htaccess_file ) ) {
|
388 |
echo '<p style="color: orange">'.esc_html__('A .htaccess file does not exist in the root! Ensure that you have not accidentally deleted it!', 'platinum-seo-pack') . '</p>';
|
@@ -460,69 +514,7 @@ class PspToolSettings extends PspSettings {
|
|
460 |
$psp_cm_ga_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/javascript', 'codemirror'=> array('autoRefresh' => true)));
|
461 |
wp_localize_script('psp-meta-box', 'psp_cm_ga_settings', $psp_cm_ga_settings);
|
462 |
wp_enqueue_script( 'psp-cmjs', plugins_url( '/js/cmjs.js', __FILE__ ),array( 'jquery' ), false, true);
|
463 |
-
}
|
464 |
-
//if ( isset( $_POST['submitrobotstxt'] ) ) {
|
465 |
-
if((isset($_GET['settings-updated']) && true == sanitize_key($_GET['settings-updated'])) && ($tab == $this->psp_robots_settings_group )){
|
466 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
467 |
-
die( esc_html__( 'You cannot edit the robots.txt file.', 'platinum-seo-pack' ) );
|
468 |
-
}
|
469 |
-
|
470 |
-
//check_admin_referer( 'psp-robotstxt' );
|
471 |
-
$psp_settings = get_option("psp_robotstxt_settings");
|
472 |
-
$use_virtual_robots_file = isset($psp_settings['use_virtual_robots_file']) ? esc_attr($psp_settings['use_virtual_robots_file']) : '';
|
473 |
-
$robotscontent = isset($psp_settings['content']) ? stripcslashes( esc_textarea($psp_settings['content'] )) : '';
|
474 |
-
|
475 |
-
$robotstxt_file = $this->robotstxt_file; //;
|
476 |
-
|
477 |
-
if (!$use_virtual_robots_file) {
|
478 |
-
|
479 |
-
if (empty($robotscontent)) {
|
480 |
-
$robotscontent = $this->getDefaultRobots();
|
481 |
-
}
|
482 |
-
|
483 |
-
if ( file_exists( $robotstxt_file )) {
|
484 |
-
|
485 |
-
if ( is_writable( $robotstxt_file ) ) {
|
486 |
-
$robotstxt_filehandle = fopen( $robotstxt_file, 'w+' );
|
487 |
-
fwrite( $robotstxt_filehandle, $robotscontent );
|
488 |
-
fclose( $robotstxt_filehandle );
|
489 |
-
$msg = esc_html__( 'Updated Robots.txt', 'platinum-seo-pack' );
|
490 |
-
}
|
491 |
-
} else {
|
492 |
-
if ( is_writable( get_home_path() ) ) {
|
493 |
-
$robotstxt_filehandle = fopen( $robotstxt_file, 'x' );
|
494 |
-
fwrite( $robotstxt_filehandle, $robotscontent );
|
495 |
-
fclose( $robotstxt_filehandle );
|
496 |
-
$msg = esc_html__( 'Created Robots.txt', 'platinum-seo-pack' );
|
497 |
-
}
|
498 |
-
}
|
499 |
-
}
|
500 |
-
}
|
501 |
-
|
502 |
-
//if ( isset( $_POST['submithtaccess'] ) ) {
|
503 |
-
if((isset($_GET['settings-updated']) && true == sanitize_key($_GET['settings-updated'])) && ($tab == $this->psp_htaccess_settings_group )){
|
504 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
505 |
-
die( esc_html__( 'You cannot edit the .htaccess file.', 'platinum-seo-pack' ) );
|
506 |
-
}
|
507 |
-
|
508 |
-
$psp_htaccess_settings = get_option("psp_htaccess_settings");
|
509 |
-
$htaccesscontent = isset($psp_htaccess_settings['content']) ? stripcslashes( html_entity_decode($psp_htaccess_settings['content']) ) : '';
|
510 |
-
|
511 |
-
$htaccess_file = $this->htaccess_file; //;
|
512 |
-
|
513 |
-
if ( file_exists( $htaccess_file )) {
|
514 |
-
|
515 |
-
if ( is_writable( $htaccess_file ) ) {
|
516 |
-
$htaccess_filehandle = fopen( $htaccess_file, 'w+' );
|
517 |
-
fwrite( $htaccess_filehandle, $htaccesscontent );
|
518 |
-
fclose( $htaccess_filehandle );
|
519 |
-
$msg = esc_html__( 'Updated .htaccess file', 'platinum-seo-pack' );
|
520 |
-
}
|
521 |
-
} else {
|
522 |
-
//do nothing.
|
523 |
-
}
|
524 |
-
|
525 |
-
}
|
526 |
?>
|
527 |
<div class="wrap">
|
528 |
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Pack Tools', 'platinum-seo-pack') ?></h1>
|
@@ -559,8 +551,10 @@ class PspToolSettings extends PspSettings {
|
|
559 |
function psp_tools_tabs() {
|
560 |
$current_tab = isset( $_GET['psptools'] ) ? sanitize_key($_GET['psptools']) : $this->psp_ga_settings_group;
|
561 |
//$current_tab = $active_tab;
|
562 |
-
wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
563 |
-
wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
|
|
|
|
564 |
//screen_icon();
|
565 |
echo '<h2 class="nav-tab-wrapper">';
|
566 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
63 |
|
64 |
$tab = isset( $_GET['psptools'] ) ? sanitize_key($_GET['psptools']) : $this->psp_ga_settings_group;
|
65 |
|
66 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
67 |
|
68 |
$this->robotstxt_file = get_home_path() . 'robots.txt';
|
69 |
$this->htaccess_file = get_home_path() . '.htaccess';
|
182 |
'option_name' => $psp_robotstxt_settings_name.'[use_virtual_robots_file]',
|
183 |
'option_value' => $use_virtual_robots_file,
|
184 |
'checkbox_label' => esc_html__( 'Yes, use a virtual robots.txt file', 'platinum-seo-pack' ),
|
185 |
+
'option_description' => esc_html__( 'If you do not have a physical robots.txt file in the root folder, a virtual robots.txt file with content as shown below will be displayed at your site URL folder. Make sure that you add the path to your site\'s sitemap.xml, if one doesn\'t exist in the content of the virtual sitemap shown below. If you try to save this without checking this option, a physical robots.txt file will be created in your root folder, provided the folder is writable. Checking this will not create a physical robots.txt file but the virtual robots.txt file with content as shown below will be retained and displayed.', 'platinum-seo-pack' ),
|
186 |
);
|
187 |
|
188 |
//$virtual_robots_field_id = 'psp_'.$setting_name.'_use_virtual_robots_file';
|
205 |
$robotstxt_content = esc_textarea( $content );
|
206 |
//$psp_robotstxt_settings['content'] = esc_textarea( $content );
|
207 |
fclose( $robotstxt_file_handle );
|
208 |
+
//}
|
209 |
|
210 |
$option_description = "";
|
211 |
if ( ! is_writable( $robotstxt_file ) ) {
|
213 |
$option_description = esc_html__( 'Robots.txt file exists in the root but it is not writeable. Make sure that it is writeable for you to write into it here.', 'platinum-seo-pack' );
|
214 |
}
|
215 |
|
216 |
+
}
|
217 |
|
218 |
$content_field = array (
|
219 |
'label_for' => 'psp_robotstxt_content',
|
227 |
|
228 |
}
|
229 |
|
230 |
+
public function sanitize_robotstxt_settings($settings) {
|
231 |
|
232 |
+
$use_virtual_robots_file = '';
|
233 |
if ( isset( $settings['use_virtual_robots_file'] ) ) {
|
234 |
+
$settings['use_virtual_robots_file'] = !is_null(filter_var($settings['use_virtual_robots_file'],FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE)) ? $settings['use_virtual_robots_file'] : '';
|
235 |
+
$use_virtual_robots_file = $settings['use_virtual_robots_file'];
|
236 |
}
|
237 |
|
238 |
if( isset( $settings['content'] ) ) $settings['content'] = sanitize_textarea_field( $settings['content'] );
|
239 |
|
240 |
+
if( !empty( $settings['content'] ) ) {
|
241 |
+
$this->psp_update_robots_txt($use_virtual_robots_file, $settings['content']);
|
242 |
+
}
|
243 |
return $settings;
|
244 |
}
|
245 |
|
246 |
+
private function psp_update_robots_txt($use_virtual_robots_file = '', $robotscontent) {
|
247 |
+
|
248 |
+
$robotstxt_file = $this->robotstxt_file; //;
|
249 |
+
|
250 |
+
if (!$use_virtual_robots_file) {
|
251 |
+
|
252 |
+
if ( file_exists( $robotstxt_file )) {
|
253 |
+
|
254 |
+
if ( is_writable( $robotstxt_file ) ) {
|
255 |
+
$robotstxt_filehandle = fopen( $robotstxt_file, 'w+' );
|
256 |
+
fwrite( $robotstxt_filehandle, $robotscontent );
|
257 |
+
fclose( $robotstxt_filehandle );
|
258 |
+
$msg = esc_html__( 'Updated Robots.txt', 'platinum-seo-pack' );
|
259 |
+
}
|
260 |
+
} else {
|
261 |
+
if ( is_writable( get_home_path() ) ) {
|
262 |
+
$robotstxt_filehandle = fopen( $robotstxt_file, 'x' );
|
263 |
+
fwrite( $robotstxt_filehandle, $robotscontent );
|
264 |
+
fclose( $robotstxt_filehandle );
|
265 |
+
$msg = esc_html__( 'Created Robots.txt', 'platinum-seo-pack' );
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
}
|
271 |
+
|
272 |
+
public function section_robotstxt_desc() {
|
273 |
$robotstxt_file = $this->robotstxt_file; //;
|
274 |
if ( ! file_exists( $robotstxt_file ) ) {
|
275 |
echo '<p style="color: orange">'.esc_html__('A physical robots.txt file does not exist in the root.', 'platinum-seo-pack') . '</p>';
|
405 |
|
406 |
}
|
407 |
|
408 |
+
public function sanitize_htaccess_settings($settings) {
|
409 |
|
410 |
if( isset( $settings['content'] ) ) $settings['content'] = sanitize_textarea_field( wp_slash(htmlentities($settings['content'])) );
|
411 |
|
412 |
+
if( !empty( $settings['content'] ) ) {
|
413 |
+
$this->psp_update_htaccess( $settings['content'] );
|
414 |
+
}
|
415 |
+
|
416 |
return $settings;
|
417 |
}
|
418 |
|
419 |
+
private function psp_update_htaccess( $htaccesscontent ) {
|
420 |
+
|
421 |
+
$htaccess_file = $this->htaccess_file; //;
|
422 |
+
|
423 |
+
$htaccessfilecontent = !empty($htaccesscontent) ? stripcslashes( html_entity_decode($htaccesscontent) ) : '';
|
424 |
+
|
425 |
+
if ( file_exists( $htaccess_file ) && !empty($htaccessfilecontent) ) {
|
426 |
+
|
427 |
+
if ( is_writable( $htaccess_file ) ) {
|
428 |
+
$htaccess_filehandle = fopen( $htaccess_file, 'w+' );
|
429 |
+
fwrite( $htaccess_filehandle, $htaccessfilecontent );
|
430 |
+
fclose( $htaccess_filehandle );
|
431 |
+
$msg = esc_html__( 'Updated .htaccess file', 'platinum-seo-pack' );
|
432 |
+
}
|
433 |
+
} else {
|
434 |
+
//do nothing.
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
//function section_htaccess_desc() {echo ''; }
|
439 |
+
public function section_htaccess_desc() {
|
440 |
$htaccess_file = $this->htaccess_file; //;
|
441 |
if ( ! file_exists( $htaccess_file ) ) {
|
442 |
echo '<p style="color: orange">'.esc_html__('A .htaccess file does not exist in the root! Ensure that you have not accidentally deleted it!', 'platinum-seo-pack') . '</p>';
|
514 |
$psp_cm_ga_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/javascript', 'codemirror'=> array('autoRefresh' => true)));
|
515 |
wp_localize_script('psp-meta-box', 'psp_cm_ga_settings', $psp_cm_ga_settings);
|
516 |
wp_enqueue_script( 'psp-cmjs', plugins_url( '/js/cmjs.js', __FILE__ ),array( 'jquery' ), false, true);
|
517 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
?>
|
519 |
<div class="wrap">
|
520 |
<h1 style='line-height:30px;'><?php esc_html_e('Techblissonline Platinum SEO Pack Tools', 'platinum-seo-pack') ?></h1>
|
551 |
function psp_tools_tabs() {
|
552 |
$current_tab = isset( $_GET['psptools'] ) ? sanitize_key($_GET['psptools']) : $this->psp_ga_settings_group;
|
553 |
//$current_tab = $active_tab;
|
554 |
+
//wp_enqueue_style("psp-settings-bs-css", plugins_url( '/css/psp-settings-bs.css', __FILE__ ));
|
555 |
+
//wp_enqueue_style("psp-htmlsettings-css", plugins_url( '/css/psp-html-settings.css', __FILE__ ));
|
556 |
+
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
557 |
+
wp_enqueue_style("psp-settings-bswide-css", plugins_url( '/css/psp-settings-bswide.css', __FILE__ ));
|
558 |
//screen_icon();
|
559 |
echo '<h2 class="nav-tab-wrapper">';
|
560 |
foreach ( $this->psp_settings_tabs as $tab_key => $tab_caption ) {
|
psp-include/sitemap/inc/class-wp-sitemaps-index.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Generates the sitemap index.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
-
* Class
|
14 |
* Builds the sitemap index page that lists the links to all of the sitemaps.
|
15 |
*
|
16 |
* @since 5.5.0
|
17 |
*/
|
18 |
-
class
|
19 |
|
20 |
/**
|
21 |
* The main registry of supported sitemaps.
|
22 |
*
|
23 |
* @since 5.5.0
|
24 |
-
* @var
|
25 |
*/
|
26 |
protected $registry;
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
*
|
31 |
* @since 5.5.0
|
32 |
*
|
33 |
-
* @param
|
34 |
*/
|
35 |
-
public function __construct(
|
36 |
$this->registry = $registry;
|
37 |
}
|
38 |
|
@@ -47,7 +47,7 @@ class WP_Sitemaps_Index {
|
|
47 |
$sitemaps = array();
|
48 |
|
49 |
$providers = $this->registry->get_sitemaps();
|
50 |
-
/* @var
|
51 |
foreach ( $providers as $provider ) {
|
52 |
$sitemap_entries = $provider->get_sitemap_entries();
|
53 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Index class.
|
4 |
*
|
5 |
* Generates the sitemap index.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
+
* Class PSP_Sitemaps_Index.
|
14 |
* Builds the sitemap index page that lists the links to all of the sitemaps.
|
15 |
*
|
16 |
* @since 5.5.0
|
17 |
*/
|
18 |
+
class PSP_Sitemaps_Index {
|
19 |
|
20 |
/**
|
21 |
* The main registry of supported sitemaps.
|
22 |
*
|
23 |
* @since 5.5.0
|
24 |
+
* @var PSP_Sitemaps_Registry
|
25 |
*/
|
26 |
protected $registry;
|
27 |
|
28 |
/**
|
29 |
+
* PSP_Sitemaps_Index constructor.
|
30 |
*
|
31 |
* @since 5.5.0
|
32 |
*
|
33 |
+
* @param PSP_Sitemaps_Registry $registry Sitemap provider registry.
|
34 |
*/
|
35 |
+
public function __construct( PSP_Sitemaps_Registry $registry ) {
|
36 |
$this->registry = $registry;
|
37 |
}
|
38 |
|
47 |
$sitemaps = array();
|
48 |
|
49 |
$providers = $this->registry->get_sitemaps();
|
50 |
+
/* @var PSP_Sitemaps_Provider $provider */
|
51 |
foreach ( $providers as $provider ) {
|
52 |
$sitemap_entries = $provider->get_sitemap_entries();
|
53 |
|
psp-include/sitemap/inc/class-wp-sitemaps-provider.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* This class is a base class for other sitemap providers to extend and contains shared functionality.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
-
* Class
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
abstract class
|
18 |
|
19 |
/**
|
20 |
* Provider name.
|
@@ -123,7 +123,7 @@ abstract class WP_Sitemaps_Provider {
|
|
123 |
* Empty string if the object type does not support subtypes.
|
124 |
* @param string $page Page of results.
|
125 |
*/
|
126 |
-
$sitemap_entry = apply_filters( '
|
127 |
|
128 |
$sitemaps[] = $sitemap_entry;
|
129 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Provider class
|
4 |
*
|
5 |
* This class is a base class for other sitemap providers to extend and contains shared functionality.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
+
* Class PSP_Sitemaps_Provider.
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
abstract class PSP_Sitemaps_Provider {
|
18 |
|
19 |
/**
|
20 |
* Provider name.
|
123 |
* Empty string if the object type does not support subtypes.
|
124 |
* @param string $page Page of results.
|
125 |
*/
|
126 |
+
$sitemap_entry = apply_filters( 'psp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );
|
127 |
|
128 |
$sitemaps[] = $sitemap_entry;
|
129 |
}
|
psp-include/sitemap/inc/class-wp-sitemaps-registry.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Handles registering sitemaps.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
-
* Class
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
* Registered sitemaps.
|
20 |
*
|
@@ -30,10 +30,10 @@ class WP_Sitemaps_Registry {
|
|
30 |
* @since 5.5.0
|
31 |
*
|
32 |
* @param string $name Name of the sitemap.
|
33 |
-
* @param
|
34 |
* @return bool True if the sitemap was added, false if it is already registered.
|
35 |
*/
|
36 |
-
public function add_sitemap( $name,
|
37 |
if ( isset( $this->sitemaps[ $name ] ) ) {
|
38 |
return false;
|
39 |
}
|
@@ -49,7 +49,7 @@ class WP_Sitemaps_Registry {
|
|
49 |
* @since 5.5.0
|
50 |
*
|
51 |
* @param string $name Sitemap provider name.
|
52 |
-
* @return
|
53 |
*/
|
54 |
public function get_sitemap( $name ) {
|
55 |
if ( ! isset( $this->sitemaps[ $name ] ) ) {
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Registry class
|
4 |
*
|
5 |
* Handles registering sitemaps.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
+
* Class PSP_Sitemaps_Registry.
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Registry {
|
18 |
/**
|
19 |
* Registered sitemaps.
|
20 |
*
|
30 |
* @since 5.5.0
|
31 |
*
|
32 |
* @param string $name Name of the sitemap.
|
33 |
+
* @param PSP_Sitemaps_Provider $provider Instance of a PSP_Sitemaps_Provider.
|
34 |
* @return bool True if the sitemap was added, false if it is already registered.
|
35 |
*/
|
36 |
+
public function add_sitemap( $name, PSP_Sitemaps_Provider $provider ) {
|
37 |
if ( isset( $this->sitemaps[ $name ] ) ) {
|
38 |
return false;
|
39 |
}
|
49 |
* @since 5.5.0
|
50 |
*
|
51 |
* @param string $name Sitemap provider name.
|
52 |
+
* @return PSP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise.
|
53 |
*/
|
54 |
public function get_sitemap( $name ) {
|
55 |
if ( ! isset( $this->sitemaps[ $name ] ) ) {
|
psp-include/sitemap/inc/class-wp-sitemaps-renderer.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Responsible for rendering Sitemaps data to XML in accordance with sitemap protocol.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
-
* Class
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
* XSL stylesheet for styling a sitemap for web browsers.
|
20 |
*
|
@@ -34,7 +34,7 @@ class WP_Sitemaps_Renderer {
|
|
34 |
protected $stylesheet_index = '';
|
35 |
|
36 |
/**
|
37 |
-
*
|
38 |
*
|
39 |
* @since 5.5.0
|
40 |
*/
|
@@ -76,7 +76,7 @@ class WP_Sitemaps_Renderer {
|
|
76 |
*
|
77 |
* @param string $sitemap_url Full URL for the sitemaps xsl file.
|
78 |
*/
|
79 |
-
return apply_filters( '
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -106,7 +106,7 @@ class WP_Sitemaps_Renderer {
|
|
106 |
*
|
107 |
* @param string $sitemap_url Full URL for the sitemaps index xsl file.
|
108 |
*/
|
109 |
-
return apply_filters( '
|
110 |
}
|
111 |
|
112 |
/**
|
@@ -145,7 +145,7 @@ class WP_Sitemaps_Renderer {
|
|
145 |
*/
|
146 |
public function get_sitemap_index_xml( $sitemaps ) {
|
147 |
$index_xml = "";
|
148 |
-
$index_xml = apply_filters( "
|
149 |
|
150 |
if (!empty($index_xml) ) {
|
151 |
|
@@ -224,7 +224,7 @@ class WP_Sitemaps_Renderer {
|
|
224 |
public function get_sitemap_xml( $url_list, $object_type, $object_subtype ) {
|
225 |
|
226 |
$sitemap_xml = "";
|
227 |
-
$sitemap_xml = apply_filters( "
|
228 |
|
229 |
if ( !empty($sitemap_xml) ) {
|
230 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Renderer class
|
4 |
*
|
5 |
* Responsible for rendering Sitemaps data to XML in accordance with sitemap protocol.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
+
* Class PSP_Sitemaps_Renderer
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Renderer {
|
18 |
/**
|
19 |
* XSL stylesheet for styling a sitemap for web browsers.
|
20 |
*
|
34 |
protected $stylesheet_index = '';
|
35 |
|
36 |
/**
|
37 |
+
* PSP_Sitemaps_Renderer constructor.
|
38 |
*
|
39 |
* @since 5.5.0
|
40 |
*/
|
76 |
*
|
77 |
* @param string $sitemap_url Full URL for the sitemaps xsl file.
|
78 |
*/
|
79 |
+
return apply_filters( 'psp_sitemaps_stylesheet_url', $sitemap_url );
|
80 |
}
|
81 |
|
82 |
/**
|
106 |
*
|
107 |
* @param string $sitemap_url Full URL for the sitemaps index xsl file.
|
108 |
*/
|
109 |
+
return apply_filters( 'psp_sitemaps_stylesheet_index_url', $sitemap_url );
|
110 |
}
|
111 |
|
112 |
/**
|
145 |
*/
|
146 |
public function get_sitemap_index_xml( $sitemaps ) {
|
147 |
$index_xml = "";
|
148 |
+
$index_xml = apply_filters( "psp_sitemaps_get_sitemap_index_xml", $index_xml, $sitemaps );
|
149 |
|
150 |
if (!empty($index_xml) ) {
|
151 |
|
224 |
public function get_sitemap_xml( $url_list, $object_type, $object_subtype ) {
|
225 |
|
226 |
$sitemap_xml = "";
|
227 |
+
$sitemap_xml = apply_filters( "psp_sitemaps_get_sitemap_xml", $sitemap_xml, $url_list, $object_type, $object_subtype );
|
228 |
|
229 |
if ( !empty($sitemap_xml) ) {
|
230 |
|
psp-include/sitemap/inc/class-wp-sitemaps-stylesheet.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* This class provides the XSL stylesheets to style all sitemaps.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
@@ -14,7 +14,7 @@
|
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
* Renders the xsl stylesheet depending on whether its the sitemap index or not.
|
20 |
*
|
@@ -143,7 +143,7 @@ XSL;
|
|
143 |
*
|
144 |
* @param string $xsl Full content for the xml stylesheet.
|
145 |
*/
|
146 |
-
return apply_filters( '
|
147 |
}
|
148 |
|
149 |
/**
|
@@ -237,7 +237,7 @@ XSL;
|
|
237 |
*
|
238 |
* @param string $xsl Full content for the xml stylesheet.
|
239 |
*/
|
240 |
-
return apply_filters( '
|
241 |
}
|
242 |
|
243 |
/**
|
@@ -283,6 +283,6 @@ XSL;
|
|
283 |
*
|
284 |
* @param string $css CSS to be applied to default xsl file.
|
285 |
*/
|
286 |
-
return apply_filters( '
|
287 |
}
|
288 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Stylesheet class
|
4 |
*
|
5 |
* This class provides the XSL stylesheets to style all sitemaps.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Stylesheet {
|
18 |
/**
|
19 |
* Renders the xsl stylesheet depending on whether its the sitemap index or not.
|
20 |
*
|
143 |
*
|
144 |
* @param string $xsl Full content for the xml stylesheet.
|
145 |
*/
|
146 |
+
return apply_filters( 'psp_sitemaps_stylesheet_content', $xsl_content );
|
147 |
}
|
148 |
|
149 |
/**
|
237 |
*
|
238 |
* @param string $xsl Full content for the xml stylesheet.
|
239 |
*/
|
240 |
+
return apply_filters( 'psp_sitemaps_stylesheet_index_content', $xsl_content );
|
241 |
}
|
242 |
|
243 |
/**
|
283 |
*
|
284 |
* @param string $css CSS to be applied to default xsl file.
|
285 |
*/
|
286 |
+
return apply_filters( 'psp_sitemaps_stylesheet_css', $css );
|
287 |
}
|
288 |
}
|
psp-include/sitemap/inc/class-wp-sitemaps.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* This is the main class integrating all other classes.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
-
* Class
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
* The main index of supported sitemaps.
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*
|
23 |
-
* @var
|
24 |
*/
|
25 |
public $index;
|
26 |
|
@@ -29,7 +29,7 @@ class WP_Sitemaps {
|
|
29 |
*
|
30 |
* @since 5.5.0
|
31 |
*
|
32 |
-
* @var
|
33 |
*/
|
34 |
public $registry;
|
35 |
|
@@ -38,19 +38,19 @@ class WP_Sitemaps {
|
|
38 |
*
|
39 |
* @since 5.5.0
|
40 |
*
|
41 |
-
* @var
|
42 |
*/
|
43 |
public $renderer;
|
44 |
|
45 |
/**
|
46 |
-
*
|
47 |
*
|
48 |
* @since 5.5.0
|
49 |
*/
|
50 |
public function __construct() {
|
51 |
-
$this->registry = new
|
52 |
-
$this->renderer = new
|
53 |
-
$this->index = new
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -60,10 +60,11 @@ class WP_Sitemaps {
|
|
60 |
*/
|
61 |
public function init() {
|
62 |
// These will all fire on the init hook.
|
|
|
63 |
$this->register_sitemaps();
|
64 |
|
65 |
// Add additional action callbacks.
|
66 |
-
add_action( '
|
67 |
add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
|
68 |
add_action( 'wp_loaded', array( $this, 'maybe_flush_rewrites' ) );
|
69 |
add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
|
@@ -83,24 +84,24 @@ class WP_Sitemaps {
|
|
83 |
* @since 5.5.0
|
84 |
*
|
85 |
* @param array $providers {
|
86 |
-
* Array of
|
87 |
*
|
88 |
-
* @type object $posts The
|
89 |
-
* @type object $taxonomies The
|
90 |
-
* @type object $users The
|
91 |
* }
|
92 |
*/
|
93 |
$providers = apply_filters(
|
94 |
-
'
|
95 |
array(
|
96 |
-
'posts' => new
|
97 |
-
'taxonomies' => new
|
98 |
-
'users' => new
|
99 |
)
|
100 |
);
|
101 |
|
102 |
// Register each supported provider.
|
103 |
-
/* @var
|
104 |
foreach ( $providers as $name => $provider ) {
|
105 |
$this->registry->add_sitemap( $name, $provider );
|
106 |
}
|
@@ -189,7 +190,7 @@ class WP_Sitemaps {
|
|
189 |
|
190 |
// Render stylesheet if this is stylesheet route.
|
191 |
if ( $stylesheet_type ) {
|
192 |
-
$stylesheet = new
|
193 |
|
194 |
$stylesheet->render_stylesheet( $stylesheet_type );
|
195 |
exit;
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps class
|
4 |
*
|
5 |
* This is the main class integrating all other classes.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
+
* Class PSP_Sitemaps.
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps {
|
18 |
/**
|
19 |
* The main index of supported sitemaps.
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*
|
23 |
+
* @var PSP_Sitemaps_Index
|
24 |
*/
|
25 |
public $index;
|
26 |
|
29 |
*
|
30 |
* @since 5.5.0
|
31 |
*
|
32 |
+
* @var PSP_Sitemaps_Registry
|
33 |
*/
|
34 |
public $registry;
|
35 |
|
38 |
*
|
39 |
* @since 5.5.0
|
40 |
*
|
41 |
+
* @var PSP_Sitemaps_Renderer
|
42 |
*/
|
43 |
public $renderer;
|
44 |
|
45 |
/**
|
46 |
+
* PSP_Sitemaps constructor.
|
47 |
*
|
48 |
* @since 5.5.0
|
49 |
*/
|
50 |
public function __construct() {
|
51 |
+
$this->registry = new PSP_Sitemaps_Registry();
|
52 |
+
$this->renderer = new PSP_Sitemaps_Renderer();
|
53 |
+
$this->index = new PSP_Sitemaps_Index( $this->registry );
|
54 |
}
|
55 |
|
56 |
/**
|
60 |
*/
|
61 |
public function init() {
|
62 |
// These will all fire on the init hook.
|
63 |
+
$this->register_rewrites();
|
64 |
$this->register_sitemaps();
|
65 |
|
66 |
// Add additional action callbacks.
|
67 |
+
//add_action( 'psp_sitemaps_init', array( $this, 'register_rewrites' ) );
|
68 |
add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
|
69 |
add_action( 'wp_loaded', array( $this, 'maybe_flush_rewrites' ) );
|
70 |
add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
|
84 |
* @since 5.5.0
|
85 |
*
|
86 |
* @param array $providers {
|
87 |
+
* Array of PSP_Sitemaps_Provider objects keyed by their name.
|
88 |
*
|
89 |
+
* @type object $posts The PSP_Sitemaps_Posts object.
|
90 |
+
* @type object $taxonomies The PSP_Sitemaps_Taxonomies object.
|
91 |
+
* @type object $users The PSP_Sitemaps_Users object.
|
92 |
* }
|
93 |
*/
|
94 |
$providers = apply_filters(
|
95 |
+
'psp_sitemaps_register_providers',
|
96 |
array(
|
97 |
+
'posts' => new PSP_Sitemaps_Posts(),
|
98 |
+
'taxonomies' => new PSP_Sitemaps_Taxonomies(),
|
99 |
+
'users' => new PSP_Sitemaps_Users(),
|
100 |
)
|
101 |
);
|
102 |
|
103 |
// Register each supported provider.
|
104 |
+
/* @var PSP_Sitemaps_Provider $provider */
|
105 |
foreach ( $providers as $name => $provider ) {
|
106 |
$this->registry->add_sitemap( $name, $provider );
|
107 |
}
|
190 |
|
191 |
// Render stylesheet if this is stylesheet route.
|
192 |
if ( $stylesheet_type ) {
|
193 |
+
$stylesheet = new PSP_Sitemaps_Stylesheet();
|
194 |
|
195 |
$stylesheet->render_stylesheet( $stylesheet_type );
|
196 |
exit;
|
psp-include/sitemap/inc/functions.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* This file contains a variety of public functions developers can use to interact with
|
6 |
* the XML Sitemaps API.
|
7 |
*
|
8 |
-
* @package WordPress
|
9 |
* @subpackage Sitemaps
|
10 |
* @since 5.5.0
|
11 |
*/
|
@@ -15,9 +15,9 @@
|
|
15 |
*
|
16 |
* @since 5.5.0
|
17 |
*
|
18 |
-
* @return
|
19 |
*/
|
20 |
-
function
|
21 |
/**
|
22 |
* Global Core Sitemaps instance.
|
23 |
*
|
@@ -25,7 +25,7 @@ function wp_sitemaps_get_server() {
|
|
25 |
*
|
26 |
* @var WP_Sitemaps $wp_sitemaps
|
27 |
*/
|
28 |
-
global $
|
29 |
|
30 |
$is_enabled = (bool) get_option( 'blog_public' );
|
31 |
|
@@ -36,16 +36,16 @@ function wp_sitemaps_get_server() {
|
|
36 |
*
|
37 |
* @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults to true for public sites.
|
38 |
*/
|
39 |
-
$is_enabled = (bool) apply_filters( '
|
40 |
|
41 |
if ( ! $is_enabled ) {
|
42 |
return null;
|
43 |
}
|
44 |
|
45 |
// If there isn't a global instance, set and bootstrap the sitemaps system.
|
46 |
-
if ( empty( $
|
47 |
-
$
|
48 |
-
$
|
49 |
|
50 |
/**
|
51 |
* Fires when initializing the Sitemaps object.
|
@@ -54,12 +54,12 @@ function wp_sitemaps_get_server() {
|
|
54 |
*
|
55 |
* @since 5.5.0
|
56 |
*
|
57 |
-
* @param
|
58 |
*/
|
59 |
-
do_action( '
|
60 |
}
|
61 |
|
62 |
-
return $
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -69,8 +69,8 @@ function wp_sitemaps_get_server() {
|
|
69 |
*
|
70 |
* @return array $sitemaps A list of registered sitemap providers.
|
71 |
*/
|
72 |
-
function
|
73 |
-
$sitemaps =
|
74 |
|
75 |
if ( ! $sitemaps ) {
|
76 |
return array();
|
@@ -85,11 +85,11 @@ function wp_get_sitemaps() {
|
|
85 |
* @since 5.5.0
|
86 |
*
|
87 |
* @param string $name Unique name for the sitemap provider.
|
88 |
-
* @param
|
89 |
* @return bool Returns true if the sitemap was added. False on failure.
|
90 |
*/
|
91 |
-
function
|
92 |
-
$sitemaps =
|
93 |
|
94 |
if ( ! $sitemaps ) {
|
95 |
return false;
|
@@ -106,7 +106,7 @@ function wp_register_sitemap( $name, WP_Sitemaps_Provider $provider ) {
|
|
106 |
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
|
107 |
* @return int The maximum number of URLs.
|
108 |
*/
|
109 |
-
function
|
110 |
/**
|
111 |
* Filters the maximum number of URLs displayed on a sitemap.
|
112 |
*
|
@@ -115,7 +115,7 @@ function wp_sitemaps_get_max_urls( $object_type ) {
|
|
115 |
* @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
|
116 |
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
|
117 |
*/
|
118 |
-
return apply_filters( '
|
119 |
}
|
120 |
|
121 |
if ( ! function_exists( 'esc_xml' ) ) :
|
5 |
* This file contains a variety of public functions developers can use to interact with
|
6 |
* the XML Sitemaps API.
|
7 |
*
|
8 |
+
* @package WordPress PlatinumSeo
|
9 |
* @subpackage Sitemaps
|
10 |
* @since 5.5.0
|
11 |
*/
|
15 |
*
|
16 |
* @since 5.5.0
|
17 |
*
|
18 |
+
* @return psp_Sitemaps|null Sitemaps instance, or null if sitemaps are disabled.
|
19 |
*/
|
20 |
+
function psp_sitemaps_get_server() {
|
21 |
/**
|
22 |
* Global Core Sitemaps instance.
|
23 |
*
|
25 |
*
|
26 |
* @var WP_Sitemaps $wp_sitemaps
|
27 |
*/
|
28 |
+
global $psp_sitemaps;
|
29 |
|
30 |
$is_enabled = (bool) get_option( 'blog_public' );
|
31 |
|
36 |
*
|
37 |
* @param bool $is_enabled Whether XML Sitemaps are enabled or not. Defaults to true for public sites.
|
38 |
*/
|
39 |
+
$is_enabled = (bool) apply_filters( 'psp_sitemaps_is_enabled', $is_enabled );
|
40 |
|
41 |
if ( ! $is_enabled ) {
|
42 |
return null;
|
43 |
}
|
44 |
|
45 |
// If there isn't a global instance, set and bootstrap the sitemaps system.
|
46 |
+
if ( empty( $psp_sitemaps ) ) {
|
47 |
+
$psp_sitemaps = new PSP_Sitemaps();
|
48 |
+
$psp_sitemaps->init();
|
49 |
|
50 |
/**
|
51 |
* Fires when initializing the Sitemaps object.
|
54 |
*
|
55 |
* @since 5.5.0
|
56 |
*
|
57 |
+
* @param PSP_Sitemaps $sitemaps Server object.
|
58 |
*/
|
59 |
+
do_action( 'psp_sitemaps_init', $psp_sitemaps );
|
60 |
}
|
61 |
|
62 |
+
return $psp_sitemaps;
|
63 |
}
|
64 |
|
65 |
/**
|
69 |
*
|
70 |
* @return array $sitemaps A list of registered sitemap providers.
|
71 |
*/
|
72 |
+
function psp_get_sitemaps() {
|
73 |
+
$sitemaps = psp_sitemaps_get_server();
|
74 |
|
75 |
if ( ! $sitemaps ) {
|
76 |
return array();
|
85 |
* @since 5.5.0
|
86 |
*
|
87 |
* @param string $name Unique name for the sitemap provider.
|
88 |
+
* @param PSP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap.
|
89 |
* @return bool Returns true if the sitemap was added. False on failure.
|
90 |
*/
|
91 |
+
function psp_register_sitemap( $name, PSP_Sitemaps_Provider $provider ) {
|
92 |
+
$sitemaps = psp_sitemaps_get_server();
|
93 |
|
94 |
if ( ! $sitemaps ) {
|
95 |
return false;
|
106 |
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
|
107 |
* @return int The maximum number of URLs.
|
108 |
*/
|
109 |
+
function psp_sitemaps_get_max_urls( $object_type ) {
|
110 |
/**
|
111 |
* Filters the maximum number of URLs displayed on a sitemap.
|
112 |
*
|
115 |
* @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
|
116 |
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
|
117 |
*/
|
118 |
+
return apply_filters( 'psp_sitemaps_max_urls', WP_SITEMAPS_MAX_URLS, $object_type );
|
119 |
}
|
120 |
|
121 |
if ( ! function_exists( 'esc_xml' ) ) :
|
psp-include/sitemap/inc/providers/class-wp-sitemaps-posts.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Builds the sitemaps for the 'post' object type.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
@@ -14,9 +14,9 @@
|
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
@@ -44,7 +44,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
44 |
*
|
45 |
* @param array $post_types Map of registered post type objects (WP_Post_Type) keyed by their name.
|
46 |
*/
|
47 |
-
return apply_filters( '
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -77,7 +77,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
77 |
* @param int $page_num Page of results.
|
78 |
*/
|
79 |
$url_list = apply_filters(
|
80 |
-
'
|
81 |
null,
|
82 |
$post_type,
|
83 |
$page_num
|
@@ -118,7 +118,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
118 |
*
|
119 |
* @param array $sitemap_entry Sitemap entry for the home page.
|
120 |
*/
|
121 |
-
$sitemap_entry = apply_filters( '
|
122 |
$url_list[] = $sitemap_entry;
|
123 |
}
|
124 |
|
@@ -136,7 +136,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
136 |
* @param WP_Post $post Post object.
|
137 |
* @param string $post_type Name of the post_type.
|
138 |
*/
|
139 |
-
$sitemap_entry = apply_filters( '
|
140 |
$url_list[] = $sitemap_entry;
|
141 |
}
|
142 |
|
@@ -167,7 +167,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
167 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
168 |
* @param string $post_type Post type name.
|
169 |
*/
|
170 |
-
$max_num_pages = apply_filters( '
|
171 |
|
172 |
if ( null !== $max_num_pages ) {
|
173 |
return $max_num_pages;
|
@@ -202,12 +202,12 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|
202 |
* @param string $post_type Post type name.
|
203 |
*/
|
204 |
$args = apply_filters(
|
205 |
-
'
|
206 |
array(
|
207 |
'orderby' => 'ID',
|
208 |
'order' => 'ASC',
|
209 |
'post_type' => $post_type,
|
210 |
-
'posts_per_page' =>
|
211 |
'post_status' => array( 'publish' ),
|
212 |
'no_found_rows' => true,
|
213 |
'update_post_term_cache' => false,
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Posts class
|
4 |
*
|
5 |
* Builds the sitemaps for the 'post' object type.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Posts extends PSP_Sitemaps_Provider {
|
18 |
/**
|
19 |
+
* PSP_Sitemaps_Posts constructor.
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
44 |
*
|
45 |
* @param array $post_types Map of registered post type objects (WP_Post_Type) keyed by their name.
|
46 |
*/
|
47 |
+
return apply_filters( 'psp_sitemaps_post_types', $post_types );
|
48 |
}
|
49 |
|
50 |
/**
|
77 |
* @param int $page_num Page of results.
|
78 |
*/
|
79 |
$url_list = apply_filters(
|
80 |
+
'psp_sitemaps_posts_pre_url_list',
|
81 |
null,
|
82 |
$post_type,
|
83 |
$page_num
|
118 |
*
|
119 |
* @param array $sitemap_entry Sitemap entry for the home page.
|
120 |
*/
|
121 |
+
$sitemap_entry = apply_filters( 'psp_sitemaps_posts_show_on_front_entry', $sitemap_entry );
|
122 |
$url_list[] = $sitemap_entry;
|
123 |
}
|
124 |
|
136 |
* @param WP_Post $post Post object.
|
137 |
* @param string $post_type Name of the post_type.
|
138 |
*/
|
139 |
+
$sitemap_entry = apply_filters( 'psp_sitemaps_posts_entry', $sitemap_entry, $post, $post_type );
|
140 |
$url_list[] = $sitemap_entry;
|
141 |
}
|
142 |
|
167 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
168 |
* @param string $post_type Post type name.
|
169 |
*/
|
170 |
+
$max_num_pages = apply_filters( 'psp_sitemaps_posts_pre_max_num_pages', null, $post_type );
|
171 |
|
172 |
if ( null !== $max_num_pages ) {
|
173 |
return $max_num_pages;
|
202 |
* @param string $post_type Post type name.
|
203 |
*/
|
204 |
$args = apply_filters(
|
205 |
+
'psp_sitemaps_posts_query_args',
|
206 |
array(
|
207 |
'orderby' => 'ID',
|
208 |
'order' => 'ASC',
|
209 |
'post_type' => $post_type,
|
210 |
+
'posts_per_page' => psp_sitemaps_get_max_urls( $this->object_type ),
|
211 |
'post_status' => array( 'publish' ),
|
212 |
'no_found_rows' => true,
|
213 |
'update_post_term_cache' => false,
|
psp-include/sitemap/inc/providers/class-wp-sitemaps-taxonomies.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Builds the sitemaps for the 'taxonomy' object type.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
@@ -14,9 +14,9 @@
|
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
@@ -42,7 +42,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
42 |
*
|
43 |
* @param array $taxonomies Map of registered taxonomy objects keyed by their name.
|
44 |
*/
|
45 |
-
return apply_filters( '
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -75,7 +75,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
75 |
* @param int $page_num Page of results.
|
76 |
*/
|
77 |
$url_list = apply_filters(
|
78 |
-
'
|
79 |
null,
|
80 |
$taxonomy,
|
81 |
$page_num
|
@@ -88,7 +88,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
88 |
$url_list = array();
|
89 |
|
90 |
// Offset by how many terms should be included in previous pages.
|
91 |
-
$offset = ( $page_num - 1 ) *
|
92 |
|
93 |
$args = $this->get_taxonomies_query_args( $taxonomy );
|
94 |
$args['offset'] = $offset;
|
@@ -110,7 +110,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
110 |
* @param WP_Term $term Term object.
|
111 |
* @param string $taxonomy Taxonomy name.
|
112 |
*/
|
113 |
-
$sitemap_entry = apply_filters( '
|
114 |
$url_list[] = $sitemap_entry;
|
115 |
}
|
116 |
}
|
@@ -142,7 +142,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
142 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
143 |
* @param string $taxonomy Taxonomy name.
|
144 |
*/
|
145 |
-
$max_num_pages = apply_filters( '
|
146 |
|
147 |
if ( null !== $max_num_pages ) {
|
148 |
return $max_num_pages;
|
@@ -150,7 +150,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
150 |
|
151 |
$term_count = wp_count_terms( $taxonomy, $this->get_taxonomies_query_args( $taxonomy ) );
|
152 |
|
153 |
-
return (int) ceil( $term_count /
|
154 |
}
|
155 |
|
156 |
/**
|
@@ -175,12 +175,12 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|
175 |
* @param string $taxonomy Taxonomy name.
|
176 |
*/
|
177 |
$args = apply_filters(
|
178 |
-
'
|
179 |
array(
|
180 |
'fields' => 'ids',
|
181 |
'taxonomy' => $taxonomy,
|
182 |
'orderby' => 'term_order',
|
183 |
-
'number' =>
|
184 |
'hide_empty' => true,
|
185 |
'hierarchical' => false,
|
186 |
'update_term_meta_cache' => false,
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Taxonomies class
|
4 |
*
|
5 |
* Builds the sitemaps for the 'taxonomy' object type.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Taxonomies extends PSP_Sitemaps_Provider {
|
18 |
/**
|
19 |
+
* PSP_Sitemaps_Taxonomies constructor.
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
42 |
*
|
43 |
* @param array $taxonomies Map of registered taxonomy objects keyed by their name.
|
44 |
*/
|
45 |
+
return apply_filters( 'psp_sitemaps_taxonomies', $taxonomies );
|
46 |
}
|
47 |
|
48 |
/**
|
75 |
* @param int $page_num Page of results.
|
76 |
*/
|
77 |
$url_list = apply_filters(
|
78 |
+
'psp_sitemaps_taxonomies_pre_url_list',
|
79 |
null,
|
80 |
$taxonomy,
|
81 |
$page_num
|
88 |
$url_list = array();
|
89 |
|
90 |
// Offset by how many terms should be included in previous pages.
|
91 |
+
$offset = ( $page_num - 1 ) * psp_sitemaps_get_max_urls( $this->object_type );
|
92 |
|
93 |
$args = $this->get_taxonomies_query_args( $taxonomy );
|
94 |
$args['offset'] = $offset;
|
110 |
* @param WP_Term $term Term object.
|
111 |
* @param string $taxonomy Taxonomy name.
|
112 |
*/
|
113 |
+
$sitemap_entry = apply_filters( 'psp_sitemaps_taxonomies_entry', $sitemap_entry, $term, $taxonomy );
|
114 |
$url_list[] = $sitemap_entry;
|
115 |
}
|
116 |
}
|
142 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
143 |
* @param string $taxonomy Taxonomy name.
|
144 |
*/
|
145 |
+
$max_num_pages = apply_filters( 'psp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );
|
146 |
|
147 |
if ( null !== $max_num_pages ) {
|
148 |
return $max_num_pages;
|
150 |
|
151 |
$term_count = wp_count_terms( $taxonomy, $this->get_taxonomies_query_args( $taxonomy ) );
|
152 |
|
153 |
+
return (int) ceil( $term_count / psp_sitemaps_get_max_urls( $this->object_type ) );
|
154 |
}
|
155 |
|
156 |
/**
|
175 |
* @param string $taxonomy Taxonomy name.
|
176 |
*/
|
177 |
$args = apply_filters(
|
178 |
+
'psp_sitemaps_taxonomies_query_args',
|
179 |
array(
|
180 |
'fields' => 'ids',
|
181 |
'taxonomy' => $taxonomy,
|
182 |
'orderby' => 'term_order',
|
183 |
+
'number' => psp_sitemaps_get_max_urls( $this->object_type ),
|
184 |
'hide_empty' => true,
|
185 |
'hierarchical' => false,
|
186 |
'update_term_meta_cache' => false,
|
psp-include/sitemap/inc/providers/class-wp-sitemaps-users.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Sitemaps:
|
4 |
*
|
5 |
* Builds the sitemaps for the 'user' object type.
|
6 |
*
|
7 |
-
* @package WordPress
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
@@ -14,9 +14,9 @@
|
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
-
class
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
@@ -49,7 +49,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
|
|
49 |
* @param int $page_num Page of results.
|
50 |
*/
|
51 |
$url_list = apply_filters(
|
52 |
-
'
|
53 |
null,
|
54 |
$page_num
|
55 |
);
|
@@ -78,7 +78,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
|
|
78 |
* @param array $sitemap_entry Sitemap entry for the user.
|
79 |
* @param WP_User $user User object.
|
80 |
*/
|
81 |
-
$sitemap_entry = apply_filters( '
|
82 |
$url_list[] = $sitemap_entry;
|
83 |
}
|
84 |
|
@@ -108,7 +108,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
|
|
108 |
*
|
109 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
110 |
*/
|
111 |
-
$max_num_pages = apply_filters( '
|
112 |
|
113 |
if ( null !== $max_num_pages ) {
|
114 |
return $max_num_pages;
|
@@ -119,7 +119,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
|
|
119 |
|
120 |
$total_users = $query->get_total();
|
121 |
|
122 |
-
return (int) ceil( $total_users /
|
123 |
}
|
124 |
|
125 |
/**
|
@@ -151,10 +151,10 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
|
|
151 |
* @param array $args Array of WP_User_Query arguments.
|
152 |
*/
|
153 |
$args = apply_filters(
|
154 |
-
'
|
155 |
array(
|
156 |
'has_published_posts' => array_keys( $public_post_types ),
|
157 |
-
'number' =>
|
158 |
)
|
159 |
);
|
160 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Sitemaps: PSP_Sitemaps_Users class
|
4 |
*
|
5 |
* Builds the sitemaps for the 'user' object type.
|
6 |
*
|
7 |
+
* @package WordPress PlatinumSeo
|
8 |
* @subpackage Sitemaps
|
9 |
* @since 5.5.0
|
10 |
*/
|
14 |
*
|
15 |
* @since 5.5.0
|
16 |
*/
|
17 |
+
class PSP_Sitemaps_Users extends PSP_Sitemaps_Provider {
|
18 |
/**
|
19 |
+
* PSP_Sitemaps_Users constructor.
|
20 |
*
|
21 |
* @since 5.5.0
|
22 |
*/
|
49 |
* @param int $page_num Page of results.
|
50 |
*/
|
51 |
$url_list = apply_filters(
|
52 |
+
'psp_sitemaps_users_pre_url_list',
|
53 |
null,
|
54 |
$page_num
|
55 |
);
|
78 |
* @param array $sitemap_entry Sitemap entry for the user.
|
79 |
* @param WP_User $user User object.
|
80 |
*/
|
81 |
+
$sitemap_entry = apply_filters( 'psp_sitemaps_users_entry', $sitemap_entry, $user );
|
82 |
$url_list[] = $sitemap_entry;
|
83 |
}
|
84 |
|
108 |
*
|
109 |
* @param int $max_num_pages The maximum number of pages. Default null.
|
110 |
*/
|
111 |
+
$max_num_pages = apply_filters( 'psp_sitemaps_users_pre_max_num_pages', null );
|
112 |
|
113 |
if ( null !== $max_num_pages ) {
|
114 |
return $max_num_pages;
|
119 |
|
120 |
$total_users = $query->get_total();
|
121 |
|
122 |
+
return (int) ceil( $total_users / psp_sitemaps_get_max_urls( $this->object_type ) );
|
123 |
}
|
124 |
|
125 |
/**
|
151 |
* @param array $args Array of WP_User_Query arguments.
|
152 |
*/
|
153 |
$args = apply_filters(
|
154 |
+
'psp_sitemaps_users_query_args',
|
155 |
array(
|
156 |
'has_published_posts' => array_keys( $public_post_types ),
|
157 |
+
'number' => psp_sitemaps_get_max_urls( $this->object_type ),
|
158 |
)
|
159 |
);
|
160 |
|
psp-include/sitemap/psp_sitemap.php
CHANGED
@@ -40,7 +40,7 @@ class PspSitemap {
|
|
40 |
|
41 |
// WP Sitemaps rewrite version
|
42 |
if ( ! defined( 'WP_SITEMAPS_REWRITE_VERSION' ) ) {
|
43 |
-
define( 'WP_SITEMAPS_REWRITE_VERSION', '2020-
|
44 |
}
|
45 |
|
46 |
// Limit the number of URLs included in a sitemap.
|
@@ -67,8 +67,8 @@ class PspSitemap {
|
|
67 |
if (!$psp_wp_sitemaps_enabled) return;
|
68 |
|
69 |
|
70 |
-
add_filter('
|
71 |
-
add_filter('
|
72 |
|
73 |
|
74 |
$excluded_post_ids = array();
|
@@ -86,27 +86,28 @@ class PspSitemap {
|
|
86 |
|
87 |
//psp sitemap disabled
|
88 |
//add_filter( 'pre_handle_404', array( $this, 'psp_redirect_sitemapxml' ), 9, 2 );
|
89 |
-
add_filter( '
|
90 |
-
add_filter( '
|
91 |
|
92 |
-
add_filter('
|
93 |
-
add_filter('
|
94 |
-
add_filter('
|
95 |
|
96 |
//add_filter('core_sitemaps_posts_list', array($this, 'psp_posts_for_sitemap'), 10, 3);
|
97 |
//add_filter('core_sitemaps_terms_list', array($this, 'psp_terms_for_sitemap'), 10, 3);
|
98 |
|
99 |
-
add_filter('
|
100 |
-
add_filter('
|
101 |
|
102 |
-
add_filter('
|
103 |
|
104 |
-
add_filter('
|
105 |
|
106 |
-
add_filter('
|
107 |
|
108 |
// Boot the sitemaps system.
|
109 |
-
|
|
|
110 |
|
111 |
}
|
112 |
|
@@ -132,8 +133,8 @@ class PspSitemap {
|
|
132 |
return $providers;
|
133 |
} else {
|
134 |
return array(
|
135 |
-
'posts' => new
|
136 |
-
'taxonomies' => new
|
137 |
);
|
138 |
}
|
139 |
|
@@ -214,7 +215,7 @@ class PspSitemap {
|
|
214 |
'update_post_meta_cache' => false,
|
215 |
);
|
216 |
|
217 |
-
$psp_posts_args['posts_per_page'] = !empty($posts_args['posts_per_page']) ? $posts_args['posts_per_page'] :
|
218 |
|
219 |
|
220 |
//Exclude NoIndex Posts
|
@@ -263,7 +264,7 @@ class PspSitemap {
|
|
263 |
'update_term_meta_cache' => false,
|
264 |
);
|
265 |
|
266 |
-
$psp_terms_args['number'] = !empty($terms_args['number']) ? $terms_args['number'] :
|
267 |
|
268 |
//Exclude noindex terms
|
269 |
|
40 |
|
41 |
// WP Sitemaps rewrite version
|
42 |
if ( ! defined( 'WP_SITEMAPS_REWRITE_VERSION' ) ) {
|
43 |
+
define( 'WP_SITEMAPS_REWRITE_VERSION', '2020-07-13' );
|
44 |
}
|
45 |
|
46 |
// Limit the number of URLs included in a sitemap.
|
67 |
if (!$psp_wp_sitemaps_enabled) return;
|
68 |
|
69 |
|
70 |
+
add_filter('psp_sitemaps_stylesheet_index_url', array($this, 'psp_get_sitemaps_stylesheet_index_url'), 10, 1);
|
71 |
+
add_filter('psp_sitemaps_stylesheet_url', array($this, 'psp_get_sitemaps_stylesheet_url'), 10, 1);
|
72 |
|
73 |
|
74 |
$excluded_post_ids = array();
|
86 |
|
87 |
//psp sitemap disabled
|
88 |
//add_filter( 'pre_handle_404', array( $this, 'psp_redirect_sitemapxml' ), 9, 2 );
|
89 |
+
add_filter( 'psp_sitemaps_register_providers', array( $this, 'psp_sitemap_providers' ), 10, 1 );
|
90 |
+
add_filter( 'psp_sitemaps_max_urls', array( $this, 'psp_sitemap_max_urls' ), 10, 2 );
|
91 |
|
92 |
+
add_filter('psp_sitemaps_is_enabled', array($this, 'psp_enable_wp_sitemaps'), 10, 1);
|
93 |
+
add_filter('psp_sitemaps_taxonomies', array($this, 'psp_taxonomies_for_sitemap'), 10, 1);
|
94 |
+
add_filter('psp_sitemaps_post_types', array($this, 'psp_post_types_for_sitemap'), 10, 1);
|
95 |
|
96 |
//add_filter('core_sitemaps_posts_list', array($this, 'psp_posts_for_sitemap'), 10, 3);
|
97 |
//add_filter('core_sitemaps_terms_list', array($this, 'psp_terms_for_sitemap'), 10, 3);
|
98 |
|
99 |
+
add_filter('psp_sitemaps_posts_query_args', array($this, 'psp_posts_args_for_sitemap'), 10, 2);
|
100 |
+
add_filter('psp_sitemaps_taxonomies_query_args', array($this, 'psp_terms_args_for_sitemap'), 10, 2);
|
101 |
|
102 |
+
add_filter('psp_sitemaps_posts_entry', array($this, 'psp_post_entry_for_sitemap'), 10, 3);
|
103 |
|
104 |
+
add_filter('psp_sitemaps_taxonomies_entry', array($this, 'psp_term_entry_for_sitemap'), 10, 3);
|
105 |
|
106 |
+
add_filter('psp_sitemaps_get_sitemap_xml', array($this, 'psp_get_sitemap_xml'), 10, 4);
|
107 |
|
108 |
// Boot the sitemaps system.
|
109 |
+
remove_action( 'init', 'wp_sitemaps_get_server' );
|
110 |
+
add_action( 'init', 'psp_sitemaps_get_server' );
|
111 |
|
112 |
}
|
113 |
|
133 |
return $providers;
|
134 |
} else {
|
135 |
return array(
|
136 |
+
'posts' => new PSP_Sitemaps_Posts(),
|
137 |
+
'taxonomies' => new PSP_Sitemaps_Taxonomies(),
|
138 |
);
|
139 |
}
|
140 |
|
215 |
'update_post_meta_cache' => false,
|
216 |
);
|
217 |
|
218 |
+
$psp_posts_args['posts_per_page'] = !empty($posts_args['posts_per_page']) ? $posts_args['posts_per_page'] : psp_sitemaps_get_max_urls( 'post' );
|
219 |
|
220 |
|
221 |
//Exclude NoIndex Posts
|
264 |
'update_term_meta_cache' => false,
|
265 |
);
|
266 |
|
267 |
+
$psp_terms_args['number'] = !empty($terms_args['number']) ? $terms_args['number'] : psp_sitemaps_get_max_urls( 'taxonomy' );
|
268 |
|
269 |
//Exclude noindex terms
|
270 |
|
psp-include/sitemap/psp_sitemap_settings.php
CHANGED
@@ -13,6 +13,8 @@ class PspSmSettings extends PspSettings {
|
|
13 |
|
14 |
private static $obj_handle = null;
|
15 |
|
|
|
|
|
16 |
// this is the URL our updater / license checker pings.
|
17 |
private static $PSPP_SITE_URL = 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/';
|
18 |
|
@@ -61,18 +63,31 @@ class PspSmSettings extends PspSettings {
|
|
61 |
}
|
62 |
|
63 |
$this->psp_settings_tabs[$this->psp_sm_settings_group] = 'SiteMap Settings';
|
|
|
64 |
//$this->psp_settings = get_option("psp_sitewide_settings");
|
65 |
|
66 |
-
|
67 |
//add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
|
68 |
|
69 |
}
|
70 |
|
71 |
-
function psp_sm_settings_init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
-
wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
74 |
|
75 |
-
|
76 |
|
77 |
}
|
78 |
|
@@ -258,7 +273,7 @@ class PspSmSettings extends PspSettings {
|
|
258 |
}
|
259 |
|
260 |
//global $wp_rewrite;
|
261 |
-
$wp_sitemaps = new
|
262 |
|
263 |
if( isset( $settings['enable']) && $settings['enable'] ) {
|
264 |
$wp_sitemaps->register_rewrites();
|
13 |
|
14 |
private static $obj_handle = null;
|
15 |
|
16 |
+
public $custom_taxonomies = array();
|
17 |
+
|
18 |
// this is the URL our updater / license checker pings.
|
19 |
private static $PSPP_SITE_URL = 'https://techblissonline.com/tools/platinum-seo-wordpress-premium/';
|
20 |
|
63 |
}
|
64 |
|
65 |
$this->psp_settings_tabs[$this->psp_sm_settings_group] = 'SiteMap Settings';
|
66 |
+
|
67 |
//$this->psp_settings = get_option("psp_sitewide_settings");
|
68 |
|
69 |
+
add_action( 'admin_init', array( &$this, 'psp_sm_settings_init' ) );
|
70 |
//add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
|
71 |
|
72 |
}
|
73 |
|
74 |
+
function psp_sm_settings_init() {
|
75 |
+
|
76 |
+
if ( null == $this->custom_taxonomies ) {
|
77 |
+
$args = array(
|
78 |
+
'public' => true,
|
79 |
+
'_builtin' => false
|
80 |
+
);
|
81 |
+
$output = 'names'; // or objects
|
82 |
+
$operator = 'and'; // 'and' or 'or'
|
83 |
+
$cust_taxonomies = get_taxonomies( $args, $output, $operator );
|
84 |
+
$this->custom_taxonomies = $cust_taxonomies;
|
85 |
+
//error_log("custom taxonomies ".print_r($cust_taxonomies, true));
|
86 |
+
}
|
87 |
|
88 |
+
//wp_enqueue_style("psp-settings-css", plugins_url( '/css/psp-settings.css', __FILE__ ));
|
89 |
|
90 |
+
//$this->register_sm_settings();
|
91 |
|
92 |
}
|
93 |
|
273 |
}
|
274 |
|
275 |
//global $wp_rewrite;
|
276 |
+
$wp_sitemaps = new PSP_Sitemaps();
|
277 |
|
278 |
if( isset( $settings['enable']) && $settings['enable'] ) {
|
279 |
$wp_sitemaps->register_rewrites();
|
psp-include/sitemap/sitemap-image.xsl
CHANGED
@@ -59,13 +59,17 @@
|
|
59 |
a:hover {
|
60 |
text-decoration: none;
|
61 |
}
|
|
|
|
|
|
|
|
|
62 |
</style>
|
63 |
</head>
|
64 |
<body>
|
65 |
<div id="intro">
|
66 |
<p>
|
67 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
68 |
-
It is generated using the <a
|
69 |
</p>
|
70 |
</div>
|
71 |
<div id="sitemap__header">
|
59 |
a:hover {
|
60 |
text-decoration: none;
|
61 |
}
|
62 |
+
|
63 |
+
h1 a {
|
64 |
+
text-decoration: none;
|
65 |
+
}
|
66 |
</style>
|
67 |
</head>
|
68 |
<body>
|
69 |
<div id="intro">
|
70 |
<p>
|
71 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
72 |
+
It is generated using the WordPress sitemap and the <a href="https://wordpress.org/plugins/platinum-seo-pack/">SEO Plugin for WordPress</a>, <strong>Platinum SEO Plugin</strong> by <strong>Techblissonline.com</strong>
|
73 |
</p>
|
74 |
</div>
|
75 |
<div id="sitemap__header">
|
psp-include/sitemap/sitemap-index.xsl
CHANGED
@@ -57,7 +57,7 @@
|
|
57 |
<div id="intro">
|
58 |
<p>
|
59 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
60 |
-
It is generated using the <a
|
61 |
</p>
|
62 |
</div>
|
63 |
<div id="sitemap__header">
|
57 |
<div id="intro">
|
58 |
<p>
|
59 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
60 |
+
It is generated using the WordPress sitemap and the <a href="https://wordpress.org/plugins/platinum-seo-pack/">SEO Plugin for WordPress</a>, <strong>Platinum SEO Plugin</strong> by <strong>Techblissonline.com</strong>
|
61 |
</p>
|
62 |
</div>
|
63 |
<div id="sitemap__header">
|
psp-include/sitemap/sitemap-post.xsl
CHANGED
@@ -51,13 +51,17 @@
|
|
51 |
a:hover {
|
52 |
text-decoration: none;
|
53 |
}
|
|
|
|
|
|
|
|
|
54 |
</style>
|
55 |
</head>
|
56 |
<body>
|
57 |
<div id="intro">
|
58 |
<p>
|
59 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
60 |
-
It is generated using the <a
|
61 |
</p>
|
62 |
</div>
|
63 |
<div id="sitemap__header">
|
51 |
a:hover {
|
52 |
text-decoration: none;
|
53 |
}
|
54 |
+
|
55 |
+
h1 a {
|
56 |
+
text-decoration: none;
|
57 |
+
}
|
58 |
</style>
|
59 |
</head>
|
60 |
<body>
|
61 |
<div id="intro">
|
62 |
<p>
|
63 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
64 |
+
It is generated using the WordPress sitemap and the <a href="https://wordpress.org/plugins/platinum-seo-pack/">SEO Plugin for WordPress</a>, <strong>Platinum SEO Plugin</strong> by <strong>Techblissonline.com</strong>
|
65 |
</p>
|
66 |
</div>
|
67 |
<div id="sitemap__header">
|
psp-include/sitemap/sitemap.xsl
CHANGED
@@ -51,13 +51,17 @@
|
|
51 |
a:hover {
|
52 |
text-decoration: none;
|
53 |
}
|
|
|
|
|
|
|
|
|
54 |
</style>
|
55 |
</head>
|
56 |
<body>
|
57 |
<div id="intro">
|
58 |
<p>
|
59 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
60 |
-
It is generated using the <a
|
61 |
</p>
|
62 |
</div>
|
63 |
<div id="sitemap__header">
|
51 |
a:hover {
|
52 |
text-decoration: none;
|
53 |
}
|
54 |
+
|
55 |
+
h1 a {
|
56 |
+
text-decoration: none;
|
57 |
+
}
|
58 |
</style>
|
59 |
</head>
|
60 |
<body>
|
61 |
<div id="intro">
|
62 |
<p>
|
63 |
This is an XML Sitemap which is supposed to be processed by search engines that follow the XML Sitemap standards like Google, Bing and other Search Engines.<br />
|
64 |
+
It is generated using the WordPress sitemap and the <a href="https://wordpress.org/plugins/platinum-seo-pack/">SEO Plugin for WordPress</a>, <strong>Platinum SEO Plugin</strong> by <strong>Techblissonline.com</strong>
|
65 |
</p>
|
66 |
</div>
|
67 |
<div id="sitemap__header">
|
psp-include/utilities/psp_helper.php
CHANGED
@@ -19,7 +19,7 @@ class PspHelper {
|
|
19 |
* as description. Touch only if you know what you're doing
|
20 |
*/
|
21 |
private $min_description_length = 1;
|
22 |
-
private $version = "2.1.
|
23 |
|
24 |
public $sitename = "";
|
25 |
public $sitedescription = "";
|
19 |
* as description. Touch only if you know what you're doing
|
20 |
*/
|
21 |
private $min_description_length = 1;
|
22 |
+
private $version = "2.1.7";
|
23 |
|
24 |
public $sitename = "";
|
25 |
public $sitedescription = "";
|
psp_main.php
CHANGED
@@ -263,14 +263,14 @@ class PspMain {
|
|
263 |
$user_id = get_current_user_id();
|
264 |
// Add the meta so that the notice is permanently dismissed.
|
265 |
//delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
|
266 |
-
update_user_meta( $user_id, 'psp_ignore_notice', "
|
267 |
};
|
268 |
};
|
269 |
}
|
270 |
|
271 |
public function platinum_seo_admin_notice__success() {
|
272 |
$user_id = get_current_user_id();
|
273 |
-
if ( "
|
274 |
global $pagenow;
|
275 |
$psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
|
276 |
if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
|
@@ -280,7 +280,7 @@ class PspMain {
|
|
280 |
'psp_ignore_notice' => '1',
|
281 |
'action' => 'psp_delete_adminnotice',
|
282 |
'nonce' => wp_create_nonce('psp_delete_adminnotice'),
|
283 |
-
] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'.'<br>'. esc_html__( 'See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"> '.esc_html__( ' Version ', 'platinum-seo-pack' ).'2.1.
|
284 |
</div>
|
285 |
<?php
|
286 |
}
|
@@ -1092,6 +1092,7 @@ class PspMain {
|
|
1092 |
|
1093 |
if ($psp_premium_valid) {
|
1094 |
//$current_page_url = $this->psp_can_link;
|
|
|
1095 |
$current_page_url = '';//get_permalink($post);
|
1096 |
if (empty($current_page_url) && is_home()) {
|
1097 |
$current_page_url = esc_url(home_url());
|
@@ -1137,8 +1138,9 @@ class PspMain {
|
|
1137 |
array_push($args, array(
|
1138 |
'parent' => 'psp-page-analysis',
|
1139 |
'id' => 'psp-inlinks-ose',
|
1140 |
-
'title' => __( 'Check Inlinks (
|
1141 |
-
'href' => '//ahrefs.com/backlink-checker?site=' . urlencode( $current_page_url ),
|
|
|
1142 |
'meta' => array( 'target' => '_blank', 'rel' => 'noopener' ),
|
1143 |
));
|
1144 |
|
@@ -1162,7 +1164,8 @@ class PspMain {
|
|
1162 |
'parent' => 'psp-page-analysis',
|
1163 |
'id' => 'psp-richsnippets',
|
1164 |
'title' => __( 'Check Rich Snippets', 'platinum-seo-pack' ),
|
1165 |
-
'href' => '//www.google.com/webmasters/tools/richsnippets?q=' . urlencode( $current_page_url ),
|
|
|
1166 |
'meta' => array( 'target' => '_blank', 'rel' => 'noopener' ),
|
1167 |
));
|
1168 |
|
263 |
$user_id = get_current_user_id();
|
264 |
// Add the meta so that the notice is permanently dismissed.
|
265 |
//delete_user_meta( $user_id, 'psp_ignore_notice_v_209' );
|
266 |
+
update_user_meta( $user_id, 'psp_ignore_notice', "v_217" );
|
267 |
};
|
268 |
};
|
269 |
}
|
270 |
|
271 |
public function platinum_seo_admin_notice__success() {
|
272 |
$user_id = get_current_user_id();
|
273 |
+
if ( "v_217" === trim(get_user_meta( $user_id, 'psp_ignore_notice', true ) )) return;
|
274 |
global $pagenow;
|
275 |
$psp_pages = array('platinum-seo-social-pack-by-techblissonline', 'psp-social-by-techblissonline', 'psp-tools-by-techblissonline', 'pspp-licenses');
|
276 |
if ('index.php' === $pagenow || ( $pagenow == 'admin.php' && in_array(sanitize_key($_GET['page']), $psp_pages))) {
|
280 |
'psp_ignore_notice' => '1',
|
281 |
'action' => 'psp_delete_adminnotice',
|
282 |
'nonce' => wp_create_nonce('psp_delete_adminnotice'),
|
283 |
+
] ) ) .'" style="float:right; display:block; border:none;">'.esc_html__( 'Dismiss permanently', 'platinum-seo-pack' ) .'</a>'.'<br>'. esc_html__( 'See What has Changed in this', 'platinum-seo-pack' ).'<a href="https://techblissonline.com/platinum-wordpress-seo-plugin/#what-is-new" target="_blank" rel="noopener"> '.esc_html__( ' Version ', 'platinum-seo-pack' ).'2.1.7'.esc_html__( ' and earlier Versions!', 'platinum-seo-pack' ) .'</a>'.'<br>'.esc_html__( 'Like this Plugin? Pls. give it a rating WordPress plugin Page', 'platinum-seo-pack' ).'<a href="https://wordpress.org/plugins/platinum-seo-pack/" target="_blank" rel="noopener">'.esc_html__(' here','platinum-seo-pack' ).'</a>'; ?></p></strong>
|
284 |
</div>
|
285 |
<?php
|
286 |
}
|
1092 |
|
1093 |
if ($psp_premium_valid) {
|
1094 |
//$current_page_url = $this->psp_can_link;
|
1095 |
+
$site_url = site_url();
|
1096 |
$current_page_url = '';//get_permalink($post);
|
1097 |
if (empty($current_page_url) && is_home()) {
|
1098 |
$current_page_url = esc_url(home_url());
|
1138 |
array_push($args, array(
|
1139 |
'parent' => 'psp-page-analysis',
|
1140 |
'id' => 'psp-inlinks-ose',
|
1141 |
+
'title' => __( 'Check Inlinks (External)', 'platinum-seo-pack' ),
|
1142 |
+
//'href' => '//ahrefs.com/backlink-checker?site=' . urlencode( $current_page_url ),
|
1143 |
+
'href' => '//search.google.com/u/1/search-console/links/drilldown?resource_id='.urlencode( $site_url ).'&type=EXTERNAL&target=' . urlencode( $current_page_url ),
|
1144 |
'meta' => array( 'target' => '_blank', 'rel' => 'noopener' ),
|
1145 |
));
|
1146 |
|
1164 |
'parent' => 'psp-page-analysis',
|
1165 |
'id' => 'psp-richsnippets',
|
1166 |
'title' => __( 'Check Rich Snippets', 'platinum-seo-pack' ),
|
1167 |
+
//'href' => '//www.google.com/webmasters/tools/richsnippets?q=' . urlencode( $current_page_url ),
|
1168 |
+
'href' => '//search.google.com/test/rich-results?url=' . urlencode( $current_page_url ).'&user_agent=2',
|
1169 |
'meta' => array( 'target' => '_blank', 'rel' => 'noopener' ),
|
1170 |
));
|
1171 |
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: seo, wordpress seo, plugin, google seo, platinum seo, schema, schema marku
|
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.4.2
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 2.1.
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -71,6 +71,9 @@ Please read these **[FAQs](https://techblissonline.com/platinum-seo-pack-faq/)**
|
|
71 |
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
|
72 |
|
73 |
== Changelog ==
|
|
|
|
|
|
|
74 |
= 2.1.6 =
|
75 |
* 2020-07-07 - Fixed a bug in rendering of static Front page Platinum SEO settings (i.e. meta description and canonical tags) when multiple Static pages are used as front page by multilingual plugins like Polylang. This bug had an impact only on users of multilingual plugins.
|
76 |
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.4.2
|
8 |
Requires PHP: 5.6
|
9 |
+
Stable tag: 2.1.7
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
71 |
4. Social Settings for Facebook, Twitter, Pinterest and LinkedIn. Generates Open Grah Tags and Twitter compatible Tags.
|
72 |
|
73 |
== Changelog ==
|
74 |
+
= 2.1.7 =
|
75 |
+
* 2020-07-13 - Fixed bugs in JS files to be compliant with the proposed JQuery versions in WordPress 5.5 and beyond. Since WordPress sitemap files is proposed to be integrated into the Core in V5.5, made the necessary changes in the plugin's version of the files.
|
76 |
+
|
77 |
= 2.1.6 =
|
78 |
* 2020-07-07 - Fixed a bug in rendering of static Front page Platinum SEO settings (i.e. meta description and canonical tags) when multiple Static pages are used as front page by multilingual plugins like Polylang. This bug had an impact only on users of multilingual plugins.
|
79 |
|