Statify Widget
Statify Widget
Description
The Statify Widget shows the most popular content from the Statify plugin, which collects statistics in compliance with data protection regulations. Fast and clear!
What is Statify?
Statify is a plugin for visitor statistics with emphasis on privacy, transparency and clarity.
Note: This widget only works with the main plugin Statify.
Features
- Popular Posts: Sum up all view from Statify and put it together in a widget
- Shortcodes: The counter for each post/page can be put everywhere
- Custom Post Types: Statify Widget supports custom post types, that can be displayed
- Intelligent summary: Once there are different paths to a content, the widget adds them together
- Period Selectable: It is possible to choose an individual daily period for the post popular content
- Custom Widget Template: You can add individual post/page paramater to widget template (see FAQ)
- New: Customize cache time: Change default 4 minutes cache time to another value! (see FAQ)
Shortcode
The shortcode [statify-count] can be used to display calls to the current post or page. With the options “prefix” and “suffix” displayed texts can be checked before (prefix) and after (suffix) the calls:
[statify-count prefix="Total " suffix=" calls." days="8"]
Parameter:
prefixSentence before viewssuffixSentence after viewsdaysInteval for view statistics
Result: A total of 243 views.
Widget Settings
The following settings can be made in the widget:
- Title
- Content Type (Default: post )
- Category (when content type post is select)
- Amount of entries (default: 5)
- Show views (default: No)
- Custom text (Replace variable for views: %VIEWS%)
- Number of past days (0 days = all statistics)
Support
Friendly questions about the widget I like to answer under Support.
If you like my work and want to support me, feel free to rate this plugin!
Author
- Finn Dohrn
- Homepage
Installation
- Install the “Statify” by pluginkollektiv.
- Install this Plugin “Statify Widget” and activate it.
- Activate the Popular Post Widget under widgets.
Faq
Statify has not added statistics yet. Wait some days to collect some statistics by Statify.
Yes! Since 1.4.1 you can add the following filter to change the default 4 minute cache (60 * 4) to another value in seconds:
add_filter( 'statify_targets_cache_expiry', fn() => 60*4 );
If you do not set a numerical value greater than zero (>0), the standard cache expiry time is automatically used.
If you deactivate the plugin, all existing cache will be delete. After that you can activate Statify Widget again. Everything continues to work as usual.
Yes! Since 1.1.4 that works.
Just in the content type widget: select Pages and posts. He then displays the default content types “post” and “page” together.
This is possible with shortcodes. Specifying a prefix and suffix is not mandatory:
Properties:
days= Amount of daysprefix= Text before the view countsuffix= Text after the view count
Shortcode:
[statify-count prefix ="Total" suffix ="calls." days="8"]
The total view counter for the whole webpage:
[statify-count-sum prefix="Total" suffix="calls."]
No problem. A pseudo “Frontpage” (with views) entry appears.
This changes nothing. The plugin takes every Statify entry and adds it together.
Just use these CSS classes:
* List: .statify-widget-list {...}
* List item: .statify-widget-element {...}
* List item view counter: .statify-widget-element span {...}
* List item link: .statify-widget-link {...}
If you want to change the list of contents (1st, 2nd, 3rd, …) to bullets, just add the following to your CSS:
.statify-widget-element {
list-style-type: circle;
}
Since 1.3.8 it is possible to customize the Widget Template by adding code to your Template functions.php. You can use the WP Post Object in the template.
There exists two hooks:
statify_widget_before_linkstatify_widget_after_link
For Example add thumbnail before link in a div:
function statify_custom_template($post) {
echo '<div class="post_thumbnail">'. get_the_post_thumbnail($post->ID, 'thumb') .'</div>';
}
add_action('statify_widget_before_link', 'statify_custom_template');
For example put this in your theme:
<?php
if(function_exists('statify_popular_posts')) {
$wp_query = statify_popular_posts(
$amount = 5,
$days = 30,
$post_type = 'post',
$post_category = 0
);
// Make WP Post loop...
while ( $wp_query->have_posts() ) {
$ wp_query->the_post();
}
}
?>
Properties
$days= Range of days for statictics (0 = all days)$amount= Amount of posts$post_type= Post type (“post”, “page”, …)$post_category= Category of the post, if post type is choosen
Reviews
Perfektes Timing für das Update
By tpnotes on January 6, 2023
Vielen Dank für das Update!
Das kam für mich genau zum richtigen Zeitpunkt, da ich gerade meine Statistik auf Statify umstelle, mir aber bisher bei diesem Plugin die Möglichkeit fehlte, das Featured Image auszugeben. Gerade wollte ich mich als php-Dummy auf die Suche nach einem Code-Schnipsel machen, da finde ich dieses Update...
Plugin installiert, Code-Schnipsel eingebaut, eine CSS-Anpassung aus den FAQ übernommen - 5(!) Minuten später war das Widget fertig. Da hat bei anderen Top-Post-Plugins allein die CSS-Anpassung schon deutlich länger gedauert.
danke für diese geniale Erweiterung
By youtubefun on July 5, 2019
Exakt was ich brauchte!
By LSBK on June 10, 2018
Fix & Fertig
By brandenfeld on September 3, 2016
Plugin installiert, Widget eingefügt, CSS angepasst - Fertig. Vielen Dank.
Changelog
1.4.8
- Fix missing translation output, if required plugin “Statify” is missing.
1.4.7
- Add missing js script
- Remove possible XSS vulnerabilities (More information)
- Fix print statement for missing posts in widget
1.4.6
- Accept only filter minute values >0 (not smaller than zero)
- Reactivate category selection for “post” type in widget (without extra jQuery)
- Reduce number of queries. That boost performance for websites with many pages.
1.4.5
- Conversion of the interval calculation from PHP UTC to the selected WordPress time zone
1.4.4
- Add again filter for “frontpage” fallback if ‘posts’ in widget.
1.4.3
- Fix bug that crashes the whole plugin.
1.4.2
- Fix small bug, that displayed “frontpage” (if blog view is activated) in ‘posts’ widgets.
1.4.1
- Add filter for customize cache expiry time (new FAQ section!)
- If you now deactivate plugin, all existing cache will be removed (new FAQ section!)
- Remove permitted tags and reduce number of tags to five
1.4.0
- New major version.
1.3.9
- Correction of the totals of views from Statify data (if a page is selected as the start page, the views of the start page and the selected page are combined). The “Blog” page is now recorded independently
- Support for up to PHP 8.4 enabled
- Text display if no posts exist yet included in translation
- Correction of the total sum in the shortcode (was always one too few)
- Change of the relation in the SQL statement from “greater than or equal to” to “really greater”
1.3.8
- Hot-Fix: Update problem, that hide any popular post widget content.
- Remove unnecessary JQuery.
1.3.7
- Add missing PHP Class File.
1.3.5
- Feature Request: Add custom template option for widget (See: https://wordpress.org/support/topic/add-thumbnails-and-disable-jquery/)
1.3.4
- Fix problem with Widget settings in Elementor (See: https://wordpress.org/support/topic/anzahl-der-aufrufe-anzeigen/)
1.3.3
- New way to return list of popular posts as WP_Query
- Correct the way how pseudo frontpage is generate
1.3.2
- Fix for non existing views in “Frontpage” alias
1.3.1
- Fix bug in [statify-count-sum]. Remove unnecessary post_id.
- Add shortcode parameter “days” for limit interval days.
1.3.0
- Bugfix: Hide duplicate frontpage item in widget.
1.2.9.
- Now comtaible with PHP8
- Fix two bugs occured in PHP8 version.
- Remove “frontpage” label, now the frontpage list with its original page name
1.2.8
- Fix bugs
1.2.7
- Add some description and tested up to WordPress v5.6
1.2.5
- Fixed bug in backend for category select
1.2.4
- Fixed ressourcen bug. Add required java script folder.
1.2.3
- Add feature to filter for post category in widget.
1.2.2
- Fixed another bug for unpublished posts
1.2.1
- Translate whole plugin into English.
- Fixed “show views” translation bug.
1.2
- English and German language
- Fixed a link bug in the widget
- Shortcode for total number of views
1.1.9
- Correction of a translation error.
- List type setting has been removed.
1.1.8
- The plugin is now ready for translation.
- You can now choose between the list type (
<ol>or<ul>) per widget. - Now the classes
statify-widget-list,statify-widget-elementandstatify-widget-linkhave been added as class to make a more flexible design possible.
1.1.7
- List type ordered (
<ol>) changed to unordered (<ul>) for higher theme compatibility. - Outdated create_function () method swapped.
- Bug with shotcode usage removed (statify_count edited in Statify_Posts.class.php)
1.1.6
- The functionality of restricting a time period for the content has been added.
- Fixed a bug that caused the homepage to ignore when choosing “Posts + Pages”.
1.1.5
- An error has been removed. He had always shown the number of views at the end of a page.
1.1.4
- Content Type: “Posts and Pages” added to show together
- Views for article shortcode and theme function
1.1.3
- Recording the evolution and tested for WordPress 4.7.6
1.1.2
- Corrections in the validation
1.1.1
- Custom text for the number of views
- Unused require_once () removes
- span element added by the number of views
1.1
- Limitation of records canceled
- added title attribute to the links
1.0
- Release of the first version

