Skip to Content
Contributing

Contributing

We welcome contributions to any LW plugin. All repositories are on GitHub .

How to Contribute

  1. Fork the repository on GitHub
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes following the coding standards below
  4. Run composer phpcs and fix any issues
  5. Commit your changes with a clear message
  6. Push to your fork and open a Pull Request against main

Coding Standards

RuleValue
PHP version8.2+
Coding standardWordPress Coding Standards (WPCS)
AutoloadingPSR-4 (strict)
Strict typesdeclare(strict_types=1); in every file
Namespace patternLightweightPlugins\{PluginName}
IndentationTabs (not spaces)

File Size Limits

Keep files small and focused. Every class should have a single responsibility.

File typeMax lines
Class~200
Trait~80
Interface~30
Method~30

If a class exceeds 200 lines, split it into smaller classes with clear responsibilities.

Commit Checklist

Before every commit, run the linter:

# 1. Check for issues composer phpcs # 2. Auto-fix what can be fixed composer phpcbf # 3. Check again composer phpcs # 4. Only commit if there are zero errors git add . git commit -m "Add feature description"

PSR-4 File Naming

File paths must mirror the namespace. Use PascalCase for directories and filenames.

NamespaceFile path
LightweightPlugins\SEO\Admin\SettingsPageincludes/Admin/SettingsPage.php
LightweightPlugins\SEO\WooCommerce\Schemaincludes/WooCommerce/Schema.php

Do not use class- prefixes, lowercase directories, or underscores in filenames.

Reporting Issues

Open an issue on the relevant plugin’s GitHub repository. Include:

  • WordPress and PHP version
  • Steps to reproduce
  • Expected vs. actual behavior
  • Any error messages or logs