Skip to main content

Technical Guide & CI/CD Pipeline

Version PHP CI Updated

Purpose

This guide covers the development workflow, asset compilation, and the theme's testing infrastructure and CI/CD pipeline.

Development Workflow

The mhm-rentiva-theme is designed for performance and strict adherence to WordPress Coding Standards (WPCS).

Asset Management — 6 CSS Files

Static files are stored in the /assets directory. As of v0.3.0 the CSS stack consists of 6 files:

#FilePurpose
1header.cssTop navigation, mobile navigation overlay (dark theme #101922).
23-layout.cssPage layout, content-wide mode, max-width: var(--wp--style--global--content-size, 1280px). @layer layout REMOVED.
3components.cssReusable UI components such as cards, buttons, and badges.
4utilities.cssHelper classes (spacing, visibility, typography).
5plugin-pages.cssStyle overrides specific to plugin pages.
6elementor-compat.cssElementor compatibility layer.
  • /assets/js: Lightweight vanilla JS (e.g., header.js for the mobile menu).
CSS Architecture Note

The @layer layout previously used in 3-layout.css was removed in v0.3.0. Additionally, white-space: nowrap was added to the rv-trust-value class (10,000+ stats card fix).

Loading Logic

All assets are loaded via mhm_rentiva_theme_enqueue_header_assets() inside functions.php:

wp_enqueue_style( 'mhm-theme-plugin-pages', $css_uri . 'plugin-pages.css', array(), $ver );
wp_enqueue_script( 'mhm-theme-header', $js_uri . 'header.js', array(), $ver, true );

Dependency Management

The theme uses Composer for development dependencies (PHPUnit, PHPCS) and npm/npx for asset minification (where applicable).

  • Install Dependencies: composer install

Testing Infrastructure

The theme includes a comprehensive PHPUnit test suite located in /tests.

Key Test Suites

Test SuiteFileResponsibility
Theme StructureThemeStructureTest.phpEnsures templates/, parts/, and theme.json exist.
Asset CheckAssetEnqueueTest.phpValidates correct enqueuing of CSS and JS.
PatternsPatternRegistrationTest.phpVerifies rentiva category and essential patterns.
TemplatesThemeTemplatesSemanticTest.phpEnsures key templates like single-vehicle.html are correct.

Running Tests Locally

Use the included phpunit.xml.dist configuration:

vendor/bin/phpunit

CI/CD Pipeline

The theme uses GitHub Actions (.github/workflows/ci.yml) for automated quality checks.

Workflow Stages

  1. PHP Lint: Checks for syntax errors across all versions.
  2. PHP Coding Standards (PHPCS): Validates adherence to WordPress-Core and WordPress-Extra.
  3. Unit Testing: Runs the complete PHPUnit suite in a headless WordPress environment.
  4. Build Check: Verifies theme.json schema validity.

Workflow Configuration

# Examples from .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- name: PHPCS Check
run: vendor/bin/phpcs --standard=phpcs.xml.dist .

Coding Standards

The theme follows these strict rules (as defined in phpcs.xml.dist):

  • declare(strict_types=1); mandatory for all PHP files.
  • No direct usage of extract().
  • Use of @since and @return tags in docblocks.
  • Prefixing all functions with mhm_rentiva_theme_.

DemoSeeder & WP-CLI

DemoSeeder Bug Fixes (v0.3.0)

7 bugs were fixed in DemoSeeder in v0.3.0. The most important: the add_booking_review() method now works fully compatible with the testimonials shortcode. The testimonials shortcode reads from vehicle_booking post meta (_mhm_rentiva_customer_review), not from WP comments.

WP-CLI Page Creation

To avoid bash ! escaping issues when creating WordPress pages via WP-CLI, the wp eval-file - heredoc method is used:

wp eval-file - <<'PHPEOF'
<?php
// Page creation code here
wp_insert_post([
'post_title' => 'Vehicles',
'post_name' => 'vehicles',
'post_content' => '<!-- wp:shortcode -->[rentiva_vehicles_grid]<!-- /wp:shortcode -->',
'post_status' => 'publish',
'post_type' => 'page',
]);
PHPEOF

Changelog

DateVersionNote
23.04.2026v0.3.0English translation applied to mixed-language sections.
27.03.2026v0.3.0CSS stack (6 files) details, DemoSeeder fixes, and WP-CLI method added.
09.03.20264.21.0-docsDevelopment guide and CI/CD documentation created.