Page 1 of 2

Sitemap Plugin Update Required

Posted: Mon Aug 05, 2019 4:33 pm
by haZh
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);
		}
	}

Re: Sitemap Plugin Update Required

Posted: Tue Aug 06, 2019 10:58 am
by diego
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

Re: Sitemap Plugin Update Required

Posted: Wed Aug 07, 2019 4:05 am
by haZh
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

Re: Sitemap Plugin Update Required

Posted: Wed Aug 07, 2019 11:46 am
by diego
Thank you!

Re: Sitemap Plugin Update Required

Posted: Wed Aug 14, 2019 5:50 pm
by Jay
I just realized that sitemap plugin generates <lastmod> value using post's creation date, not modification date.

Re: Sitemap Plugin Update Required

Posted: Thu Aug 15, 2019 3:11 pm
by haZh
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?

Re: Sitemap Plugin Update Required

Posted: Thu Aug 15, 2019 5:04 pm
by Jay
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.

Re: Sitemap Plugin Update Required

Posted: Thu Aug 15, 2019 7:42 pm
by haZh
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

Re: Sitemap Plugin Update Required

Posted: Thu Aug 15, 2019 9:18 pm
by Jay
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.

Re: Sitemap Plugin Update Required

Posted: Fri Aug 16, 2019 8:24 am
by dbelov
lastmod is also optional tag and Google says they ignore it.