Skip to content
hooman helmi edited this page Jul 14, 2025 · 14 revisions

WP Statistics Development Guide

Welcome to the WP Statistics development guide! This page provides an overview of the codebase, including key classes, methods, architectural decisions, and resources to help you understand the structure of the WP Statistics plugin and contribute effectively.

Getting Started

Before diving into development, set up your development environment by following our comprehensive guide:

This guide covers:

  • Cloning the repository
  • Installing PHP and JavaScript dependencies
  • Building assets with Gulp
  • Running unit tests with PHPUnit

Developer Resources

Traits

Classes

Database Manager

Components

Front-End Development and CSS Guide

WP-CLI Commands

Enhance your development workflow using WP-CLI commands tailored for WP Statistics:

This document explains how to:

  • Use bash scripts to insert dummy data
  • Run WP-CLI commands for testing and development purposes

Architecture Overview

The WP Statistics plugin is designed with a modular architecture to handle various functionalities like visitor tracking, performance reporting, and more. It is structured into several core components:

  • Service Layer: Manages application logic and data processing.
  • Models: Handles data operations and interactions with the WordPress database.
  • Traits: Reusable code blocks like the ObjectCacheTrait for caching.
  • Helpers: Utility functions and classes for common tasks.

Development Guidelines

  1. Follow Coding Standards: Adhere to PSR-12 standards for PHP coding to maintain code quality.
  2. Error Handling: Ensure proper error handling using try-catch blocks.
  3. Testing: Write unit tests for new features and critical components.

For a complete list of guidelines, visit our Contributing Guide.

Contributing

We welcome contributions to the WP Statistics project! To get started:

  1. Read the Contributing Guide: Familiarize yourself with our development processes and standards.
  2. Fork the Repository: Create your own fork to work on new features or bug fixes.
  3. Create a New Branch: Use descriptive branch names like feat-your-feature-name.
  4. Submit a Pull Request: Once your changes are ready, submit a pull request for review.

For more information on how to get involved, visit our GitHub Issues page.

Clone this wiki locally