Extension talk:AutoSitemap

Jump to navigation Jump to search

About this board

AutoSitemap generating invalid sitemaps (according to inspyder.com's SitemapValidator tool)

2
Summary by Martynov Maxim

Google's sitemap validator is totally ok with a format used by extension

MichaelBeijer (talkcontribs)

I just validated the sitemap generated by the latest version of AutoSitemap, and am being told it is invalid. I used this free service:


https://www.inspyder.com/free/SitemapValidator.aspx


I am being told:

The element 'url' has invalid child element 'lastmod'. List of possible elements expected: any element in namespace 'http://www.google.com/schemas/sitemap-image/1.1, http://www.google.com/schemas/sitemap-mobile/1.0, http://www.google.com/schemas/sitemap-video/1.1'.


Is this related to this: https://webmasters.stackexchange.com/questions/50440/why-is-this-date-in-my-sitemap-invalid-according-to-google ??

Martynov Maxim (talkcontribs)

Hello.


Actually, I have no idea why do you use this validator.


Firstly, all the schemas which are used here correspond to pages which contains only one image or video, not any type of page. They are not a part of the standard.

Secondly, the standard scheme is saying that lastmod tag can contain any datetime value matching the format. AutoSitemap uses yyyy-mm-ddThh-mm-ssZ format which does match this format.

Thirdly, have you checked your sitemap using Google's own sitemap checker? I'm using it for checking my wiki's sitemap and it is totally OK:

Pukethirst (talkcontribs)

When I save an edit on a post, it gives the message above. The XML file is created and populated, and it appears that the edit on the page saves, but it still gives that error every time. As soon as i disable the extension the error goes away.

Product Version
MediaWiki 1.35.1
PHP 7.4.13 (apache2handler)
MySQL 8.0.22
ICU 66.1

can anyone help me figure out whats going on with this?

Martynov Maxim (talkcontribs)

Hi.


Can you please provide here the extension settings?

Pukethirst (talkcontribs)

everything is currently default, the only thing i have in my LocalSettings.php is wfLoadExtension( 'AutoSitemap' );

i didnt want to add anything else until everything was working as it should be.

Martynov Maxim (talkcontribs)

Do you have any other sitemap related extensions installed?

Pukethirst (talkcontribs)

this is the only one

Martynov Maxim (talkcontribs)

Could you please enable debug on your site (check Manual:How to debug for more details) and post here full error message after editing the page?

Missing AutoSitemap File

2
Summary by Martynov Maxim

You should make some change (create/update/rename/delete/etc) on any page to generate sitemap file after installing the extension.

81.41.132.144 (talkcontribs)

Hi!


I've installed AutoSitemap Extension. No errors.


But sitemap.xml file is missing and Google Search Console doesn't fint it:

Producto Versión
MediaWiki 1.35.1
PHP 7.4.10 (cgi-fcgi)
MySQL 5.7.32-35-log
ICU 50.2

This is my localsettings configuration:


wfLoadExtension( 'AutoSitemap' );

$wgAutoSitemap["server"] = "myurl/wiki";


But this URL return me a 404 Error:


myurl/wiki/sitemap.xml


Could anyone help me?


Thanks!

81.41.132.144 (talkcontribs)

I've solved it!


Reading previous questions I've seen that sitemap file was created after every creation/deletion or modification.


I didn't make any modification. So the file wasn't created.


After creating a new page, the file was perfectly created.


Thanks for all.

42.106.217.119 (talkcontribs)

I installed AutoSitemap extension on me MediaWiki site and I would like to change its visibility. I can see there is an option at the end of the extension page that reads: "If you want to see a human-readable sitemap, allow read access for sitemap.xsl file in your site config (.htaccess file or other)" but I don't know what code to add and where so can someone please guide me on this?

Thank you

AutoSitemap_body.php on line 97 error

4
Yedidyarashi (talkcontribs)

Warning: fopen(sitemap.xml.tmpf4de173a4f85e1bc051e0b5a9ced5390.tmp): failed to open stream: Permission denied in /opt/bitnami/apps/mediawiki/htdocs/extensions/AutoSitemap/AutoSitemap_body.php on line 97

Cannot write to sitemap.xml.tmpf4de173a4f85e1bc051e0b5a9ced5390.tmp.


Ciencia Al Poder (talkcontribs)
Yedidyarashi (talkcontribs)

sudo chmode +w mediawiki

sudo chown www-data. mediawiki

i added this code to htaccess.conf

<Directory "opt/bitnami/apps/mediawiki/htdocs/extensions/AutoSitemap/sitemap.xsl">

Allow from all

</Directory>

and

sudo /opt/bitnami/ctlscript.sh restart

and still it don't work

Ciencia Al Poder (talkcontribs)

The code in htaccess.conf is unneeded.

This will work only if PHP is being executed by www-data. (with the dot?). You should be sure that's correct in your system. However, the code is very stunky, and tries to write to a file without specifying a path. This gives no clue as to what folder it will write the file to (relative to index.php, or the extension's file that's currently running that code?). If in doubt, give all permissions to all subfolders (sudo find . -type d -exec chmod 777 {} \;) and try again to discard other issues.

81.44.180.134 (talkcontribs)

How can I program it to create multiple sitemap files of 50K pages each instead of just one with all the pages not fully processed by search engines?

Martynov Maxim (talkcontribs)

Hello.


Unfortunately, for now there is no such option in the extension.

79.150.219.147 (talkcontribs)

I would appreciate the addition of this feature in the next version.

Martynov Maxim (talkcontribs)

Currently there is no plan of adding such feature to the extension.

Fokebox (talkcontribs)

Hello! Do you have any plans to update the extension for MW 1.35? I tried to use it, but had problems with VisualEditor and saving a page via this tool.

Martynov Maxim (talkcontribs)

Hello.


Can you please share the issues you've faced with? I'm not using the latest MW version, so this is the only way to get useful information about these problems.

Fokebox (talkcontribs)

Here is what I have:

MediaWiki 1.35.0
PHP 7.4.11 (cgi-fcgi)
MySQL 5.7.27-30
ICU 50.1.2
Lua 5.1.5

As soon as I switch on the extension now all works fine, but as soon as I want exclude some pages from xml file adding following code:

$wgAutoSitemap["exclude_namespaces"] = [
    NS_WIDGET,
    NS_WIDGET_TALK,
];

I Have error appeared on the top of each page:

Warning: Use of undefined constant NS_WIDGET - assumed 'NS_WIDGET' (this will throw an Error in a future version of PHP) in /var/www/u0402490/data/www/wikireshebnik.ru/LocalSettings.php on line 261

Warning: Use of undefined constant NS_WIDGET_TALK - assumed 'NS_WIDGET_TALK' (this will throw an Error in a future version of PHP) in /var/www/u0402490/data/www/mysite.ru/LocalSettings.php on line 262

Warning: session_name(): Cannot change session name when headers already sent in /var/www/u0402490/data/www/mysite.ru/includes/Setup.php on line 713

Warning: session_id(): Cannot change session id when headers already sent in /var/www/u0402490/data/www/mysite.ru/includes/Setup.php on line 757

Warning: session_start(): Cannot start session when headers already sent in /var/www/u0402490/data/www/mysite.ru/includes/Setup.php on line 758

Warning: Cannot modify header information - headers already sent by (output started at /var/www/u0402490/data/www/wikireshebnik.ru/LocalSettings.php:261) in /var/www/u0402490/data/www/mysite.ru/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /var/www/u0402490/data/www/wikireshebnik.ru/LocalSettings.php:261) in /var/www/u0402490/data/www/mysite.ru/includes/WebResponse.php on line 74
Martynov Maxim (talkcontribs)

These namespaces are added by Extension:Widgets. Do you add these lines before or after lines where you enable this extension?

Fokebox (talkcontribs)

I add these lines after I enable Widget extension

Martynov Maxim (talkcontribs)

The issue is connected with Widgets extensions and the way it defines namespace NS_WIDGET - there is no such constant in LocalSettings file.


In previous versions of MediaWiki, an import style like that was used:

require_once "$IP/extensions/Widgets/Widgets.php";

This style executed the whole source code of extension, and new global variables could be accessed just on the next lines of LocalSettings file.

But it looks that new style of import (wfLoadExtension) does not add global constant with namespace ID, and that's why you're facing with this error message.


Can you please try to use old style import of Widgets extension? Or try replace these constants with ID values (they are just hard coded, see Extension default namespaces#270–279: Widgets).

Summary by Fokebox

Resolved as I used two extension for sitemap generating

Fokebox (talkcontribs)

Hello all,

The extension worked fine until today. I opened the link to my sitemap.xml and see the error:

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.

Can you please help to fix it?

Fokebox (talkcontribs)

Hello dear developers, I have found some bugs of the extension, to be correct - there are two other extension that incompatible with following extension that do not function correctly:

  • MSUpload - Multiple upload of the files
  • Flow - Creates topics at Discussion pages

So when I upload files the extension shows some error addressing to autositemap extension. Topic doesn't appear immediately (ass it should be) when I add it at discussion page with Flow. It appears just after refreshing the page. As I switch off the Autositemap extension all works fine. Would be nice if you fix this problem!

I imported 150K articles and the extension blocked editing

6
Uziel302 (talkcontribs)

"Notice: Only variables should be assigned by reference in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 118

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50874710 bytes) in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 108"

Martynov Maxim (talkcontribs)

It looks like you didn't set enough memory to php interpreter, so generated sitemap file size exceeds memory limit. Try to set higher memory limit for php or set filters for namespace or pages to reduce sitemap size.

Uziel302 (talkcontribs)

How do I change limit? How do I reduce sitemap without deleting articles?

Martynov Maxim (talkcontribs)

http://bfy.tw/OVDS

You can add some page names to $wgAutoSitemap["exclude_pages"] or namespaces to $wgAutoSitemap["exclude_namespaces"] and they be excluded from sitemap.

Uziel302 (talkcontribs)

I know how to google, I changed multiple memory limits in php.ini and I thought there is something specific for this one. Is the php interpreter limit you talked about lives in the php.ini?

Uziel302 (talkcontribs)

In the list of namespace available to exclude I didn't find main namespace where all my articles are. I won't list 150K pages.