WP Manifestindependent plugin directory
manifest / developer / wp-custom-api-logger

WP Custom API Logger

A custom high-performance WordPress plugin offering custom REST API endpoints, secure database logging, and caching via Transients API.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/jvrhar/wp-custom-api-logger/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A high-performance custom WordPress plugin built to log API events into a custom database table with REST API access, input sanitization, security checks, and Transients API caching for optimal performance.


🌟 Features

  • Custom Database Architecture: Dynamically creates an optimized table on activation using dbDelta().
  • REST API Endpoints:
    • POST /wp-json/custom-logger/v1/log - Secure endpoint to accept log entries.
    • GET /wp-json/custom-logger/v1/logs - Fetch latest log entries with automatic transient caching.
  • Performance Optimization: Uses WordPress Transients API to reduce database read overhead on heavy query loads.
  • Security First: Features permission callbacks, data sanitization (sanitize_text_field), and dynamic query parameterization.
  • Design Pattern: Implemented using modern OOP Singleton Pattern.

🛠️ Architecture & Tech Stack

  • Language: PHP 8.x
  • Framework: WordPress Core APIs (WP_REST_Server, $wpdb, Transients API)
  • Database: MySQL
  • Version Control: Git

🚀 Installation & Usage

  1. Clone or download this repository into your /wp-content/plugins/ directory.
  2. Activate the plugin via WordPress Admin Dashboard.
  3. Test POST requests to /wp-json/custom-logger/v1/log via Postman or cURL.