- Favorite list is empty.
Your favorite posts saved to your browsers cookies. If you clear cookies also favorite posts will be deleted.
I made a plugin named as WP Favorite Posts. This plugin allows visitors to mark a post as favorite. There is no register requirement because this plugin saves data to cookies. Furthermore it can save data to database if user logged in. The user can see his/her favorite posts list from “Your Favorites” page which you created.
Don’t forget to donate
[paypal-donation purpose=”WP Favorite Posts” reference=”nxsn.com”]
Installation
It’s very easy;
- Download the WP Favorite Posts plugin.
- Unzip into your
/wp-content/plugins/
directory. - Activate the plugin through the ‘Plugins’ menu in WordPress
- Place
<?php if (function_exists('wpfp_link')) { wpfp_link(); } ?>
in your single.php or index.php template file. Then favorite this post link will appear in all posts. - Create a page e.g. “Your Favorites” and insert
text into content section. This page will contain users favorite posts.
- That’s it :)
Widget
And there is a widget and template tag for listing most favorited posts. You can go widgets page for using widget. Template tag’s usage;
<h2>Most Favorited Posts</h2>
<?php wpfp_list_most_favorited(10); ?>
The parameter for limiting post count of list. Default value is 5 posts.
Bugs & Appreciations
You can report bugs or write your appreciations by using comments of this post. Also you can see the source code and the ChangeLog. Thanks for using my plugin!
New Feature Request or Need Modification
If you have a feature request or need modification which is urgent for you, contact me. We can make a deal.
Did you like plugin ?
If you like my plugin, i’ll appreciate it if you buy me a coffe or beer! I would love if you write a blog post/tweet etc about my plugin.
[paypal-donation purpose=”WP Favorite Posts” reference=”nxsn.com”]
Some Details
Show Link In Post Content
You can show Add/Remove Favorites Link into post wherever you want with writing Add to favorites
into post content while HTML mode.
Change Template Of “Your Favorites” Page
(version 1.4) You can change “your favorites” page’s templates easily.
First copy wpfp-page-template.php from plugin’s directory to your theme’s directory. Then make template changes (add thumbnail image, make what you want).
If you make something wrong just delete or rename wpfp-page-template.php from your theme’s directory and page’s view will be turn back to basic view.
Who Uses This Plugin ? (DEMO)
http://www.nefisyemektarifleri.com/tarif-defterim/
http://www.hdvideoclip.com/my-playlist
love the plugin but desperately need pagination for the page that lists the favorite posts. any chance someone can post sample code??
@pirco; last version has pagination.
You have a huge bug: if I open in a new tag the link from “add to favorites” ?pfpaction=add&postid=xxx” it will insert a +1 in the favs stats. Even certain search engine robots can do this and you end up in having a lot of favs that are not real!
The bug comes first from the function wpfp_do_add_to_list($post_id) . You check wpfp_check_favorited if is already favorited and you return TRUE. Then you use if(wpfp_do_add_to_list) which says TRUE even if it has been already added to favorited by the user. The sollution is to return FALSE in
if (wpfp_check_favorited($post_id))
return false;
This is only one solution but you need to check the code because even not logged in users can add to favorite even if you allow only logged in ones.
I made a function that allows to show how many favs a post has and which users favorited that post. I even check in phpmyadmin and it is clear to me that the plugin inserts “fake” stats. Please solve this issue.
Thanks a lot
@Marian; you’re right. I applied your solution. Thanks a lot!
Hi Huseyin,
after updating your plugin it seems to conflict with the FA light slider plugin. http://wordpress.org/extend/plugins/featured-articles-lite/
It’s a kind of weired but the content (images, excerpts, etc) of the slider I have on my main page appears on the favorites page unformatted. Further the content overlapps the list of favorites and even my footer.
How should I deal with this?
Thanks & happy new year?
Boris
I discovered the problem!
For any reason I have to uncheck a slider setting to automatically display the slider on my homepage.
Now everything works fine.
Hi, Marian. & Huseyin
had same issue..
I solved it by rewriting code in plugin to block out some search engines from favoriting.
I used something like this.
/* if server host contains eg. search.msn.com die */
$badbot = $_SERVER['REMOTE_HOST'];
$badagent = $_SERVER['HTTP_USER_AGENT'];
$badots= "search.msn.com , net.ua , softlayer.com , Spider , Sitesucker , google , GSiteCrawler ";
if( stristr ( $badbot , $badots) || stristr ( $badagent , $badots) || !isset($_COOKIE["visit"]) ) {
wpfp_die_or_go("ERROR or Javascript required"); } else {
wpfp_add_favorite() ;
}
Are you saying now this issue is resolved with latest update and I can update and remove this block now ?
forgot to check nofity box…
Thanks for mentioning this bug, Marian. I have noticed fake stats, too, and had to remove the widget because of it. Perhaps this update will fix it. What is strange in my case is that I’m using the plugin as an “Add to Wishlist” function for my book review site but the most added posts are actually not the book reviews, but one particular category of posts that is not book reviews. According to the statistics, hundreds of people are adding these old posts from this category and I know that’s not right because the category is old outdated discussions with book giveaways — not at all what people would add to a wishlist.
I really like the plugin as a wishlist for readers, but I really wish the stats would work correctly and hope this will fix it. Thanks for your work, Huseyin!
Great plugin! Congratulations!
Thanks for great plugin :) i hope that it works! greetings from Latvia :)
Thanks for your work on this plugin. With help from the support forum we have been able to customise this plugin to exactly match our site’s needs.
Is there a way I can hire you to fix the plugin? I use WP-Cache on my site and people are saying that some days they go there and their favorites list is someone elses and other times it’s blank. I have people using it 24/7 so I don’t want to get rid of it. I had someone do some customization to it that you also might like and I am glad to let you see the code for that as well if you can fix my problem.
This is what it looks like on my site http://sweetiessweeps.com/your-sweeps-list
Sorry, I mean I use W3 Total Cache