Skip to content

BuddyLists creates three custom tables on activation, all prefixed with the site table prefix (wp_ by default). The schema version is tracked in the buddylists_db_version option, and upgrades run on plugins_loaded when the stored version is older.

Holds the lists themselves.

Column Type Notes
id BIGINT UNSIGNED Primary key, auto increment.
user_id BIGINT UNSIGNED Owner user ID. Indexed.
name VARCHAR(255) List name.
description TEXT Optional.
slug VARCHAR(191) Unique, indexed. Used in the public URL. Built from the list name, for example close-friends.
cover_image VARCHAR(255) Optional cover image URL.
list_icon VARCHAR(255) Optional icon URL.
visibility ENUM(‘private’,‘public’) Defaults to public. Indexed.
created_at DATETIME Defaults to the current timestamp.

Maps members to lists.

Column Type Notes
id BIGINT UNSIGNED Primary key.
list_id BIGINT UNSIGNED Foreign key to bp_lists.id, cascade on delete.
member_id BIGINT UNSIGNED Foreign key to the users table, cascade on delete. Indexed.
added_at DATETIME Defaults to the current timestamp.

A unique key unique_membership (list_id, member_id) prevents duplicate memberships.

Tracks list follows.

Column Type Notes
id BIGINT UNSIGNED Primary key.
list_id BIGINT UNSIGNED Foreign key to bp_lists.id, cascade on delete.
follower_id BIGINT UNSIGNED Foreign key to the users table, cascade on delete. Indexed.
followed_at DATETIME Defaults to the current timestamp.

A unique key unique_follow (list_id, follower_id) prevents duplicate follows.

The upgrade routine runs only when the stored database version is behind the plugin’s. It:

  • Widens the slug column to 191 characters, because slugs are built from list names.
  • Adds the list_icon column when it is missing.
  • Adds the unique_membership and unique_follow unique keys to existing installations, removing any duplicate rows first.
  • Copies list covers and icons that were stored in dated uploads folders into uploads/buddylists/<list ID>/. Only real JPG, PNG and GIF pictures from dated folders that are not in the Media Library are copied. Anything else keeps its old URL. The originals are left where they were.
  • Moves the old buddylists_activity_settings option into buddylists_visibility_settings (the list_visible and enable_follow keys) and deletes the old option.

Each list’s cover and icon are stored in wp-content/uploads/buddylists/<list ID>/. They are not Media Library attachments. Deleting a list deletes that folder.

Option Holds
buddylists_general_settings Label, address word, creation roles, blocked member types, limits.
buddylists_visibility_settings Who can add people, suggestions, default privacy, private message, activity and follow options.
buddylists_notification_settings On-site and email notice switches.
buddylists_color_settings Custom color switch and the three colors.
buddylists_db_version Schema version.

There is no uninstall routine. Deleting the plugin leaves the three tables, the options and the images folders in place.