Extension talk:AutoSitemap
Add topic| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Exlude some other pages from sitemap
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello all. Thank you for the extension. It works fine. I would like to know if it is possible to exclude some other pages at my wiki. For example I have my own namespaces "MiWiki:Article name" So I would like to exclude all pages with this namespace. How can I do it? And It would me fine for me to exclude all images in my sitemap. How to exclude them? Thank you! Fokebox (talk) 12:01, 21 July 2017 (UTC)
- Hi. Add this item to you LocalSettings.php:
- $wgAutoSitemap["exclude_namespaces"][] = NS_PROJECT; Martynov Maxim (talk) 10:46, 23 July 2017 (UTC)
- Thank you! Now I excluded all images and project pages. And the final question how to exclude the topics like this one from the list of xml sitemap? Fokebox (talk) 09:52, 24 July 2017 (UTC)
- You can find at extension page setting "exclude_pages"which excludes certain pages from sitemap. Martynov Maxim (talk) 21:45, 24 July 2017 (UTC)
- Hi all and thanks for replies. I have set the extension as I wanted! Fokebox (talk) 09:59, 25 July 2017 (UTC)
Bugs of the extension
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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! Fokebox (talk) 13:34, 28 August 2017 (UTC)
how to force to generate sitemap.xml ?
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
how to force to generate sitemap.xml immediately? Alexandroslee (talk) 02:26, 21 September 2018 (UTC)
- Save something at any page, create new or delete. Martynov Maxim (talk) 18:41, 27 September 2018 (UTC)
- got it! Thanks 2001:B011:4007:1A63:844C:5F26:D909:4B10 (talk) 06:12, 7 December 2018 (UTC)
DataBase error after adding a new namespace to exclude
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
When I add a new namespace to exclude in $wgAutoSitemap["exclude_namespaces"] = like
| NS_WIDGET |
and after when I try to edit a page on the wiki I get a database error. Nicolas NALLET Wiki-Valley.com (talk) 18:43, 20 November 2018 (UTC)
- Can you attach trace log with debug mode enabled? Martynov Maxim (talk) 22:00, 26 November 2018 (UTC)
- You can create an account on https://domotiki.eu and try to edit a page to see the full erro message
- See https://domotiki.eu/domotique/Special:Version
- =Database error=
- A database query error has occurred. This may indicate a bug in the software.
- [15d59b6bbc7b1e30c4d8f1f7] /index.php?title=Bac_%C3%A0_sable&action=submit Wikimedia\Rdbms\DBQueryError from line 1075 of /srv/data/web/vhosts/domotiki.eu/htdocs/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
- 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
- `page`,
- `revision`
- WHERE
- page_is_redirect = 0
- AND rev_page = page_id
- AND page_namespace NOT IN (5,7,8,9,10,11,12,13,15,6,NS_WIDGET)
- GROUP BY page_id
- Function: Wikimedia\Rdbms\Database::query
- Error: 1054 Unknown column 'NS_WIDGET' in 'where clause' (localhost)
- Backtrace:
- #0 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
- #1 /srv/data/web/vhosts/domotiki.eu/htdocs/extensions/AutoSitemap/AutoSitemap_body.php(104): Wikimedia\Rdbms\Database->query(string)
- #2 [internal function]: AutoSitemap::writeSitemap(Revision, string, string)
- #3 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/Hooks.php(186): call_user_func_array(string, array)
- #4 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/Revision.php(1511): Hooks::run(string, array)
- #5 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/page/WikiPage.php(1716): Revision->insertOn(Wikimedia\Rdbms\DatabaseMysqli)
- #6 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/page/WikiPage.php(1619): WikiPage->doModify(WikitextContent, integer, User, string, array)
- #7 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(2161): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)
- #8 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(1493): EditPage->internalAttemptSave(array, boolean)
- #9 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(637): EditPage->attemptSave(array)
- #10 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/actions/EditAction.php(59): EditPage->edit()
- #11 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/actions/SubmitAction.php(38): EditAction->show()
- #12 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(499): SubmitAction->show()
- #13 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(293): MediaWiki->performAction(Article, Title)
- #14 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(862): MediaWiki->performRequest()
- #15 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(523): MediaWiki->main()
- #16 /srv/data/web/vhosts/domotiki.eu/htdocs/index.php(43): MediaWiki->run()
- #17 {main}
Nicolas NALLET Wiki-Valley.com (talk) 10:59, 1 December 2018 (UTC)- I guess that you added new namespace in wrong way. NS_* are numeric constants, but in your case it is a string because PHP understand this unknown value as a string.
- You should add new namespace properly. Martynov Maxim (talk) 10:42, 8 December 2018 (UTC)
- When I try
php maintenance/eval.php> var_dump(NS_WIDGET);- I get
int(274)Nicolas NALLET Wiki-Valley.com (talk) 15:30, 16 January 2019 (UTC)- Add something like
var_dump(NS_WIDGET);into LocalSettings.php before passing this namespace into an extension, and give an output here. Martynov Maxim (talk) 13:43, 19 January 2019 (UTC)
Set priority to pages
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
First of all, thanks for this very useful extension!
I'm checking it and have one question that I am not able to solve
Is there any way to set priority to a specific page or for all pages? Maybe some var in the LocalSettings.php?
I have been reviewing the source extension (ManualSitemap) and I have seen that it had some configuration options in this regard. I tried to do tests modifying the LocalSetings file but I can not get any of them to work.
Any help will be appreciated!
Thank you! AngelSanz1977 (talk) 09:29, 3 July 2019 (UTC)
- Check v1.3, I've added options for namespace, page or whole site priority set. Martynov Maxim (talk) 21:04, 9 July 2019 (UTC)
- Thanks very very much my friend !!
- :) AngelSanz1977 (talk) 00:23, 10 July 2019 (UTC)
- Hello again Martynov,
- I have already installed the updated extension and the new functionalities work correctly. Great job! Thank you!
- Abusing your kindness I would like to ask you one last question. Unfortunately I have found a small problem that I can not solve:
- When I add a priority exception for some page it stops working if the title of the page contains some special character, such as the letter "ñ" that we use in Spain or some letter with an accent, as "á" for example.
- I have done some tests changing the coding but I can not get it to work. For example, in my main page ("Página principal" in spanish) in this way it does not work:
- $wgAutoSitemap ["priority"] ['Página principal'] = 0.8;
- But neither does it:
- $wgAutoSitemap ["priority"] ['P%C3%A1gina principal'] = 0.8;
- Nor with other combinations like this:
- $wgAutoSitemap ["priority"] [''P%C3%A1gina_principal'] = 0.8;
- Do you know if there is any way in which I can solve this problem?
- If there is no way to fix it, I can always leave unchanged the pages with titles that contain some special character but in my language there are many of them and I prefer to ask you first.
- Thank you very much again for your time and attention!
- Best regards
- Angel AngelSanz1977 (talk) 13:12, 10 July 2019 (UTC)
- Can you add {{FULLPAGENAME}} to page and them check it return value? Extension uses exactly the same name as get by this function.
- Also maybe there is some issue with files code page (non-Unicode). Which one do you use? Martynov Maxim (talk) 20:14, 10 July 2019 (UTC)
Made me get errors on mobile view
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I installed this extension on a private wiki and got: "Error, edit not saved" when trying to save from mobile view (MinervaNeue). Edit was actually saved. Desktop works fine.
I noted out the line on localsettings and it fixed the issue. Probably gonna play with it back and forth when I want new sitemap. Uziel302 (talk) 19:10, 5 July 2019 (UTC)
- Can you provide error log? Martynov Maxim (talk) 18:59, 9 July 2019 (UTC)
- Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
- [Tue Jul 09 19:09:16.600629 2019] [core:notice] [pid 6899] AH00094: Command line: '/usr/sbin/apache2'
- [Tue Jul 09 19:10:21.934343 2019] [php7:notice] [pid 6917] [client 37.26.146.236:61840] PHP 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, referer: http://meaning.wiki/en/Crocheting
- [Tue Jul 09 19:11:20.854122 2019] [php7:error] [pid 6917] [client 37.26.146.236:61840] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50980320 bytes) in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 108, referer: http://meaning.wiki/en/Crocheting Uziel302 (talk) 19:14, 9 July 2019 (UTC)
- Same error as above, I guess. Martynov Maxim (talk) 19:44, 9 July 2019 (UTC)
- The issue on mobile happened even before the import when no limit could have been met. I won't remove the import for original error log. Maybe if I could exclude main namespace temporarily and get it work again in desktop I will get the unique mobile issue. Uziel302 (talk) 20:13, 9 July 2019 (UTC)
I imported 150K articles and the extension blocked editing
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
"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" Uziel302 (talk) 07:58, 9 July 2019 (UTC)
- 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. Martynov Maxim (talk) 18:58, 9 July 2019 (UTC)
- How do I change limit? How do I reduce sitemap without deleting articles? Uziel302 (talk) 19:16, 9 July 2019 (UTC)
- 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. Martynov Maxim (talk) 19:44, 9 July 2019 (UTC)
- 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 (talk) 20:02, 9 July 2019 (UTC)
- 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. Uziel302 (talk) 20:11, 9 July 2019 (UTC)
Long Page Save Times
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Since installing this extension on MW 1.33.0, saving a page takes about 8 to 15 seconds. Is this normal? Thanks. Grlucas (talk) 19:09, 25 August 2019 (UTC)
- It seems like there are a lot of pages on your wiki or your server/php performance is limited/low. Martynov Maxim (talk) 17:08, 5 September 2019 (UTC)
Priority Error
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
When I edit or create a page on my wiki, I get this error: "ArgumentCountError from line 157 of /membri/solu/extensions/AutoSitemap/AutoSitemap_body.php: Too few arguments to function AutoSitemap::getPriority(), 0 passed in /membri/solu/extensions/AutoSitemap/AutoSitemap_body.php on line 229 and exactly 3 expected"
This is my configuration in LocalSettings:
wfLoadExtension( 'AutoSitemap' );
$wgAutoSitemap["filename"] = "sitemapp.xml";
$wgAutoSitemap["freq"] = "hourly";
$wgAutoSitemap["priority"] = 1;
how can I resolve it? Xsteeplol (talk) 16:17, 20 October 2019 (UTC)
- Hello.
- Please download extension source code again, problem was fixed. Martynov Maxim (talk) 10:06, 27 October 2019 (UTC)
- Thanks, now it works! Xsteeplol (talk) 18:12, 29 October 2019 (UTC)
AutoSitemap_body.php on line 97 error
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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.
Yedidyarashi (talk) 12:04, 6 February 2020 (UTC)
- See Extension:AutoSitemap#Permissions Ciencia Al Poder (talk) 18:09, 6 February 2020 (UTC)
- 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 Yedidyarashi (talk) 13:12, 7 February 2020 (UTC)
- 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. Ciencia Al Poder (talk) 12:08, 9 February 2020 (UTC)
Error in the sitemap.xml
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 (talk) 17:53, 8 September 2020 (UTC)
More than one file
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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? 81.44.180.134 (talk) 13:33, 25 September 2020 (UTC)
- Hello.
- Unfortunately, for now there is no such option in the extension. Martynov Maxim (talk) 12:33, 27 September 2020 (UTC)
- I would appreciate the addition of this feature in the next version. 79.150.219.147 (talk) 15:56, 4 October 2020 (UTC)
- Currently there is no plan of adding such feature to the extension. Martynov Maxim (talk) 18:01, 14 October 2020 (UTC)
AutoSitemap for MW 1.35
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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. Fokebox (talk) 17:50, 1 October 2020 (UTC)
- 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. Martynov Maxim (talk) 17:59, 14 October 2020 (UTC)
- 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:I Have error appeared on the top of each page:
$wgAutoSitemap["exclude_namespaces"] = [ NS_WIDGET, NS_WIDGET_TALK, ];Fokebox (talk) 08:44, 15 October 2020 (UTC)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
- These namespaces are added by Extension:Widgets. Do you add these lines before or after lines where you enable this extension? Martynov Maxim (talk) 08:47, 19 October 2020 (UTC)
- I add these lines after I enable Widget extension Fokebox (talk) 12:57, 20 October 2020 (UTC)
- 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). Martynov Maxim (talk) 08:11, 26 October 2020 (UTC)
Human-readable sitemap
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 42.106.217.119 (talk) 14:44, 17 October 2020 (UTC)
Invalid Response From Server
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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? Pukethirst (talk) 20:34, 20 January 2021 (UTC)
- Hi.
- Can you please provide here the extension settings? Martynov Maxim (talk) 20:46, 20 January 2021 (UTC)
- 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. Pukethirst (talk) 20:55, 20 January 2021 (UTC)
- Do you have any other sitemap related extensions installed? Martynov Maxim (talk) 21:04, 20 January 2021 (UTC)
- this is the only one Pukethirst (talk) 21:27, 20 January 2021 (UTC)
- 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? Martynov Maxim (talk) 19:48, 21 January 2021 (UTC)
- 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 376Deprecated: 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 376Deprecated: 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 |
- Hello.
- Please try the latest extension version Martynov Maxim (talk) 12:04, 27 March 2022 (UTC)
- 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}Josua Koenig (talk) 10:25, 2 April 2022 (UTC)- Thank you, I've updated hooks list. Martynov Maxim (talk) 15:28, 3 April 2022 (UTC)
Missing AutoSitemap File
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 (talk) 19:32, 25 February 2021 (UTC)
- 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. 81.41.132.144 (talk) 13:16, 26 February 2021 (UTC)
AutoSitemap generating invalid sitemaps (according to inspyder.com's SitemapValidator tool)
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 ?? MichaelBeijer (talk) 17:20, 9 May 2021 (UTC)
- 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-ssZformat 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:
Martynov Maxim (talk) 16:56, 16 May 2021 (UTC)
SOLVED: Database error after upgrade? CHECK LocalSettings.php
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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)
- 0 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1703): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
- 1 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1678): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
- 2 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/Database.php(1244): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
- 3 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->query(string, string, integer)
- 4 /home/myusername/public_html/mywikiname/includes/libs/rdbms/database/DBConnRef.php(286): Wikimedia\Rdbms\DBConnRef->__call(string, array)
- 5 /home/myusername/public_html/mywikiname/extensions/AutoSitemap/AutoSitemap_body.php(101): Wikimedia\Rdbms\DBConnRef->query(string)
- 6 /home/myusername/public_html/mywikiname/includes/HookContainer/HookContainer.php(338): AutoSitemap::writeSitemap(Revision, NULL, NULL)
- 7 /home/myusername/public_html/mywikiname/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
- 8 /home/myusername/public_html/mywikiname/includes/HookContainer/HookRunner.php(3270): MediaWiki\HookContainer\HookContainer->run(string, array)
- 9 /home/myusername/public_html/mywikiname/includes/Revision/RevisionStore.php(536): MediaWiki\HookContainer\HookRunner->onRevisionInsertComplete(Revision, NULL, NULL)
- 10 /home/myusername/public_html/mywikiname/includes/Storage/PageUpdater.php(1390): MediaWiki\Revision\RevisionStore->insertRevisionOn(MediaWiki\Revision\RevisionStoreRecord, Wikimedia\Rdbms\DBConnRef)
- 11 /home/myusername/public_html/mywikiname/includes/Storage/PageUpdater.php(817): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
- 12 /home/myusername/public_html/mywikiname/includes/page/WikiPage.php(2225): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
- 13 /home/myusername/public_html/mywikiname/includes/page/WikiPage.php(2080): WikiPage->doUserEditContent(WikitextContent, User, CommentStoreComment, integer, boolean, array, integer)
- 14 /home/myusername/public_html/mywikiname/includes/EditPage.php(2361): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)
- 15 /home/myusername/public_html/mywikiname/includes/EditPage.php(1694): EditPage->internalAttemptSave(array, boolean)
- 16 /home/myusername/public_html/mywikiname/includes/EditPage.php(669): EditPage->attemptSave(array)
- 17 /home/myusername/public_html/mywikiname/includes/actions/EditAction.php(71): EditPage->edit()
- 18 /home/myusername/public_html/mywikiname/includes/actions/SubmitAction.php(38): EditAction->show()
- 19 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(531): SubmitAction->show()
- 20 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(315): MediaWiki->performAction(Article, Title)
- 21 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(913): MediaWiki->performRequest()
- 22 /home/myusername/public_html/mywikiname/includes/MediaWiki.php(546): MediaWiki->main()
- 23 /home/myusername/public_html/mywikiname/index.php(53): MediaWiki->run()
- 24 /home/myusername/public_html/mywikiname/index.php(46): wfIndexMain()
25 {main}
Josemoya (talk)
- Forgot to say, disabling AutoSiteMap gets rid of this error. Josemoya (talk) 07:18, 4 July 2021 (UTC)
- 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 Josemoya (talk) 07:29, 4 July 2021 (UTC)
Unable to open file AutoSitemap
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 (talk) 20:58, 26 November 2021 (UTC)
- Resolved, the autositemap file name was changed while extracting files. 178.40.57.86 (talk) 06:44, 27 November 2021 (UTC)
Sitemap.xml is not generated
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 |
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 (talk) 13:12, 28 February 2022 (UTC)
- All works fine! Fokebox (talk) 06:38, 1 March 2022 (UTC)
How to exclude module from sitemap?
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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, Vladlen Terezhe (talk) 06:49, 18 February 2023 (UTC)
- You should add the custom namespace id to this option. 176.59.17.63 (talk) 11:57, 18 February 2023 (UTC)
- Thanks. Where i can find more info about it? Vladlen Terezhe (talk) 12:39, 18 February 2023 (UTC)
- You can find your website custome namespace id from here via call the API
- https://YOURDOMAINAME/api.php?action=query&meta=siteinfo&siprop=namespaces&formatversion=2 Lotusccong (talk) 14:29, 19 February 2023 (UTC)
This just kills the site and doesn't work wtf
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Dumb 168.1.201.119 (talk) 05:42, 2 March 2023 (UTC)
- cant' delete this i got it working 168.1.201.119 (talk) 05:44, 2 March 2023 (UTC)
- yea where does the sitemap even go? This appears to do nothing 168.1.201.119 (talk) 08:12, 2 March 2023 (UTC)
- Please provide some information about your MediaWiki instance, like MW version, extension version, number of pages on your site, available RAM, debug logs. Martynov Maxim (talk) 10:32, 5 March 2023 (UTC)
HTTP rather than HTTPS sitemap
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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 2A02:C7C:5E03:3900:C99E:FD20:80DD:A076 (talk) 09:17, 18 June 2023 (UTC)
- Have you read documentation of $wgAutoSitemap["server"] option? Martynov Maxim (talk) 09:43, 6 January 2024 (UTC)
How to exclude module?
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
If i add in:
$wgAutoSitemap["exclude_namespaces"] = [
NS_MODULE
Then my site stop working. Vladlen Terezhe (talk) 08:55, 27 December 2023 (UTC)
- It looks like there is no NS_MODULE global constant, so php cannot resolve its value and fails while reading settings file. Replace namespace name with its id, this is probably Extension default namespaces#820–829: Scribunto
- Also read documentation how to investigate such errors: Manual:How to debug Martynov Maxim (talk) 09:49, 6 January 2024 (UTC)
AutoSitemap_body.php on line 311
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
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... Шариф Ахмет (talk) 13:23, 17 March 2024 (UTC)
- Try setting
$wgAutoSitemap["notify"] = []to disable notifying search engined like Google that sitemap file was updated. Martynov Maxim (talk) 14:19, 31 March 2024 (UTC) - I don't agree. Notice comes from "Google Webmasters":
- [04-Apr-2024 10:35:38 Asia/Baku] PHP Warning: fopen(https://www.google.com/webmasters/sitemaps/ping?sitemap=https://sheki.org/wiki/sitemap.xml): failed to open stream: HTTP request failed! HTTP/1.0 404 Sitemaps ping is deprecated. See https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping.
- in /home/shekiafn/public_html/wiki/extensions/AutoSitemap/AutoSitemap_body.php on line 311
- [04-Apr-2024 10:48:33 Asia/Baku] PHP Warning: fopen(https://www.google.com/webmasters/sitemaps/ping?sitemap=https://sheki.org/wiki/sitemap.xml): failed to open stream: HTTP request failed! HTTP/1.0 404 Sitemaps ping is deprecated. See https://developers.google.com/search/blog/2023/06/sitemaps-lastmod-ping.
- in /home/shekiafn/public_html/wiki/extensions/AutoSitemap/AutoSitemap_body.php on line 311 Шариф Ахмет (talk) 13:47, 4 April 2024 (UTC)
- > I don't agree
- What you don't agree with? Have you tried setting
$wgAutoSitemap["notify"] = [];? Martynov Maxim (talk) 10:59, 6 April 2024 (UTC) - I did this 1 hour ago. No notification or warning has been received yet. Thanks. Шариф Ахмет (talk) 17:59, 6 April 2024 (UTC)
Trying to generate the sitemap.xml
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Someone can help me pls. When I try to generate a new sitemap.xml when editig or creating a new page it shows up: Cannot write to sitemap.xml.tmpcb70ac9268d09b5dc17297441c9ff751.tmp. 189.61.116.159 (talk) 00:53, 5 June 2024 (UTC)
- "Your MediaWiki folder should be permitted for write operations (
chmod +wwithchown apacheorchown nginx)." Martynov Maxim (talk) 17:07, 11 June 2024 (UTC)
$wgAutoSitemap erroring out entire wiki
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
putting the following in your localsettings.php seems to error out the whole wiki and return a 500 error.
$wgAutoSitemap["exclude_namespaces"] = [
NS_TALK,
NS_USER,
NS_USER_TALK,
NS_PROJECT_TALK,
NS_FILE_TALK,
NS_MEDIAWIKI,
NS_MEDIAWIKI_TALK,
NS_TEMPLATE,
NS_TEMPLATE_TALK,
NS_HELP,
NS_HELP_TALK,
NS_CATEGORY_TALK
NS_FILE
]; Imjustcaden (talk) 21:24, 6 June 2024 (UTC)
- Well, apparently some of these namespaces does not exist. Follow this manual Manual:How to debug to detect which one is missing, and remove it from the LocalSettings.php Martynov Maxim (talk) 17:09, 11 June 2024 (UTC)
links to jpg
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
At my spiritwiki.org i have 2100 pages.
I get pairs : <url>
<loc>https://spiritwiki.org/w/Datei:Chakrasamvara_Vajravarahi.jpg</loc>
<priority>1.0</priority>
<lastmod>2022-03-26T15:32:45Z</lastmod>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>https://spiritwiki.org/w/Chakrasamvara</loc>
<priority>1.0</priority>
<lastmod>2023-02-12T22:11:57Z</lastmod>
<changefreq>weekly</changefreq>
</url>
and not all sites. Manbu (talk) 19:22, 29 June 2024 (UTC)
- What do you mean by "all sites"? Maybe "all pages"? What namespaces are used in your wiki instance? Martynov Maxim (talk) 16:23, 30 June 2024 (UTC)
- if You look at my wiki : The namespace is /w/ - all other is standard (i have now deactivated the plugin and use another sitemap)
- P.S. In the wiki is a site 'All Pages'. Using the source-code of the wiki instead the code of this plugin would avoid such jpg-errors - and also would make the variable
- $wgAutoSitemap["exclude_namespaces"] = [ superfluous. Manbu (talk) 19:05, 30 June 2024 (UTC)
- No idea what I've just read Martynov Maxim (talk) 18:43, 27 July 2024 (UTC)
multi wiki site problem
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
In multisite it appears as a blank page. DevAny.KR (talk) 09:55, 21 August 2024 (UTC)
Search Engine Notification
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi, just to let you know this site doesn't work anymore:
https://www.google.com/webmasters/sitemaps/ping?sitemap=https://your-site.com/sitemap.xml
for this code:
$wgAutoSitemap["notify"] = [
'<nowiki>https://www.google.com/webmasters/sitemaps/ping?sitemap=https://your-site.com/sitemap.xml',
];
One now needs to go to the Google Search Console and do it through that instead. TattooedLeprechaun (talk) 09:45, 28 August 2024 (UTC)
- Thanks for pull requests, merged Martynov Maxim (talk) 12:11, 1 September 2024 (UTC)
PHP Deprecated: Use of wfGetDB was deprecated in MediaWiki 1.39. [Called from AutoSitemap::writeSitemap in AutoSitemap/AutoSitemap_body.php at line 114]
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi, are there any plans to fix this issue? C schmitz (talk) 09:46, 15 October 2024 (UTC)
- Fixed in 1.8.2 by https://github.com/dolfinus/AutoSitemap/pull/36 Martynov Maxim (talk) 21:19, 28 October 2024 (UTC)
Error: Class "Title" not found .. in AutoSitemap_body.php at line 282
[edit]After updating WikiMedia from some older version to current 1.45.1 and editing/saving a page with AutoSitemap 1.8.2 extension active we get PHP Fatal Error: Class "Title" not found .. in AutoSitemap_body.php at line 282, page is not saved and almost empty temp sitemap file is left behind.
We added this in line 62 in AutoSitemap_body.php, then all worked again:
use MediaWiki\Title\Title; ~2026-80312-2 (talk) 15:59, 5 February 2026 (UTC)
Robots.txt
[edit]If I use the AutoSitemap Extension, I need to create Robots.txt the file?
User-agent: *
Host: example.com
Sitemap: https://example.com/sitemap.xml
aka_sektor (talk) 10:35, 28 February 2026 (UTC)