WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Loggedin – 限制帳號同時登入工作階段數量

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

Loggedin – 限制帳號同時登入工作階段數量

由 Joel James 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

By default in WordPress users can login using one account from unlimited devices/browsers at a time. This is not good for everyone, seriously! With this plugin you can easily set a limit for no. of active logins a user can have.

Loggedin 🔒 Features and Advantages

  • Set maximum no. of active logins for a user.
  • Block new logins when the login limit is reached.
  • Allow new logins while logging out from other devices when the limit is reached.
  • Force logout users from admin.
  • Prevent users from sharing their account.
  • Useful for membership sites (for others too).
  • No complex settings. Just one optional field to set the limit.
  • Super Light weight.
  • Filter to bypass login limit for certain users or roles.
  • Completely free to use with lifetime updates.
  • Follows best WordPress coding standards.

Installation | Support | Screenshots

Please contribute to the plugin development in GitHub.

🔐 Important Notice

Even if the user is closing the browser without logging out, their login session exists for period of time. So this will also considered as an active login.

🐛 Bug Reports

Bug reports are always welcome – report here.

螢幕擷圖

  • Settings – Set maximum no. of active logins for a user account.

安裝方式

Installing the plugin – Simple

  1. In your WordPress admin panel, go to Plugins > New Plugin, search for LoggedIn and click “Install now“
  2. Alternatively, download the plugin and upload the contents of loggedin.zip to your plugins directory, which usually is /wp-content/plugins/.
  3. Activate the plugin
  4. Go to General tab under WordPress Settings menu.
  5. Find the “Maximum Active Logins” option and select the maximum number of active logins for a user account.

Missing something?

If you would like to have an additional feature for this plugin, let me know

常見問題集

How can I set the limit, and where? 🤔

This plugin does not have a seperate settings page. But we have one configural settings to let you set the login limit.

  1. Go to Settings page in admin dashboard.
  2. Scroll down to see the section 🔐 Loggedin.
  3. Set the maximum number of active logins a user can have in Maximum Active Logins option.

Can I somehow allow new logins when the limit is reached? 🤔

You can forcefully logout the user from other devices and allow new login.

  1. Go to Settings page in admin dashboard.
  2. Scroll down to see the section 🔐 Loggedin.
  3. Select the Login Logic as Allow.

Can I block the new logins when the limit is reached? 🤔

You block the new logins when the user is logged in from maximum no. of devices according to the limit you set.

  1. Go to Settings page in admin dashboard.
  2. Scroll down to see the section 🔐 Loggedin.
  3. Select the Login Logic as Block.
  4. Now user will have to wait for the other login sessions to expire before login from new device.

How long a login session exist? How long the user needs to wait for new login? 🤔

That depends. If the “Remember Me” box is checked while login, WordPress will keep the user logged in for 14 days by default. If “Remember Me” is not checked, 2 days will be the active login session time.

You can change that period using, auth_cookie_expiration filter.

function loggedin_auth_cookie_expiration( $expire ) {
    // Allow for a month.
    return MONTH_IN_SECONDS;
}

add_filter( 'auth_cookie_expiration', 'loggedin_auth_cookie_expiration' );

How can I forcefully logout a user from all devices? 🤔

You can forcefully logout a user from all the devices he has logged into. Get his WordPress user ID and,

  1. Go to Settings page in admin dashboard.
  2. Scroll down to see the section 🔐 Loggedin.
  3. Enter user ID of the user you would like to logout.
  4. Click Force Logout.

Can I bypass this limit for certain users or roles? 🤔

Yes, of course. But this time you are going to add few lines of code. Don’t worry. Just copy+paste this code in your theme’s functions.php file or in custom plugin:

function loggedin_bypass_users( $bypass, $user_id ) {

    // Enter the user IDs to bypass.
    $allowed_users = array( 1, 2, 3, 4, 5 );

    return in_array( $user_id, $allowed_users );
}

add_filter( 'loggedin_bypass', 'loggedin_bypass_users', 10, 2 );

Or if you want to bypass this for certain roles:

function loggedin_bypass_roles( $prevent, $user_id ) {

    // Array of roles to bypass.
    $allowed_roles = array( 'administrator', 'editor' );

    $user = get_user_by( 'id', $user_id );

    $roles = ! empty( $user->roles ) ? $user->roles : array();

    return ! empty( array_intersect( $roles, $allowed_roles ) );
}

add_filter( 'loggedin_bypass', 'loggedin_bypass_roles', 10, 2 );

使用者評論

Nice plugin

jeunon 2025 年 3 月 20 日
Simple and efficient !

Fantastic Plugin

jonahcoyote 2024 年 10 月 17 日
Simple, effective, works as advertised. Thanks so much!

Works well

Steven 2024 年 8 月 20 日
It works well.

It works fine

Jaravillanueva 2024 年 7 月 16 日
It works fine!

Awesome for Security and Membership solutions

Pauk 2024 年 6 月 5 日
Love the plugin. Easy and lightweight. I really hope the team will keep the plugin alive with regular updates!

Excellent

aaronsackey 2024 年 4 月 30 日
Excellent it works
閱讀全部 104 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Loggedin – 限制帳號同時登入工作階段數量〉的開發相關工作。

參與者
  • Joel James
  • Duck Dev

〈Loggedin – 限制帳號同時登入工作階段數量〉外掛目前已有 5 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Loggedin – 限制帳號同時登入工作階段數量〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

1.3.2 (01/10/2024)

🐛 Bug Fixes

  • Security fixes.

1.3.1 (19/09/2020)

👌 Improvements

  • Support ajax logins – Thanks Carlos Faria.

1.3.0 (28/08/2020)

👌 Improvements

  • Improved “Allow” logic to check only after password check.

1.2.0 (07/06/2019)

📦 New

  • Added ability to choose login logic.

1.1.0 (06/06/2019)

📦 New

  • Added ability to force logout users.
  • Added cleanup on plugin uninstall.
  • Added review notice.

👌 Improvements

  • Code improvement

1.0.1 (02/07/2016)

🐛 Bug Fixes

  • Fixing misspelled variable.

1.0.0 (16/06/2016)

📦 New

  • Initial version release.

中繼資料

  • 版本 1.3.2
  • 最後更新 4 個月前
  • 啟用安裝數 8,000+
  • WordPress 版本需求 4.0 或更新版本
  • 已測試相容的 WordPress 版本 6.7.2
  • PHP 版本需求 5.6 或更新版本
  • 語言

    Chinese (Taiwan)、English (US)、German、Russian、Spanish (Mexico)、及 Swedish.

    將這個外掛本地化為你的母語版本

  • 標籤
    concurrent loginsloginlogin limitlogout
  • 進階檢視

評分

4.9 星,滿分為 5 星
  • 99 個 5 星使用者評論 5 星 99
  • 2 個 4 星使用者評論 4 星 2
  • 0 個 3 星使用者評論 3 星 0
  • 2 個 2 星使用者評論 2 星 2
  • 1 個 1 星使用者評論 1 星 1

新增使用者評論

查看全部使用者評論

參與者

  • Joel James
  • Duck Dev

技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

檢視技術支援論壇

贊助

想要支援這個外掛的發展嗎?

贊助這個外掛

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • Visit our Bluesky account
  • Visit our Mastodon account
  • Visit our Threads account
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our TikTok account
  • Visit our YouTube channel
  • Visit our Tumblr account
程式碼,如詩