Skip to content

BeAPI/remove-emojis-slugs

Repository files navigation

Remove emojis from slugs

Current version: 1.0.0

This plugin strips emoji and related pictographic symbols from sanitized slugs so post URLs stay ASCII-only. Post titles are not altered.

How ?

Requirements

  • PHP 7.4+
  • WordPress 1.2+

Installation

As with other small quality-of-life plugins, we recommend using it as a must-use plugin. If you ship it as a folder, you can load it with a MU loader such as wp-mu-loader.

WordPress

  • Download and copy the plugin folder into your must-use plugins directory.
  • Nothing more, this plugin is ready to use !

What ?

Features

  • Removes Unicode Extended_Pictographic characters (emoji).
  • Strips regional indicator symbols used in flag sequences.
  • Removes common dingbat / misc symbol ranges often used as icons.
  • Cleans emoji component characters (variation selectors, ZWJ, combining enclosing keycap).
  • Trims redundant hyphen / underscore runs at the edges of the slug fragment.

Contributing

Issues and pull requests are welcome. For bug reports or feature proposals, use Issues & features request / proposal.

Before you open a pull request:

  • Run the unit tests (see Testing below).
  • Run coding standards with composer run cs (PHP_CodeSniffer and the project ruleset in phpcs.xml).

Please keep changes focused and consistent with the existing code style.

Testing

Introduction

The tests are based on PHPUnit and run inside wp-env.

Only unit tests are available.

Installation

  1. Install Docker and Node.js (>= 18)
  2. Install dependencies: npm install && composer install
  3. Run tests: npm run test:unit

Tools

To test the code, just launch :

  • For unit tests: npm run test:unit
  • For a readable report: npm run test:unit:report
  • For one-shot start + test + stop: npm run test:unit:once

Operating procedure

  1. Initialize once on your machine:
    • npm install
    • composer install
  2. Run test suite:
    • npm run test:unit
  3. Read result directly in terminal output:
    • Success: exit code 0 and PHPUnit success line.
    • Failure: exit code 1 or 2 with failing test names and stack traces.
  4. Stop environment if needed:
    • npm run wp-env:stop

Troubleshooting

  • Error service "cli" is not running:
    • npm run wp-env:start
    • npm run test:unit
  • If environment is corrupted:
    • npm run wp-env:clean
    • npm run wp-env:start
    • npm run test:unit

Changelog

Please refer to CHANGELOG.md.

Issues & features request / proposal

If you identify any errors or have an idea for improving the plugin, feel free to open an issue. Please provide as much info as needed in order to help us resolving / approve your request.

Who ?

Created by Be API, the French WordPress leader agency since 2009. Based in Paris, we are more than 30 people and always hiring some fun and talented guys. So we will be pleased to work with you.

This plugin is only maintained by the Be API team, which means we do not guarantee some free support. Consider reporting an issue and be patient.

If you really like what we do or want to thank us for our quick work, feel free to donate as much as you want / can, even 1€ is a great gift for buying coffee :)

License

Remove emojis from slugs is licensed under the GPL-3.0-or-later.

About

Remove emojis in contents slugs

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages