{"id":79003,"date":"2018-07-27T06:16:22","date_gmt":"2018-07-27T06:16:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/redis-post-views\/"},"modified":"2018-07-27T06:32:52","modified_gmt":"2018-07-27T06:32:52","slug":"optimize-redis-post-views","status":"publish","type":"plugin","link":"https:\/\/bal.wordpress.org\/plugins\/optimize-redis-post-views\/","author":14690603,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.7","stable_tag":"1.7","tested":"4.9.29","requires":"4.5","requires_php":"5.2.4","requires_plugins":"","header_name":"Redis Post Views","header_author":"Razvan Stanga","header_description":"Highly optimized post views using Redis","assets_banners_color":"935651","last_updated":"2018-07-27 06:32:52","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/razvanstanga","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/optimize-redis-post-views\/","header_author_uri":"http:\/\/git.razvi.ro\/","rating":4,"author_block_rating":0,"active_installs":10,"downloads":1658,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1915717","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1915717","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1915717","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.7"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1915717","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1915717","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1915717","resolution":"3","location":"assets"}},"screenshots":{"1":"Statistics admin panel","2":"Posts queue admin panel","3":"Configuration info admin panel"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[146,144,187,5899,45952],"plugin_category":[52],"plugin_contributors":[86318],"plugin_business_model":[],"class_list":["post-79003","plugin","type-plugin","status-publish","hentry","plugin_tags-cache","plugin_tags-caching","plugin_tags-optimization","plugin_tags-postviews","plugin_tags-redis","plugin_category-performance","plugin_contributors-razvanstanga","plugin_committers-razvanstanga"],"banners":{"banner":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/banner-772x250.png?rev=1915717","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/icon-128x128.png?rev=1915717","icon_2x":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/icon-256x256.png?rev=1915717","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/screenshot-1.png?rev=1915717","caption":"Statistics admin panel"},{"src":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/screenshot-2.png?rev=1915717","caption":"Posts queue admin panel"},{"src":"https:\/\/ps.w.org\/optimize-redis-post-views\/assets\/screenshot-3.png?rev=1915717","caption":"Configuration info admin panel"}],"raw_content":"<!--section=description-->\n<p>Imagine a high traffic website that needs post views as an algorithm to display posts on the homepage.\nThis website also uses <a href=\"https:\/\/wordpress.org\/plugins\/vcaching\/\">Varnish Caching<\/a>. So we need an AJAX based post views counter.\nNow imagine a minimum 5000 concurrent users browsing the website, so we can't use the default \"AJAX in Plugins\" as live updates on the backend using update_post_meta will be very painful for the backend.<\/p>\n\n<p>So what can we do ?<\/p>\n\n<p>What if all these post views counts will be done in memory using Redis ?\nThen we run a cornjob using WP-CLI to sync the post views count in Redis to the Wordpress database.<\/p>\n\n<p>Redis Post Views was born.<\/p>\n\n<!--section=installation-->\n<ul>\n<li>You must install Redis on your server(s)<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ul>\n<li>You must install Redis on your server(s)<\/li>\n<\/ul><\/dd>\n<dt>How can I display the post views in a template?<\/dt>\n<dd><p>You can do this with get_post_meta(get_the_ID(), RPV_POST_META_KEY, true); php function<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.7<\/h4>\n\n<ul>\n<li>optimizations<\/li>\n<\/ul>\n\n<h4>1.6<\/h4>\n\n<ul>\n<li>moved wp-config-rpv.php wo wp-config for improved compatibility<\/li>\n<\/ul>\n\n<h4>1.5<\/h4>\n\n<ul>\n<li>WP-Admin sync all option<\/li>\n<li>optimizations<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>show total views on Posts Queue tab<\/li>\n<li>optimizations<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>improved stats using Chart.js<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>posibility to sync the post views in Posts Queue tab<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>added wp-admin backend including stats<\/li>\n<li>added posibility to override settings in wp-config.php<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>in production extensive testing done<\/li>\n<\/ul>","raw_excerpt":"Highly optimized post views counter using Redis","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/79003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=79003"}],"author":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/razvanstanga"}],"wp:attachment":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=79003"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=79003"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=79003"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=79003"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=79003"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=79003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}