WP Manifestindependent plugin directory
manifest / events / lh-buddypress-log-entry

LH Buddypress Log Entry

Record work via a form and buddypress

by Peter Shaw · github.com/lhero-org/lh-buddypress-log-entry · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/lhero-org/lh-buddypress-log-entry/archive/refs/heads/main.zip

Record quantified activity (hours, laps, etc.) against GatherPress events via a front-end form, stored as BuddyPress activity entries.

Description

Provides a shortcode-driven front-end form that lets members log quantified activity against GatherPress events. Submissions are stored as WordPress comments of type log-entry and as BuddyPress activity entries. Unknown visitors can be provisioned on the fly via email.

Requires BuddyPress and GatherPress to be active.

Installation

  1. Upload the plugin folder to /wp-content/plugins/.
  2. Network-activate the plugin.
  3. Use the shortcodes below on any page or post.

Shortcodes

[lh_bp_log_entry_form]

Renders the log entry submission form.

Attribute Default Description
event_id auto-detected GatherPress event post ID to log against
verb log Submit button label
unit hours Unit of measurement
step .1 Input step increment
action worked Activity verb (e.g. "ran", "worked")
nothing_here No event to log to Message shown when no current event is found
textarea_placeholder An optional comment Comment field placeholder

[lh_bp_log_entry_open]

Shows content when a current event is open for logging; shows fallback otherwise.

Attribute Default Description
fallback (empty) Content to show when no event is open
category_slug (none) Restrict to events in this category

[lh_bp_log_entry_closed]

Shows content when no current event is open for logging.

Attribute Default Description
fallback (empty) Content to show when an event is open

[lh_bp_log_entry_user]

After a successful submission, outputs a field from the logged user object.

Attribute Default Description
key display_name User object property to output
avatar_size 96 Avatar size in pixels (only used when key=avatar)

[lh_bp_log_entry_post]

After a successful submission, outputs a field from the event post object.

Attribute Default Description
key post_title Post object property to output

[lh_bp_log_entry_event_listing]

Lists past GatherPress events with links to their log entry tables.

Attribute Default Description
posts_per_page 25 Number of events to list
separator p HTML wrapper element for each event

[lh_bp_log_entry_user_listing]

Displays the log entry table for the event specified in the lh_bp_log_entry-event_id query parameter.

Filters

lh_bp_log_entry_return_plugin_debugging_status

Controls whether debug logging is active. Default: true.

lh_bp_log_entry_return_event_post_type

Overrides the post type used for events. Default: gatherpress_event.

lh_bp_log_entry_check_if_can_check_in

Controls whether a user is permitted to submit a log entry. Receives $can (bool), $user_id, $event_id. Return false to block.

lh_bp_log_entry_add_log_entry_action

Filters the BuddyPress activity action string. Receives $action_string, $post_id, $user_id.

lh_bp_log_entry_user_shortcode_output

Filters the output of [lh_bp_log_entry_user]. Receives $return, $user_id, $key, $avatar_size, $content.

Actions

lh_bp_log_entry_user_recognised

Fired when a known user is identified from the form email. Receives $user_object.

lh_bp_log_entry_activity_added

Fired after a BuddyPress activity entry is successfully created. Receives $activity_id.

lh_bp_log_entry_add_log_entry

Fired after a full log entry (comment + activity) is saved. Receives $activity_id, $post_id, $user_id, $string, $amount, $comment.

lh_bp_log_entry_form_unknown

Fired inside the unknown-user form partial, after the standard fields. Receives $unknown_user.

lh_bp_log_entry_user_table_header_after

Fired after the last header column in the user listing table. Receives $activities, $post_id.

lh_bp_log_entry_user_table_row_after

Fired after the last cell in each user listing table row. Receives $user, $post_id.

Known PCP false positives

  • NonSingularStringLiteralDomain — all i18n calls use self::return_plugin_text_domain() which returns the literal string 'lh-buddypress-log-entry'. PHPCS cannot statically resolve method calls; this is a known false positive.
  • InterpolatedNotPrepared on {$table} — the table name is sourced from BuddyPress's own internal buddypress()->activity->table_name property, not from user input.
  • DirectDatabaseQuery / NoCaching — querying BuddyPress's activity table directly is unavoidable; no WP API exists for these queries.
  • PreparedSQL.NotPrepared on $sql — PHPCS cannot trace that $sql was built via $wpdb->prepare().
  • error_log / print_r warnings — gated behind WP_DEBUG.
  • TextDomainMismatch on 'webmention' strings — intentional; those strings are passed to register_webmention_comment_type() and must use the webmention plugin's domain.

Changelog

1.02 — 2026-06-10

  • Fix: Plugin header Text Domain corrected from lh_buddypress-log-entry (underscore) to lh-buddypress-log-entry (hyphen).
  • Fix: License and License URI fields added to plugin header.
  • Fix: return_plugin_text_domain() return value corrected from 'lh_buddypress-log-entry' to 'lh-buddypress-log-entry'.
  • Fix: All i18n calls (__(), _e()) throughout main file and all partials now use self::return_plugin_text_domain() instead of self::return_plugin_namespace() as the text domain.

1.01 — 2026-06-10

  • Fix: All direct SQL queries now use $wpdb->prepare() to prevent injection via unvalidated input.
  • Fix: Removed leftover echo 'foobar'; exit; debug output from the already-logged branch in save_data.
  • Fix: Hidden field name attribute typo (stray >) in the unknown-user partial corrected.
  • Fix: last_name in the unknown-user partial was reading the first_name meta key; now reads last_name.
  • Fix: open_shortcode_output was passing $category_slug as the $interval argument to get_appropriate_event_id(); corrected to get_appropriate_event_id(86400, $category_slug).
  • Remove: Dead methods curpageurl(), return_form_first_name_value(), return_form_last_name_value().

1.00

  • Initial release.