Sitemap Plugin Update Required

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

Mon Aug 05, 2019 4:33 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: 704
Joined: Sat May 16, 2015 2:53 pm
Contact:

Tue Aug 06, 2019 10:58 am

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

Wed Aug 07, 2019 4:05 am

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: 704
Joined: Sat May 16, 2015 2:53 pm
Contact:

Wed Aug 07, 2019 11:46 am

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

Wed Aug 14, 2019 5:50 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

Thu Aug 15, 2019 3:11 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: 72
Joined: Mon Feb 11, 2019 8:41 pm

Thu Aug 15, 2019 5:04 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

Thu Aug 15, 2019 7:42 pm

Jay wrote:
Thu Aug 15, 2019 5:04 pm
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.
Thank you. I have removed that value.
Jay wrote:
Thu Aug 15, 2019 5:04 pm
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.
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: 72
Joined: Mon Feb 11, 2019 8:41 pm

Thu Aug 15, 2019 9:18 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: 13
Joined: Mon Jan 08, 2018 10:01 am
Contact:

Fri Aug 16, 2019 8:24 am

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