Linux 软件免费装
Banner图

Stats4U

开发者 lwitsolutions
更新时间 2026年10月1日 01:29
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

statistics counter visitor counter consent hit counter

下载

1.6.0

详情介绍:

The plugin puts the official Stats4U script (s4u.js) on your site - the same code the creator on stats4u.net gives you, with every setting from it - right where you want the counter to appear. A ready-made paragraph for your privacy policy is at https://www.stats4u.net/privacy-embed - tailored to your counter number, in 19 languages. The words in the counter come in 19 languages - the same as on stats4u.net. The settings page is written in English and ready for translation on translate.wordpress.org; WordPress installs the translation for your language by itself once it is there.

安装:

  1. Install and activate the plugin.
  2. Open Settings -> Stats4U and choose the wizard - or the custom configuration, if you prefer all settings at once.
  3. Paste the code you got on stats4u.net, click "Create a free counter on stats4u.net" (its last step brings the code back), or request a new counter number right there.
  4. Save. The counter appears below your theme's footer; change the place, the look and the consent tool any time.

屏幕截图:

  • The wizard: counter, appearance, placement and consent, one step at a time.
  • Custom configuration: every setting, sorted in a menu.
  • The counter right below the footer of a theme.

升级注意事项:

1.6.0 Output escaping hardened. The settings page is translated through translate.wordpress.org now; until your language is complete there, it is in English. Your settings are kept. 1.5.0 The counter now uses the official Stats4U script: your statistics get the page, the referrer and the time on page of every visit. Your settings are kept. 1.4.0 Paste the code from stats4u.net, choose where the counter goes and let your consent tool decide when it loads. Your settings are kept.

常见问题:

Where exactly does the automatic counter appear?

By default right below your theme's footer: behind the element that the theme marks as its site footer (<footer>, role="contentinfo", site-footer, the footer part of a block theme, an Elementor footer ...). Tested with Twenty Twenty-Four and -Five, Astra, GeneratePress, Hello Elementor, Kadence, Neve, OceanWP and themes whose page body is a flex or grid container. If a theme has no recognisable footer, the counter goes to the end of the page. You can also choose "inside the footer", "below the content of posts and pages", a fixed corner, or place it yourself with the block or the shortcode.

How do I put the counter into a theme template?

Write <?php echo do_shortcode( '[stats4u]' ); ?> where it should appear - in footer.php, for example. A shortcode typed into a PHP file as plain text is not processed. Set Where to show it to "nowhere automatically", otherwise the counter appears twice. The settings page shows the same line under Placement.

Why the script and not just the counter image?

Up to version 1.4.0 the plugin used the image alone. It was lighter, but your statistics got almost nothing from it: a browser sends only your site's domain along with an image from another server, not the page, and nothing about where the visitor came from or how long they stayed. The script sends the page and the referrer with every count and adds time on page, scroll depth and the "online now" figure.

Do I need a cookie banner?

The script sets no cookie and stores nothing on the device; what it sends is listed under External services. Which duties apply to your site is a question for your jurisdiction; a description for your privacy policy is at https://www.stats4u.net/privacy-embed. If your site uses a consent tool anyway, choose it under Consent and the counter waits for the visitor's consent.

My consent tool is not in the list.

If it supports the WP Consent API, choose that. If it blocks scripts that carry a certain attribute, choose "another tool" and enter what it wants on such a script, for example type="text/plain" data-category="statistics".

Some tools ask me to create a service first.

Tools that decide per service (Usercentrics, Klaro!, Real Cookie Banner, Axeptio, consented.eu, Civic) need Stats4U as a service in their own settings. Create it in the statistics category and enter its name under Category or service - the settings page tells you which name it expects. Until the service exists, those tools never release the counter.

Will I lose visitors in my numbers?

With a consent tool, visitors who decline are not counted - so yes, the numbers will be lower than without one. The same happens with optimisation plugins that hold back JavaScript until the first click or scroll: visitors who do neither are not counted. Exclude stats4u.net/s4u.js there.

My theme changes pages without a full reload.

Then the counter counts the first page only, unless the theme lets the Stats4U script run again for each new page - the way the navigation of stats4u.net itself does: before swapping the page, fire the event s4u:seiteweg on document (it closes the time on the old page), and afterwards insert the counter's script tag again. With a consent tool, window.stats4uAn() fills new placeholders after the swap; it exists only once the visitor agreed.

How do I change the design?

Create or change it on stats4u.net and paste the new code - or use "Create a free counter on stats4u.net": when you come back, the settings page shows the new design at once, and Save Changes puts it on your site. The plugin keeps your placement and consent settings; only the counter changes. Pasting just a number keeps the design and changes only the counter.

Does the plugin send anything to stats4u.net while I am in the admin area?

Your server does not. Your browser loads the preview image on the settings page and in the block editor, marked so that it is not counted.

What happens if stats4u.net is unreachable?

Then the counter is missing from your page, and nothing else. The script loads asynchronously and does not hold up your page.

Why is the counter a link?

The Stats4U script links every counter to its statistics page, so visitors can click through to your numbers - the same on every site that uses the code from stats4u.net. If your statistics should stay private, set the counter to "not public" on stats4u.net: the link then goes to the Stats4U home page instead of your numbers.

Does deleting the plugin delete my counter?

No. Deleting the plugin removes its option and the remembered view of its settings page from your database, and nothing else. The counter belongs to you and keeps its history - your numbers should not disappear because you tried a plugin and removed it again.

更新日志:

1.6.0 1.5.0 1.4.0 1.3.1 1.3.0 1.2.0 1.1.0 1.0.0