Closed phtmgt closed 7 years ago
Hey there!
No, attachments are not officially supported by the plugin - but you can enable support by making a tiny change to the WPP_Query class: change _AND p.poststatus = 'publish' to _AND p.poststatus = 'inherit'.
Note that every time the plugin gets an upgrade this change will be lost and you'll have to redo it.
Hey,
Thanks for the suggestion. Unfortunately it doesn't work and my feeling is that because this only pertains to displaying, not collecting data. In the backend the count does not show media posts when they are viewed and on the frontend it displays "no data avalilable".
Did you change the post type on the Stats section as well?
Yes, tried both "post,page,attachment" and "attachment". On attachment only it doesn't display any data despite media being viewed.
Not sure what's going on then. I know it's not the tracking part because the plugin doesn't check for the post type when registering a view so it must be something else. I'll have another look at the code and get back to you later.
Well, I can tell you it registers data in the database, I checked it manually. The pageviews column of popuparpostsdata table is populated properly (+1 on pageview).
Here's a partial CSV export from the posts table, my feeling is that our structure/post settings might be the problem (this is a custom theme).
"ID","post_author","post_date","post_date_gmt","post_content","post_title","post_excerpt","post_status","comment_status","ping_status","post_password","post_name","to_ping","pinged","post_modified","post_modified_gmt","post_content_filtered","post_parent","guid","menu_order","post_type","post_mime_type","comment_count" 37454,0,"2017-09-28 12:24:44","2017-09-28 12:24:44","","You Are More Than Beautiful","","inherit","open","open","","you-are-more-than-beautiful","","","2017-09-28 12:24:44","2017-09-28 12:24:44","",37513,"",0,"attachment","image/jpeg",0
Hey there!
You're right, the Stats section doesn't show statistics for the attachment post type. This happens because this section uses some custom queries were post_status is also set to publish.
The solution is simple: you also must change these to inherit and it'll work :) (see: WPP_Admin class).
Just wanted to report back it works. Thanks!
Took you a while :P Thanks for reporting back! Happy New Year!
Hey,
Thanks for the great plugin. Unfortunately, we need it to keep tabs on popular images on our website, i.e. to count visits for 'attachment' type of posts. Although we change the setting from post,page to attachment, it does not work.
Any suggestions?
Thanks.