{"action":"created","issue":{"url":"https://api.github.com/repos/pento/react/issues/5","repository_url":"https://api.github.com/repos/pento/react","labels_url":"https://api.github.com/repos/pento/react/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pento/react/issues/5/comments","events_url":"https://api.github.com/repos/pento/react/issues/5/events","html_url":"https://github.com/pento/react/issues/5","id":139427288,"number":5,"title":"Make storage implementation more flexible for plugin developers","user":{"login":"paulgibbs","id":1275914,"avatar_url":"https://avatars.githubusercontent.com/u/1275914?v=3","gravatar_id":"","url":"https://api.github.com/users/paulgibbs","html_url":"https://github.com/paulgibbs","followers_url":"https://api.github.com/users/paulgibbs/followers","following_url":"https://api.github.com/users/paulgibbs/following{/other_user}","gists_url":"https://api.github.com/users/paulgibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/paulgibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulgibbs/subscriptions","organizations_url":"https://api.github.com/users/paulgibbs/orgs","repos_url":"https://api.github.com/users/paulgibbs/repos","events_url":"https://api.github.com/users/paulgibbs/events{/privacy}","received_events_url":"https://api.github.com/users/paulgibbs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-08T23:34:08Z","updated_at":"2016-03-08T23:44:18Z","closed_at":null,"body":"Merits aside, I don't like the fact that the current implementation forces the storage to be tied to comments (which are tied to post types). I know post types get \"stuff for free\", and that's okay, but since this is such a front-end facing feature, it's pretty lame if a 3rd party plugin has content types that are implemented using their own database tables, because it makes this entire feature useless -- those developers can't re-use any of the implementation.\r\n\r\nWhen you approach feature plugin proposals, *please* try to remember to consider the implementation from the perspective of outside plugin developers who want to extend or re-use it as much as possible\r\n\r\nThis matters because it would be a really poor user experience if a WordPress post has this core implementation/design of reactions, but if non-CPT content had its own distinct design.\r\n\r\nIn this case, I'd suggest using a class to handle the \"CRUD\". You'd require an interface to be implemented for that class (I can't immediately think why this would benefit from using inheritance). A simple filter around the class name before the object is instantiated would be enough to let plugin developers switch out the storage layer as they need. And by making the feature flexible for developers, you'd go a long way to preventing each major plugin implementing its own slightly-different version of this."},"comment":{"url":"https://api.github.com/repos/pento/react/issues/comments/194027251","html_url":"https://github.com/pento/react/issues/5#issuecomment-194027251","issue_url":"https://api.github.com/repos/pento/react/issues/5","id":194027251,"user":{"login":"paulgibbs","id":1275914,"avatar_url":"https://avatars.githubusercontent.com/u/1275914?v=3","gravatar_id":"","url":"https://api.github.com/users/paulgibbs","html_url":"https://github.com/paulgibbs","followers_url":"https://api.github.com/users/paulgibbs/followers","following_url":"https://api.github.com/users/paulgibbs/following{/other_user}","gists_url":"https://api.github.com/users/paulgibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/paulgibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulgibbs/subscriptions","organizations_url":"https://api.github.com/users/paulgibbs/orgs","repos_url":"https://api.github.com/users/paulgibbs/repos","events_url":"https://api.github.com/users/paulgibbs/events{/privacy}","received_events_url":"https://api.github.com/users/paulgibbs/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T23:44:18Z","updated_at":"2016-03-08T23:44:18Z","body":"BuddyPress' Activity Stream, which you can see demo'd at https://buddypress.org/members/djpaul/ (if you are logged in you should see Favorite and Delete buttons below each item)."}}