Extension talk:AutoSitemap

Jump to navigation Jump to search

About this board

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

Reply to "AutoSitemap for MW 1.35"
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

Reply to "Human-readable sitemap"
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.

Reply to "More than one file"
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.

Uziel302 (talkcontribs)

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.

Martynov Maxim (talkcontribs)

Can you provide error log?

Uziel302 (talkcontribs)

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

Martynov Maxim (talkcontribs)

Same error as above, I guess.

Uziel302 (talkcontribs)

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.

AngelSanz1977 (talkcontribs)

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!

Martynov Maxim (talkcontribs)

Check v1.3, I've added options for namespace, page or whole site priority set.

AngelSanz1977 (talkcontribs)

Thanks very very much my friend !!

:)

AngelSanz1977 (talkcontribs)

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

Martynov Maxim (talkcontribs)

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?

Grlucas (talkcontribs)

Since installing this extension on MW 1.33.0, saving a page takes about 8 to 15 seconds. Is this normal? Thanks.

Martynov Maxim (talkcontribs)

It seems like there are a lot of pages on your wiki or your server/php performance is limited/low.

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.

Reply to "AutoSitemap_body.php on line 97 error"