How renatobo/telegrarm works
Project type and purpose
• This is a WordPress plugin (“TelegrARM”) that extends ARMember to send user-event notifications (new registrations, profile updates).
• It lives entirely inside the WordPress environment (hooks, options, plugin files, database).
File structure
• Top-level plugin entry point: telegrarm.php
• Feature modules:
• telegrarm_after_new_user_notification.php (handles new-user events)
• telegrarm_update_profile_external.php (handles profile-update events)
• telegrarm_settings.php (admin UI for bot token, channels, field mappings)
• uninstall.php (cleanup on plugin removal)
• Standard plugin assets: README.md, license, git workflows, packaging scripts—these live outside of the runtime environment.
README for technical stack
• WordPress 6.7+ / PHP 8.0+
• Depends on ARMember plugin (for membership events)
• Uses Telegram Bot API (external, out of scope per “show WordPress environment only”)
a. WordPress Core
• Plugin loader, action/filter dispatch system, options API, database API
b. ARMember Plugin
• Fires two key actions: “armember_user_registered” and “armember_profile_updated”
c. TelegrARM Plugin
• Registers hooks on ARMember events
• Settings page under WP Admin > Settings > Telegram Bot
• Stores credentials & mappings in wp_options
d. WordPress Database
• wp_options table holds TelegrARM settings
• (Optionally) any transient data (not used here)
Relationships and data flow (within WP)
• User triggers event → WP Core routes to ARMember
• ARMember emits action → TelegrARM’s listener functions fire
• TelegrARM reads settings from wp_options → builds notification payload
• (External: sends HTTP request to Telegram; omit in WP-only view)
Architectural patterns and design principles
• Modular plugin architecture: one file per notification type
• WordPress actions/filters as the integration/extension mechanism
• Separation of concerns:
• telegrarm_settings.php handles admin UI
• event handlers handle only data collection/formatting
• uninstall.php cleans up stored options