Extension talk:AutoSitemap

About this board

AutoSitemap_body.php on line 311

1
Шариф Ахмет (talkcontribs)

In the error_log file of our site (https://sheki.org/wiki/Ana_s%C9%99hif%C9%99) , more than 100 such warnings appear in a few hours:

[17-Mar-2024 13:43:47 Asia/Baku] PHP Warning:  fopen(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/shekiwik/public_html/wiki/extensions/AutoSitemap/AutoSitemap_body.php on line 311

[17-Mar-2024 13:43:47 Asia/Baku] PHP Warning:  fopen(https://www.google.com/webmasters/sitemaps/ping?sitemap=https://sheki.org/wiki/sitemap.xml): Failed to open stream: no suitable wrapper could be found in /home/shekiwik/public_html/wiki/extensions/AutoSitemap/AutoSitemap_body.php on line 311...

Reply to "AutoSitemap_body.php on line 311"

This just kills the site and doesn't work wtf

4
Summary by Martynov Maxim

No data provided

168.1.201.119 (talkcontribs)

Dumb

168.1.201.119 (talkcontribs)

cant' delete this i got it working

168.1.201.119 (talkcontribs)

yea where does the sitemap even go? This appears to do nothing

Martynov Maxim (talkcontribs)

Please provide some information about your MediaWiki instance, like MW version, extension version, number of pages on your site, available RAM, debug logs.

How to exclude module?

2
Vladlen Terezhe (talkcontribs)

If i add in:

$wgAutoSitemap["exclude_namespaces"] = [

    NS_MODULE

Then my site stop working.

Martynov Maxim (talkcontribs)
Reply to "How to exclude module?"

HTTP rather than HTTPS sitemap

2
2A02:C7C:5E03:3900:C99E:FD20:80DD:A076 (talkcontribs)

Hi,


The AutoSitemap extension is working but it only create links HTTP, all HTTP requests redirect to HTTPS. Is there any way to get the AutoSitemap extension to create HTTPS links to avoid redirection (which I am told is bad for SEO).


Thanks in Advance

Martynov Maxim (talkcontribs)

Have you read documentation of $wgAutoSitemap["server"] option?

Reply to "HTTP rather than HTTPS sitemap"

How to exclude module from sitemap?

4
Vladlen Terezhe (talkcontribs)

Now my site includes modules in the sitemap and I want to fix it. Thanks you for attention. https://greenwiki.ru/sitemap.xml

Right now my exclude namespaces

$wgAutoSitemap["exclude_namespaces"] = [

    NS_TALK,

    NS_USER,   

    NS_USER_TALK,

    NS_PROJECT_TALK,

    NS_MEDIAWIKI,   

    NS_MEDIAWIKI_TALK,

    NS_TEMPLATE,

    NS_TEMPLATE_TALK,

    NS_SPECIAL,

    NS_HELP,   

    NS_HELP_TALK,

    NS_CATEGORY,

    NS_CATEGORY_TALK,

    NS_FILE,

    NS_MEDIA,

176.59.17.63 (talkcontribs)

You should add the custom namespace id to this option.

Vladlen Terezhe (talkcontribs)

Thanks. Where i can find more info about it?

Lotusccong (talkcontribs)

Invalid Response From Server

10
Summary by Martynov Maxim

Fixed in v1.6

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?

Josua Koenig (talkcontribs)

I have the same error with the Visual Editor: Invalid Response From Server. It saves the changes, but this is not shown in the Visual Editor.


I still use the Moderation extension. There it throws the following error:

Deprecated: Use of Revision::__construct was deprecated in MediaWiki 1.31. [Called from MediaWiki\Revision\RevisionStore::insertRevisionOn in /var/www/html/includes/Revision/RevisionStore.php at line 535] in /var/www/html/includes/debug/MWDebug.php on line 376

Deprecated: Use of RevisionInsertComplete hook (used in AutoSitemap::writeSitemap) was deprecated in MediaWiki 1.31. [Called from MediaWiki\HookContainer\HookContainer::run in /var/www/html/includes/HookContainer/HookContainer.php at line 137] in /var/www/html/includes/debug/MWDebug.php on line 376

Deprecated: Use of PageContentSaveComplete hook (used in AutoSitemap::writeSitemap) was deprecated in MediaWiki 1.35. [Called from MediaWiki\HookContainer\HookContainer::run in /var/www/html/includes/HookContainer/HookContainer.php at line 137] in /var/www/html/includes/debug/MWDebug.php on line 376

I have deactivated the AutoSitemap extension at the moment. But I would like to use it, can someone help me?

Software Version
MediaWiki 1.36.0
PHP 7.4.19 (apache2handler)
MariaDB 10.5.9-MariaDB-1:10.5.9+maria~focal
ICU 63.1
Lua 5.1.5
Martynov Maxim (talkcontribs)

Hello.


Please try the latest extension version

Josua Koenig (talkcontribs)

Thanks a lot. Unfortunately, it doesn't quite work yet. Now it only has one error:

Deprecated:  Use of Revision::__construct was deprecated in MediaWiki 1.31. [Called from MediaWiki\Storage\PageUpdater::MediaWiki\Storage\{closure} in /var/www/html/includes/Storage/PageUpdater.php at line 1554] in /var/www/html/includes/debug/MWDebug.php on line 376

These hooks are also still deprecated:

Manual:Hooks/ArticleRevisionUndeleted

Manual:Hooks/TitleMoveComplete

Manual:Hooks/PageContentInsertComplete

Manual:Hooks/ArticleRollbackComplete

Now it works for me. My new extension.json:

{
 "name": "AutoSitemap",
 "author": "Dolfinus",
 "url": "https://www.mediawiki.org/wiki/Extension:AutoSitemap",
 "description": "Creates a XML Sitemap file automatically.",
 "version": "1.6",
 "license-name": "GPL-3.0+",
 "type": "other",
 "ExtensionMessagesFiles": {
   "AutoSitemap": "AutoSitemap.i18n.php"
 },
 "AutoloadClasses": {
   "AutoSitemap": "AutoSitemap_body.php"
 },
 "Hooks": {
   "AfterImportPage": [
     "AutoSitemap::writeSitemap"
   ],
   "PageDeleteComplete": [
     "AutoSitemap::writeSitemap"
   ],
   "ArticleUndelete": [
     "AutoSitemap::writeSitemap"
   ],
   "PageMoveComplete": [
     "AutoSitemap::writeSitemap"
   ],
   "ArticleMergeComplete": [
     "AutoSitemap::writeSitemap"
   ],
   "UploadComplete": [
     "AutoSitemap::writeSitemap"
   ],
   "RevisionUndeleted": [
     "AutoSitemap::writeSitemap"
   ],
   "RevisionRecordInserted": [
     "AutoSitemap::writeSitemap"
   ],
   "PageSaveComplete": [
     "AutoSitemap::writeSitemap"
   ]
 },
 "manifest_version": 1
}
Martynov Maxim (talkcontribs)

Thank you, I've updated hooks list.

Sitemap.xml is not generated

2
Summary by Fokebox

Resolved. File generated lately

Fokebox (talkcontribs)

Hi all,

I have MW:

Продукт Версия
MediaWiki 1.37.1
PHP 7.3.33 (cgi-fcgi)
MySQL 5.7.27-30
ICU 52.2
Lua 5.1.5

And installed the extension and made following settings:

wfLoadExtension( 'AutoSitemap' );
$wgAutoSitemap["filename"] = "sitemap.xml";

And then I don't have sitemap.xml file at my root category. Could you please let me know how can I resolve the problem?

Fokebox (talkcontribs)

All works fine!

178.40.57.86 (talkcontribs)

hi, I tried to add an AutoSitemap extension but after applying the whole procedure I get an error: Fatal error: Uncaught Exception: Unable to open file /web/htdocs6/altysk/home/www/extensions/AutoSitemap/extension.json: filemtime (): stat failed for /web/htdocs6/altysk/home/www/extensions/AutoSitemap/extension.json in /web/htdocs6/altysk/home/www/includes/registration/ExtensionRegistry.php:177 Stack trace: # 0 / web / htdocs6 / altysk / home / www / includes / GlobalFunctions.php (51): ExtensionRegistry-> queue ('/ web / htdocs6 / al ...') # 1 /web/htdocs6/altysk/home/www/LocalSettings.php(14 ): wfLoadExtension ('AutoSitemap') # 2 /web/htdocs6/altysk/home/www/includes/Setup.php(143): require_once ('/ web / htdocs6 / al ...') # 3 / web / htdocs6 require_once ('/ web / htdocs6 / al ...') # 4 /web/htdocs6/altysk/home/www/index.php(44): require ('/ web / htdocs6 / al ...') # 5 {main} thrown in /web/htdocs6/altysk/home/www/includes/registration/ExtensionRegistry.php on line 177


mediawiki version 1.35

178.40.57.86 (talkcontribs)

Resolved, the autositemap file name was changed while extracting files.

SOLVED: Database error after upgrade? CHECK LocalSettings.php

2
Summary by CayceP

The bug is not in the extension, but in the legacy settings that still appears in user's LocalSettings.php: $wgAutoSitemap["exclude_namespaces"] array.

Josemoya (talkcontribs)

Hi! I recently upgraded to mediaWiki 1.36.1 I then upgraded AutoSitemap to 1.4, and did the /mw-config But I still get a DBQueryError. I attach the debug view here. I changed some path names to avoid revealing details of my server.


[YOFfYxh8xzsb5DpGpDwlawAAARw] /index.php?title=Wiki_page&action=submit Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Error 1054: Unknown column 'NS_IMAGE_TALK' in 'where clause' (localhost) Function: Wikimedia\Rdbms\DBConnRef::query Query: SELECT "Popularpages" AS type, page_id AS id, page_namespace AS namespace, page_title AS title, (MAX(rev_timestamp)) AS last_modification, rev_timestamp AS value FROM `mw_page`, `mw_revision` WHERE page_is_redirect = 0 AND rev_page = page_id AND page_namespace NOT IN (1,2,3,5,NS_IMAGE_TALK,8,9,10,11,12,13,15) GROUP BY page_id Backtrace: from /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1719)

  1. 0 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1703): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
  2. 1 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1678): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
  3. 2 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1244): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  4. 3 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->query(string, string, integer)
  5. 4 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/DBConnRef.php(286): Wikimedia\Rdbms\DBConnRef->__call(string, array)
  6. 5 /home/myusername/public_html/mywikiname/extensions/AutoSitemap/AutoSitemap_body.php(101): Wikimedia\Rdbms\DBConnRef->query(string)
  7. 6 /home/myusername/public_html/mywikiname/includes/HookContainer/HookContainer.php(338): AutoSitemap::writeSitemap(Revision, NULL, NULL)
  8. 7 /home/myusername/public_html/mywikiname/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
  9. 8 /home/myusername/public_html/mywikiname/includes/HookContainer/HookRunner.php(3270): MediaWiki\HookContainer\HookContainer->run(string, array)
  10. 9 /home/myusername/public_html/mywikiname/includes/Revision/RevisionStore.php(536): MediaWiki\HookContainer\HookRunner->onRevisionInsertComplete(Revision, NULL, NULL)
  11. 10 /home/myusername/public_html/mywikiname/includes/Storage/PageUpdater.php(1390): MediaWiki\Revision\RevisionStore->insertRevisionOn(MediaWiki\Revision\RevisionStoreRecord, Wikimedia\Rdbms\DBConnRef)
  12. 11 /home/myusername/public_html/mywikiname/includes/Storage/PageUpdater.php(817): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
  13. 12 /home/myusername/public_html/mywikiname/includes/page/WikiPage.php(2225): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
  14. 13 /home/myusername/public_html/mywikiname/includes/page/WikiPage.php(2080): WikiPage->doUserEditContent(WikitextContent, User, CommentStoreComment, integer, boolean, array, integer)
  15. 14 /home/myusername/public_html/mywikiname/includes/EditPage.php(2361): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)
  16. 15 /home/myusername/public_html/mywikiname/includes/EditPage.php(1694): EditPage->internalAttemptSave(array, boolean)
  17. 16 /home/myusername/public_html/mywikiname/includes/EditPage.php(669): EditPage->attemptSave(array)
  18. 17 /home/myusername/public_html/mywikiname/includes/actions/EditAction.php(71): EditPage->edit()
  19. 18 /home/myusername/public_html/mywikiname/includes/actions/SubmitAction.php(38): EditAction->show()
  20. 19 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(531): SubmitAction->show()
  21. 20 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(315): MediaWiki->performAction(Article, Title)
  22. 21 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(913): MediaWiki->performRequest()
  23. 22 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(546): MediaWiki->main()
  24. 23 /home/myusername/public_html/mywikiname/index.php(53): MediaWiki->run()
  25. 24 /home/myusername/public_html/mywikiname/index.php(46): wfIndexMain()
  26. 25 {main}

Josemoya (talk)

Forgot to say, disabling AutoSiteMap gets rid of this error.
Josemoya (talkcontribs)

SOLVED. The bug is not in the extension, but in the legacy settings that still appear in my LocalSettings.php: $wgAutoSitemap["exclude_namespaces"] = [

   NS_TALK,
   NS_USER,   
   NS_USER_TALK,
   NS_PROJECT_TALK,

/** NS_IMAGE_TALK <== CHANGE THIS WITH THE FOLLOWING LINE **/ NS_FILE_TALK,

   NS_MEDIAWIKI,   
   NS_MEDIAWIKI_TALK,
   NS_TEMPLATE,
   NS_TEMPLATE_TALK,
   NS_HELP,   
   NS_HELP_TALK,
   NS_CATEGORY_TALK

]; //default values

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: