Extension talk:HitCounters

Jump to navigation Jump to search

About this board

Please create Phabricator tasks if you run into bugs
I need bug reports in Phabricator so that they can be worked on. If you run into a problem with one of the following, please create a phabricator task and link to it here. -- MarkAHershberger(talk) 16:03, 30 July 2016 (UTC)

--> Archived talk

Emikulic (talkcontribs)

Installing into 1.35.0 did not update the database. php update.php did nothing and I get errors on our wiki saying the table cannot be found.

[X9rTt6Dou00@cr2kmZ5c4AAAAMA] /index.php?title=Main_Page Wikimedia\Rdbms\DBQueryError from line 1699 of /var/www/mediawikis/wiki-1.35.0/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?

WikiForMen (talkcontribs)

I have just done a new installation. If the checkbox "HitCounters" is ticked during the first installation, the DB table "hit_counter" is created immediately during the first installation. If the extension HitCounters is added after the initial installation, php update.php must be called up again on the command line and the DB table "hit_counter" is created subsequently. Both variants work.

Emikulic (talkcontribs)

I will have to try again. Will let you all know how it goes.

Reply to "update.php did nothing"

Feature suggestion: Views since last change

2 (talkcontribs)

As a MediaWiki administrator, I suggest an option to display the view count since the last change, to provide a rough idea of how many people have read the current revision of a page.

For example: “This page has been accessed 21948 times; 1827 times since the last edit.

For that, it would only have to memorize the edit count upon saving the last edit, and subtract that from the current view count.

If that is considered out-of-scope, one could create a simple separate extension for this purpose.

MarkAHershberger (talkcontribs)

I don't think it is out of scope. Could you create a phabricator task with this request?

Reply to "Feature suggestion: Views since last change"

Does it also count action=render and action=raw views?

8 (talkcontribs)

When accessing a page through action=raw or action=render, is a view supposed to be counted?

According to my tests, they sometimes count as a view and sometimes do not. Is action=render and action=raw supposed to count or not?

I also tested with action=edit and action=history, which apparently count no views. Correct me if I'm wrong.

MarkAHershberger (talkcontribs)

If there is an inconsistency, that is a bug. Please file a bug with your findings. (talkcontribs)

Sorry for late response.

Like that other comment noted, yes, the apparent inconsistency might be caused by caching and/or delayed database updates.

I might run another test soon.

But, as already asked, is HitCounters supposed to also count views on pages accessed with the action=raw and action=render URL parameters, or only when viewed normally? (talkcontribs)

I have done my own testing. Next to the default action=view, only action=render does count as view. action=raw does not.

I suggest other users to test it as well and share their results here. (talkcontribs)

I can confirm this too, but whether revision views count as a view is not tested so far. Maybe I will do it later.

But I think it does count as well, regarding ?action=render counts. (talkcontribs)

Tested that. It counts as well. (talkcontribs)

I have tested it it as well. Same results.

The render action counts as view, but not raw, and also not info, edit and exporting. (talkcontribs)

Hello, Mark.

I can't speak for the user above, but these perceived inconsistencies might be related to caching.

I came here because I had the same question as IP 79.249:

Which of the actions do supposedly count as view?

(This should be documented on the article.)

Reply to "Does it also count action=render and action=raw views?"

{{NUMBEROFVIEWS}} for specific articles?

3 (talkcontribs)

{{NUMBEROFVIEWS}} usually displays the total view count of the wiki.

Is there any way to have {{NUMBEROFVIEWS}} for specific articles?

I tried out {{NUMBEROFVIEWS|Example}} , but it did not work.

If there is no way, I suggest it as a new feature.

MarkAHershberger (talkcontribs)

I believe you would have to create a phabricator task for that. (talkcontribs)

As a magic word, I guess it would need to be something like {{NUMBEROFPAGEVIEWS:PageName}}, which would show the view count for the current page if none specified.

Reply to "{{NUMBEROFVIEWS}} for specific articles?"

Live Updates since 1.35.0 upgrade

2601:646:8E01:1740:158A:E49A:ADD3:F161 (talkcontribs)

I've noticed that the hit counters on my site are updating live, even over the 100 limit listed on the extension page, since upgrading to 1.35.0 last weekend. Is anyone else noticing this?

MarkAHershberger (talkcontribs)

Pinging @GregRundlett since I know he uses this extension to see if he has any similar reports.

Reply to "Live Updates since 1.35.0 upgrade"
Tgr (talkcontribs)

Despite the scary warning, installing under 1.35a works fine, and at a glance I don't see any reason in the code why it wouldn't. Anyone knows what that's about?

Cboltz (talkcontribs)
Tgr (talkcontribs)

That's the opposite of what the template says, though (Currently it is only possible to migrate wikis using MW 1.25 to use this extension. A fresh install in MW 1.26 and higher is not possible!).

Cboltz (talkcontribs)

Please re-read the template - the important part is the word "migrate", and all text in that box talks about migration and updating. The next sentence after what you quoted says (highlighting done by me)

[...] an update to MediaWiki 1.26 or newer can permanently delete your hitcounter numbers! See task T120216.

So if you ignore this warning, you will loose the old visitor count from the page table - but in a fresh installation, you have 0 visits, and therefore don't loose anything.

That's at least how I interpret this warning, and also what I expect based on the experience with this extension. Besides this, the fact that it works for you in a fresh install also confirms this.

So: don't worry too much ;-)

Tgr (talkcontribs)

Updated the warning.

Special:PopularPages redirects to Special:Beliebteste_Seiten (German)

Summary by Kghbln

This was reported with task T236012 and fixed in the meantime.

Amousey (talkcontribs)

Version 0.3

1. Despite a default MediaWiki language of "en", Special:PopularPages actually uses the page name Special:Beliebteste_Seiten.

This may be due to an error in HitCounters.i18n.alias.php using "en" not "de": $specialPageAliases['en'] = [ 'PopularPages' => [

'Beliebteste_Seiten' ], ];

Kghbln (talkcontribs)

This was reported with task T236012 and fixed in the meantime. (talkcontribs)

Is it possible to read the total hits from the database by using the API-interface?

Kind regards from Basel, Switzerland


MarkAHershberger (talkcontribs) (talkcontribs)

Would be nice.

Reply to "API and HitCounter"
Wgkderdicke (talkcontribs)

The infobox tells that this extension is compatible with MW 1.25 or higher. The installation chapter says insistent: "Use MediaWiki 1.25 and install this extension. Still in MediaWiki 1.25, run update.php.". Yet a few lines later in the installation chapter the instructions regarding the needed code in the LocalSettings.php file are suggesting that one can install this in MW 1.24 or in an earlier version. Why should one do this if exact MW 1.25 is needed?

Or, asked the other way around, if I do this:

  1. Installation of this extension in MW 1.23.17
  2. Running update.php after installation in MW 1.23.17
  3. Update to MW 1.31.1
  • Hit counters are still available and counting???
Kghbln (talkcontribs)

The MW 1.24 stuff was indeed not needed and misleading.

This is how I have done it many times.

  1. Backup database
  2. Update software, in your case from 1.23.x to 1.31.x including extensions (DO NOT run update.php)
  3. Install HitCounters and invoke it in LocalSettings.php
  4. Now run update.php
  5. That's it.

I am not sure if HitCounters is installable for MW 1.24 and earlier.

Wgkderdicke (talkcontribs)

Shouldn't your way mentioned in the installation chapter also? Because at the moment the installation chapter tells me this:

  1. Coming from < MW 1.25, that, firstly, I have to install MW 1.25 (update software & run update.php)
  2. Then I have to install this extension here
  3. After that I have to run update.php under MW 1.25 with this extension installed
  4. And at the end I have to install MW 1.31, for example (update software & run update.php)

Your solution skips the complete MW 1.25 installation and it seems that with the installation of this extension in addition to the update to MW 1.31 with a update.php runthrough only once one gets two things at a single stroke.

Kghbln (talkcontribs)

Hmm, the more I think about this ... I believe I made a big mistake here. It is over two years ago I last did this. Yeah, do this:

  1. Backup database
  2. Update software, in your case from 1.23.x to 1.25.x including extensions (DO NOT run update.php)
  3. Install HitCounters and invoke it in LocalSettings.php
  4. Now run update.php
  5. Update software from 1.25.x to 1.31.x including extensions
  6. Run update.php
  7. That's it.

In the end the docu is correct and you understood correctly.

Reply to "Installation in MW 1.23?"
There are no older topics