Sitemap Plugin Update Required

User avatar
haZh
Jr. Bludit
Posts: 7
Joined: Mon Aug 05, 2019 4:07 pm

Hello, I'm not an expert in this but I have looked into the sitemap plugin included in Bludit and I think following changes are required.

1. Generating

Code: Select all

<changefreq></changefreq>
tags aren't necessary anymore.

2. Ping URLs needs to be updated.

Code: Select all

private function ping()
	{
		if ($this->getValue('pingGoogle')) {
			$url = 'https://www.google.com/ping?sitemap='.Theme::sitemapUrl();
			TCP::http($url, 'GET', true, 3);
		}

		if ($this->getValue('pingBing')) {
			$url = 'https://www.bing.com/ping?sitemap='.Theme::sitemapUrl();
			TCP::http($url, 'GET', true, 3);
		}
	}
User avatar
diego
Site Admin
Posts: 761
Joined: Sat May 16, 2015 2:53 pm
Contact:

Hi,
thanks for the updates.

I found the URL for the pings, but I don't found the deprecated fields, can you share a link ?

Thanks
User avatar
haZh
Jr. Bludit
Posts: 7
Joined: Mon Aug 05, 2019 4:07 pm

diego wrote: Tue Aug 06, 2019 10:58 am but I don't found the deprecated fields, can you share a link ?
1. According to the official sitemap site, <changefreq> is now an optional tag.
https://www.sitemaps.org/protocol.html

2. In Google sitemap formats, they aren't using <changefreq> tag.
https://support.google.com/webmasters/a ... emapformat

3. In a recent interview with Google, they have confirmed that <changefreq> doesn’t really play that much of a role with sitemaps anymore.
https://www.seroundtable.com/google-pri ... 20273.html
User avatar
diego
Site Admin
Posts: 761
Joined: Sat May 16, 2015 2:53 pm
Contact:

Thank you!
User avatar
Jay
Master Bludit
Posts: 133
Joined: Mon Feb 11, 2019 8:41 pm

I just realized that sitemap plugin generates <lastmod> value using post's creation date, not modification date.
User avatar
haZh
Jr. Bludit
Posts: 7
Joined: Mon Aug 05, 2019 4:07 pm

Jay wrote: Wed Aug 14, 2019 5:50 pm I just realized that sitemap plugin generates <lastmod> value using post's creation date, not modification date.
I can confirm this too. Now I have placed the following code, don't know if that's accurate. So far it picks up the modification date if I make any changes to relevant posts.

Code: Select all

$xml .= '<lastmod>'.$page->dateModified(SITEMAP_DATE_FORMAT).' +05:30</lastmod>';
+05:30 should be changed to your timezone. Is there a function that I can automatically get the timezone from admin settings?
User avatar
Jay
Master Bludit
Posts: 133
Joined: Mon Feb 11, 2019 8:41 pm

haZh wrote: Thu Aug 15, 2019 3:11 pm

Code: Select all

$xml .= '<lastmod>'.$page->dateModified(SITEMAP_DATE_FORMAT).' +05:30</lastmod>';
+05:30 should be changed to your timezone. Is there a function that I can automatically get the timezone from admin settings?
Basically dateModified() function doesn't have any values set, thus SITEMAP_DATE_FORMAT value defined in variables.php has usage only with default php date() function.

As it goes to timezone, why do you change the modification date in a hard way?
It's being set and shown correctly according to the timezone set in bludit's language option.
User avatar
haZh
Jr. Bludit
Posts: 7
Joined: Mon Aug 05, 2019 4:07 pm

Jay wrote: Thu Aug 15, 2019 5:04 pmBasically dateModified() function doesn't have any values set, thus SITEMAP_DATE_FORMAT value defined in variables.php has usage only with default php date() function.
Thank you. I have removed that value.
Jay wrote: Thu Aug 15, 2019 5:04 pmAs it goes to timezone, why do you change the modification date in a hard way?
It's being set and shown correctly according to the timezone set in bludit's language option.
Without hard coding my timezone, I get following output format within lastmod tags;

Code: Select all

YYYY-MM-DD HH:MM:SS
Is it wrong to include +05:30 as the timezone with above output? Now my lastmod output format is like this;

Code: Select all

YYYY-MM-DD HH:MM:SS +05:30
User avatar
Jay
Master Bludit
Posts: 133
Joined: Mon Feb 11, 2019 8:41 pm

haZh wrote: Thu Aug 15, 2019 7:42 pm Without hard coding my timezone, I get following output format within lastmod tags;

Code: Select all

YYYY-MM-DD HH:MM:SS
Is it wrong to include +05:30 as the timezone with above output? Now my lastmod output format is like this;

Code: Select all

YYYY-MM-DD HH:MM:SS +05:30
<lastmod> value in sitemaps should be compliant with W3C date format: RRRR-MM-DD.
Showing exact time is not needed, but also not prohibited. If you want, you can just truncate time using substr() function.

I still don't understand what is your purpose of adding this "+05:30" string at the end of date, as it makes date value in <lastmod> tag invalid.
dbelov
Ssr. Bludit
Posts: 15
Joined: Mon Jan 08, 2018 10:01 am
Contact:

lastmod is also optional tag and Google says they ignore it.
Post Reply