Skip to content

Feat: Metric / Imperial Switcher#149

Open
mgiannopoulos24 wants to merge 9 commits into
XjSv:developfrom
mgiannopoulos24:feat/metric-imperial-switcher
Open

Feat: Metric / Imperial Switcher#149
mgiannopoulos24 wants to merge 9 commits into
XjSv:developfrom
mgiannopoulos24:feat/metric-imperial-switcher

Conversation

@mgiannopoulos24

@mgiannopoulos24 mgiannopoulos24 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces a new feature to switch between Metric and Imperial units through a simple dropdown menu.

Related issues

Closes issue #145 and #64.

Changes

File Change
.wp-env.json Removed deprecated options that are not required on the latest version
assets/css/style.css Styling for the unit label with an icon
assets/js/cooked-functions.js A new function for the switcher
composer.json Addition of php-units-of-measure library
includes/class.cooked-cli.php PHPCS fixes
includes/class.cooked-import.php Addition of links for sample data
includes/class.cooked-measurements.php Addition of new field for measurement system
includes/class.cooked-plugin-extra.php PHPCS fixes
includes/class.cooked-recipes.php Addition of the dropdown on the frontend
includes/class.cooked-unit-converter.php A unit converter utility that utilizes the units of measure library
tests/phpunit/UnitConverterTest.php Unit test for the new feature

Screenshots

Disable Switcher option:

image

Sample file links:

image

Measurement system dropdown:

image

Metric system showcase

image

Checklist

Please check if your PR fulfills the following requirements:

  • Tested in latest version of WordPress
  • No JavaScript errors or warnings in the console
  • No PHP errors or warnings logs
  • Generate language files, if necessary
  • Extended the README / documentation / etc, if necessary

@XjSv XjSv self-requested a review June 15, 2026 21:58
@XjSv XjSv added enhancement New feature or request javascript Pull requests that update Javascript code php Pull requests that update Php code labels Jun 15, 2026
@XjSv XjSv added this to the 1.15.0 milestone Jun 15, 2026
@XjSv XjSv linked an issue Jun 15, 2026 that may be closed by this pull request
@mgiannopoulos24 mgiannopoulos24 marked this pull request as ready for review June 16, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update Javascript code php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Switcher for Imperial to Metric

2 participants