Skip to content

Latest commit

Β 

History

History
122 lines (87 loc) Β· 3 KB

File metadata and controls

122 lines (87 loc) Β· 3 KB

Contributing to Simple Post Like

Thank you for your interest in contributing! Here is everything you need to get started.


Ways to Contribute

  • πŸ› Report bugs β€” open a GitHub Issue
  • πŸ’‘ Suggest features β€” open an issue with the enhancement label
  • πŸ”§ Submit a pull request β€” fixes, improvements, or new features
  • 🌍 Translations β€” submit a .po file for your language

Development Setup

Requirements

  • PHP 8.0+
  • Composer
  • Node.js 18+ and npm
  • WordPress 6.8+

Getting started

git clone https://github.com/fronttheme/simple-post-like.git
cd simple-post-like

# Install PHP dependencies
composer install

# Install Node dependencies and compile SCSS
npm install
npm run dev

npm run dev watches for SCSS changes and recompiles automatically.


Project Structure

simple-post-like/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/              # Compiled CSS (committed to git)
β”‚   β”œβ”€β”€ js/               # Vanilla ES6 (no build step)
β”‚   └── scss/             # SCSS source
β”‚       β”œβ”€β”€ _variables.scss
β”‚       β”œβ”€β”€ simple-post-like.scss
β”‚       β”œβ”€β”€ admin.scss
β”‚       β”œβ”€β”€ frontend/
β”‚       └── admin/
β”œβ”€β”€ includes/
β”‚   β”œβ”€β”€ classes/          # PHP classes (PSR-4 autoloaded)
β”‚   └── traits/
β”œβ”€β”€ languages/            # Translation files
β”œβ”€β”€ simple-post-like.php  # Plugin entry point
β”œβ”€β”€ composer.json
└── package.json

Code Standards

PHP

  • Follow WordPress Coding Standards
  • PHP 8.0+ syntax is welcome (match, named arguments, union types)
  • All user-facing strings wrapped in esc_html__() or equivalent
  • All output must be properly escaped

JavaScript

  • Plain ES6+ β€” no jQuery, no frameworks, no build step
  • Follow the existing style in assets/js/

SCSS

  • BEM naming β€” .block__element--modifier
  • New components go in their own partial under assets/scss/
  • Run npm run build before committing β€” always commit the compiled CSS

Pull Request Process

  1. Fork the repo and create a branch from main:

    git checkout -b fix/your-fix-name
    git checkout -b feature/your-feature-name
  2. Make changes following the standards above

  3. Compile SCSS if you changed any .scss files:

    npm run build
  4. Test on a clean WordPress 6.8+ install

  5. Commit with a clear message:

    fix: prevent double like on rapid click
    feat: add reaction count to REST API response
    docs: update shortcode examples in README
    
  6. Open a pull request against main describing what changed and why


Reporting Bugs

Please include: WordPress version, PHP version, plugin version, steps to reproduce, expected vs actual behaviour, and any relevant errors.


Questions

Open a GitHub Discussion for general questions.