Skip to content

LabPress Documentation Overview

Welcome to the LabPress documentation. This guide provides a technical overview of LabPress, a lightweight academic content management system designed for research groups, university laboratories, and individual research teams. You will learn what LabPress is, the design principles behind it, the technology stack that powers it, and how the system architecture is organized to support extensibility, internationalization, and dynamic content management.

What is LabPress?

LabPress is an open-source Academic CMS written in pure PHP and MySQL, with no framework dependencies. It allows labs or small research teams to deploy a professional website capable of presenting research outputs, team members, publications, news, custom tools, and projects within minutes. Unlike generic CMS platforms, LabPress is natively tailored for academic use cases: it ships with built-in modules for managing publications, project portfolios with category filters, research news with Markdown editing, tool versioning, and a fully dynamic homepage that can be edited entirely from the administration panel.

LabPress is not just another website builder. Its core strength lies in a hook-driven plugin system inspired by WordPress, which allows developers to extend functionality without modifying any core files. Combined with a decoupled internationalization (i18n) layer that handles both static and database-stored dynamic content, LabPress achieves modularity and multilingual support rarely found in lightweight CMS solutions.

Design Philosophy

LabPress was born out of the practical needs of academic research groups that require both dynamic content management and multilingual presentation. Every architectural decision follows a few guiding principles:

  • Academic First – Features such as publication listings, project categorization, research news, and tool showcases are first-class entities with dedicated admin interfaces and database tables.
  • Extensible by Design – All core functionality is exposed through actions and filters via the LabPress_Hooks class. Plugins can intercept, modify, or augment behavior at dozens of defined hook points.
  • Zero Coupling – The core system has no awareness of any plugin. Even the dynamic multilingual capability is implemented entirely as a plugin, using the translate filter to replace strings. Removing all plugins leaves a functional site that falls back to its default language for core features.
  • Separation of Concerns – The frontend and backend are split at the entry-point level, with independent language contexts, asset loading, and permission checks. This ensures that public-facing performance is not impacted by administrative complexity.
  • Lightweight Yet Complete – The entire application runs on commodity hosting with PHP 7.4+ and MySQL 5.7+. No Composer, no Node.js build step, and no virtual environment are required. Third-party libraries are kept to a minimum and are either bundled locally or loaded from stable public CDNs.

Technology Stack

Layer Technology Justification
Language PHP 7.4+ Ubiquitous on shared hosting; no framework overhead; compatible with most virtual hosting environments
Database MySQL 5.7+ / MariaDB 10.3+ Reliable and widely available; structured data for academic entities
Frontend HTML5, CSS3, vanilla JS Minimal dependencies; EasyMDE and Isotope are bundled locally, while Font Awesome is loaded from a public CDN.
Plugin System Custom LabPress_Hooks class Lightweight implementation of the WordPress hook paradigm
i18n Custom __() function + language files Module-based loading, supports nested keys, integrates with the filter system
Markdown Parsedown library (bundled) Converts Markdown to HTML for news and project content
Security PDO prepared statements, bcrypt hashing, session-based authentication, permission checks Prevents SQL injection and XSS; restricts admin actions based on user roles

LabPress does not depend on any third-party PHP frameworks, ORMs, or template engines. The codebase follows a pragmatic flat-file structure. Frontend pages are standalone PHP files at the project root, each handling its own data retrieval and rendering. Administrative interfaces are separated into /admin/views/ and loaded by the backend entry points. Shared logic resides in /includes/, with data access provided by PDO wrapper functions.

Architecture Overview

LabPress follows a straightforward request lifecycle:

  1. Bootstrapping: index.php (or the relevant frontend page) loads includes/config.php, initializes the database connection, and triggers the init action hook after all plugins have been loaded.
  2. Hook Initialization: Each enabled plugin registers its callbacks on init. Plugins typically add filters for translation, menu items, or slide data, and actions for injecting scripts or registering admin pages. For detailed information, please refer to the Plugin Development section.
  3. Content Rendering: Frontend pages query the database directly using helper functions. Key output points are wrapped in applyFilters() or __() calls, allowing plugins to alter content without the core being aware of their existence.
  4. Admin Panel: The /admin directory contains an independent entry point that enforces authentication and loads the appropriate view based on the query string. Admin views are plain PHP files that typically contain their own data retrieval and POST handling logic for simplicity, without a separate controller layer.

The plugin system is the backbone of extensibility. It provides:

  • Actions (addAction, doAction) – for executing code at specific points (e.g., footer_scripts, admin_before_head_end).
  • Filters (addFilter, applyFilters) – for modifying data (e.g., translate, nav_menu_item, slides_data).
  • Plugin Lifecycle Hooks – plugin_activation,Β plugin_deactivation, andΒ plugin_uninstalledΒ are triggered during activation, deactivation, and uninstallation respectively.

For a complete list of all available actions and filters, refer to the Hooks Reference.

A plugin is simply a folder inside /plugins/ containing a plugin.php file with a standardized header comment. The admin panel scans this directory, manages activation states, and supports ZIP upload for installation.

The internationalization system works on two levels:

  • Static strings are stored in language files under languages/{locale}/, organized by module. The __() function loads these on demand and supports dot-notation for nested arrays.
  • Dynamic content (e.g., homepage slogan, research direction cards, navigation menus) stored in the database is translated via the Dynamic Multi-Language plugin, which registers on the translate filter and queries its own ml_translations table.

The two systems operate independently but share the same translate filter mechanism. The core uses __() for all output, and the plugin transparently provides translations when available without modifying the core.

Directory Structure

LabPress/
β”œβ”€β”€ admin/                            # Backend management panel
β”‚   β”œβ”€β”€ index.php                     # Admin entry point (dashboard loader)
β”‚   β”œβ”€β”€ login.php                     # Admin login page
β”‚   β”œβ”€β”€ logout.php                    # Logout handler
β”‚   β”œβ”€β”€ includes/
β”‚   β”‚   β”œβ”€β”€ admin-header.php          # Admin sidebar + top bar
β”‚   β”‚   └── admin-footer.php          # Admin footer (JS includes)
β”‚   β”œβ”€β”€ views/                        # Individual management views
β”‚   β”‚   β”œβ”€β”€ dashboard.php             # System overview & stats
β”‚   β”‚   β”œβ”€β”€ publications.php          # Publications CRUD
β”‚   β”‚   β”œβ”€β”€ slides.php                # Slides management
β”‚   β”‚   β”œβ”€β”€ tool-list.php             # Tool list management
β”‚   β”‚   β”œβ”€β”€ tool-detail.php           # Tool detail editor
β”‚   β”‚   β”œβ”€β”€ tool-versions.php         # Version history manager
β”‚   β”‚   β”œβ”€β”€ project-categories.php    # Project categories CRUD
β”‚   β”‚   β”œβ”€β”€ projects.php              # Projects management
β”‚   β”‚   β”œβ”€β”€ news.php                  # Research news management
β”‚   β”‚   β”œβ”€β”€ users.php                 # User management
β”‚   β”‚   β”œβ”€β”€ site-config.php           # General site settings
β”‚   β”‚   β”œβ”€β”€ nav-menus.php             # Navigation menu manager
β”‚   β”‚   β”œβ”€β”€ plugins.php               # Installed plugins list
β”‚   β”‚   β”œβ”€β”€ plugins-install.php       # Plugin installer (ZIP upload)
β”‚   β”‚   └── plugins-market.php        # Plugin marketplace (placeholder)
β”‚   └── assets/
β”‚       β”œβ”€β”€ css/
β”‚       β”‚   β”œβ”€β”€ admin.css             # Backend global styles
β”‚       β”‚   └── easymde.min.css       # EasyMDE editor styles (admin)
β”‚       └── js/
β”‚           β”œβ”€β”€ admin.js              # Sidebar & common admin scripts
β”‚           β”œβ”€β”€ easymde.min.js        # EasyMDE Markdown editor (admin)
β”‚           β”œβ”€β”€ plugins-manage.js     # Plugin activation/deactivation
β”‚           β”œβ”€β”€ plugins-install.js    # Plugin installation logic
β”‚           β”œβ”€β”€ plugins-market.js     # Plugin market interactions
β”‚           β”œβ”€β”€ publications.js       # Publications CRUD logic
β”‚           β”œβ”€β”€ slides.js             # Slides CRUD + image upload
β”‚           β”œβ”€β”€ tool-list.js          # Tool list CRUD
β”‚           β”œβ”€β”€ tool-detail.js        # Tool detail loading
β”‚           β”œβ”€β”€ tool-versions.js      # Version management logic
β”‚           β”œβ”€β”€ project-categories.js # Category CRUD
β”‚           β”œβ”€β”€ project-manage.js     # Projects CRUD + EasyMDE
β”‚           β”œβ”€β”€ news-manage.js        # News CRUD + EasyMDE
β”‚           β”œβ”€β”€ users.js              # User management logic
β”‚           β”œβ”€β”€ site-config.js        # Site settings dynamic forms
β”‚           └── nav-menus.js          # Menu CRUD logic
β”‚
β”œβ”€β”€ api/                              # RESTful data endpoints
β”‚   β”œβ”€β”€ data.php                      # Unified data reader (type-based)
β”‚   β”œβ”€β”€ save.php                      # Unified data saver (type-based)
β”‚   β”œβ”€β”€ upload.php                    # Image upload handler
β”‚   β”œβ”€β”€ users.php                     # User CRUD API
β”‚   β”œβ”€β”€ auth.php                      # Authentication API (check/login/logout)
β”‚   β”œβ”€β”€ plugin-install.php            # Plugin ZIP installation endpoint
β”‚   β”œβ”€β”€ plugin-install-from-url.php   # Remote plugin installation
β”‚   └── plugin-uninstall.php          # Plugin removal endpoint
β”‚
β”œβ”€β”€ assets/                           # Frontend global static resources
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ index.css                 # Homepage styles
β”‚   β”‚   β”œβ”€β”€ header.css                # Navigation bar styles
β”‚   β”‚   β”œβ”€β”€ tools.css                 # Tools list page styles
β”‚   β”‚   β”œβ”€β”€ tool_detail.css           # Tool detail page styles
β”‚   β”‚   β”œβ”€β”€ news.css                  # News list & detail styles
β”‚   β”‚   β”œβ”€β”€ news-detail.css           # News detail specific styles
β”‚   β”‚   β”œβ”€β”€ projects.css              # Project list page styles
β”‚   β”‚   └── project-detail.css        # Project detail page styles
β”‚   └── js/
β”‚       β”œβ”€β”€ index.js                  # Homepage carousel & publications loader
β”‚       β”œβ”€β”€ project.js                # Project list interactions (Isotope)
β”‚       └── isotope.pkgd.min.js       # Isotope filtering library
β”‚
β”œβ”€β”€ includes/                         # Core library & configuration
β”‚   β”œβ”€β”€ config.php                    # Database connection & site constants (user-created, not in repository)
β”‚   β”œβ”€β”€ config-sample.php             # Configuration template (copy to config.php)
β”‚   β”œβ”€β”€ functions.php                 # Core functions (data access, helpers, i18n)
β”‚   β”œβ”€β”€ hooks.php                     # Plugin hook system (LabPress_Hooks)
β”‚   β”œβ”€β”€ header.php                    # Frontend header + navigation
β”‚   β”œβ”€β”€ footer.php                    # Frontend footer
β”‚   └── labpress.php                  # LabPress core utility class (config, pages, etc.)
β”‚
β”œβ”€β”€ languages/                        # Core language packs
β”‚   β”œβ”€β”€ zh_CN/
β”‚   β”‚   β”œβ”€β”€ lang.config               # Language metadata (flag, name)
β”‚   β”‚   β”œβ”€β”€ common.php                # Shared UI strings (nav, footer, buttons)
β”‚   β”‚   β”œβ”€β”€ index.php                 # Homepage strings
β”‚   β”‚   β”œβ”€β”€ news.php                  # News module strings
β”‚   β”‚   β”œβ”€β”€ projects.php              # Projects module strings
β”‚   β”‚   β”œβ”€β”€ tools.php                 # Tools module strings
β”‚   β”‚   └── publications.php          # Publications module strings
β”‚   └── en_US/
β”‚       β”œβ”€β”€ lang.config
β”‚       β”œβ”€β”€ common.php
β”‚       β”œβ”€β”€ index.php
β”‚       β”œβ”€β”€ news.php
β”‚       β”œβ”€β”€ projects.php
β”‚       β”œβ”€β”€ tools.php
β”‚       └── publications.php
β”‚
β”œβ”€β”€ plugins/                          # Plugin directory
β”‚   β”œβ”€β”€ FooterInfo/                   # Footer customization plugin
β”‚   β”‚   └── plugin.php
β”‚   β”œβ”€β”€ dynamic-multilang/            # Dynamic multi-language translation plugin
β”‚   β”‚   β”œβ”€β”€ plugin.php                # Plugin main file (hooks & filters)
β”‚   β”‚   β”œβ”€β”€ admin-page.php            # Admin management page
β”‚   β”‚   β”œβ”€β”€ languages/
β”‚   β”‚   β”‚   └── zh_CN.php             # Plugin UI language pack
β”‚   β”‚   └── assets/
β”‚   β”‚       β”œβ”€β”€ dm-admin.css          # Admin panel styles
β”‚   β”‚       └── dm-admin.js           # Admin panel interactions
β”‚   └── hello-word/                   # Hello World example plugin
β”‚       └── plugin.php
β”‚
β”œβ”€β”€ images/                           # Repository images used by demo content and slides
β”‚   β”œβ”€β”€ slide-1771610110.png
β”‚   β”œβ”€β”€ slide-1771663308.png
β”‚   β”œβ”€β”€ slide3.jpg
β”‚   β”œβ”€β”€ proteintrim-logo.png
β”‚   └── proteintrim-screenshot.jpg
β”‚
β”œβ”€β”€ uploads/                          # User uploaded files
β”‚   β”œβ”€β”€ news/                         # News images
β”‚   β”œβ”€β”€ projects/                     # Project images
β”‚   β”œβ”€β”€ general/                      # General purpose uploads
β”‚   └── gallery/                      # Gallery images (e.g., Gromacs, ComputBio, ComputChem)
β”‚
β”œβ”€β”€ ReadImg/                          # Repository images (logo, screenshots for README)
β”‚   β”œβ”€β”€ labpress-logo.png
β”‚   └── screenshot-home.png
β”‚
β”œβ”€β”€ index.php                         # Frontend homepage (dynamic content)
β”œβ”€β”€ tools.php                         # Tools list page
β”œβ”€β”€ tool-detail.php                   # Tool detail page
β”œβ”€β”€ projects.php                      # Projects list page (with category filter)
β”œβ”€β”€ project-detail.php                # Project detail page
β”œβ”€β”€ news.php                          # News list page
β”œβ”€β”€ news-detail.php                   # News detail page
β”œβ”€β”€ publications.php                  # Publications list page
β”œβ”€β”€ category.php                      # Category filtered project list
β”‚
β”œβ”€β”€ labpressexample.sql               # Example database dump
β”‚
β”œβ”€β”€ .gitignore                        # Git ignore rules
β”œβ”€β”€ LICENSE                           # Open-source license (GPL-3.0)
└── README.md                         # Project overview & setup guide

Documentation Structure

This documentation is organized into several major sections, each targeting a specific aspect of LabPress usage and development:

- Home: index.md
- Getting Started:
  - Guide Overview: getting-started/guide-overview.md
  - Installation Guide: getting-started/installation.md
  - Quick Start: getting-started/quick-start.md
  - Basic Configuration: getting-started/configuration.md
- Setup:
  - Site Settings: setup/site-settings.md
  - Navigation Menus: setup/navigation.md
  - Plugin Management: setup/plugins.md
- Content Management:
  - Publications: content/publications.md
  - Slides: content/slides.md
  - Tools: content/tools.md
  - Projects: content/projects.md
  - News: content/news.md
  - Users: content/users.md
- Internationalization:
  - Overview: i18n/overview.md
  - Core Language Packs: i18n/core-lang.md
  - Dynamic Multi-Language Plugin: i18n/dynamic-multilang.md
- Plugin Development:
  - Plugin System Introduction: plugins/intro.md
  - Developing Your First Plugin: plugins/develop.md
  - Hooks Reference: plugins/hooks-reference.md
  - Plugin Examples: plugins/examples.md
- Reference:
  - API Endpoints: reference/api.md
  - Database Schema: reference/database.md
  - Developer Resources: reference/developer-resources.md
- Contributing: contributing.md
- Security: security.md
- Changelog: changelog.md

The documentation is structured to guide you from initial installation through advanced plugin development. Each section is self-contained and can be read independently based on your needs.

How to Use This Documentation

This documentation is organized to support different personas:

  • New Users should start with the Getting Started section, which walks through installation, initial configuration, and basic content creation.
  • Site Administrators will find detailed guides in the Setup and Content Management chapters, covering every configurable aspect of the system.
  • Developers interested in extending LabPress should head directly to the Plugin Development section, which explains the hook system, plugin anatomy, and includes a full hooks reference.
  • Translators and those managing multilingual sites can explore the Internationalization chapter to understand how both static and dynamic translations work.
  • Contributors should read the Contribution Guidelines and the Security Policy before submitting patches.

Every page aims to be technically precise, providing code examples, database schema snippets, and configuration samples where appropriate. If you encounter any inconsistencies, please open an issue on the GitHub repository.

Next Steps

Begin your journey with the Installation Guide to get LabPress running on your server, or jump directly to the Plugin Development Introduction if you are eager to write your first extension.