https://github.com/kartikmehta8/wp-developer-logs
A WordPress plugin for logging and managing custom developer logs with an AJAX-driven interface and secure, OOP-based design.
https://github.com/kartikmehta8/wp-developer-logs
php wordpress wordpress-plugin
Last synced: about 2 months ago
JSON representation
A WordPress plugin for logging and managing custom developer logs with an AJAX-driven interface and secure, OOP-based design.
- Host: GitHub
- URL: https://github.com/kartikmehta8/wp-developer-logs
- Owner: kartikmehta8
- Created: 2024-08-25T05:40:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T05:40:21.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T03:58:43.410Z (over 1 year ago)
- Topics: php, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Developer Logs Plugin

**Developer Logs Plugin** is a WordPress plugin that provides a simple and effective way to log custom developer logs. This plugin allows you to log messages, arrays, and other data types from anywhere in your WordPress site. The logs are displayed on a dedicated settings page in the WordPress admin area and can be cleared with a single click.
## Features
- **Log Any Data:** Easily log strings, arrays, objects, and more from your WordPress codebase.
- **AJAX-Driven UI:** View and clear logs on the settings page without reloading the page.
- **Secure:** Follows WordPress best practices for security, including sanitization, validation, and nonces.
## Installation
1. **Upload the Plugin:**
- Download the plugin from the link provided below.
- Upload the `developer-logs-plugin` folder to the `/wp-content/plugins/` directory.
2. **Activate the Plugin:**
- Go to the 'Plugins' menu in WordPress and activate the **Developer Logs Plugin**.
3. **Start Logging:**
- Use the `Dev_Logs_Logger::log()` method in your code to log data.
## Usage
### Logging Data
To log data from anywhere in your WordPress code, use the `Dev_Logs_Logger::log()` method. This method accepts multiple arguments and logs them together.
```php
Dev_Logs_Logger::log('This is a log message', array('key' => 'value'), 12345);
```
### Viewing Logs
1. Go to the WordPress admin dashboard.
2. Navigate to `Settings > Developer Logs` to view the logs.
### Clearing Logs
Click the "Clear Logs" button on the `Developer Logs` settings page to clear all logs.
## File Structure
```
developer-logs-plugin/
│
├── assets/
│ └── js/
│ └── dev-logs-plugin.js
│
├── templates/
│ └── admin-page.php
│
├── includes/
│ ├── class-dev-logs-plugin.php
│ ├── class-dev-logs-logger.php
│ └── class-dev-logs-settings-page.php
│
├── uninstall.php
│
└── developer-logs-plugin.php
```
## License
This plugin is licensed under the [MIT License](https://opensource.org/licenses/MIT).