Giter VIP home page Giter VIP logo

favorites's People

Contributors

cadoo avatar gfargo avatar kylephillips avatar radwanhallak avatar renatonascalves avatar sakano avatar slimndap avatar stephenwidom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

favorites's Issues

Add WPMU Compatibility

  • Need to save the site ID along with the post ID
  • When fetching favorites, need an additional site ID parameter for MU installations

Get last favorited post (Callback function)

Hi,

is there a way to get the post that a user just favorited, just right after the favorite button has been submitted?

The callback favorites_after_button_submit is returning an array of all posts that a user has favorited so far, but it would be interesting to have a function that returns only the last one (and get if the user favorited or "unfavorited" it).

I need it to integrate the favorites activity in the Activity Feed of a BuddyPress site. Any other way to implement that would be also welcome.

Thanks!

Add delete_post action

Need to add a delete post action that loops through users, checks if the post has been favorited, and removes it from their favorites.

get count of favorites, across all posts

i'm integrating Favorites into my site at watchmecode.net and i'm loving it so far!

now i'm trying to build a little vanity metric on my WP Dashboard, to show me the total number of favorites added by all users, but I can't find a way to do this easily.

i could loop through all posts, call get_users_who_favorited_post, loop through those and add +1 per favorite, but that's going to be a ton of processing and loops for a large list of posts / taxonomies.

it would be nice to have a get_all_favorites or something like that, where i can get a list or count of all favorites in the system

thanks for the great plugin!

Autoloader problem

Hi, when I activate the plugin, I get the following error in the debug.log:

PHP Fatal error:  Class 'SimpleFavorites\Bootstrap' not found in /var/www/content/plugins/favorites/app/SimpleFavorites.php on line 20

There seems to be a strange problem with the autoloader, that I can't figure out. I tried to recreate the autoloader files with composer, but no luck so far.

Empty Lists displaying fantom favorite

Some users reporting the following:

  • New user visits site without any favorites
  • Empty favorite item without link showing up in their favorites list
  • If the user favorites an item, the behavior stops

JavaScript Callback Functions

What is the proper way to use the JavaScript callback functions?

You already have them defined in the minified JavaScript file. Are you wanting us to modify that file directly?

Also, the documentation here seems incorrect, where you reference "simple-locator", under "Callback Functions":

https://favoriteposts.com

Add filter to generated list

Add filter to the generated list, which will let devs format however they need to without a custom query. Will also solve AJAX problem.

The [user_favorite_count]-shortcode is not dynamically updated.

Unlike the [favorite_button]-shortcode.

I would like to show the total favorite count for the current user at the top of the screen and use it as a link to their favorites overview page.

Whenever you add a new item to your favorites (using the favorite button), the favorite count is not updated. I guess this is also needed to make it work with caching turned on.

Using filters not working

passing a post type into any of the retrieval functions always displays ALL of the post ID's that have been favorited for that user.

Would love support for favoriting users/authors

I'm using a custom version of https://pippinsplugins.com/series/creating-a-user-follow-system-plugin/ for a project I'm working on now. WP Favorites would help me minimize code if I could add similar functionality for users. It's basically a "Follow" button like twitter/facebook. If I 'favorite' a user, I can then use a template tag or build a custom query to show latest posts/post_type of the authors I follow. Or anything for that matter.

My current system works well, just curious of the idea to add it to your amazing looking plugin.

[user_favorite_count] always zero

Hi Kyle!

Thanks for #18!

I was just trying it on my dev machine, but it doesn't seems to be working on my install. I'm running multisite, with no caching enabled.

I am able to add posts to the favorites with the [favorite_button] and get_user_favorites() gives me the correct posts back.

Unfortunately [user_favorite_count] always returns zero.

I looked at your code to see if I could fix it, but I failed. The get_user_favorites_count() method in app/API/functions.php seems to be a bit messy compared to get_user_favorites(). Perhaps it's still missing the multisite fix from 1.1.0?

Jeroen

Cookie expiration time

Hi Friend, It is possible for a future update to set the expiration time of the cookie?

1 Month
No Expire
etc

    /**
    * Sync a Cookie Favorite
    */
    public function cookie()
    {
        if ( $this->user->isFavorite($this->post_id, $this->site_id) ){
            setcookie('simplefavorites', json_encode($this->removeFavorite()), time() + (86400 * 30), '/' );
            return;
        }
        setcookie('simplefavorites', json_encode($this->addFavorite()), time() + (86400 * 30), '/' );
        return;
    }

Thanks

AJAX update favorites list

Need to inject favorites list on page load – same issue with page caching as button.
Also, can update list when a user favorites/unfavorites a post.

[Suggestion] Replace favorites with lists

Basically instead of favoring a post the user adds it to a list (could be favorites, bookmarks, read later etc), maybe the user could create this "lists" (like youtube) or they are created by the admin.

Would this be viable at this point?

Content Filtering

One feature request that would be really helpful… if a user has favorited a taxonomy (once taxonomy favoriting is in place), provide a way to filter queries by "favorites".

Most Favorited Posts

Add function & shortcode to display top favorited posts. Add limit parameter.

Get Favourite Thumnail

I think personally it would be an awesome idea if you could get the post thumbnail - this is just a suggest and would be pretty awesome.

Say you favourite a blog you can recognize that blog much easier if the thumbnail was there with it :)

SimpleFavorites\Bootstrap::startSession consumes a lot of time

SimpleFavorites\Bootstrap::startSession slows down the page for almost 898 ms at index.php of the WordPress.

I haven't read the code yet, but I use cookie instead of session to store the metadata. I guess startSession here means using session to store the metadata?

Please let me know if I can help with debugging.

Front-end screenshots

Add WP repository screenshots for:

  • Favorite Button
  • Favorite Button (favorited)
  • User favorites list
  • Post Favorites count

Sentences for translation

I'm working on a french translation and found:

If you are compiling your own minified Javascript, include the below (required for plugin functionality):
Depenedencies

Favorites don’t save if page hasn’t completely loaded

Hi @kylephillips ,

I don’t know how you best handle support requests/bug reports and the like & thought this might be a better place than the wp.org forums. So please excuse my double posting.

The problem I experience is simple: Your Plugin obviously needs to have all elements on a page to be loaded completely in order to fully function when using shortcodes and automatic placement of buttons. Latest version of WordPress and your plugin.

When I open a page or post, I can immediately see your Fav button. When I click on it while loading or even shortly after, the button changes to success message, takes a few seconds, then changes back to its unfavorited state, i.e. the page/post has not been added to my favourites. This is also reflected on the user’s fav count shortcode output I placed visibly. When I wait for a bit and then try to favorite my post, it works.

Chrome console throws out an error when fav adding fails:
Uncaught TypeError: Cannot read property 'length' of undefined for simple-favorites.min.js in line 1.

Show users who have liked a post

Add function/shortcode to list users who have liked a post. Include an array function and shortcode/list.

Will need to add in anonymous users.

Options:

  • Include anonymous
  • Display as (nicename, firstname, firstname lastname… same options as user settings)

PHP Notice: Array to string conversion

When using the shortcode [user_favorites] and a user who never had any favorites (so he has no "simplefavorites"-entry in the usermeta-table) visits the site you get the following Notice:
PHP Notice: Array to string conversion in /var/www/html/wordpress/wp-content/plugins/favorites/app/Entities/User/UserFavorites.php on line 117

If you set /var/www/html/wordpress/wp-content/plugins/favorites/app/Entities/User/UserRepository.php:91 from if ( empty($favorites) ) return array(array('site_id'=>1, 'posts' => array())); to if ( empty($favorites) ) return array(); the Notice disappears

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.