webberzone / top-10 Goto Github PK
View Code? Open in Web Editor NEWTop 10 - Popular Posts plugin for WordPress
Home Page: https://webberzone.com/plugins/top-10/
Top 10 - Popular Posts plugin for WordPress
Home Page: https://webberzone.com/plugins/top-10/
This line should be changed to if ( ! empty( $add_to['feed'] ) ) {
Line 61 in 4affca2
Source: https://wordpress.org/support/topic/displaying-attachment-pages-in-widgets
Fix:
$where .= " AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'inherit') ";
The widgets will need to have a separate cache.
Details in: https://wordpress.org/support/topic/widgets-not-displaying-posts-from-the-set-custom-date-range?replies=10
Right now the posts count is increased when in Customizer mode.
Check for is_customize_preview and do not add the code.
This used to be there in previous versions.
Add a navigation bar at the Widget in the WordPress dashboard that lets a user directly jump to the next 10 posts.
Alternate consideration is using ajax to update the widget
Allow passing an offset argument to display a different set of posts
Implementation potentially similar to how WordPress does it
As in this post, https://wordpress.org/support/topic/support-for-srcset/#post-9769365
Support for srcset can be added in the plugin
As part of v2.3.2, the external js/php file had to be removed due to risk of incompatibility on every single WordPress install as it seeks wp-load.php as per wordpress.org repository requirements.
A new addon should be built that will bring back this functionality. It won't be listed on the wordpress.org but on webberzone.com
I'm hosting a site on WP Engine. Periodically I export my local db, changing all url references via search/replace, and import to the WP Engine production db.
Every time I do this, all Top 10 settings are restored to the defaults. It's a pain to have to reset these each time. Can you reproduce this on your end?
Currently, Exclude categories is specific for the current category only but not sub-categories. Add a new option to exclude posts on sub-categories/ descendent categories.
New option to not track posts if the user is logged in.
if ( !is_user_logged_in() ) { $include_code = false; }
Top 10 tracking script hooks to the_content
filter. This doesn't work when jquery is moved to the footer e.g. with a plugin like https://wordpress.org/plugins/scripts-to-footerphp/
Change code to use an external (cacheable) javascript file which triggers an ajax action via wp_ajax_wherego_tracker
Refer to this support thread: https://wordpress.org/support/topic/some-posts-have-total-views-stuck-at-zero-0/#post-9726819
The issue with the ON DUPLICATE KEY is that the blog_id
is not included in the primary key which causes an issue that any updated counts where there are same post ids across multiple blogs only go to the first blog being tracked.
To fix by upgrading the database format to have both blog_id and post_id as the keys
By default, strict_limit is false which results in more posts being selected when limit is passed.
This is not good for user experience because the expectation is to have the exact number of posts specified by limit.
As detailed in: https://wordpress.org/support/topic/top-10-now-showing-only-overall-top-posts-and-not-daily-ones?replies=17#post-7720102
If no arguments are passed, then the function displays the popular posts only. Potentially creates an error / warning.
This function works fine with v2.2.2
Add a menu item and screen to Multisite to display all the top posts across all the sites.
Firstly, thanks for your WP plugin, it's really useful and helpful for tracking the number of visited on my blog. However, I have been encountering an issue for a while.
The number of total visited time hasn't been updated since 2 months ago, although the number of daily visited was updated when I refresh the browser. As a result, I checked the database. I found there are many duplicate records in the wp_top_ten table such as
mysql> select * from wp_top_ten where postnumber = 8422;
+------------+-----------+---------+
| postnumber | cntaccess | blog_id |
+------------+-----------+---------+
| 8422 | 17534 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
| 8422 | 1 | 1 |
+------------+-----------+---------+
11 rows in set (0.00 sec)
I am not familiar with your project, so I am wondering is it correct?
And the records from wp_ten_top_daily is as below:
mysql> select * from wp_top_ten_daily where postnumber = 8422;
+------------+-----------+---------------------+---------+
| postnumber | cntaccess | dp_date | blog_id |
+------------+-----------+---------------------+---------+
| 8422 | 1 | 2018-01-24 12:00:00 | 1 |
| 8422 | 1 | 2018-02-04 15:00:00 | 1 |
| 8422 | 2 | 2018-02-04 18:00:00 | 1 |
| 8422 | 2 | 2018-02-04 21:00:00 | 1 |
| 8422 | 2 | 2018-02-04 22:00:00 | 1 |
| 8422 | 1 | 2018-02-05 00:00:00 | 1 |
| 8422 | 2 | 2018-02-05 01:00:00 | 1 |
+------------+-----------+---------------------+---------+
7 rows in set (0.00 sec)
I am not sure why the first record was created on 2018-01-24 12:00:00
. Is because the scheduled maintenance will delete entries older than 90 days in the daily tables?
Add a filter to override the number of days that maintenance considers to delete the database entries
Line 181 in 621412a
Fix the missing semicolon in document.write
Currently only admins can edit counts. Allow users with edit_posts
permission to set the post count as well.
Add a filter, which would allow admins to turn it off by adding code to functions.php or functional plugin
2.2.4 does not work with PolyLang. The WPML implementation has caused an issue with the way PolyLang works
top-10/includes/public/output-generator.php
Line 198 in 4affca2
Use code similar to: crp_trim_char for trimming.
Add link to Daily Posts view which was there in previous versions
Fatal error: Uncaught Error: [] operator not supported for strings in /.../wp-content/plugins/top-10/includes/public/display-posts.php:353
save_post
action doesn't work with attachments.
Use add_action('edit_attachment'
instead
if the main blogpost has a 2000x2000 image, same image will be called and rendered in a small box. which effectively hapers the site performance.
As reported here:
https://wordpress.org/support/topic/you-have-contexual-related-posts-installed-what-does-this-mean
The function check needs to be replaced with crp_default_options
Currently the views are either all popular posts or only the current day.
Propose to modify the screen to have a drop down to select it for a specific day.
Option to set the oldest posts to display e.g. right now even very old posts would show at the top if they are popular.
Showing only recent posts would help bring focus to them.
As explained in: https://wordpress.org/support/topic/size-of-thumbnail-in-widget-doesnt-take?replies=5
Fix:
$postthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $result->ID ), array( $args['thumb_width'], $args['thumb_height'] ) );
Add custom roles for the plugin e.g. Admin screen etc.
Add a widget to display the overall posts counts on a blog via a function and a widget
Hi @ajaydsouza,
I've been using bedrock structure and it's seems top 10 not work on the bedrock.
in bellow files:
top-10-addcount.js.php
top-10-counter.js.php
Should be change:
$wp_config_filename = '/wp-load.php';
to:
$wp_config_filename = '/wp/wp-load.php';
Regards
Unchecking all boxes still causes the visits to appear. However, leaving any one box checked works properly.
Wordpress plugin page : https://wordpress.org/plugins/top-10/ is returning a 404 from past 2 days any specific reason.
Add two new checkboxes for this:
a) Exclude display of top posts on this post
b) Exclude this post from the top posts list
Views on drafts are being recorded when they are viewed. Code shouldn't be included when viewing a draft.
Updated the plugin to use the Settings API instead of the custom programming for the admin interface.
Wrapper function for:
`
`
That will allow a user to ad this to their theme inc ase it is missing the the_content
tag.
I'm sorry if this has been already answered but how do I make a count either by using JS and PHP?
For example, I'm using fancybox and I can insert whatever code I want inside the callback when opening a post link. I want to add a piece of code there (JS/Jquery) to count a visit (the user is not technically entering the post page but he's viewing some content through fancybox). How can I achieve this?
Also, regarding PHP, there used to be this code:
<?php echo tptn_add_viewed_count( ' ' ); ?>
But it's not working anymore. Any way to achieve the same result through PHP?
Enter a list of categories and tags on which the display of posts would be excluded.
Hi,
I have Top-10 on webpage with four widgets:
When cache is turned off everything is ok, widgets show correct content. Unfortunately plugin cause high server without cache, so it is required. When cache is turned on, widgets: today, last 7 days, last 30 days shows same content, only overall show diffrent posts.
WP Super Cache is installed on page too.
Refer to https://wordpress.org/support/topic/make-the-plugin-compatible-to-be-translated-with-wpml/
change this line:
global $tptn_settings;
to this
$tptn_settings = get_option('tptn_settings');
Views are not tracked with using AMP (via the Automattic AMP plugin)
If a post is in the top list and a user is on it, then exclude this list from the top posts. i.e. show Other popular posts.
Caching the top posts query can go a long way in performance improvement.
Sample code: https://wordpress.org/support/topic/cache-wpdb-result?replies=1
The styles box should read: "Style of popular posts" not "related posts"
Allow the user to choose which tracking code. Use the old code by default due to speed reasons.
Create an addon that will generate a custom feed of the top popular posts.
Customizable options:
a) No. of posts
b) Configurable permalink
c) Daily and/or overall posts i.e. custom time period
Is there any way to track visits even if the_content is not there?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.