{"id":33710,"date":"2014-12-31T22:21:40","date_gmt":"2014-12-31T22:21:40","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/prevent-concurrent-logins\/"},"modified":"2016-08-16T22:21:28","modified_gmt":"2016-08-16T22:21:28","slug":"prevent-concurrent-logins","status":"publish","type":"plugin","link":"https:\/\/kea.wordpress.org\/plugins\/prevent-concurrent-logins\/","author":1172341,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.4.0","stable_tag":"0.4.0","tested":"4.6.30","requires":"4.1","requires_php":"","requires_plugins":"","header_name":"Prevent Concurrent Logins","header_author":"Frankie Jarrett","header_description":"","assets_banners_color":"f9aa4b","last_updated":"2016-08-16 22:21:28","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/frankiejarrett.com","rating":5,"author_block_rating":0,"active_installs":900,"downloads":17370,"num_ratings":17,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"17"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1152517","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1152517","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1152517","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1152517","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.2.0","0.3.0","0.4.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[602,1932,600,50978,1917],"plugin_category":[38,54,58],"plugin_contributors":[77890],"plugin_business_model":[],"class_list":["post-33710","plugin","type-plugin","status-publish","hentry","plugin_tags-login","plugin_tags-membership","plugin_tags-security","plugin_tags-sensei","plugin_tags-users","plugin_category-authentication","plugin_category-security-and-spam-protection","plugin_category-user-management","plugin_contributors-fjarrett","plugin_committers-fjarrett"],"banners":{"banner":"https:\/\/ps.w.org\/prevent-concurrent-logins\/assets\/banner-772x250.png?rev=1152517","banner_2x":"https:\/\/ps.w.org\/prevent-concurrent-logins\/assets\/banner-1544x500.png?rev=1152517","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/prevent-concurrent-logins\/assets\/icon-128x128.png?rev=1152517","icon_2x":"https:\/\/ps.w.org\/prevent-concurrent-logins\/assets\/icon-256x256.png?rev=1152517","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong>Did you find this plugin helpful? Please consider <a href=\"https:\/\/wordpress.org\/support\/view\/plugin-reviews\/prevent-concurrent-logins\">leaving a 5-star review<\/a>.<\/strong><\/p>\n\n<ul>\n<li>Deters members\/subscribers from sharing their accounts with others<\/li>\n<li>Hardens security by destoying old sessions automatically<\/li>\n<li>Prompts old sessions to login again if they want to continue<\/li>\n<li>Ideal for membership sites and web applications<\/li>\n<\/ul>\n\n<p><strong>Important:<\/strong> If you plan to network-activate this plugin on a multisite network, please install the <a href=\"https:\/\/wordpress.org\/plugins\/proper-network-activation\/\">Proper Network Activation<\/a> plugin <em>beforehand<\/em>.<\/p>\n\n<p><strong>Development of this plugin is done <a href=\"https:\/\/github.com\/fjarrett\/prevent-concurrent-logins\">on GitHub<\/a>. Pull requests welcome. Please see <a href=\"https:\/\/github.com\/fjarrett\/prevent-concurrent-logins\/issues\">issues reported<\/a> there before going to the plugin forum.<\/strong><\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Where are the options for this plugin?<\/dt>\n<dd><p>This plugin does not have a settings page. Simply put, I don't like bloating my plugins with a bunch of options.<\/p>\n\n<p>Instead, I try to develop functionality using the 80\/20 principle so that for 80% of use cases you all you need to do is activate the plugin and it \"just works\".<\/p>\n\n<p>For the other 20% of you who want things to behave differently there are hooks available in the plugin so you can customize default behaviors.<\/p><\/dd>\n<dt>Can I still allow concurrent logins for certain users?<\/dt>\n<dd><p>Yes, simply add this code to your theme's <code>functions.php<\/code> file or as an <a href=\"http:\/\/codex.wordpress.org\/Must_Use_Plugins\">MU plugin<\/a>:<\/p>\n\n<pre>\nfunction my_pcl_whitelist_user_ids( $prevent, $user_id ) {\n\n    $whitelist = array( 1, 2, 3 ); \/\/ Provide an array of whitelisted user IDs\n\n    return in_array( $user_id, $whitelist ) ? false : $prevent;\n\n}\nadd_filter( 'pcl_prevent_concurrent_logins', 'my_pcl_whitelist_user_ids', 10, 2 );\n<\/pre>\n\n<p>Or this code to bypass users with certain roles:<\/p>\n\n<pre>\nfunction my_pcl_whitelist_roles( $prevent, $user_id ) {\n\n    $whitelist = array( 'administrator', 'editor' ); \/\/ Provide an array of whitelisted user roles\n\n    $user = get_user_by( 'id', absint( $user_id ) );\n\n    $roles = ! empty( $user-&gt;roles ) ? $user-&gt;roles : array();\n\n    return array_intersect( $roles, $whitelist ) ? false : $prevent;\n\n}\nadd_filter( 'pcl_prevent_concurrent_logins', 'my_pcl_whitelist_roles', 10, 2 );\n<\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.4.0 - October 16, 2015<\/h4>\n\n<ul>\n<li>Official support for WordPress 4.3<\/li>\n<\/ul>\n\n<p>Props <a href=\"https:\/\/github.com\/fjarrett\">fjarrett<\/a><\/p>\n\n<h4>0.3.0 - May 4, 2015<\/h4>\n\n<ul>\n<li>Action hooks now available after sessions are destroyed for logging purposes <a href=\"https:\/\/github.com\/fjarrett\/prevent-concurrent-logins\/issues\/4\">(#4)<\/a><\/li>\n<\/ul>\n\n<p>Props <a href=\"https:\/\/github.com\/fjarrett\">fjarrett<\/a><\/p>\n\n<h4>0.2.0 - January 28, 2015<\/h4>\n\n<ul>\n<li>Destroy old sessions for all users upon activation<\/li>\n<\/ul>\n\n<p>Props <a href=\"https:\/\/github.com\/fjarrett\">fjarrett<\/a>, <a href=\"https:\/\/github.com\/chuckreynolds\">chuckreynolds<\/a><\/p>\n\n<h4>0.1.1 - January 2, 2015<\/h4>\n\n<ul>\n<li>Added filter to allow certain users to have concurrent sessions when necessary<\/li>\n<\/ul>\n\n<p>Props <a href=\"https:\/\/github.com\/fjarrett\">fjarrett<\/a>, <a href=\"https:\/\/github.com\/nutsandbolts\">nutsandbolts<\/a><\/p>\n\n<h4>0.1.0 - December 31, 2014<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>\n\n<p>Props <a href=\"https:\/\/github.com\/fjarrett\">fjarrett<\/a><\/p>","raw_excerpt":"Prevents users from staying logged into the same account from multiple places.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33710"}],"author":[{"embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/fjarrett"}],"wp:attachment":[{"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33710"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33710"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33710"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33710"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33710"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/kea.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}