Content Guardian Content Guardian
Navigation
← CGS3 AI Portal Overview Features Architecture & CAS Developer Guide Security Model Testing & QA Matrix User Documentation Downloads (Pending)
CGS3 Portal / Content Guardian / Developer Guide

Developer & Contributor Guide

Setup your local environment, execute isolated test suites, and build production packages.

1. System Prerequisites

To contribute to Speedlink3 Content Guardian, ensure your workstation meets the following runtime environment:

  • PHP 8.4 or PHP 8.5 (with CLI executable, e.g., C:\PHP-8.5.12\php.exe or /usr/bin/php)
  • PHP Extensions: pdo_mysql, mbstring, json
  • PowerShell 7.x (for Windows ZIP build automation) or standard Bash for CI
  • MySQL 8.0+ or MariaDB 10.5+ (for concurrency verification)
  • WordPress Development Site: LocalWP, Docker, or XAMPP (WordPress 6.4+)

2. Repository Layout

Clone the planned repository and inspect the primary files:

# Planned Public Repository (CGS3 Community): git clone https://github.com/ChatGPT-GURU-Speedlink3-AI/speedlink3-content-guardian.git cd speedlink3-content-guardian

Key files and directories:

  • speedlink3-content-guardian.php: Plugin header & bootstrap entry point
  • includes/class-sl3cg-plugin.php: Core plugin logic, CAS, lock, and security engine
  • tests/preview-authorization-tests.php: 18-step strict mock authorization test suite
  • tests/mysql-concurrency-test.php: Multi-connection real MySQL concurrency test harness
  • tools/build-zip.ps1: Automated release packager & exclusion manager

3. PHP 8.5 Syntax & Linting

Always verify that all PHP files pass strict syntax validation under PHP 8.5:

# Lint main plugin entrypoint php -l speedlink3-content-guardian.php # Lint core class php -l includes/class-sl3cg-plugin.php # Lint test suites php -l tests/preview-authorization-tests.php php -l tests/mysql-concurrency-test.php

4. Running Authorization & Mock Tests

Execute the 18-step mock test suite. All tests report PASS with an exit code of 0:

# Run with all errors reported C:\PHP-8.5.12\php.exe -d "error_reporting=-1" .\tests\preview-authorization-tests.php # Verified Status: Tests 1–18 PASS (Owner-verified on PHP 8.5.12, Exit code 0)

5. MySQL Concurrency Testing Status

The multi-connection database test harness (tests/mysql-concurrency-test.php) is locally syntax validated. Physical MySQL 8.0 execution and real WordPress integration tests are classified as NOT_RUN / Pending Execution in submitted community evidence.

# Configure test database connection in environment $env:SL3CG_TEST_DB_HOST = "127.0.0.1" $env:SL3CG_TEST_DB_NAME = "sl3cg_test_db" $env:SL3CG_TEST_DB_USER = "root" $env:SL3CG_TEST_DB_PASS = "secret" # Execute test harness C:\PHP-8.5.12\php.exe .\tests\mysql-concurrency-test.php
Mandatory Test Notice
Missing database drivers or connection failures trigger a nonzero exit code (1). In CGS3 AI governance, an unexecuted test is never recorded as PASS.

6. Password Guard Bcrypt Hash Generation

To configure an administrative action override password, generate a secure Bcrypt hash using the PHP CLI:

php -r "echo password_hash('YourStrongPasswordHere', PASSWORD_BCRYPT, ['cost' => 12]) . PHP_EOL;"

Store the generated hash in your wp-config.php using:

define( 'SL3CG_ACTION_PASSWORD_HASH', '$2y$12$YourGeneratedBcryptHashGoesHere...' );

7. Building Production ZIP Archives

Production distribution ZIPs are generated with strict exclusion filters (excluding Git files, test harnesses, internal notes, and portal web files):

# Build production package powershell -ExecutionPolicy Bypass -File .\tools\build-zip.ps1 -Clean