From a12ea84a819c7228ba456c5c1390078befccbda8 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:43:36 +0300 Subject: [PATCH 1/9] Initial commit of Metric/Imperial switcher. --- assets/css/style.css | 35 +++++++ assets/css/style.min.css | 2 +- assets/js/cooked-functions.js | 19 +++- assets/js/cooked-functions.min.js | 2 +- cooked.php | 1 + includes/class.cooked-measurements.php | 15 +++ includes/class.cooked-post-types.php | 1 + includes/class.cooked-recipes.php | 64 +++++++++++- includes/class.cooked-settings.php | 1 + includes/class.cooked-shortcodes.php | 11 ++ includes/class.cooked-unit-converter.php | 128 +++++++++++++++++++++++ readme.txt | 1 + 12 files changed, 275 insertions(+), 5 deletions(-) create mode 100644 includes/class.cooked-unit-converter.php diff --git a/assets/css/style.css b/assets/css/style.css index 86efd8b..e4a332b 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -86,6 +86,41 @@ button.cooked-button { margin-left: 1rem; } +/* Measurement System Switcher */ +.cooked-recipe-info span.cooked-measurement-system { + padding-left: 3rem; +} +.cooked-recipe-info span.cooked-measurement-system select.cooked-measurement-system-changer { + opacity: 0; + position: absolute; + bottom: 0; + left: 0; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + cursor: pointer; + border: none; + background: none; + width: 100%; + padding: 0; + margin: 0; +} +.cooked-recipe-info span.cooked-measurement-system-icon { + opacity: 0.5; + width: 1rem; + height: 1rem; + font-size: 2.2rem; + line-height: 1; + display: block; + position: absolute; + top: 50%; + left: 0; + margin: -1.1rem 0 0 0; +} +.cooked-recipe-info span.cooked-measurement-system-icon i.cooked-icon { + display: block; +} + /* Recipe Image */ .cooked-post-featured-image { max-width: 100%; diff --git a/assets/css/style.min.css b/assets/css/style.min.css index 93da775..2db6c21 100644 --- a/assets/css/style.min.css +++ b/assets/css/style.min.css @@ -1 +1 @@ -#wp-admin-bar-cooked-ab .ab-icon:before{font-family:CookedIcons;content:"\f035";font-size:17px;top:-2px}.cooked-clearfix:after{content:"";display:table;clear:both}.cooked-noscroll{overflow:hidden;width:100%;height:100%}.cooked-hidden-schema{display:none}.cooked-fsm .cooked-fsm-mobile-nav{display:none}.cooked-browse-search-button,.cooked-button,.cooked-fsm .cooked-fsm-top,.cooked-icon-loading,.cooked-profile-tabs,.cooked-progress span{color:#fff!important;text-decoration:none!important}.cooked-recipe-search .cooked-taxonomy-selected .cooked-field-title,.cooked-recipe-search .cooked-taxonomy-selected:before{color:#fff}.cooked-button,button.cooked-button,input[type=button].cooked-button,input[type=submit].cooked-button{box-sizing:border-box;cursor:pointer;display:inline-block;padding:.4rem .65rem;height:2.1rem;line-height:1.25rem;font-size:.9rem;font-weight:500;letter-spacing:.03rem;color:#fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.cooked-button i.cooked-icon{color:#fff;font-size:1rem;font-weight:400}.cooked-button.cooked-square-button{padding:0;width:2.25rem;height:2.25rem;line-height:2.25rem;text-align:center}.cooked-button.cooked-square-button i.cooked-icon{font-size:1rem}.cooked-servings-switcher{display:block}.cooked-servings-switcher .cooked-button:first-child{margin-right:1rem}.cooked-servings-switcher .cooked-button:last-child{margin-left:1rem}.cooked-post-featured-image{max-width:100%;height:auto;border:none;display:block;margin:0 0 2rem;padding:0}body .cooked-post-featured-image img{display:block;width:100%;height:auto}.cooked-recipe-ingredients{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-ingredients .cooked-heading{margin:1rem 0 .3rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-ingredients .cooked-heading:first-child{margin-top:0}.cooked-recipe-ingredients .cooked-ingredient{position:relative;padding:.5rem 0 0 2rem;margin:0;font-size:inherit}.cooked-recipe-ingredients .cooked-ingredient.cooked-ing-no-checkbox{padding-left:0}.cooked-recipe-ingredients .cooked-ingredient .cooked-ing-name{line-height:1.4rem;padding:1px 0}.cooked-recipe-ingredients .cooked-ingredient-checkbox{transform:scale(1);position:absolute;top:.9rem;left:0;cursor:pointer;display:inline-block;width:1rem;height:1rem;line-height:1rem;border:1px solid #ddd;border-color:rgba(0,0,0,.2);margin:0 .8rem 0 0}.cooked-recipe-ingredients .cooked-ingredient-checkbox:active{transform:scale(.9)}.cooked-recipe-ingredients .cooked-ingredient-checkbox:hover{border-color:#bbb;border-color:rgba(0,0,0,.5)}.cooked-recipe-ingredients .cooked-ingredient-checkbox.cooked-checked:after{font-family:CookedIcons;content:"\f01d";position:absolute;top:0;left:0;font-size:.6rem;line-height:1rem;width:100%;height:100%;text-align:center}.cooked-recipe-ingredients .cooked-ingredient.cooked-checked{text-decoration:line-through;opacity:.5}.cooked-ingredient-substitution{font-style:italic;color:#777;margin-left:5px;display:inline-block}.cooked-ing-sub-label{font-style:normal;font-weight:600;font-size:.85em;color:#999;margin-right:2px}.cooked-recipe-directions{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-directions .cooked-heading{margin:0 0 1rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-directions .cooked-direction{position:relative;padding:0;margin:0;font-size:inherit}.cooked-recipe-directions .cooked-direction img{max-width:100%;height:auto;display:block;margin:0 0 2rem;padding:0;border:none}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number .cooked-dir-content{padding-left:2.75rem}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-dir-content{padding-left:2.75rem}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-direction-number{width:2ch;text-align:right;font-variant-numeric:tabular-nums}.cooked-recipe-directions .cooked-direction-number{opacity:.35;position:absolute;display:inline-block;width:auto;height:1.5rem;line-height:1.5rem;font-weight:800;top:0;left:0;font-size:1.5rem}.cooked-recipe-excerpt{display:block;padding:0;margin:0 0 1rem}.cooked-recipe-info{display:block;padding:0;margin:0 0 1rem}.cooked-recipe-info>section.cooked-left>span,.cooked-recipe-info>span{line-height:1.25rem;position:relative;box-sizing:border-box;vertical-align:top;margin:0 2rem 1rem 0;display:inline-block;width:auto}.cooked-recipe-info>section.cooked-right>span{line-height:1.3rem;position:relative;box-sizing:border-box;vertical-align:top;margin:0 0 1rem 2rem;display:inline-block;width:auto}.cooked-recipe-info>section.cooked-left>span:last-child,.cooked-recipe-info>span:last-child{margin-right:0}.cooked-recipe-info>section.cooked-right>span:first-child{margin-left:0}.cooked-recipe-info strong{font-size:.75rem;letter-spacing:.03rem;font-weight:800;text-transform:uppercase;display:block}.cooked-recipe-notes{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-notes .cooked-heading{margin:0 0 1rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-info span.cooked-print,.cooked-recipe-info span.cooked-print>a{height:2rem;display:inline-block}.cooked-recipe-info span.cooked-print>a{color:rgba(0,0,0,.4)}.cooked-recipe-info span.cooked-print>a:hover{color:rgba(0,0,0,.6)}.cooked-recipe-info span.cooked-print .cooked-icon{font-size:2.25rem;line-height:2.5rem}.cooked-recipe-info span.cooked-fsm-button{cursor:pointer;color:rgba(0,0,0,.4);height:2rem;display:inline-block}.cooked-recipe-info span.cooked-fsm-button:hover{color:rgba(0,0,0,.6)}.cooked-recipe-info span.cooked-fsm-button .cooked-icon{font-size:2.25rem;line-height:2.5rem}.cooked-recipe span.cooked-author,.cooked-recipe-info span.cooked-author{padding-left:3.25rem}.cooked-recipe span.cooked-author.cooked-no-avatar,.cooked-recipe-info span.cooked-author.cooked-no-avatar{padding-left:0}.cooked-recipe span.cooked-author-avatar,.cooked-recipe-info span.cooked-author-avatar{width:2.5rem;height:2.5rem;display:block;position:absolute;top:50%;left:0;margin:-1.25rem 0 0 0}.cooked-recipe span.cooked-author-avatar img,.cooked-recipe-info span.cooked-author-avatar img{margin:0;padding:0;display:block;height:auto;width:100%;max-width:100%;max-height:100%;border-radius:100px}.cooked-author-avatar,.cooked-author-avatar img{border-radius:5rem}.cooked-recipe-info span.cooked-time{padding-left:3rem}.cooked-recipe-info span.cooked-time-icon{opacity:.5;width:1rem;height:1rem;font-size:2.2rem;display:block;position:absolute;top:50%;left:0;margin:-1.1rem 0 0 0}.cooked-recipe-info span.cooked-time-icon i.cooked-icon{display:block}.cooked-timer{padding-left:2px}.cooked-timer i.cooked-icon{opacity:.6}body .cooked-timer a{font-weight:600;cursor:pointer;text-decoration:none}body .cooked-timer a:hover{text-decoration:none}#cooked-timers-wrap{z-index:99999;white-space:nowrap;overflow:hidden;border-radius:10px 10px 0 0;background:#fff;box-shadow:0 -5px 30px rgba(0,0,0,.15);line-height:1.6rem;font-size:1rem;width:50%;max-width:100%;height:7.5rem;position:fixed;transform:translate3d(0,7.2em,0);opacity:0;bottom:0;right:50%;margin:0 -25% 0 0;box-sizing:border-box}#cooked-timers-wrap.cooked-visible{transform:translate3d(0,0,0);opacity:1}#cooked-timers-wrap .cooked-timer-block{overflow:hidden;position:relative;display:block;height:0;padding:0;width:100%;opacity:0;padding:0 1.5rem 0 6rem;box-sizing:border-box}#cooked-timers-wrap .cooked-timer-block.cooked-visible{opacity:1;height:7.5rem;padding:1.9rem 1.5rem 1.55rem 6rem}#cooked-timers-wrap .cooked-timer-block>span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:auto}#cooked-timers-wrap .cooked-timer-block i.cooked-icon-times{line-height:2rem;color:rgba(0,0,0,.25);position:absolute;font-size:2rem;top:2.5rem;left:2rem;cursor:pointer}#cooked-timers-wrap .cooked-timer-block i.cooked-icon-times:hover{color:inherit}#cooked-timers-wrap .cooked-timer-block .cooked-timer-step{font-size:1.1rem;font-weight:800;text-transform:uppercase}#cooked-timers-wrap .cooked-timer-block .cooked-timer-desc{font-size:1.2rem;width:100%;padding-right:14rem;box-sizing:border-box;font-weight:400;color:rgba(0,0,0,.65)}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj{font-weight:600;position:absolute;top:2.5rem;right:2rem;width:13.5rem;font-size:2rem;line-height:2rem}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>div,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon{display:inline-block}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-pause,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-play,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-reverse{cursor:pointer;opacity:.5;width:2rem;text-align:center;margin-right:.5rem;position:relative;font-size:2rem;transform:scale(.75)}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-play{display:none}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon:hover{opacity:1}#cooked-timers-wrap.cooked-multiples{margin:0;right:0;border-radius:10px 0 0 0;width:20rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block{padding-left:3.25rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block.cooked-visible{padding-top:1rem;line-height:1.5rem;padding-left:3.25rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-step{font-size:.9rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-desc{font-size:1rem;padding:0}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-obj{top:auto;right:auto;width:auto;font-size:1.5rem;line-height:2rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-obj>i.cooked-icon{font-size:1.5rem;width:1.3rem;margin-right:.5rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block i.cooked-icon-times{line-height:1rem;font-size:1rem;top:1.4rem;left:1.2rem}#cooked-timers-wrap .cooked-timer-block .cooked-progress{display:block;position:absolute;left:0;bottom:0;height:.5rem;width:100%;background:rgba(0,0,0,.15)}#cooked-timers-wrap .cooked-timer-block .cooked-progress span{width:0;display:block;position:absolute;left:0;top:0;height:.5rem}#cooked-timers-wrap .cooked-timer-block.cooked-paused{background:#f9f9f9}#cooked-timers-wrap .cooked-timer-block.cooked-paused .cooked-timer-obj{color:rgba(0,0,0,.5)}#cooked-timers-wrap .cooked-timer-block.cooked-complete{background:rgba(255,0,0,.05)}#cooked-timers-wrap .cooked-timer-block.cooked-complete .cooked-progress span{background:red}#cooked-timers-wrap .cooked-timer-block.cooked-complete .cooked-timer-obj{color:red}.cooked-recipe-info span.cooked-servings{padding-left:3rem}.cooked-recipe-info span.cooked-servings select.cooked-servings-changer{opacity:0;position:absolute;bottom:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0;width:100%;padding:0;margin:0}.cooked-recipe-info span.cooked-servings-icon{opacity:.5;width:1rem;height:1rem;font-size:2.2rem;display:block;position:absolute;top:50%;left:0;margin:-1.1rem 0 0 0}.cooked-recipe-info span.cooked-servings-icon i.cooked-icon{display:block}.cooked-left{float:left;display:inline-block;width:auto}.cooked-right{float:right;display:inline-block;width:auto}.cooked-recipe-gallery{height:1px;overflow:hidden;opacity:0;transform:translate3d(0,10px,0);padding:0;margin:0}.cooked-recipe-gallery .fotorama__thumb-border{border-color:#333}.cooked-recipe-gallery .fotorama__caption__wrap{background:#333;color:#fff}.cooked-recipe-gallery .fotorama__stage__frame.fotorama__active{background:#333}.cooked-recipe-gallery.cooked-gallery-loaded{height:auto;overflow:inherit;opacity:1;transform:translate3d(0,0,0);margin:0 0 2rem}.cooked-nutrition-label{background:#fff;font-size:.9rem;border:1px solid #aaa;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:10px;margin:0 0 2rem;font-family:Helvetica,Arial,sans-serif;container-name:nutrition-label;container-type:inline-size}.cooked-nutrition-label .cooked-nutrition-title{font-size:2.3rem;line-height:1;letter-spacing:0;font-weight:800;padding:0 0 .5rem 0;margin:0;color:#333;border-bottom:1px solid #aaa}.cooked-nutrition-label.cooked-float-left{max-width:45%;margin:0 3rem 3rem 0;float:left}body .cooked-nutrition-label p{margin:0!important;padding:0!important}body .cooked-nutrition-label p.cooked-daily-value-text{padding:.75rem 0 .15rem 0!important;margin:0!important;font-size:.9rem;line-height:1.3rem!important}body .cooked-nutrition-label p.cooked-daily-value-text strong{font-weight:400}body .cooked-nutrition-label dl{margin:0!important;padding:0!important}body .cooked-nutrition-label dt{position:relative;margin:0;padding:2px 0;border-top:1px solid #aaa}body .cooked-nutrition-label dt.cooked-calories{border-top:none;display:flex;justify-content:space-between;align-items:baseline;padding-bottom:10px}body .cooked-nutrition-label dt.cooked-calories strong{font-size:2rem;font-weight:800}body .cooked-nutrition-label dt.cooked-calories strong.cooked-nut-label{font-size:2.5rem}body .cooked-nutrition-label dt.cooked-nut-servings{border-top:none;padding-bottom:0}body .cooked-nutrition-label dt.cooked-serving-size{border-top:none;padding-top:0}body .cooked-nutrition-label div.cooked-serving-size strong,body .cooked-nutrition-label dt.cooked-serving-size strong,body .cooked-nutrition-label dt.cooked-serving-size strong.cooked-nut-label{font-size:1.3rem;font-weight:800}body .cooked-nutrition-label div.cooked-nut-servings p,body .cooked-nutrition-label dt.cooked-nut-servings p{font-size:1.2rem}body .cooked-nutrition-label dt dt{padding:2px 0 0;margin:2px 0 0}body .cooked-nutrition-label dt:after{content:"";display:table;clear:both}body .cooked-nutrition-label dt.no-after:after{content:none}body .cooked-nutrition-label div.cooked-nut-spacer,body .cooked-nutrition-label dt.cooked-nut-spacer{border:none;height:.5rem;padding:0;background:#333;margin-top:.3rem}body .cooked-nutrition-label dl dt.cooked-nut-no-border,body .cooked-nutrition-label>dl>dt:first-child{border:none}body .cooked-nutrition-label dt dl{margin:0 0 0 1.5rem!important}body .cooked-nutrition-label .cooked-nut-hr{border:none;border-top:1rem solid #333;margin:.1rem 0 0;padding:0}body .cooked-nutrition-label strong{font-weight:800}body .cooked-nutrition-label strong.cooked-nut-heading{font-size:1rem}body .cooked-nutrition-label strong.cooked-nut-label{font-weight:400}body .cooked-nutrition-label dl dl strong.cooked-nut-right{font-weight:800}body .cooked-nutrition-label .cooked-nut-right{float:right}body .cooked-nutrition-label dl.cooked-nut-bottom dt{border-top:none;border-bottom:1px solid #aaa;float:left;width:100%;box-sizing:border-box}body .cooked-nutrition-label dl.cooked-nut-bottom dt strong{font-weight:400}body .cooked-nutrition-label dl.cooked-nut-bottom dt:last-child{border:none}body .cooked-nutrition-label dl.cooked-nut-bottom dt:nth-last-child(2):nth-child(even){border-bottom:1px solid #aaa}.widget .cooked-nutrition-label{margin:0}body .cooked-nutrition-label .cooked-nutrition-facts-powered-by-edamam img{float:right;height:2rem}.cooked-recipe-search{box-sizing:border-box;padding:0;margin:0;width:100%;display:block;border:1px solid transparent;position:relative}.cooked-recipe-search .cooked-field-wrap,.cooked-recipe-search .cooked-fields-wrap{display:inline-block;box-sizing:border-box;width:100%;margin:0 1% 0 0}.cooked-recipe-search .cooked-fields-wrap{margin:0}.cooked-recipe-search .cooked-browse-select{display:block;cursor:pointer;position:relative;border-radius:3px;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;background:rgba(0,0,0,.075);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);width:100%;font-size:1rem;line-height:3rem;height:auto;padding:0 1rem}.cooked-recipe-search .cooked-browse-select:hover{background:rgba(0,0,0,.1)}.cooked-recipe-search .cooked-browse-select .cooked-field-title{font-size:.9rem;vertical-align:top}.cooked-recipe-search .cooked-taxonomy-selected{border-radius:3px}.cooked-recipe-search .cooked-sortby-wrap{background:#f5f5f5;position:absolute;top:0;height:3rem;width:12rem;display:inline-block;margin:0 1px 0 0;right:3.5rem}.cooked-recipe-search .cooked-sortby-wrap>select{margin:0;box-shadow:none;position:relative;width:100%;background:0 0;cursor:pointer;font-size:.9rem;border:none;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:100%;border-radius:0;display:inline-block;padding:0 1.25rem}.cooked-recipe-search .cooked-sortby-wrap:hover{background:#eee}.cooked-recipe-search input[type=text]{margin:0;vertical-align:initial;box-shadow:none;display:inline-block;box-sizing:border-box;background:#fff;width:100%;height:3rem;padding:0 1rem;font-size:1rem;border:1px solid rgba(0,0,0,.15);border-right:none}.cooked-recipe-search .cooked-3-search-fields>*,.cooked-recipe-search .cooked-4-search-fields>*{float:left}.cooked-recipe-search .cooked-field-wrap-select{position:relative}.cooked-recipe-search .cooked-field-wrap-select:before,.cooked-recipe-search .cooked-sortby-wrap:before{content:"\f00b";opacity:.25;font-family:CookedIcons;font-size:.75rem;position:absolute;top:50%;right:1.5rem;line-height:1.25rem;height:1.25rem;margin-top:-.5rem}.cooked-recipe-search .cooked-field-wrap-select:hover:before,.cooked-recipe-search .cooked-sortby-wrap:hover:before{opacity:.75;margin-top:-.5rem}.cooked-recipe-search .cooked-fields-wrap{padding-right:3.5rem;position:relative}.cooked-recipe-search .cooked-fields-wrap>.cooked-field-wrap-select{width:14%}.cooked-recipe-search .cooked-fields-wrap>.cooked-browse-search{width:85%;max-width:85%;margin:0}.cooked-recipe-search.cooked-search-no-sorting.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{width:100%}.cooked-recipe-search .cooked-browse-search-button{position:absolute;top:0;right:1px;width:3.5rem;text-decoration:none;font-size:1rem;text-align:center;color:#fff;line-height:3rem;height:3rem}.cooked-recipe-search .cooked-browse-search-button:hover{color:#fff;text-decoration:none}.cooked-recipe-search .cooked-browse-select-block{display:flex;color:inherit;cursor:default;visibility:hidden;opacity:0;transform:translate3d(0,-6px,0);box-sizing:border-box;z-index:99;position:absolute;width:auto;background:#fff;top:4rem;left:-10px;margin:0;line-height:1.5rem;border-radius:6px}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column{display:block;width:25%;min-width:25%;box-sizing:border-box;padding:0 .75rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div{max-height:16rem;overflow:auto}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>span{display:block}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>a,.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>span{display:block;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>span.cooked-tax-column-title{font-size:.9rem;font-weight:800;text-transform:uppercase;margin:0 0 .6rem;padding:0 10px .6rem 0;border-bottom:1px solid rgba(0,0,0,.15)}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>a{line-height:1.6rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>span.cooked-tax-sub-item{margin-left:.75rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column i.cooked-icon{font-size:.9rem;color:rgba(0,0,0,.5)}.cooked-recipe-search .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:170%;padding:1.5rem}.cooked-recipe-search .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%;padding:0}.cooked-recipe-search .cooked-browse-select.cooked-active .cooked-browse-select-block{visibility:visible;opacity:1;transform:translate3d(0,-1px,0)}.cooked-recipe-search .cooked-browse-select-block{box-shadow:0 2px 2px rgba(0,0,0,.05),0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 16px 16px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}.cooked-browse-select-inline-block{display:flex;color:inherit;cursor:default;visibility:visible;opacity:1;box-sizing:border-box;z-index:99;position:relative;width:auto;background:#fff;margin:10px 2px 3rem;line-height:1.5rem;border-radius:6px;padding:1.5rem}.cooked-browse-select-inline-block .cooked-tax-column{display:block;width:100%;box-sizing:border-box;padding:0 .75rem}.cooked-browse-select-inline-block .cooked-tax-column>div{max-height:16rem;overflow:auto}.cooked-browse-select-inline-block .cooked-tax-column>div>span{display:block}.cooked-browse-select-inline-block .cooked-tax-column>div>a,.cooked-browse-select-inline-block .cooked-tax-column>span{display:block;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.cooked-browse-select-inline-block .cooked-tax-column>span.cooked-tax-column-title{font-size:.9rem;font-weight:800;text-transform:uppercase;margin:0 0 .6rem;padding:0 10px .6rem 0;border-bottom:1px solid rgba(0,0,0,.15)}.cooked-browse-select-inline-block .cooked-tax-column>div>a{line-height:1.6rem}.cooked-browse-select-inline-block .cooked-tax-column>div>span.cooked-tax-sub-item{margin-left:.75rem}.cooked-browse-select-inline-block .cooked-tax-column i.cooked-icon{font-size:.9rem;color:rgba(0,0,0,.5)}.cooked-browse-select-inline-block{box-shadow:0 2px 2px -1px rgba(0,0,0,.15)}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap{padding:0;display:block}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap>.cooked-browse-search{width:100%;max-width:100%;border-right:1px solid rgba(0,0,0,.15);margin:3% 0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:100%;left:0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap>.cooked-field-wrap-select{display:block;width:100%}.cooked-recipe-search.cooked-search-compact .cooked-sortby-wrap{display:block;position:relative;width:67%;right:auto;top:auto;float:left;margin:0}.cooked-recipe-search.cooked-search-compact .cooked-sortby-wrap>select{position:absolute;width:100%;border:1px solid rgba(0,0,0,.15);margin:0}.cooked-recipe-search.cooked-search-compact .cooked-browse-search-button{width:30%;right:auto;position:relative;display:block;float:right}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block{top:3rem;left:0;max-height:16rem;overflow:auto;transform:translate3d(0,-1px,0)}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-2-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-3-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-4-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block .cooked-tax-column{float:none;padding:0 0 1.5rem 0}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block .cooked-tax-column:last-child{padding:0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-2-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-3-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-4-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting .cooked-fields-wrap>.cooked-browse-search{width:80%;margin:3% 0}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting .cooked-browse-search-button{width:20%;margin:3% 0}.cooked-recipe-search.cooked-search-compact.cooked-search-no-browse .cooked-browse-search-button,.cooked-recipe-search.cooked-search-compact.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{margin:0 0 3%}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting.cooked-search-no-browse .cooked-browse-search-button,.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{margin:0}.cooked-author-list-heading{display:block;margin:0 0 2rem}.cooked-author-list-heading .cooked-author-avatar{float:left;width:3rem;height:auto;display:block;margin:0 1rem 0 0}.cooked-author-list-heading .cooked-author-avatar img{display:block;margin:0}.cooked-author-list-heading .cooked-meta-title{font-size:1.25rem;line-height:1.2rem;margin:0}.cooked-author-list-heading a{font-size:.9rem}body p.cooked-none-found{display:block;margin:0;padding:1rem 0 2rem;color:#888;text-align:center;font-style:italic}.cooked-recipe-grid{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;box-sizing:border-box;padding:0;margin:3% -1.5%;width:103%;display:flex;flex-wrap:wrap}.cooked-recipe-grid .cooked-recipe{width:30.333%;min-width:30.333%;display:block;box-sizing:border-box;margin:0 1.5% 3%;padding:0}.cooked-recipe-grid .cooked-recipe .cooked-recipe-card-title{cursor:pointer;color:inherit;text-decoration:none}.cooked-recipe-grid .cooked-recipe .cooked-recipe-card-title:hover{text-decoration:none!important}.cooked-recipe-grid.cooked-columns-1 .cooked-recipe{width:97%;min-width:97%}.cooked-recipe-grid.cooked-columns-2 .cooked-recipe{width:47%;min-width:47%}.cooked-recipe-grid.cooked-columns-3 .cooked-recipe{width:30.333%;min-width:30.333%}.cooked-recipe-grid.cooked-columns-4 .cooked-recipe{width:22%;min-width:22%}.cooked-recipe-grid.cooked-columns-5 .cooked-recipe{width:17%;min-width:17%}.cooked-recipe-grid.cooked-columns-6 .cooked-recipe{width:13.666%;min-width:13.666%}.cooked-recipe a,.cooked-recipe a:hover,.cooked-recipe-info a,.cooked-recipe-info a:hover,.cooked-recipe-search a,.cooked-recipe-search:hover{box-shadow:none!important}.cooked-recipe-card{text-align:left;background:#fff;text-decoration:none!important;border:none!important;color:inherit!important;display:block;overflow:hidden;border-radius:3px;margin:0 auto 1rem;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.cooked-recipe-card-content>span,.cooked-recipe-card>span{display:block!important}.cooked-recipe-card:hover{text-decoration:none!important;border:none!important;color:inherit!important}.cooked-recipe-card-image{background-size:cover;background-position:center;display:block;margin:0;padding:0;height:250px;width:100%;position:relative}.cooked-recipe-card .cooked-recipe-image-empty{display:block;margin:0;padding:0;height:250px;width:100%;position:relative}.cooked-recipe-card .cooked-recipe-card-sep{display:none}.cooked-recipe-card-content{padding:1rem 1.5rem;margin:0}.cooked-recipe-card-title{display:block;font-weight:600;margin:.5rem 0;font-size:1.25rem;line-height:1.65rem}.cooked-recipe-card-author{margin:.5rem 0;font-size:.9rem}.cooked-recipe-card-excerpt{display:block;margin:.5rem 0;font-size:1rem}.cooked-recipe-card-centered,.cooked-recipe-card-modern-centered{text-align:center}.cooked-recipe-card-modern,.cooked-recipe-card-modern-centered{transform:translate3d(0,0,0);border-radius:10px;box-shadow:0 2px 3px rgba(0,0,0,.04),inset 0 0 0 1px rgba(0,0,0,.1)}.cooked-recipe-card-modern .cooked-recipe-card-author,.cooked-recipe-card-modern .cooked-recipe-card-excerpt,.cooked-recipe-card-modern .cooked-recipe-card-title,.cooked-recipe-card-modern-centered .cooked-recipe-card-author,.cooked-recipe-card-modern-centered .cooked-recipe-card-excerpt,.cooked-recipe-card-modern-centered .cooked-recipe-card-title{margin:.25rem 0}.cooked-recipe-card-modern .cooked-recipe-card-content,.cooked-recipe-card-modern-centered .cooked-recipe-card-content{padding:1.25rem 1.5rem}.cooked-recipe-card-modern .cooked-recipe-card-author,.cooked-recipe-card-modern-centered .cooked-recipe-card-author{opacity:.75}.cooked-recipe-card-modern .cooked-recipe-card-sep,.cooked-recipe-card-modern-centered .cooked-recipe-card-sep{margin:1rem 0;display:block;width:15%;height:6px;border-radius:3px;background:#ddd}.cooked-recipe-card-modern-centered .cooked-recipe-card-sep{margin:1rem auto}.cooked-recipe-card-modern-centered:hover,.cooked-recipe-card-modern:hover{transform:translate3d(0,-2px,0)!important;box-shadow:0 5px 5px rgba(0,0,0,.05),inset 0 0 0 1px rgba(0,0,0,.1)}.cooked-recipe-card-modern-centered:hover .cooked-recipe-card-sep,.cooked-recipe-card-modern:hover .cooked-recipe-card-sep{width:25%}.widget .cooked-recipe-card{margin:0 auto}.cooked-recipe-term-list .cooked-term-item a{display:block;padding:5px 0;border-top:1px solid rgba(0,0,0,.1)}.cooked-shortcode-recipe-list{margin:0 auto 1rem}.cooked-shortcode-recipe-list .cooked-srl-single{box-sizing:border-box;border:none;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.15);position:relative;display:block;padding:.6rem 0 0 0;margin:0 0 1rem}.cooked-shortcode-recipe-list .cooked-srl-single:hover{border:none;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.15)}.cooked-shortcode-recipe-list .cooked-srl-single.cooked-srl-has-image{padding-left:4rem;min-height:3.75rem}.cooked-shortcode-recipe-list .cooked-srl-image{margin:0;padding:0}.cooked-shortcode-recipe-list .cooked-srl-image img{width:3rem;height:3rem;border-radius:3px;position:absolute;top:.9rem;left:0;display:block;margin:0;padding:0}.cooked-shortcode-recipe-list .cooked-srl-sep{display:none}.cooked-shortcode-recipe-list .cooked-srl-content{line-height:1.4rem;padding:0;margin:0}.cooked-shortcode-recipe-list .cooked-srl-title{line-height:1.4rem;display:block;font-weight:600;margin:.25rem 0;font-size:1rem}.cooked-shortcode-recipe-list .cooked-srl-author{line-height:1.4rem;margin:.25rem 0;font-size:.9rem;opacity:.75}.cooked-shortcode-recipe-list .cooked-srl-single:first-child{border:none;padding-top:0}.cooked-shortcode-recipe-list .cooked-srl-single:first-child .cooked-srl-image img{top:0}.cooked-shortcode-recipe-list .cooked-srl-single.cooked-srl-has-image:first-child{min-height:3rem}.cooked-pagination-numbered{text-align:center;display:block;margin:0 0 2rem}.cooked-pagination-numbered>a,.cooked-pagination-numbered>span{font-size:1.2rem;font-weight:600;display:inline-block;padding:0 5px;background:0 0}.cooked-pagination-numbered>span{color:rgba(0,0,0,.25)}body .cooked-pagination-numbered>a{text-decoration:none;border:none}body .cooked-pagination-numbered>a:hover{text-decoration:none;border:none}.cooked-fsm{box-sizing:border-box;display:none;opacity:0;transform:scale(.95);position:fixed;top:0;left:0;width:100%;height:100%;background:#fff;z-index:99998}.cooked-fsm.cooked-visible{display:block}.cooked-fsm.cooked-active{opacity:1;transform:scale(1)}.cooked-fsm .cooked-fsm-top{font-size:1.2rem;font-weight:300;text-align:center;box-sizing:border-box;position:absolute;top:0;left:0;width:100%;color:#fff;padding:0 4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:3.5rem;height:3.5rem}.cooked-fsm .cooked-fsm-ingredients{box-sizing:border-box;padding:5.5rem 2rem 1rem;font-size:1rem;line-height:1.6rem;width:30%;height:100%;background:#f9f9f9;overflow-y:scroll;-webkit-overflow-scrolling:touch;position:absolute;top:0;left:0}.cooked-fsm .cooked-recipe-ingredients{margin-top:-.75rem}.cooked-fsm .cooked-recipe-ingredients .cooked-ingredient{padding:.75rem 0 0 2rem}.cooked-fsm .cooked-recipe-ingredients .cooked-heading{font-size:1.25rem}.cooked-fsm .cooked-recipe-ingredients .cooked-heading:first-child{padding-top:.75rem}.cooked-fsm .cooked-recipe-ingredients .cooked-ingredient-checkbox{top:.75rem}.cooked-fsm .cooked-fsm-directions-wrap{box-sizing:border-box;padding:5.5rem 2rem 1rem;font-size:1rem;line-height:1.6rem;width:70%;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch;position:absolute;top:0;left:30%}.cooked-fsm .cooked-fsm-directions p{margin:0 0 1.5rem;font-size:1.2rem;line-height:1.6rem}.cooked-fsm .cooked-recipe-directions .cooked-heading{font-size:1.5rem}.cooked-fsm .cooked-recipe-directions .cooked-direction-number{font-size:1.8rem}.cooked-fsm .cooked-recipe-directions .cooked-direction.cooked-direction-has-number .cooked-dir-content{padding-left:3.05rem}.cooked-fsm .cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-dir-content{padding-left:3.05rem}.cooked-fsm .cooked-close-fsm{color:#fff;position:absolute;top:0;right:1.25rem}.cooked-fsm h2{margin:0 0 2rem;padding:0;font-size:1rem;text-transform:uppercase;letter-spacing:.05rem;font-weight:800}.cooked-fsm-directions .cooked-panel,.cooked-fsm-ingredients .cooked-panel,.cooked-fsm-notes .cooked-panel{padding-left:1%;padding-right:2%}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes{font-size:1.2rem;line-height:1.6rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes{margin:0 0 1rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ol,.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ul{padding-left:1.5rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ul li{margin:0 0 1rem 1rem}.cooked-fsm .cooked-fsm-mobile-nav{box-sizing:border-box;position:absolute;top:3.5rem;left:0;margin:-1px 0 0 0;width:100%;padding:0;line-height:3.5rem;z-index:9999999}.cooked-fsm .cooked-fsm-mobile-nav a{text-transform:uppercase;font-size:.9rem;font-weight:700;letter-spacing:.03rem;display:block;float:left;width:50%;text-align:center;color:#fff;color:rgba(255,255,255,.6);background:rgba(25,25,25,.3);box-shadow:inset -1px 0 0 0 rgba(0,0,0,.15)}.cooked-fsm .cooked-fsm-mobile-nav a.cooked-active{color:#fff}.cooked-fsm .cooked-fsm-mobile-nav a.cooked-active{box-shadow:none}.cooked-fsm .cooked-fsm-mobile-nav a:last-child{box-shadow:inset 1px 0 0 0 rgba(0,0,0,.15)}body.cooked-fsm-active #wpadminbar{display:none}.cooked-recipe-term-grid{margin:3% -1%;position:relative}.cooked-term-block{box-sizing:border-box;display:block;background:0 0;position:relative;float:left}.cooked-term-block .cooked-recipe-card{margin:0}.cooked-term-block .cooked-recipe-card .cooked-recipe-card-sep{margin:.65rem auto;height:3px}.cooked-term-block.cooked-col-33{width:31.333%;margin:1%}.cooked-term-block.cooked-col-25{width:23%;margin:1%}.cooked-recipe-gallery{-webkit-transition:all .5s cubic-bezier(.42,0,.15,1);-moz-transition:all .5s cubic-bezier(.42,0,.15,1);-o-transition:all .5s cubic-bezier(.42,0,.15,1);transition:all .5s cubic-bezier(.42,0,.15,1)}#cooked-timers-wrap,#cooked-timers-wrap .cooked-timer-block,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj,.cooked-fsm,.cooked-icon-loading-wrap,.cooked-progress>span,.cooked-recipe,.cooked-recipe-card-modern,.cooked-recipe-card-modern-centered,.cooked-recipe-card-sep,.cooked-recipe-info span.cooked-fsm-button,.cooked-recipe-info span.cooked-print>a,.cooked-recipe-search .cooked-browse-search-button,.cooked-recipe-search .cooked-browse-select,.cooked-recipe-search .cooked-field-wrap-select:before,.cooked-recipe-search .cooked-sortby-wrap,.cooked-recipe-search .cooked-sortby-wrap:before,.cooked-recipe-search .cooked-taxonomy-selected,.cooked-recipe-search>form>div:last-child .cooked-browse-search-button{-webkit-transition:all .2s cubic-bezier(.42,0,.15,1);-moz-transition:all .2s cubic-bezier(.42,0,.15,1);-o-transition:all .2s cubic-bezier(.42,0,.15,1);transition:all .2s cubic-bezier(.42,0,.15,1)}.cooked-term-block{-webkit-transition:all .1s cubic-bezier(.25,.25,.75,.75);-moz-transition:all .1s cubic-bezier(.25,.25,.75,.75);-o-transition:all .1s cubic-bezier(.25,.25,.75,.75);transition:all .1s cubic-bezier(.25,.25,.75,.75)}.cooked-term-block .cooked-term-name,.cooked-term-block .cooked-term-thumbnail img{-webkit-transition:all .3s cubic-bezier(.47,0,0,1);-moz-transition:all .3s cubic-bezier(.47,0,0,1);-o-transition:all .3s cubic-bezier(.47,0,0,1);transition:all .3s cubic-bezier(.47,0,0,1)}.cooked-button,.cooked-button i.cooked-icon{-webkit-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);-moz-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);-o-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1)}.cooked-recipe-ingredients .cooked-ingredient-checkbox,.cooked-recipe-search .cooked-browse-select.cooked-active .cooked-browse-select-block{-webkit-transition:all .1s cubic-bezier(.42,0,.15,1);-moz-transition:all .1s cubic-bezier(.42,0,.15,1);-o-transition:all .1s cubic-bezier(.42,0,.15,1);transition:all .1s cubic-bezier(.42,0,.15,1)}.cooked-related-recipes-title{margin:0 0 20px 0;font-size:1.5em;font-weight:600;color:#333}.cooked-related-recipes-grid{margin:20px 0}.cooked-related-recipes-empty,.cooked-related-recipes-error{padding:15px;margin:20px 0;background:#f9f9f9;border-left:4px solid #d63638;color:#666;font-style:italic}.cooked-related-recipes-empty{border-left-color:#0073aa;text-align:center}.cooked-related-recipes-grid .cooked-recipe-card{margin-bottom:20px}@media (max-width:768px){.cooked-related-recipes-grid.cooked-columns-3,.cooked-related-recipes-grid.cooked-columns-4{margin-left:-1.5%;width:103%}.cooked-related-recipes-grid.cooked-columns-3 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-4 .cooked-recipe{width:47%;min-width:47%}}@media (max-width:480px){.cooked-related-recipes-grid.cooked-columns-2 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-3 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-4 .cooked-recipe{width:97%;min-width:97%}}.cooked-allergens{display:inline-flex;flex-wrap:wrap;gap:6px;margin:6px 0 0 0;vertical-align:middle}.cooked-allergen{display:inline-flex;align-items:center;justify-content:center;cursor:default}.cooked-allergen .cooked-icon{font-size:1.5rem;line-height:1}.cooked-allergen,.cooked-allergen .cooked-icon{color:rgba(0,0,0,.4)}.cooked-allergen:hover .cooked-icon{color:rgba(0,0,0,.6)}.cooked-recipe-card .cooked-allergens{display:flex;margin:8px 0 0 0}.cooked-recipe-card-modern-centered .cooked-allergens{justify-content:center}.cooked-recipe-full .cooked-allergens{display:flex;margin:0 0 1rem}.cooked-recipe-fitness .cooked-allergens,.cooked-recipe-modern .cooked-allergens{display:flex;justify-content:center;margin:0;padding:0 1rem .4rem}.cooked-recipe-info .cooked-allergens-info .cooked-allergens{display:inline-flex;margin:0;vertical-align:middle} \ No newline at end of file +#wp-admin-bar-cooked-ab .ab-icon:before{font-family:CookedIcons;content:"\f035";font-size:17px;top:-2px}.cooked-clearfix:after{content:"";display:table;clear:both}.cooked-noscroll{overflow:hidden;width:100%;height:100%}.cooked-hidden-schema{display:none}.cooked-fsm .cooked-fsm-mobile-nav{display:none}.cooked-browse-search-button,.cooked-button,.cooked-fsm .cooked-fsm-top,.cooked-icon-loading,.cooked-profile-tabs,.cooked-progress span{color:#fff!important;text-decoration:none!important}.cooked-recipe-search .cooked-taxonomy-selected .cooked-field-title,.cooked-recipe-search .cooked-taxonomy-selected:before{color:#fff}.cooked-button,button.cooked-button,input[type=button].cooked-button,input[type=submit].cooked-button{box-sizing:border-box;cursor:pointer;display:inline-block;padding:.4rem .65rem;height:2.1rem;line-height:1.25rem;font-size:.9rem;font-weight:500;letter-spacing:.03rem;color:#fff;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.cooked-button i.cooked-icon{color:#fff;font-size:1rem;font-weight:400}.cooked-button.cooked-square-button{padding:0;width:2.25rem;height:2.25rem;line-height:2.25rem;text-align:center}.cooked-button.cooked-square-button i.cooked-icon{font-size:1rem}.cooked-servings-switcher{display:block}.cooked-servings-switcher .cooked-button:first-child{margin-right:1rem}.cooked-servings-switcher .cooked-button:last-child{margin-left:1rem}.cooked-recipe-info span.cooked-measurement-system{padding-left:3rem}.cooked-recipe-info span.cooked-measurement-system select.cooked-measurement-system-changer{opacity:0;position:absolute;bottom:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0;width:100%;padding:0;margin:0}.cooked-recipe-info span.cooked-measurement-system-icon{opacity:.5;width:1rem;height:1rem;font-size:2.2rem;line-height:1;display:block;position:absolute;top:50%;left:0;margin:-1.1rem 0 0 0}.cooked-recipe-info span.cooked-measurement-system-icon i.cooked-icon{display:block}.cooked-post-featured-image{max-width:100%;height:auto;border:none;display:block;margin:0 0 2rem;padding:0}body .cooked-post-featured-image img{display:block;width:100%;height:auto}.cooked-recipe-ingredients{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-ingredients .cooked-heading{margin:1rem 0 .3rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-ingredients .cooked-heading:first-child{margin-top:0}.cooked-recipe-ingredients .cooked-ingredient{position:relative;padding:.5rem 0 0 2rem;margin:0;font-size:inherit}.cooked-recipe-ingredients .cooked-ingredient.cooked-ing-no-checkbox{padding-left:0}.cooked-recipe-ingredients .cooked-ingredient .cooked-ing-name{line-height:1.4rem;padding:1px 0}.cooked-recipe-ingredients .cooked-ingredient-checkbox{transform:scale(1);position:absolute;top:.9rem;left:0;cursor:pointer;display:inline-block;width:1rem;height:1rem;line-height:1rem;border:1px solid #ddd;border-color:rgba(0,0,0,.2);margin:0 .8rem 0 0}.cooked-recipe-ingredients .cooked-ingredient-checkbox:active{transform:scale(.9)}.cooked-recipe-ingredients .cooked-ingredient-checkbox:hover{border-color:#bbb;border-color:rgba(0,0,0,.5)}.cooked-recipe-ingredients .cooked-ingredient-checkbox.cooked-checked:after{font-family:CookedIcons;content:"\f01d";position:absolute;top:0;left:0;font-size:.6rem;line-height:1rem;width:100%;height:100%;text-align:center}.cooked-recipe-ingredients .cooked-ingredient.cooked-checked{text-decoration:line-through;opacity:.5}.cooked-ingredient-substitution{font-style:italic;color:#777;margin-left:5px;display:inline-block}.cooked-ing-sub-label{font-style:normal;font-weight:600;font-size:.85em;color:#999;margin-right:2px}.cooked-recipe-directions{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-directions .cooked-heading{margin:0 0 1rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-directions .cooked-direction{position:relative;padding:0;margin:0;font-size:inherit}.cooked-recipe-directions .cooked-direction img{max-width:100%;height:auto;display:block;margin:0 0 2rem;padding:0;border:none}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number .cooked-dir-content{padding-left:2.75rem}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-dir-content{padding-left:2.75rem}.cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-direction-number{width:2ch;text-align:right;font-variant-numeric:tabular-nums}.cooked-recipe-directions .cooked-direction-number{opacity:.35;position:absolute;display:inline-block;width:auto;height:1.5rem;line-height:1.5rem;font-weight:800;top:0;left:0;font-size:1.5rem}.cooked-recipe-excerpt{display:block;padding:0;margin:0 0 1rem}.cooked-recipe-info{display:block;padding:0;margin:0 0 1rem}.cooked-recipe-info>section.cooked-left>span,.cooked-recipe-info>span{line-height:1.25rem;position:relative;box-sizing:border-box;vertical-align:top;margin:0 2rem 1rem 0;display:inline-block;width:auto}.cooked-recipe-info>section.cooked-right>span{line-height:1.3rem;position:relative;box-sizing:border-box;vertical-align:top;margin:0 0 1rem 2rem;display:inline-block;width:auto}.cooked-recipe-info>section.cooked-left>span:last-child,.cooked-recipe-info>span:last-child{margin-right:0}.cooked-recipe-info>section.cooked-right>span:first-child{margin-left:0}.cooked-recipe-info strong{font-size:.75rem;letter-spacing:.03rem;font-weight:800;text-transform:uppercase;display:block}.cooked-recipe-notes{display:block;padding:0;margin:0 0 2rem}.cooked-recipe-notes .cooked-heading{margin:0 0 1rem;display:block;font-weight:600;font-size:1.25rem;line-height:1.5}.cooked-recipe-info span.cooked-print,.cooked-recipe-info span.cooked-print>a{height:2rem;display:inline-block}.cooked-recipe-info span.cooked-print>a{color:rgba(0,0,0,.4)}.cooked-recipe-info span.cooked-print>a:hover{color:rgba(0,0,0,.6)}.cooked-recipe-info span.cooked-print .cooked-icon{font-size:2.25rem;line-height:2.5rem}.cooked-recipe-info span.cooked-fsm-button{cursor:pointer;color:rgba(0,0,0,.4);height:2rem;display:inline-block}.cooked-recipe-info span.cooked-fsm-button:hover{color:rgba(0,0,0,.6)}.cooked-recipe-info span.cooked-fsm-button .cooked-icon{font-size:2.25rem;line-height:2.5rem}.cooked-recipe span.cooked-author,.cooked-recipe-info span.cooked-author{padding-left:3.25rem}.cooked-recipe span.cooked-author.cooked-no-avatar,.cooked-recipe-info span.cooked-author.cooked-no-avatar{padding-left:0}.cooked-recipe span.cooked-author-avatar,.cooked-recipe-info span.cooked-author-avatar{width:2.5rem;height:2.5rem;display:block;position:absolute;top:50%;left:0;margin:-1.25rem 0 0 0}.cooked-recipe span.cooked-author-avatar img,.cooked-recipe-info span.cooked-author-avatar img{margin:0;padding:0;display:block;height:auto;width:100%;max-width:100%;max-height:100%;border-radius:100px}.cooked-author-avatar,.cooked-author-avatar img{border-radius:5rem}.cooked-recipe-info span.cooked-time{padding-left:3rem}.cooked-recipe-info span.cooked-time-icon{opacity:.5;width:1rem;height:1rem;font-size:2.2rem;display:block;position:absolute;top:50%;left:0;margin:-1.1rem 0 0 0}.cooked-recipe-info span.cooked-time-icon i.cooked-icon{display:block}.cooked-timer{padding-left:2px}.cooked-timer i.cooked-icon{opacity:.6}body .cooked-timer a{font-weight:600;cursor:pointer;text-decoration:none}body .cooked-timer a:hover{text-decoration:none}#cooked-timers-wrap{z-index:99999;white-space:nowrap;overflow:hidden;border-radius:10px 10px 0 0;background:#fff;box-shadow:0 -5px 30px rgba(0,0,0,.15);line-height:1.6rem;font-size:1rem;width:50%;max-width:100%;height:7.5rem;position:fixed;transform:translate3d(0,7.2em,0);opacity:0;bottom:0;right:50%;margin:0 -25% 0 0;box-sizing:border-box}#cooked-timers-wrap.cooked-visible{transform:translate3d(0,0,0);opacity:1}#cooked-timers-wrap .cooked-timer-block{overflow:hidden;position:relative;display:block;height:0;padding:0;width:100%;opacity:0;padding:0 1.5rem 0 6rem;box-sizing:border-box}#cooked-timers-wrap .cooked-timer-block.cooked-visible{opacity:1;height:7.5rem;padding:1.9rem 1.5rem 1.55rem 6rem}#cooked-timers-wrap .cooked-timer-block>span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:auto}#cooked-timers-wrap .cooked-timer-block i.cooked-icon-times{line-height:2rem;color:rgba(0,0,0,.25);position:absolute;font-size:2rem;top:2.5rem;left:2rem;cursor:pointer}#cooked-timers-wrap .cooked-timer-block i.cooked-icon-times:hover{color:inherit}#cooked-timers-wrap .cooked-timer-block .cooked-timer-step{font-size:1.1rem;font-weight:800;text-transform:uppercase}#cooked-timers-wrap .cooked-timer-block .cooked-timer-desc{font-size:1.2rem;width:100%;padding-right:14rem;box-sizing:border-box;font-weight:400;color:rgba(0,0,0,.65)}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj{font-weight:600;position:absolute;top:2.5rem;right:2rem;width:13.5rem;font-size:2rem;line-height:2rem}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>div,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon{display:inline-block}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-pause,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-play,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-reverse{cursor:pointer;opacity:.5;width:2rem;text-align:center;margin-right:.5rem;position:relative;font-size:2rem;transform:scale(.75)}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon-play{display:none}#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj>i.cooked-icon:hover{opacity:1}#cooked-timers-wrap.cooked-multiples{margin:0;right:0;border-radius:10px 0 0 0;width:20rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block{padding-left:3.25rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block.cooked-visible{padding-top:1rem;line-height:1.5rem;padding-left:3.25rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-step{font-size:.9rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-desc{font-size:1rem;padding:0}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-obj{top:auto;right:auto;width:auto;font-size:1.5rem;line-height:2rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block .cooked-timer-obj>i.cooked-icon{font-size:1.5rem;width:1.3rem;margin-right:.5rem}#cooked-timers-wrap.cooked-multiples .cooked-timer-block i.cooked-icon-times{line-height:1rem;font-size:1rem;top:1.4rem;left:1.2rem}#cooked-timers-wrap .cooked-timer-block .cooked-progress{display:block;position:absolute;left:0;bottom:0;height:.5rem;width:100%;background:rgba(0,0,0,.15)}#cooked-timers-wrap .cooked-timer-block .cooked-progress span{width:0;display:block;position:absolute;left:0;top:0;height:.5rem}#cooked-timers-wrap .cooked-timer-block.cooked-paused{background:#f9f9f9}#cooked-timers-wrap .cooked-timer-block.cooked-paused .cooked-timer-obj{color:rgba(0,0,0,.5)}#cooked-timers-wrap .cooked-timer-block.cooked-complete{background:rgba(255,0,0,.05)}#cooked-timers-wrap .cooked-timer-block.cooked-complete .cooked-progress span{background:red}#cooked-timers-wrap .cooked-timer-block.cooked-complete .cooked-timer-obj{color:red}.cooked-recipe-info span.cooked-servings{padding-left:3rem}.cooked-recipe-info span.cooked-servings select.cooked-servings-changer{opacity:0;position:absolute;bottom:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0;width:100%;padding:0;margin:0}.cooked-recipe-info span.cooked-servings-icon{opacity:.5;width:1rem;height:1rem;font-size:2.2rem;display:block;position:absolute;top:50%;left:0;margin:-1.1rem 0 0 0}.cooked-recipe-info span.cooked-servings-icon i.cooked-icon{display:block}.cooked-left{float:left;display:inline-block;width:auto}.cooked-right{float:right;display:inline-block;width:auto}.cooked-recipe-gallery{height:1px;overflow:hidden;opacity:0;transform:translate3d(0,10px,0);padding:0;margin:0}.cooked-recipe-gallery .fotorama__thumb-border{border-color:#333}.cooked-recipe-gallery .fotorama__caption__wrap{background:#333;color:#fff}.cooked-recipe-gallery .fotorama__stage__frame.fotorama__active{background:#333}.cooked-recipe-gallery.cooked-gallery-loaded{height:auto;overflow:inherit;opacity:1;transform:translate3d(0,0,0);margin:0 0 2rem}.cooked-nutrition-label{background:#fff;font-size:.9rem;border:1px solid #aaa;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:10px;margin:0 0 2rem;font-family:Helvetica,Arial,sans-serif;container-name:nutrition-label;container-type:inline-size}.cooked-nutrition-label .cooked-nutrition-title{font-size:2.3rem;line-height:1;letter-spacing:0;font-weight:800;padding:0 0 .5rem 0;margin:0;color:#333;border-bottom:1px solid #aaa}.cooked-nutrition-label.cooked-float-left{max-width:45%;margin:0 3rem 3rem 0;float:left}body .cooked-nutrition-label p{margin:0!important;padding:0!important}body .cooked-nutrition-label p.cooked-daily-value-text{padding:.75rem 0 .15rem 0!important;margin:0!important;font-size:.9rem;line-height:1.3rem!important}body .cooked-nutrition-label p.cooked-daily-value-text strong{font-weight:400}body .cooked-nutrition-label dl{margin:0!important;padding:0!important}body .cooked-nutrition-label dt{position:relative;margin:0;padding:2px 0;border-top:1px solid #aaa}body .cooked-nutrition-label dt.cooked-calories{border-top:none;display:flex;justify-content:space-between;align-items:baseline;padding-bottom:10px}body .cooked-nutrition-label dt.cooked-calories strong{font-size:2rem;font-weight:800}body .cooked-nutrition-label dt.cooked-calories strong.cooked-nut-label{font-size:2.5rem}body .cooked-nutrition-label dt.cooked-nut-servings{border-top:none;padding-bottom:0}body .cooked-nutrition-label dt.cooked-serving-size{border-top:none;padding-top:0}body .cooked-nutrition-label div.cooked-serving-size strong,body .cooked-nutrition-label dt.cooked-serving-size strong,body .cooked-nutrition-label dt.cooked-serving-size strong.cooked-nut-label{font-size:1.3rem;font-weight:800}body .cooked-nutrition-label div.cooked-nut-servings p,body .cooked-nutrition-label dt.cooked-nut-servings p{font-size:1.2rem}body .cooked-nutrition-label dt dt{padding:2px 0 0;margin:2px 0 0}body .cooked-nutrition-label dt:after{content:"";display:table;clear:both}body .cooked-nutrition-label dt.no-after:after{content:none}body .cooked-nutrition-label div.cooked-nut-spacer,body .cooked-nutrition-label dt.cooked-nut-spacer{border:none;height:.5rem;padding:0;background:#333;margin-top:.3rem}body .cooked-nutrition-label dl dt.cooked-nut-no-border,body .cooked-nutrition-label>dl>dt:first-child{border:none}body .cooked-nutrition-label dt dl{margin:0 0 0 1.5rem!important}body .cooked-nutrition-label .cooked-nut-hr{border:none;border-top:1rem solid #333;margin:.1rem 0 0;padding:0}body .cooked-nutrition-label strong{font-weight:800}body .cooked-nutrition-label strong.cooked-nut-heading{font-size:1rem}body .cooked-nutrition-label strong.cooked-nut-label{font-weight:400}body .cooked-nutrition-label dl dl strong.cooked-nut-right{font-weight:800}body .cooked-nutrition-label .cooked-nut-right{float:right}body .cooked-nutrition-label dl.cooked-nut-bottom dt{border-top:none;border-bottom:1px solid #aaa;float:left;width:100%;box-sizing:border-box}body .cooked-nutrition-label dl.cooked-nut-bottom dt strong{font-weight:400}body .cooked-nutrition-label dl.cooked-nut-bottom dt:last-child{border:none}body .cooked-nutrition-label dl.cooked-nut-bottom dt:nth-last-child(2):nth-child(even){border-bottom:1px solid #aaa}.widget .cooked-nutrition-label{margin:0}body .cooked-nutrition-label .cooked-nutrition-facts-powered-by-edamam img{float:right;height:2rem}.cooked-recipe-search{box-sizing:border-box;padding:0;margin:0;width:100%;display:block;border:1px solid transparent;position:relative}.cooked-recipe-search .cooked-field-wrap,.cooked-recipe-search .cooked-fields-wrap{display:inline-block;box-sizing:border-box;width:100%;margin:0 1% 0 0}.cooked-recipe-search .cooked-fields-wrap{margin:0}.cooked-recipe-search .cooked-browse-select{display:block;cursor:pointer;position:relative;border-radius:3px;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;background:rgba(0,0,0,.075);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);width:100%;font-size:1rem;line-height:3rem;height:auto;padding:0 1rem}.cooked-recipe-search .cooked-browse-select:hover{background:rgba(0,0,0,.1)}.cooked-recipe-search .cooked-browse-select .cooked-field-title{font-size:.9rem;vertical-align:top}.cooked-recipe-search .cooked-taxonomy-selected{border-radius:3px}.cooked-recipe-search .cooked-sortby-wrap{background:#f5f5f5;position:absolute;top:0;height:3rem;width:12rem;display:inline-block;margin:0 1px 0 0;right:3.5rem}.cooked-recipe-search .cooked-sortby-wrap>select{margin:0;box-shadow:none;position:relative;width:100%;background:0 0;cursor:pointer;font-size:.9rem;border:none;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:100%;border-radius:0;display:inline-block;padding:0 1.25rem}.cooked-recipe-search .cooked-sortby-wrap:hover{background:#eee}.cooked-recipe-search input[type=text]{margin:0;vertical-align:initial;box-shadow:none;display:inline-block;box-sizing:border-box;background:#fff;width:100%;height:3rem;padding:0 1rem;font-size:1rem;border:1px solid rgba(0,0,0,.15);border-right:none}.cooked-recipe-search .cooked-3-search-fields>*,.cooked-recipe-search .cooked-4-search-fields>*{float:left}.cooked-recipe-search .cooked-field-wrap-select{position:relative}.cooked-recipe-search .cooked-field-wrap-select:before,.cooked-recipe-search .cooked-sortby-wrap:before{content:"\f00b";opacity:.25;font-family:CookedIcons;font-size:.75rem;position:absolute;top:50%;right:1.5rem;line-height:1.25rem;height:1.25rem;margin-top:-.5rem}.cooked-recipe-search .cooked-field-wrap-select:hover:before,.cooked-recipe-search .cooked-sortby-wrap:hover:before{opacity:.75;margin-top:-.5rem}.cooked-recipe-search .cooked-fields-wrap{padding-right:3.5rem;position:relative}.cooked-recipe-search .cooked-fields-wrap>.cooked-field-wrap-select{width:14%}.cooked-recipe-search .cooked-fields-wrap>.cooked-browse-search{width:85%;max-width:85%;margin:0}.cooked-recipe-search.cooked-search-no-sorting.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{width:100%}.cooked-recipe-search .cooked-browse-search-button{position:absolute;top:0;right:1px;width:3.5rem;text-decoration:none;font-size:1rem;text-align:center;color:#fff;line-height:3rem;height:3rem}.cooked-recipe-search .cooked-browse-search-button:hover{color:#fff;text-decoration:none}.cooked-recipe-search .cooked-browse-select-block{display:flex;color:inherit;cursor:default;visibility:hidden;opacity:0;transform:translate3d(0,-6px,0);box-sizing:border-box;z-index:99;position:absolute;width:auto;background:#fff;top:4rem;left:-10px;margin:0;line-height:1.5rem;border-radius:6px}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column{display:block;width:25%;min-width:25%;box-sizing:border-box;padding:0 .75rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div{max-height:16rem;overflow:auto}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>span{display:block}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>a,.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>span{display:block;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>span.cooked-tax-column-title{font-size:.9rem;font-weight:800;text-transform:uppercase;margin:0 0 .6rem;padding:0 10px .6rem 0;border-bottom:1px solid rgba(0,0,0,.15)}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>a{line-height:1.6rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column>div>span.cooked-tax-sub-item{margin-left:.75rem}.cooked-recipe-search .cooked-browse-select-block .cooked-tax-column i.cooked-icon{font-size:.9rem;color:rgba(0,0,0,.5)}.cooked-recipe-search .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:170%;padding:1.5rem}.cooked-recipe-search .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%;padding:0}.cooked-recipe-search .cooked-browse-select.cooked-active .cooked-browse-select-block{visibility:visible;opacity:1;transform:translate3d(0,-1px,0)}.cooked-recipe-search .cooked-browse-select-block{box-shadow:0 2px 2px rgba(0,0,0,.05),0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 16px 16px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}.cooked-browse-select-inline-block{display:flex;color:inherit;cursor:default;visibility:visible;opacity:1;box-sizing:border-box;z-index:99;position:relative;width:auto;background:#fff;margin:10px 2px 3rem;line-height:1.5rem;border-radius:6px;padding:1.5rem}.cooked-browse-select-inline-block .cooked-tax-column{display:block;width:100%;box-sizing:border-box;padding:0 .75rem}.cooked-browse-select-inline-block .cooked-tax-column>div{max-height:16rem;overflow:auto}.cooked-browse-select-inline-block .cooked-tax-column>div>span{display:block}.cooked-browse-select-inline-block .cooked-tax-column>div>a,.cooked-browse-select-inline-block .cooked-tax-column>span{display:block;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.cooked-browse-select-inline-block .cooked-tax-column>span.cooked-tax-column-title{font-size:.9rem;font-weight:800;text-transform:uppercase;margin:0 0 .6rem;padding:0 10px .6rem 0;border-bottom:1px solid rgba(0,0,0,.15)}.cooked-browse-select-inline-block .cooked-tax-column>div>a{line-height:1.6rem}.cooked-browse-select-inline-block .cooked-tax-column>div>span.cooked-tax-sub-item{margin-left:.75rem}.cooked-browse-select-inline-block .cooked-tax-column i.cooked-icon{font-size:.9rem;color:rgba(0,0,0,.5)}.cooked-browse-select-inline-block{box-shadow:0 2px 2px -1px rgba(0,0,0,.15)}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap{padding:0;display:block}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap>.cooked-browse-search{width:100%;max-width:100%;border-right:1px solid rgba(0,0,0,.15);margin:3% 0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:100%;left:0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap>.cooked-field-wrap-select{display:block;width:100%}.cooked-recipe-search.cooked-search-compact .cooked-sortby-wrap{display:block;position:relative;width:67%;right:auto;top:auto;float:left;margin:0}.cooked-recipe-search.cooked-search-compact .cooked-sortby-wrap>select{position:absolute;width:100%;border:1px solid rgba(0,0,0,.15);margin:0}.cooked-recipe-search.cooked-search-compact .cooked-browse-search-button{width:30%;right:auto;position:relative;display:block;float:right}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block{top:3rem;left:0;max-height:16rem;overflow:auto;transform:translate3d(0,-1px,0)}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-2-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-3-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-4-search-fields .cooked-browse-select-block{width:100%;padding:1.5rem}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block .cooked-tax-column{float:none;padding:0 0 1.5rem 0}.cooked-recipe-search.cooked-search-compact .cooked-browse-select-block .cooked-tax-column:last-child{padding:0}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-1-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-2-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-3-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact .cooked-fields-wrap.cooked-4-search-fields .cooked-browse-select-block .cooked-tax-column{width:100%}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting .cooked-fields-wrap>.cooked-browse-search{width:80%;margin:3% 0}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting .cooked-browse-search-button{width:20%;margin:3% 0}.cooked-recipe-search.cooked-search-compact.cooked-search-no-browse .cooked-browse-search-button,.cooked-recipe-search.cooked-search-compact.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{margin:0 0 3%}.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting.cooked-search-no-browse .cooked-browse-search-button,.cooked-recipe-search.cooked-search-compact.cooked-search-no-sorting.cooked-search-no-browse .cooked-fields-wrap>.cooked-browse-search{margin:0}.cooked-author-list-heading{display:block;margin:0 0 2rem}.cooked-author-list-heading .cooked-author-avatar{float:left;width:3rem;height:auto;display:block;margin:0 1rem 0 0}.cooked-author-list-heading .cooked-author-avatar img{display:block;margin:0}.cooked-author-list-heading .cooked-meta-title{font-size:1.25rem;line-height:1.2rem;margin:0}.cooked-author-list-heading a{font-size:.9rem}body p.cooked-none-found{display:block;margin:0;padding:1rem 0 2rem;color:#888;text-align:center;font-style:italic}.cooked-recipe-grid{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;box-sizing:border-box;padding:0;margin:3% -1.5%;width:103%;display:flex;flex-wrap:wrap}.cooked-recipe-grid .cooked-recipe{width:30.333%;min-width:30.333%;display:block;box-sizing:border-box;margin:0 1.5% 3%;padding:0}.cooked-recipe-grid .cooked-recipe .cooked-recipe-card-title{cursor:pointer;color:inherit;text-decoration:none}.cooked-recipe-grid .cooked-recipe .cooked-recipe-card-title:hover{text-decoration:none!important}.cooked-recipe-grid.cooked-columns-1 .cooked-recipe{width:97%;min-width:97%}.cooked-recipe-grid.cooked-columns-2 .cooked-recipe{width:47%;min-width:47%}.cooked-recipe-grid.cooked-columns-3 .cooked-recipe{width:30.333%;min-width:30.333%}.cooked-recipe-grid.cooked-columns-4 .cooked-recipe{width:22%;min-width:22%}.cooked-recipe-grid.cooked-columns-5 .cooked-recipe{width:17%;min-width:17%}.cooked-recipe-grid.cooked-columns-6 .cooked-recipe{width:13.666%;min-width:13.666%}.cooked-recipe a,.cooked-recipe a:hover,.cooked-recipe-info a,.cooked-recipe-info a:hover,.cooked-recipe-search a,.cooked-recipe-search:hover{box-shadow:none!important}.cooked-recipe-card{text-align:left;background:#fff;text-decoration:none!important;border:none!important;color:inherit!important;display:block;overflow:hidden;border-radius:3px;margin:0 auto 1rem;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.cooked-recipe-card-content>span,.cooked-recipe-card>span{display:block!important}.cooked-recipe-card:hover{text-decoration:none!important;border:none!important;color:inherit!important}.cooked-recipe-card-image{background-size:cover;background-position:center;display:block;margin:0;padding:0;height:250px;width:100%;position:relative}.cooked-recipe-card .cooked-recipe-image-empty{display:block;margin:0;padding:0;height:250px;width:100%;position:relative}.cooked-recipe-card .cooked-recipe-card-sep{display:none}.cooked-recipe-card-content{padding:1rem 1.5rem;margin:0}.cooked-recipe-card-title{display:block;font-weight:600;margin:.5rem 0;font-size:1.25rem;line-height:1.65rem}.cooked-recipe-card-author{margin:.5rem 0;font-size:.9rem}.cooked-recipe-card-excerpt{display:block;margin:.5rem 0;font-size:1rem}.cooked-recipe-card-centered,.cooked-recipe-card-modern-centered{text-align:center}.cooked-recipe-card-modern,.cooked-recipe-card-modern-centered{transform:translate3d(0,0,0);border-radius:10px;box-shadow:0 2px 3px rgba(0,0,0,.04),inset 0 0 0 1px rgba(0,0,0,.1)}.cooked-recipe-card-modern .cooked-recipe-card-author,.cooked-recipe-card-modern .cooked-recipe-card-excerpt,.cooked-recipe-card-modern .cooked-recipe-card-title,.cooked-recipe-card-modern-centered .cooked-recipe-card-author,.cooked-recipe-card-modern-centered .cooked-recipe-card-excerpt,.cooked-recipe-card-modern-centered .cooked-recipe-card-title{margin:.25rem 0}.cooked-recipe-card-modern .cooked-recipe-card-content,.cooked-recipe-card-modern-centered .cooked-recipe-card-content{padding:1.25rem 1.5rem}.cooked-recipe-card-modern .cooked-recipe-card-author,.cooked-recipe-card-modern-centered .cooked-recipe-card-author{opacity:.75}.cooked-recipe-card-modern .cooked-recipe-card-sep,.cooked-recipe-card-modern-centered .cooked-recipe-card-sep{margin:1rem 0;display:block;width:15%;height:6px;border-radius:3px;background:#ddd}.cooked-recipe-card-modern-centered .cooked-recipe-card-sep{margin:1rem auto}.cooked-recipe-card-modern-centered:hover,.cooked-recipe-card-modern:hover{transform:translate3d(0,-2px,0)!important;box-shadow:0 5px 5px rgba(0,0,0,.05),inset 0 0 0 1px rgba(0,0,0,.1)}.cooked-recipe-card-modern-centered:hover .cooked-recipe-card-sep,.cooked-recipe-card-modern:hover .cooked-recipe-card-sep{width:25%}.widget .cooked-recipe-card{margin:0 auto}.cooked-recipe-term-list .cooked-term-item a{display:block;padding:5px 0;border-top:1px solid rgba(0,0,0,.1)}.cooked-shortcode-recipe-list{margin:0 auto 1rem}.cooked-shortcode-recipe-list .cooked-srl-single{box-sizing:border-box;border:none;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.15);position:relative;display:block;padding:.6rem 0 0 0;margin:0 0 1rem}.cooked-shortcode-recipe-list .cooked-srl-single:hover{border:none;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.15)}.cooked-shortcode-recipe-list .cooked-srl-single.cooked-srl-has-image{padding-left:4rem;min-height:3.75rem}.cooked-shortcode-recipe-list .cooked-srl-image{margin:0;padding:0}.cooked-shortcode-recipe-list .cooked-srl-image img{width:3rem;height:3rem;border-radius:3px;position:absolute;top:.9rem;left:0;display:block;margin:0;padding:0}.cooked-shortcode-recipe-list .cooked-srl-sep{display:none}.cooked-shortcode-recipe-list .cooked-srl-content{line-height:1.4rem;padding:0;margin:0}.cooked-shortcode-recipe-list .cooked-srl-title{line-height:1.4rem;display:block;font-weight:600;margin:.25rem 0;font-size:1rem}.cooked-shortcode-recipe-list .cooked-srl-author{line-height:1.4rem;margin:.25rem 0;font-size:.9rem;opacity:.75}.cooked-shortcode-recipe-list .cooked-srl-single:first-child{border:none;padding-top:0}.cooked-shortcode-recipe-list .cooked-srl-single:first-child .cooked-srl-image img{top:0}.cooked-shortcode-recipe-list .cooked-srl-single.cooked-srl-has-image:first-child{min-height:3rem}.cooked-pagination-numbered{text-align:center;display:block;margin:0 0 2rem}.cooked-pagination-numbered>a,.cooked-pagination-numbered>span{font-size:1.2rem;font-weight:600;display:inline-block;padding:0 5px;background:0 0}.cooked-pagination-numbered>span{color:rgba(0,0,0,.25)}body .cooked-pagination-numbered>a{text-decoration:none;border:none}body .cooked-pagination-numbered>a:hover{text-decoration:none;border:none}.cooked-fsm{box-sizing:border-box;display:none;opacity:0;transform:scale(.95);position:fixed;top:0;left:0;width:100%;height:100%;background:#fff;z-index:99998}.cooked-fsm.cooked-visible{display:block}.cooked-fsm.cooked-active{opacity:1;transform:scale(1)}.cooked-fsm .cooked-fsm-top{font-size:1.2rem;font-weight:300;text-align:center;box-sizing:border-box;position:absolute;top:0;left:0;width:100%;color:#fff;padding:0 4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:3.5rem;height:3.5rem}.cooked-fsm .cooked-fsm-ingredients{box-sizing:border-box;padding:5.5rem 2rem 1rem;font-size:1rem;line-height:1.6rem;width:30%;height:100%;background:#f9f9f9;overflow-y:scroll;-webkit-overflow-scrolling:touch;position:absolute;top:0;left:0}.cooked-fsm .cooked-recipe-ingredients{margin-top:-.75rem}.cooked-fsm .cooked-recipe-ingredients .cooked-ingredient{padding:.75rem 0 0 2rem}.cooked-fsm .cooked-recipe-ingredients .cooked-heading{font-size:1.25rem}.cooked-fsm .cooked-recipe-ingredients .cooked-heading:first-child{padding-top:.75rem}.cooked-fsm .cooked-recipe-ingredients .cooked-ingredient-checkbox{top:.75rem}.cooked-fsm .cooked-fsm-directions-wrap{box-sizing:border-box;padding:5.5rem 2rem 1rem;font-size:1rem;line-height:1.6rem;width:70%;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch;position:absolute;top:0;left:30%}.cooked-fsm .cooked-fsm-directions p{margin:0 0 1.5rem;font-size:1.2rem;line-height:1.6rem}.cooked-fsm .cooked-recipe-directions .cooked-heading{font-size:1.5rem}.cooked-fsm .cooked-recipe-directions .cooked-direction-number{font-size:1.8rem}.cooked-fsm .cooked-recipe-directions .cooked-direction.cooked-direction-has-number .cooked-dir-content{padding-left:3.05rem}.cooked-fsm .cooked-recipe-directions .cooked-direction.cooked-direction-has-number-wide .cooked-dir-content{padding-left:3.05rem}.cooked-fsm .cooked-close-fsm{color:#fff;position:absolute;top:0;right:1.25rem}.cooked-fsm h2{margin:0 0 2rem;padding:0;font-size:1rem;text-transform:uppercase;letter-spacing:.05rem;font-weight:800}.cooked-fsm-directions .cooked-panel,.cooked-fsm-ingredients .cooked-panel,.cooked-fsm-notes .cooked-panel{padding-left:1%;padding-right:2%}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes{font-size:1.2rem;line-height:1.6rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes{margin:0 0 1rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ol,.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ul{padding-left:1.5rem}.cooked-fsm-notes .cooked-panel .cooked-recipe-notes ul li{margin:0 0 1rem 1rem}.cooked-fsm .cooked-fsm-mobile-nav{box-sizing:border-box;position:absolute;top:3.5rem;left:0;margin:-1px 0 0 0;width:100%;padding:0;line-height:3.5rem;z-index:9999999}.cooked-fsm .cooked-fsm-mobile-nav a{text-transform:uppercase;font-size:.9rem;font-weight:700;letter-spacing:.03rem;display:block;float:left;width:50%;text-align:center;color:#fff;color:rgba(255,255,255,.6);background:rgba(25,25,25,.3);box-shadow:inset -1px 0 0 0 rgba(0,0,0,.15)}.cooked-fsm .cooked-fsm-mobile-nav a.cooked-active{color:#fff}.cooked-fsm .cooked-fsm-mobile-nav a.cooked-active{box-shadow:none}.cooked-fsm .cooked-fsm-mobile-nav a:last-child{box-shadow:inset 1px 0 0 0 rgba(0,0,0,.15)}body.cooked-fsm-active #wpadminbar{display:none}.cooked-recipe-term-grid{margin:3% -1%;position:relative}.cooked-term-block{box-sizing:border-box;display:block;background:0 0;position:relative;float:left}.cooked-term-block .cooked-recipe-card{margin:0}.cooked-term-block .cooked-recipe-card .cooked-recipe-card-sep{margin:.65rem auto;height:3px}.cooked-term-block.cooked-col-33{width:31.333%;margin:1%}.cooked-term-block.cooked-col-25{width:23%;margin:1%}.cooked-recipe-gallery{-webkit-transition:all .5s cubic-bezier(.42,0,.15,1);-moz-transition:all .5s cubic-bezier(.42,0,.15,1);-o-transition:all .5s cubic-bezier(.42,0,.15,1);transition:all .5s cubic-bezier(.42,0,.15,1)}#cooked-timers-wrap,#cooked-timers-wrap .cooked-timer-block,#cooked-timers-wrap .cooked-timer-block .cooked-timer-obj,.cooked-fsm,.cooked-icon-loading-wrap,.cooked-progress>span,.cooked-recipe,.cooked-recipe-card-modern,.cooked-recipe-card-modern-centered,.cooked-recipe-card-sep,.cooked-recipe-info span.cooked-fsm-button,.cooked-recipe-info span.cooked-print>a,.cooked-recipe-search .cooked-browse-search-button,.cooked-recipe-search .cooked-browse-select,.cooked-recipe-search .cooked-field-wrap-select:before,.cooked-recipe-search .cooked-sortby-wrap,.cooked-recipe-search .cooked-sortby-wrap:before,.cooked-recipe-search .cooked-taxonomy-selected,.cooked-recipe-search>form>div:last-child .cooked-browse-search-button{-webkit-transition:all .2s cubic-bezier(.42,0,.15,1);-moz-transition:all .2s cubic-bezier(.42,0,.15,1);-o-transition:all .2s cubic-bezier(.42,0,.15,1);transition:all .2s cubic-bezier(.42,0,.15,1)}.cooked-term-block{-webkit-transition:all .1s cubic-bezier(.25,.25,.75,.75);-moz-transition:all .1s cubic-bezier(.25,.25,.75,.75);-o-transition:all .1s cubic-bezier(.25,.25,.75,.75);transition:all .1s cubic-bezier(.25,.25,.75,.75)}.cooked-term-block .cooked-term-name,.cooked-term-block .cooked-term-thumbnail img{-webkit-transition:all .3s cubic-bezier(.47,0,0,1);-moz-transition:all .3s cubic-bezier(.47,0,0,1);-o-transition:all .3s cubic-bezier(.47,0,0,1);transition:all .3s cubic-bezier(.47,0,0,1)}.cooked-button,.cooked-button i.cooked-icon{-webkit-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);-moz-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);-o-transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1);transition:border .2s cubic-bezier(.42,0,.15,1),background .2s cubic-bezier(.42,0,.15,1),color .2s cubic-bezier(.42,0,.15,1)}.cooked-recipe-ingredients .cooked-ingredient-checkbox,.cooked-recipe-search .cooked-browse-select.cooked-active .cooked-browse-select-block{-webkit-transition:all .1s cubic-bezier(.42,0,.15,1);-moz-transition:all .1s cubic-bezier(.42,0,.15,1);-o-transition:all .1s cubic-bezier(.42,0,.15,1);transition:all .1s cubic-bezier(.42,0,.15,1)}.cooked-related-recipes-title{margin:0 0 20px 0;font-size:1.5em;font-weight:600;color:#333}.cooked-related-recipes-grid{margin:20px 0}.cooked-related-recipes-empty,.cooked-related-recipes-error{padding:15px;margin:20px 0;background:#f9f9f9;border-left:4px solid #d63638;color:#666;font-style:italic}.cooked-related-recipes-empty{border-left-color:#0073aa;text-align:center}.cooked-related-recipes-grid .cooked-recipe-card{margin-bottom:20px}@media (max-width:768px){.cooked-related-recipes-grid.cooked-columns-3,.cooked-related-recipes-grid.cooked-columns-4{margin-left:-1.5%;width:103%}.cooked-related-recipes-grid.cooked-columns-3 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-4 .cooked-recipe{width:47%;min-width:47%}}@media (max-width:480px){.cooked-related-recipes-grid.cooked-columns-2 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-3 .cooked-recipe,.cooked-related-recipes-grid.cooked-columns-4 .cooked-recipe{width:97%;min-width:97%}}.cooked-allergens{display:inline-flex;flex-wrap:wrap;gap:6px;margin:6px 0 0 0;vertical-align:middle}.cooked-allergen{display:inline-flex;align-items:center;justify-content:center;cursor:default}.cooked-allergen .cooked-icon{font-size:1.5rem;line-height:1}.cooked-allergen,.cooked-allergen .cooked-icon{color:rgba(0,0,0,.4)}.cooked-allergen:hover .cooked-icon{color:rgba(0,0,0,.6)}.cooked-recipe-card .cooked-allergens{display:flex;margin:8px 0 0 0}.cooked-recipe-card-modern-centered .cooked-allergens{justify-content:center}.cooked-recipe-full .cooked-allergens{display:flex;margin:0 0 1rem}.cooked-recipe-fitness .cooked-allergens,.cooked-recipe-modern .cooked-allergens{display:flex;justify-content:center;margin:0;padding:0 1rem .4rem}.cooked-recipe-info .cooked-allergens-info .cooked-allergens{display:inline-flex;margin:0;vertical-align:middle} \ No newline at end of file diff --git a/assets/js/cooked-functions.js b/assets/js/cooked-functions.js index ea8981c..d823a20 100644 --- a/assets/js/cooked-functions.js +++ b/assets/js/cooked-functions.js @@ -75,7 +75,24 @@ var cooked_loading = false; }); } - /**** 5. Browse Search Button ****/ + /**** 4b. Measurement System Switcher ****/ + + if ( $('.cooked-measurement-system').length ) { + var msSelectField = $('.cooked-measurement-system').find('select'); + msSelectField.on('change', function(e) { + e.preventDefault(); + var ms = $(this).children("option:selected").val(); + const url = new URL(window.location.href); + if ( ms ) { + url.searchParams.set('measurement_system', ms); + } else { + url.searchParams.delete('measurement_system'); + } + window.location.href = url.toString(); + }); + } + + /**** 5. Browse Search Button ****/ if ( $_Cooked_Recipe_Search.length ) { $('body').on( 'click',function(e) { diff --git a/assets/js/cooked-functions.min.js b/assets/js/cooked-functions.min.js index e31d7e2..9710d81 100644 --- a/assets/js/cooked-functions.min.js +++ b/assets/js/cooked-functions.min.js @@ -1 +1 @@ -var cooked_loading=!1;(l=>{$_Cooked_Ingredient_Boxes=l(".cooked-ingredient-checkbox"),$_Cooked_Fotorama=l(".cooked-recipe-gallery"),$_Cooked_Ajax_List=l(".cooked-recipe-loader"),$_Cooked_Recipe_Search=l(".cooked-recipe-search"),$_Cooked_Timers=l(".cooked-timer > a"),$_Cooked_FSM_Button=l(".cooked-fsm-button"),$_Cooked_Fotorama.length&&$_Cooked_Fotorama.on("fotorama:ready",function(e,o){setTimeout(function(){$_Cooked_Fotorama.addClass("cooked-gallery-loaded")},100)}),l(document).ready(function(){function i(e){e.on("click",function(e){var o=l(this);o.hasClass("cooked-checked")?(o.parent().removeClass("cooked-checked"),o.removeClass("cooked-checked")):(o.parent().addClass("cooked-checked"),o.addClass("cooked-checked"))})}var a,c;function d(e){e.on("click",function(e){e.preventDefault();var o,s,e=l(this),i="cookedTimer-"+e.data("timer-id"),c=l("#cooked-timers-wrap").find(".cooked-timer-block").length;l("div#"+i).length?(l("div#"+i).css({background:"#eeeeee"}),setTimeout(function(){l("div#"+i).css({background:""})},200)):4==c?(l("#cooked-timers-wrap").css({transform:"translate3d(0,0.5em,0)"}),setTimeout(function(){l("#cooked-timers-wrap").css({transform:""})},200)):(o=7.5*(c+=1),s=e.parents(".cooked-single-direction").length?e.parents(".cooked-single-direction").data("step"):cooked_functions_i18n_js_vars.i18n_timer,s={id:i,seconds:e.data("seconds"),step:s,desc:e.data("desc")},l("#cooked-timers-wrap").length?(e=1==c?" cooked-visible":"",a",{id:"cooked-timers-wrap"}),c=t(s),e.append(c),l("body").append(e),n(l("#"+s.id).find(".cooked-timer-obj"),!1),setTimeout(function(){l("#cooked-timers-wrap").addClass("cooked-visible")},50)))})}function t(e,o="cooked-visible"){o=l("
",{id:e.id,class:"cooked-timer-block "+o}),l("",{class:"cooked-timer-step",text:e.step}).appendTo(o),l("",{class:"cooked-timer-desc",text:e.desc}).appendTo(o),l("
",{class:"cooked-timer-obj","data-seconds-left":e.seconds}).appendTo(o),l("",{class:"cooked-icon cooked-icon-times"}).appendTo(o),e=l("
",{class:"cooked-progress"});return l("").appendTo(e),e.appendTo(o),o}function n(o,e){var s=cooked_functions_js_vars.timer_sound,i=new Audio(s),c=o.parents(".cooked-timer-block").attr("id"),d=o.data("seconds-left"),t=o.parents(".cooked-timer-block");o.startTimer({classNames:{hours:"cooked-timer-hours",minutes:"cooked-timer-minutes",seconds:"cooked-timer-seconds",clearDiv:"cooked-timer-clearDiv",timeout:"cooked-timer-timeout"},onComplete:function(){i.play(),o.addClass("cooked-timer-complete")}}),o.prepend(''),e&&(o.trigger("pause"),t.addClass("cooked-paused"),t.find("i.cooked-icon-pause").hide(),t.find("i.cooked-icon-play").css({display:"inline-block"}),t.addClass("cooked-paused"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"})),r(t,10,10),o.on("update",function(e,o){r(t,o,d)}),o.on("complete",function(e,o){i.play(),t.find("i.cooked-icon-pause").hide(),t.find("i.cooked-icon-play").hide(),t.find(".cooked-timer-seconds").html("00")}),o.on("click","i.cooked-icon-pause",function(e){e.preventDefault(),l(this).hide(),t.addClass("cooked-paused"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"}),o.trigger("pause")}),o.on("click","i.cooked-icon-play",function(e){e.preventDefault(),l(this).hide(),t.removeClass("cooked-paused cooked-complete"),l(this).parent().find("i.cooked-icon-pause").css({display:"inline-block"}),o.trigger("resume")}),o.on("click","i.cooked-icon-reverse",function(e){e.preventDefault(),t.removeClass("cooked-paused cooked-complete"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"}),l(this).parent().find("i.cooked-icon-pause").hide(),o.remove(),l("#"+c).append('
'),n(l("#"+c).find(".cooked-timer-obj"),!0)}),t.on("click","i.cooked-icon-times",function(e){var o;e.preventDefault(),1==l("#cooked-timers-wrap").find(".cooked-timer-block").length?l("#cooked-timers-wrap").removeClass("cooked-visible"):(o=7.5*(e=l("#cooked-timers-wrap").find(".cooked-timer-block").length-1),l("#cooked-timers-wrap").css({height:o+"em"}),t.removeClass("cooked-visible"),e==a&&l("#cooked-timers-wrap").removeClass("cooked-multiples")),setTimeout(function(){t.remove()},200)})}function r(e,o,s){o=100-o/s*100;e.find(".cooked-progress > span").css({width:o+"%"}),100<=o&&e.addClass("cooked-complete")}$_Cooked_Fotorama.length&&$_Cooked_Fotorama.fotorama(),$_Cooked_Ingredient_Boxes.length&&i($_Cooked_Ingredient_Boxes),l(".cooked-servings").length&&l(".cooked-servings").find("select").on("change",function(e){e.preventDefault();var e=l(this).children("option:selected").val(),o=new URL(window.location.href);o.searchParams.set("servings",e),window.location.href=o.toString()}),$_Cooked_Recipe_Search.length&&(l("body").on("click",function(e){var o=!1;0{var o;e.value&&(o=encodeURIComponent(e.prefix),e=encodeURIComponent(e.value),s.push(o+"/"+e))}),e.search&&s.push("search/"+encodeURIComponent(e.search)),s.push("sort/"+encodeURIComponent(e.sort));e=s.filter(Boolean).join("/"),e=((cooked_functions_js_vars.browse_page_url||cooked_functions_js_vars.site_url)+"/"+e).replace(/\/+/g,"/").replace(":/","://");window.location.href=e}),$_Cooked_Timers.length&&(a=1,d($_Cooked_Timers)),$_Cooked_FSM_Button.length&&(c=new NoSleep,$_Cooked_FSM_Button.on("click",function(e){e.preventDefault();var e=l(this).data("recipe-id"),e=l('.cooked-fsm[data-recipe-id="'+e+'"]'),o=(l("body").addClass("cooked-noscroll cooked-fsm-active"),e.clone().appendTo("body")),e=(setTimeout(function(){o.addClass("cooked-visible")},10),setTimeout(function(){o.addClass("cooked-active")},50),o.find(".cooked-timer > a")),s=o.find(".cooked-ingredient-checkbox");d(e),i(s),c.enable(),o.on("click",".cooked-close-fsm",function(e){e.preventDefault(),o.removeClass("cooked-active"),l("body").removeClass("cooked-noscroll cooked-fsm-active"),c.disable(),setTimeout(function(){o.remove()},350)})}),l("body").on("click",".cooked-fsm-mobile-nav > a",function(e){e.preventDefault();var e=l(this),o=e.data("nav-id"),s=e.parents(".cooked-fsm");s.find(".cooked-fsm-mobile-nav > a").removeClass("cooked-active"),s.find(".cooked-fsm-content").removeClass("cooked-active"),e.addClass("cooked-active"),("ingredients"==o?s.find(".cooked-fsm-content.cooked-fsm-ingredients"):(s.find(".cooked-fsm-content.cooked-fsm-directions-wrap").addClass("cooked-active"),s.find(".cooked-fsm-content.cooked-fsm-directions").addClass("cooked-active"),s.find(".cooked-fsm-content.cooked-fsm-notes"))).addClass("cooked-active")}))})})(jQuery); \ No newline at end of file +var cooked_loading=!1;(l=>{$_Cooked_Ingredient_Boxes=l(".cooked-ingredient-checkbox"),$_Cooked_Fotorama=l(".cooked-recipe-gallery"),$_Cooked_Ajax_List=l(".cooked-recipe-loader"),$_Cooked_Recipe_Search=l(".cooked-recipe-search"),$_Cooked_Timers=l(".cooked-timer > a"),$_Cooked_FSM_Button=l(".cooked-fsm-button"),$_Cooked_Fotorama.length&&$_Cooked_Fotorama.on("fotorama:ready",function(e,o){setTimeout(function(){$_Cooked_Fotorama.addClass("cooked-gallery-loaded")},100)}),l(document).ready(function(){function c(e){e.on("click",function(e){var o=l(this);o.hasClass("cooked-checked")?(o.parent().removeClass("cooked-checked"),o.removeClass("cooked-checked")):(o.parent().addClass("cooked-checked"),o.addClass("cooked-checked"))})}var n,i;function t(e){e.on("click",function(e){e.preventDefault();var o,s,e=l(this),c="cookedTimer-"+e.data("timer-id"),i=l("#cooked-timers-wrap").find(".cooked-timer-block").length;l("div#"+c).length?(l("div#"+c).css({background:"#eeeeee"}),setTimeout(function(){l("div#"+c).css({background:""})},200)):4==i?(l("#cooked-timers-wrap").css({transform:"translate3d(0,0.5em,0)"}),setTimeout(function(){l("#cooked-timers-wrap").css({transform:""})},200)):(o=7.5*(i+=1),s=e.parents(".cooked-single-direction").length?e.parents(".cooked-single-direction").data("step"):cooked_functions_i18n_js_vars.i18n_timer,s={id:c,seconds:e.data("seconds"),step:s,desc:e.data("desc")},l("#cooked-timers-wrap").length?(e=1==i?" cooked-visible":"",n",{id:"cooked-timers-wrap"}),i=d(s),e.append(i),l("body").append(e),a(l("#"+s.id).find(".cooked-timer-obj"),!1),setTimeout(function(){l("#cooked-timers-wrap").addClass("cooked-visible")},50)))})}function d(e,o="cooked-visible"){o=l("
",{id:e.id,class:"cooked-timer-block "+o}),l("",{class:"cooked-timer-step",text:e.step}).appendTo(o),l("",{class:"cooked-timer-desc",text:e.desc}).appendTo(o),l("
",{class:"cooked-timer-obj","data-seconds-left":e.seconds}).appendTo(o),l("",{class:"cooked-icon cooked-icon-times"}).appendTo(o),e=l("
",{class:"cooked-progress"});return l("").appendTo(e),e.appendTo(o),o}function a(o,e){var s=cooked_functions_js_vars.timer_sound,c=new Audio(s),i=o.parents(".cooked-timer-block").attr("id"),t=o.data("seconds-left"),d=o.parents(".cooked-timer-block");o.startTimer({classNames:{hours:"cooked-timer-hours",minutes:"cooked-timer-minutes",seconds:"cooked-timer-seconds",clearDiv:"cooked-timer-clearDiv",timeout:"cooked-timer-timeout"},onComplete:function(){c.play(),o.addClass("cooked-timer-complete")}}),o.prepend(''),e&&(o.trigger("pause"),d.addClass("cooked-paused"),d.find("i.cooked-icon-pause").hide(),d.find("i.cooked-icon-play").css({display:"inline-block"}),d.addClass("cooked-paused"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"})),r(d,10,10),o.on("update",function(e,o){r(d,o,t)}),o.on("complete",function(e,o){c.play(),d.find("i.cooked-icon-pause").hide(),d.find("i.cooked-icon-play").hide(),d.find(".cooked-timer-seconds").html("00")}),o.on("click","i.cooked-icon-pause",function(e){e.preventDefault(),l(this).hide(),d.addClass("cooked-paused"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"}),o.trigger("pause")}),o.on("click","i.cooked-icon-play",function(e){e.preventDefault(),l(this).hide(),d.removeClass("cooked-paused cooked-complete"),l(this).parent().find("i.cooked-icon-pause").css({display:"inline-block"}),o.trigger("resume")}),o.on("click","i.cooked-icon-reverse",function(e){e.preventDefault(),d.removeClass("cooked-paused cooked-complete"),l(this).parent().find("i.cooked-icon-play").css({display:"inline-block"}),l(this).parent().find("i.cooked-icon-pause").hide(),o.remove(),l("#"+i).append('
'),a(l("#"+i).find(".cooked-timer-obj"),!0)}),d.on("click","i.cooked-icon-times",function(e){var o;e.preventDefault(),1==l("#cooked-timers-wrap").find(".cooked-timer-block").length?l("#cooked-timers-wrap").removeClass("cooked-visible"):(o=7.5*(e=l("#cooked-timers-wrap").find(".cooked-timer-block").length-1),l("#cooked-timers-wrap").css({height:o+"em"}),d.removeClass("cooked-visible"),e==n&&l("#cooked-timers-wrap").removeClass("cooked-multiples")),setTimeout(function(){d.remove()},200)})}function r(e,o,s){o=100-o/s*100;e.find(".cooked-progress > span").css({width:o+"%"}),100<=o&&e.addClass("cooked-complete")}$_Cooked_Fotorama.length&&$_Cooked_Fotorama.fotorama(),$_Cooked_Ingredient_Boxes.length&&c($_Cooked_Ingredient_Boxes),l(".cooked-servings").length&&l(".cooked-servings").find("select").on("change",function(e){e.preventDefault();var e=l(this).children("option:selected").val(),o=new URL(window.location.href);o.searchParams.set("servings",e),window.location.href=o.toString()}),l(".cooked-measurement-system").length&&l(".cooked-measurement-system").find("select").on("change",function(e){e.preventDefault();var e=l(this).children("option:selected").val(),o=new URL(window.location.href);e?o.searchParams.set("measurement_system",e):o.searchParams.delete("measurement_system"),window.location.href=o.toString()}),$_Cooked_Recipe_Search.length&&(l("body").on("click",function(e){var o=!1;0{var o;e.value&&(o=encodeURIComponent(e.prefix),e=encodeURIComponent(e.value),s.push(o+"/"+e))}),e.search&&s.push("search/"+encodeURIComponent(e.search)),s.push("sort/"+encodeURIComponent(e.sort));e=s.filter(Boolean).join("/"),e=((cooked_functions_js_vars.browse_page_url||cooked_functions_js_vars.site_url)+"/"+e).replace(/\/+/g,"/").replace(":/","://");window.location.href=e}),$_Cooked_Timers.length&&(n=1,t($_Cooked_Timers)),$_Cooked_FSM_Button.length&&(i=new NoSleep,$_Cooked_FSM_Button.on("click",function(e){e.preventDefault();var e=l(this).data("recipe-id"),e=l('.cooked-fsm[data-recipe-id="'+e+'"]'),o=(l("body").addClass("cooked-noscroll cooked-fsm-active"),e.clone().appendTo("body")),e=(setTimeout(function(){o.addClass("cooked-visible")},10),setTimeout(function(){o.addClass("cooked-active")},50),o.find(".cooked-timer > a")),s=o.find(".cooked-ingredient-checkbox");t(e),c(s),i.enable(),o.on("click",".cooked-close-fsm",function(e){e.preventDefault(),o.removeClass("cooked-active"),l("body").removeClass("cooked-noscroll cooked-fsm-active"),i.disable(),setTimeout(function(){o.remove()},350)})}),l("body").on("click",".cooked-fsm-mobile-nav > a",function(e){e.preventDefault();var e=l(this),o=e.data("nav-id"),s=e.parents(".cooked-fsm");s.find(".cooked-fsm-mobile-nav > a").removeClass("cooked-active"),s.find(".cooked-fsm-content").removeClass("cooked-active"),e.addClass("cooked-active"),("ingredients"==o?s.find(".cooked-fsm-content.cooked-fsm-ingredients"):(s.find(".cooked-fsm-content.cooked-fsm-directions-wrap").addClass("cooked-active"),s.find(".cooked-fsm-content.cooked-fsm-directions").addClass("cooked-active"),s.find(".cooked-fsm-content.cooked-fsm-notes"))).addClass("cooked-active")}))})})(jQuery); \ No newline at end of file diff --git a/cooked.php b/cooked.php index f610b67..66e5f3e 100644 --- a/cooked.php +++ b/cooked.php @@ -482,6 +482,7 @@ private function includes() { require_once COOKED_DIR . 'includes/class.cooked-recipe-meta.php'; require_once COOKED_DIR . 'includes/class.cooked-shortcodes.php'; require_once COOKED_DIR . 'includes/class.cooked-measurements.php'; + require_once COOKED_DIR . 'includes/class.cooked-unit-converter.php'; require_once COOKED_DIR . 'includes/class.cooked-admin-enqueues.php'; require_once COOKED_DIR . 'includes/class.cooked-enqueues.php'; require_once COOKED_DIR . 'includes/class.cooked-admin-menus.php'; diff --git a/includes/class.cooked-measurements.php b/includes/class.cooked-measurements.php index 24f8e53..8ac4080 100644 --- a/includes/class.cooked-measurements.php +++ b/includes/class.cooked-measurements.php @@ -30,6 +30,7 @@ public static function get() { 'plural_abbr' => _x( 'g', 'Grams Abbreviation (Plural)', 'cooked' ), 'singular' => __( 'gram', 'cooked' ), 'plural' => __( 'grams', 'cooked' ), + 'system' => 'metric', 'variations' => [ 'g', 'g.', 'gram', 'grams' ], ], 'kg' => [ @@ -37,6 +38,7 @@ public static function get() { 'plural_abbr' => _x('kg', 'Kilograms Abbreviation (Plural)', 'cooked'), 'singular' => __('kilogram', 'cooked'), 'plural' => __('kilograms', 'cooked'), + 'system' => 'metric', 'variations' => ['kg', 'kg.', 'kilogram', 'kilograms'], ], 'mg' => [ @@ -44,6 +46,7 @@ public static function get() { 'plural_abbr' => __('mg', 'cooked'), 'singular' => __('milligram', 'cooked'), 'plural' => __('milligrams', 'cooked'), + 'system' => 'metric', 'variations' => ['mg', 'mg.', 'milligram', 'milligrams'], ], 'oz' => [ @@ -51,6 +54,7 @@ public static function get() { 'plural_abbr' => __('oz', 'cooked'), 'singular' => __('ounce', 'cooked'), 'plural' => __('ounces', 'cooked'), + 'system' => 'imperial', 'variations' => ['oz', 'oz.', 'ounce', 'ounces'], ], 'floz' => [ @@ -58,6 +62,7 @@ public static function get() { 'plural_abbr' => __('fl oz', 'cooked'), 'singular' => __('fluid ounce', 'cooked'), 'plural' => __('fluid ounces', 'cooked'), + 'system' => 'imperial', 'variations' => ['fl oz', 'fl oz.', 'fl. oz.', 'fluid ounce', 'fluid ounces'], ], 'cup' => [ @@ -65,6 +70,7 @@ public static function get() { 'plural_abbr' => __('cups', 'cooked'), 'singular' => __('cup', 'cooked'), 'plural' => __('cups', 'cooked'), + 'system' => 'imperial', 'variations' => ['c', 'c.', 'cup', 'cups'], ], 'tsp' => [ @@ -72,6 +78,7 @@ public static function get() { 'plural_abbr' => __('tsp', 'cooked'), 'singular' => __('teaspoon', 'cooked'), 'plural' => __('teaspoons', 'cooked'), + 'system' => 'imperial', 'variations' => ['t', 'tsp.', 'tsp', 'teaspoon', 'teaspoons'], ], 'tbsp' => [ @@ -79,6 +86,7 @@ public static function get() { 'plural_abbr' => __('tbsp', 'cooked'), 'singular' => __('tablespoon', 'cooked'), 'plural' => __('tablespoons', 'cooked'), + 'system' => 'imperial', 'variations' => ['T', 'tbl.', 'tbl', 'tbs.', 'tbs', 'tbsp.', 'tbsp', 'tablespoon', 'tablespoons'], ], 'dl' => [ @@ -86,6 +94,7 @@ public static function get() { 'plural_abbr' => __('dl', 'cooked'), 'singular' => __('deciliter', 'cooked'), 'plural' => __('deciliters', 'cooked'), + 'system' => 'metric', 'variations' => ['dl', 'dl.', 'deciliter', 'deciliters'], ], 'ml' => [ @@ -93,6 +102,7 @@ public static function get() { 'plural_abbr' => __('ml', 'cooked'), 'singular' => __('milliliter', 'cooked'), 'plural' => __('milliliters', 'cooked'), + 'system' => 'metric', 'variations' => ['ml', 'ml.', 'mL', 'mL.', 'cc', 'milliliter', 'milliliters', 'millilitre', 'millilitres'], ], 'l' => [ @@ -100,6 +110,7 @@ public static function get() { 'plural_abbr' => __('l', 'cooked'), 'singular' => __('liter', 'cooked'), 'plural' => __('liters', 'cooked'), + 'system' => 'metric', 'variations' => ['l', 'l.', 'L', 'L.', 'liter', 'liters', 'litre', 'litres'], ], 'stick' => [ @@ -114,6 +125,7 @@ public static function get() { 'plural_abbr' => __('lbs', 'cooked'), 'singular' => __('pound', 'cooked'), 'plural' => __('pounds', 'cooked'), + 'system' => 'imperial', 'variations' => ['lb', 'lbs', 'lb.', 'lbs.', 'pound', 'pounds'], ], 'dash' => [ @@ -135,6 +147,7 @@ public static function get() { 'plural_abbr' => __('gals', 'cooked'), 'singular' => __('gallon', 'cooked'), 'plural' => __('gallons', 'cooked'), + 'system' => 'imperial', 'variations' => ['G', 'G.', 'gal', 'gal.', 'gallon', 'gallons'], ], 'pinch' => [ @@ -149,6 +162,7 @@ public static function get() { 'plural_abbr' => __('pt', 'cooked'), 'singular' => __('pint', 'cooked'), 'plural' => __('pints', 'cooked'), + 'system' => 'imperial', 'variations' => ['p', 'p.', 'pt', 'pt.', 'pts', 'pts.', 'fl pt', 'fl. pt.', 'pint', 'pints'], ], 'qt' => [ @@ -156,6 +170,7 @@ public static function get() { 'plural_abbr' => __('qts', 'cooked'), 'singular' => __('quart', 'cooked'), 'plural' => __('quarts', 'cooked'), + 'system' => 'imperial', 'variations' => ['q', 'q.', 'qt', 'qt.', 'qts', 'qts.', 'fl qt', 'fl. qt.', 'quart', 'quarts'], ], 'drizzle' => [ diff --git a/includes/class.cooked-post-types.php b/includes/class.cooked-post-types.php index 8f73165..7a98ea5 100644 --- a/includes/class.cooked-post-types.php +++ b/includes/class.cooked-post-types.php @@ -172,6 +172,7 @@ public static function cooked_meta_tags() { public static function add_query_vars_filter( $vars ) { $vars[] = 'servings'; + $vars[] = 'measurement_system'; return $vars; } diff --git a/includes/class.cooked-recipes.php b/includes/class.cooked-recipes.php index 78d264d..782c8cb 100644 --- a/includes/class.cooked-recipes.php +++ b/includes/class.cooked-recipes.php @@ -862,6 +862,32 @@ public static function gallery_types() { return $gallery_types; } + public static function measurement_system_switcher() { + global $_cooked_settings, $post; + $switcher_disabled = ( isset( $_cooked_settings['advanced'] ) && in_array( 'disable_measurement_switcher', $_cooked_settings['advanced'] ) ? true : false ); + $printing = ( is_singular('cp_recipe') && isset($_GET['print']) ); + + if ( !$printing && !$switcher_disabled ): + $current = esc_html( get_query_var( 'measurement_system', '' ) ); + $labels = [ + '' => __( 'Default', 'cooked' ), + 'metric' => __( 'Metric', 'cooked' ), + 'imperial' => __( 'Imperial', 'cooked' ), + ]; + $current_label = isset( $labels[ $current ] ) ? $labels[ $current ] : $labels['']; + echo ''; + echo '' . __( 'Units', 'cooked' ) . ''; + echo '' . esc_html( $current_label ) . ''; + echo ''; + echo ''; + echo ''; + endif; + } + public static function serving_size_switcher( $servings ) { global $_cooked_settings, $post; $switcher_disabled = ( isset( $_cooked_settings['advanced'] ) && in_array( 'disable_servings_switcher', $_cooked_settings['advanced'] ) ? true : false ); @@ -980,8 +1006,26 @@ public static function single_ingredient( $ing, $checkboxes = true, $plain_text } } - $measurement = ( isset($ing['measurement']) && $ing['measurement'] ? esc_html( $ing['measurement'] ) : false ); - $measurement = ( $measurement && $float_amount ? $Cooked_Measurements->singular_plural( $measurements[ $measurement ]['singular_abbr'], $measurements[ $measurement ]['plural_abbr'], $float_amount ) : false ); + $measurement_key = ( isset($ing['measurement']) && $ing['measurement'] ? esc_html( $ing['measurement'] ) : false ); + + $measurement_system = get_query_var( 'measurement_system', '' ); + if ( $measurement_system && $measurement_key && $float_amount && isset( $measurements[ $measurement_key ]['system'] ) ) { + $source_system = $measurements[ $measurement_key ]['system']; + if ( $source_system && $source_system !== $measurement_system ) { + $converter = new Cooked_Unit_Converter(); + $result = $converter->convert( $float_amount, $measurement_key ); + if ( $result ) { + $float_amount = $result['amount']; + $measurement_key = $result['unit']; + if ( $float_amount > 10 ) { + $format = 'decimal'; + } + $amount = $Cooked_Measurements->format_amount( $float_amount, $format ); + } + } + } + + $measurement = ( $measurement_key && $float_amount && isset( $measurements[ $measurement_key ] ) ? $Cooked_Measurements->singular_plural( $measurements[ $measurement_key ]['singular_abbr'], $measurements[ $measurement_key ]['plural_abbr'], $float_amount ) : false ); $name = ( isset($ing['name']) && $ing['name'] ? apply_filters( 'cooked_ingredient_name', wp_kses_post( $ing['name'] ), $ing ) : false ); @@ -1011,6 +1055,22 @@ public static function single_ingredient( $ing, $checkboxes = true, $plain_text } $sub_measurement_key = ( isset($ing['sub_measurement']) && $ing['sub_measurement'] ? esc_html( $ing['sub_measurement'] ) : false ); + + if ( $measurement_system && $sub_measurement_key && $sub_float_amount && isset( $measurements[ $sub_measurement_key ]['system'] ) ) { + $sub_source_system = $measurements[ $sub_measurement_key ]['system']; + if ( $sub_source_system && $sub_source_system !== $measurement_system ) { + $sub_result = $converter->convert( $sub_float_amount, $sub_measurement_key ); + if ( $sub_result ) { + $sub_float_amount = $sub_result['amount']; + $sub_measurement_key = $sub_result['unit']; + if ( $sub_float_amount > 10 ) { + $sub_format = 'decimal'; + } + $sub_amount = $Cooked_Measurements->format_amount( $sub_float_amount, $sub_format ); + } + } + } + $sub_measurement = ( $sub_measurement_key && $sub_float_amount && isset($measurements[$sub_measurement_key]) ? $Cooked_Measurements->singular_plural( $measurements[ $sub_measurement_key ]['singular_abbr'], $measurements[ $sub_measurement_key ]['plural_abbr'], $sub_float_amount ) : false ); } diff --git a/includes/class.cooked-settings.php b/includes/class.cooked-settings.php index 869024c..75a6248 100644 --- a/includes/class.cooked-settings.php +++ b/includes/class.cooked-settings.php @@ -342,6 +342,7 @@ public static function tabs_fields() { /* translators: an option to disable "meta" tags. */ 'disable_meta_tags' => '' . sprintf(__('Disable %s Tags', 'cooked'), 'Cooked <meta>') . ' — ' . __('Prevents duplicates when tags already exist.', 'cooked'), 'disable_servings_switcher' => '' . __('Disable "Servings Switcher"', 'cooked') . ' — ' . __('Removes the servings dropdown on recipes.', 'cooked'), + 'disable_measurement_switcher' => '' . __('Disable "Measurement System Switcher"', 'cooked') . ' — ' . __('Removes the Metric/Imperial toggle on recipes.', 'cooked'), 'disable_schema_output' => '' . __('Disable Recipe Schema Output', 'cooked') . ' — ' . __('You should only do this if you\'re using something else to output schema information.', 'cooked'), 'disable_cp_recipe_archive' => '' . __('Disable Recipe Archive Page', 'cooked') . ' — ' . __('Prevents the recipe archive from being displayed.', 'cooked') ] diff --git a/includes/class.cooked-shortcodes.php b/includes/class.cooked-shortcodes.php index d78ee2d..5f6cfad 100644 --- a/includes/class.cooked-shortcodes.php +++ b/includes/class.cooked-shortcodes.php @@ -62,6 +62,16 @@ function __construct() { add_filter('pre_do_shortcode_tag', [$this, 'preprocess_shortcode'], 10, 4); } + /** + * Preprocess Shortcode. + * + * @since 1.0.0 + * @param mixed $output The shortcode output. + * @param string $tag The shortcode tag. + * @param array $attr The shortcode attributes. + * @param array $m The regex matches. + * @return mixed + */ public function preprocess_shortcode($output, $tag, $attr, $m) { // Tags to skip $skip_tags = [ @@ -672,6 +682,7 @@ public static function cooked_info_servings( $recipe ) { if (in_array('servings', $_cooked_settings['recipe_info_display_options'])) { $servings = isset($recipe['nutrition']['servings']) && $recipe['nutrition']['servings'] ? $recipe['nutrition']['servings'] : 1; Cooked_Recipes::serving_size_switcher( $servings ); + Cooked_Recipes::measurement_system_switcher(); } } diff --git a/includes/class.cooked-unit-converter.php b/includes/class.cooked-unit-converter.php new file mode 100644 index 0000000..84d9395 --- /dev/null +++ b/includes/class.cooked-unit-converter.php @@ -0,0 +1,128 @@ + array( + 'to' => 'ml', + 'factor' => 236.588, + ), + 'tsp' => array( + 'to' => 'ml', + 'factor' => 4.929, + ), + 'tbsp' => array( + 'to' => 'ml', + 'factor' => 14.787, + ), + 'floz' => array( + 'to' => 'ml', + 'factor' => 29.574, + ), + 'gal' => array( + 'to' => 'l', + 'factor' => 3.785, + ), + 'pt' => array( + 'to' => 'ml', + 'factor' => 473.176, + ), + 'qt' => array( + 'to' => 'ml', + 'factor' => 946.353, + ), + 'dl' => array( + 'to' => 'floz', + 'factor' => 3.381, + ), + 'ml' => array( + 'to' => 'floz', + 'factor' => 0.034, + ), + 'l' => array( + 'to' => 'cup', + 'factor' => 4.227, + ), + 'oz' => array( + 'to' => 'g', + 'factor' => 28.3495, + ), + 'lb' => array( + 'to' => 'g', + 'factor' => 453.592, + ), + 'g' => array( + 'to' => 'oz', + 'factor' => 0.0353, + ), + 'kg' => array( + 'to' => 'lb', + 'factor' => 2.205, + ), + 'mg' => array( + 'to' => 'g', + 'factor' => 0.001, + ), + ); + + /** + * Convert an amount from one unit to its opposite-system equivalent. + * + * @since 1.15.0 + * @param float $amount The numeric amount to convert. + * @param string $from_unit_key The measurement key to convert from (e.g. 'cup', 'oz', 'g'). + * @return array|null Array with 'amount' (float) and 'unit' (string) on success, null if no conversion exists. + */ + public static function convert( $amount, $from_unit_key ) { + if ( ! isset( self::$table[ $from_unit_key ] ) ) { + return null; + } + + $target = self::$table[ $from_unit_key ]; + + return array( + 'amount' => $amount * $target['factor'], + 'unit' => $target['to'], + ); + } + + /** + * Get the target unit key for a given source unit. + * + * @since 1.15.0 + * @param string $from_unit_key The measurement key to convert from. + * @return string|null The target unit key, or null if no conversion exists. + */ + public static function get_target_unit( $from_unit_key ) { + if ( ! isset( self::$table[ $from_unit_key ] ) ) { + return null; + } + + return self::$table[ $from_unit_key ]['to']; + } +} diff --git a/readme.txt b/readme.txt index 1ef40a0..e2f99cc 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,7 @@ Version 1.15.0 adds allergen badges to recipe cards and single recipe views via == Changelog == = 1.15.0 = +* **NEW:** Metric/Imperial measurement system switcher. Convert ingredient units between systems with a new toggle alongside the servings switcher. Added `measurement_system` query var and `disable_measurement_switcher` advanced setting. * **NEW:** Added allergen support. Mark up to 14 major allergens (FDA + EU) on a recipe via a new sidebar meta box. Allergen icons are shown automatically on recipe cards and can be added to single recipes via `[cooked-info include="allergens"]`. = 1.14.0 = From 439a4dbbef8e886ea1f7187d3130e0446155d09b Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:43:58 +0300 Subject: [PATCH 2/9] Metric / Imperial tests --- tests/phpunit/UnitConverterTest.php | 175 ++++++++++++++++++++++++++++ tests/phpunit/bootstrap.php | 1 + 2 files changed, 176 insertions(+) create mode 100644 tests/phpunit/UnitConverterTest.php diff --git a/tests/phpunit/UnitConverterTest.php b/tests/phpunit/UnitConverterTest.php new file mode 100644 index 0000000..512a217 --- /dev/null +++ b/tests/phpunit/UnitConverterTest.php @@ -0,0 +1,175 @@ +assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); + } + + public function data_volume_imperial_to_metric() { + return array( + 'cup to ml' => array( 'cup', 'ml', 1, 236.588, 0.001 ), + 'tsp to ml' => array( 'tsp', 'ml', 1, 4.929, 0.001 ), + 'tbsp to ml' => array( 'tbsp', 'ml', 1, 14.787, 0.001 ), + 'floz to ml' => array( 'floz', 'ml', 1, 29.574, 0.001 ), + 'gal to l' => array( 'gal', 'l', 1, 3.785, 0.001 ), + 'pt to ml' => array( 'pt', 'ml', 1, 473.176, 0.001 ), + 'qt to ml' => array( 'qt', 'ml', 1, 946.353, 0.001 ), + ); + } + + /** + * Test volume conversions from metric to imperial. + * + * @dataProvider data_volume_metric_to_imperial + */ + public function test_volume_metric_to_imperial( $from, $to, $amount, $expected_amount, $tolerance ) { + $result = Cooked_Unit_Converter::convert( $amount, $from ); + $this->assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); + } + + public function data_volume_metric_to_imperial() { + return array( + 'dl to floz' => array( 'dl', 'floz', 1, 3.381, 0.001 ), + 'ml to floz' => array( 'ml', 'floz', 1, 0.034, 0.001 ), + 'l to cup' => array( 'l', 'cup', 1, 4.227, 0.001 ), + ); + } + + /** + * Test weight conversions from imperial to metric. + * + * @dataProvider data_weight_imperial_to_metric + */ + public function test_weight_imperial_to_metric( $from, $to, $amount, $expected_amount, $tolerance ) { + $result = Cooked_Unit_Converter::convert( $amount, $from ); + $this->assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); + } + + public function data_weight_imperial_to_metric() { + return array( + 'oz to g' => array( 'oz', 'g', 1, 28.3495, 0.001 ), + 'lb to g' => array( 'lb', 'g', 1, 453.592, 0.001 ), + ); + } + + /** + * Test weight conversions from metric to imperial. + * + * @dataProvider data_weight_metric_to_imperial + */ + public function test_weight_metric_to_imperial( $from, $to, $amount, $expected_amount, $tolerance ) { + $result = Cooked_Unit_Converter::convert( $amount, $from ); + $this->assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); + } + + public function data_weight_metric_to_imperial() { + return array( + 'g to oz' => array( 'g', 'oz', 1, 0.0353, 0.001 ), + 'kg to lb' => array( 'kg', 'lb', 1, 2.205, 0.001 ), + 'mg to g' => array( 'mg', 'g', 1, 0.001, 0.0001 ), + ); + } + + /** + * Test get_target_unit returns correct target keys. + * + * @dataProvider data_target_units + */ + public function test_get_target_unit( $from, $expected_target ) { + $this->assertSame( $expected_target, Cooked_Unit_Converter::get_target_unit( $from ) ); + } + + public function data_target_units() { + return array( + array( 'cup', 'ml' ), + array( 'tsp', 'ml' ), + array( 'tbsp', 'ml' ), + array( 'floz', 'ml' ), + array( 'gal', 'l' ), + array( 'pt', 'ml' ), + array( 'qt', 'ml' ), + array( 'dl', 'floz' ), + array( 'ml', 'floz' ), + array( 'l', 'cup' ), + array( 'oz', 'g' ), + array( 'lb', 'g' ), + array( 'g', 'oz' ), + array( 'kg', 'lb' ), + array( 'mg', 'g' ), + ); + } + + /** + * Test that neutral units return null. + */ + public function test_neutral_units_return_null() { + $neutral_units = array( 'stick', 'dash', 'drop', 'pinch', 'drizzle', 'clove', 'jar', 'can' ); + foreach ( $neutral_units as $unit ) { + $this->assertNull( Cooked_Unit_Converter::convert( 1, $unit ) ); + $this->assertNull( Cooked_Unit_Converter::get_target_unit( $unit ) ); + } + } + + /** + * Test unknown units return null. + */ + public function test_unknown_unit_returns_null() { + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'nonexistent' ) ); + $this->assertNull( Cooked_Unit_Converter::get_target_unit( 'nonexistent' ) ); + } + + /** + * Test converting zero amount. + */ + public function test_convert_zero_amount() { + $result = Cooked_Unit_Converter::convert( 0, 'cup' ); + $this->assertNotNull( $result ); + $this->assertSame( 'ml', $result['unit'] ); + $this->assertEquals( 0, $result['amount'] ); + } + + /** + * Test converting fractional amounts. + */ + public function test_convert_fractional_amount() { + $result = Cooked_Unit_Converter::convert( 0.5, 'cup' ); + $this->assertNotNull( $result ); + $this->assertSame( 'ml', $result['unit'] ); + $this->assertEqualsWithDelta( 118.294, $result['amount'], 0.001 ); + } + + /** + * Test converting large amounts. + */ + public function test_convert_large_amount() { + $result = Cooked_Unit_Converter::convert( 10, 'oz' ); + $this->assertNotNull( $result ); + $this->assertSame( 'g', $result['unit'] ); + $this->assertEqualsWithDelta( 283.495, $result['amount'], 0.001 ); + } + + +} diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 372fee9..6d5ba60 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -283,6 +283,7 @@ function add_rewrite_rule( $regex, $query, $after = 'bottom' ) { return true; } * Load plugin class files needed for testing */ require_once COOKED_DIR . 'includes/class.cooked-measurements.php'; +require_once COOKED_DIR . 'includes/class.cooked-unit-converter.php'; require_once COOKED_DIR . 'includes/class.cooked-functions.php'; require_once COOKED_DIR . 'includes/class.cooked-recipes.php'; require_once COOKED_DIR . 'includes/class.cooked-multilingual.php'; From 68dd6698a79b28f451c8621eb7640ea4883457e9 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:44:14 +0300 Subject: [PATCH 3/9] Dependency upgrades --- .wp-env.json | 2 +- bun.lock | 58 +++++++++++++--------------------------------------- package.json | 2 +- 3 files changed, 16 insertions(+), 46 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index 0d91e28..b3a69ae 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -4,7 +4,7 @@ "themes": ["WordPress/twentytwentyfive"], "plugins": ["."], "port": 8888, - "testsPort": 8889, + "testsEnvironment": false, "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true, diff --git a/bun.lock b/bun.lock index 210e10a..9fea95b 100644 --- a/bun.lock +++ b/bun.lock @@ -6,17 +6,17 @@ "name": "cooked", "devDependencies": { "@playwright/test": "^1.60.0", - "@types/node": "^25.8.0", - "@wordpress/e2e-test-utils-playwright": "^1.46.0", - "@wordpress/env": "^10.39.0", - "bestzip": "^2.2.5", + "@types/node": "^25.9.2", + "@wordpress/e2e-test-utils-playwright": "^1.48.0", + "@wordpress/env": "^11.8.0", + "bestzip": "^3.0.1", "gulp": "^5.0.1", "gulp-clean-css": "^4.3.0", "gulp-rename": "^2.1.0", "gulp-sass": "^6.0.1", "gulp-uglify": "^3.0.2", "playwright": "^1.60.0", - "sass": "^1.99.0", + "sass": "^1.100.0", }, }, }, @@ -315,7 +315,7 @@ "@wordpress/e2e-test-utils-playwright": ["@wordpress/e2e-test-utils-playwright@1.48.0", "", { "dependencies": { "change-case": "^4.1.2", "get-port": "^5.1.1", "lighthouse": "^12.2.2", "mime": "^3.0.0", "web-vitals": "^4.2.1" }, "peerDependencies": { "@playwright/test": ">=1", "@types/node": "^20.17.10" } }, "sha512-jLzobHMQha8ZUHkRhl4OJVCkk26jTVqbhN5hFpQruVTETMI3Z1PFJZH1DFAumJKKAIociVMVeH2MDD8XVp72ww=="], - "@wordpress/env": ["@wordpress/env@10.39.0", "", { "dependencies": { "@inquirer/prompts": "^7.2.0", "@wp-playground/cli": "^3.0.0", "chalk": "^4.0.0", "copy-dir": "^1.3.0", "cross-spawn": "^7.0.6", "docker-compose": "^0.24.3", "extract-zip": "^1.6.7", "got": "^11.8.5", "js-yaml": "^3.13.1", "ora": "^4.0.2", "rimraf": "^5.0.10", "simple-git": "^3.5.0", "terminal-link": "^2.0.0", "yargs": "^17.3.0" }, "bin": { "wp-env": "bin/wp-env" } }, "sha512-Hgl2RQAAzXFMqkpegGWT1/KkX88OVikRroPidWkij1WtU8p+AZniTcncWmlWqbdLdfGbPqQS5ZkqDZCzrQjgnA=="], + "@wordpress/env": ["@wordpress/env@11.8.0", "", { "dependencies": { "@inquirer/prompts": "^7.2.0", "@wp-playground/cli": "^3.0.48", "chalk": "^4.0.0", "copy-dir": "^1.3.0", "cross-spawn": "^7.0.6", "docker-compose": "^0.24.3", "extract-zip": "^1.6.7", "got": "^11.8.5", "js-yaml": "^3.13.1", "ora": "^4.0.2", "rimraf": "^5.0.10", "simple-git": "^3.5.0", "yargs": "^17.3.0" }, "bin": { "wp-env": "bin/wp-env" } }, "sha512-VPsP81ID/XAuZn1DHDyApIeSx88WyKwwFhwc2u0RkGWzbYFB3xnkMBqx7ipFBS0TD79PLY5tcEgjMPU2R077pg=="], "@wp-playground/blueprints": ["@wp-playground/blueprints@3.1.33", "", { "dependencies": { "@php-wasm/logger": "3.1.33", "@php-wasm/progress": "3.1.33", "@php-wasm/stream-compression": "3.1.33", "@php-wasm/universal": "3.1.33", "@php-wasm/util": "3.1.33", "@php-wasm/web-service-worker": "3.1.33", "@wp-playground/common": "3.1.33", "@wp-playground/storage": "3.1.33", "@wp-playground/wordpress": "3.1.33", "ajv": "8.12.0" } }, "sha512-bAs0MOBgXPDYtsO2tQcXSqveEaye8xcNGOQvovvE6c5pZWD4RlsiuZ71oKGmtq7JJhgdLTNj0lkcF9f2NX6vrg=="], @@ -347,8 +347,6 @@ "ansi-colors": ["ansi-colors@1.1.0", "", { "dependencies": { "ansi-wrap": "^0.1.0" } }, "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA=="], - "ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="], - "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], @@ -357,9 +355,7 @@ "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="], - "archiver": ["archiver@7.0.1", "", { "dependencies": { "archiver-utils": "^5.0.2", "async": "^3.2.4", "buffer-crc32": "^1.0.0", "readable-stream": "^4.0.0", "readdir-glob": "^1.1.2", "tar-stream": "^3.0.0", "zip-stream": "^6.0.1" } }, "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ=="], - - "archiver-utils": ["archiver-utils@5.0.2", "", { "dependencies": { "glob": "^10.0.0", "graceful-fs": "^4.2.0", "is-stream": "^2.0.1", "lazystream": "^1.0.0", "lodash": "^4.17.15", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0" } }, "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA=="], + "archiver": ["archiver@8.0.0", "", { "dependencies": { "async": "^3.2.4", "buffer-crc32": "^1.0.0", "is-stream": "^4.0.0", "lazystream": "^1.0.0", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0", "readdir-glob": "^3.0.0", "tar-stream": "^3.0.0", "zip-stream": "^7.0.2" } }, "sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g=="], "argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], @@ -415,7 +411,7 @@ "before-after-hook": ["before-after-hook@2.2.3", "", {}, "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="], - "bestzip": ["bestzip@2.2.5", "", { "dependencies": { "archiver": "^7.0.1", "glob": "^13.0.6", "which": "^6.0.1", "yargs": "^16.2.0" }, "bin": { "bestzip": "bin/cli.js" } }, "sha512-3c+7j24mW+Si8rNKe9rDQEaCBI/ECRlNIU1rBLlqIt2zjBsakVqHxpLySMToM/JTGmfXfqBpr2okkfBxARkwRw=="], + "bestzip": ["bestzip@3.0.1", "", { "dependencies": { "archiver": "^8.0.0", "glob": "^13.0.6", "which": "^6.0.1", "yargs": "^16.2.0" }, "bin": { "bestzip": "bin/cli.js" } }, "sha512-sUOmPTsusjvT/hdflzoGrCreDgtGHx4btDdLw2Ykjpg4hhJWuIlWUd3a4qWdHhcTJ8kHL6JLW/dR/XhCPomB4w=="], "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], @@ -491,7 +487,7 @@ "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], - "compress-commons": ["compress-commons@6.0.2", "", { "dependencies": { "crc-32": "^1.2.0", "crc32-stream": "^6.0.0", "is-stream": "^2.0.1", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0" } }, "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg=="], + "compress-commons": ["compress-commons@7.0.1", "", { "dependencies": { "crc-32": "^1.2.0", "crc32-stream": "^7.0.1", "is-stream": "^4.0.0", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0" } }, "sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ=="], "concat-stream": ["concat-stream@1.6.2", "", { "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" } }, "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw=="], @@ -517,7 +513,7 @@ "crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="], - "crc32-stream": ["crc32-stream@6.0.0", "", { "dependencies": { "crc-32": "^1.2.0", "readable-stream": "^4.0.0" } }, "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g=="], + "crc32-stream": ["crc32-stream@7.0.1", "", { "dependencies": { "crc-32": "^1.2.0", "readable-stream": "^4.0.0" } }, "sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g=="], "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], @@ -795,7 +791,7 @@ "is-relative": ["is-relative@1.0.0", "", { "dependencies": { "is-unc-path": "^1.0.0" } }, "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA=="], - "is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], + "is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="], "is-typed-array": ["is-typed-array@1.1.15", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="], @@ -855,8 +851,6 @@ "lighthouse-stack-packs": ["lighthouse-stack-packs@1.12.2", "", {}, "sha512-Ug8feS/A+92TMTCK6yHYLwaFMuelK/hAKRMdldYkMNwv+d9PtWxjXEg6rwKtsUXTADajhdrhXyuNCJ5/sfmPFw=="], - "lodash": ["lodash@4.18.1", "", {}, "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q=="], - "lodash-es": ["lodash-es@4.18.1", "", {}, "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A=="], "lodash.clonedeep": ["lodash.clonedeep@4.5.0", "", {}, "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ=="], @@ -1065,7 +1059,7 @@ "readable-stream": ["readable-stream@4.7.0", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10", "string_decoder": "^1.3.0" } }, "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg=="], - "readdir-glob": ["readdir-glob@1.1.3", "", { "dependencies": { "minimatch": "^5.1.0" } }, "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA=="], + "readdir-glob": ["readdir-glob@3.0.0", "", { "dependencies": { "minimatch": "^10.2.2" } }, "sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw=="], "readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], @@ -1191,8 +1185,6 @@ "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], - "supports-hyperlinks": ["supports-hyperlinks@2.3.0", "", { "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" } }, "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA=="], - "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], "sver": ["sver@1.8.4", "", { "optionalDependencies": { "semver": "^6.3.0" } }, "sha512-71o1zfzyawLfIWBOmw8brleKyvnbn73oVHNCsu51uPMz/HWiKkkXsI31JjHW5zqXEqnPYkIiHd8ZmL7FCimLEA=="], @@ -1203,8 +1195,6 @@ "teex": ["teex@1.0.1", "", { "dependencies": { "streamx": "^2.12.5" } }, "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg=="], - "terminal-link": ["terminal-link@2.1.1", "", { "dependencies": { "ansi-escapes": "^4.2.1", "supports-hyperlinks": "^2.0.0" } }, "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ=="], - "text-decoder": ["text-decoder@1.2.7", "", { "dependencies": { "b4a": "^1.6.4" } }, "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ=="], "third-party-web": ["third-party-web@0.27.0", "", {}, "sha512-h0JYX+dO2Zr3abCQpS6/uFjujaOjA1DyDzGQ41+oFn9VW/ARiq9g5ln7qEP9+BTzDpOMyIfsfj4OvfgXAsMUSA=="], @@ -1229,7 +1219,7 @@ "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - "type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="], + "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], "type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="], @@ -1327,7 +1317,7 @@ "yoctocolors-cjs": ["yoctocolors-cjs@2.1.3", "", {}, "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw=="], - "zip-stream": ["zip-stream@6.0.1", "", { "dependencies": { "archiver-utils": "^5.0.0", "compress-commons": "^6.0.2", "readable-stream": "^4.0.0" } }, "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA=="], + "zip-stream": ["zip-stream@7.0.5", "", { "dependencies": { "compress-commons": "^7.0.0", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0" } }, "sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w=="], "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], @@ -1409,8 +1399,6 @@ "anymatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - "archiver-utils/glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], - "bestzip/yargs": ["yargs@16.2.0", "", { "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="], "bl/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], @@ -1429,8 +1417,6 @@ "defaults/clone": ["clone@1.0.4", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="], - "dot-prop/type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], - "enquirer/ansi-colors": ["ansi-colors@4.1.3", "", {}, "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw=="], "get-uri/debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], @@ -1481,8 +1467,6 @@ "raw-body/iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="], - "readdir-glob/minimatch": ["minimatch@5.1.9", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw=="], - "require-in-the-middle/debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], "restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], @@ -1543,10 +1527,6 @@ "@sentry/node/minimatch/brace-expansion": ["brace-expansion@2.1.0", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="], - "archiver-utils/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], - - "archiver-utils/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], - "bestzip/yargs/cliui": ["cliui@7.0.4", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="], "bestzip/yargs/yargs-parser": ["yargs-parser@20.2.9", "", {}, "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="], @@ -1595,8 +1575,6 @@ "puppeteer-core/debug/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], - "readdir-glob/minimatch/brace-expansion": ["brace-expansion@2.1.0", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="], - "require-in-the-middle/debug/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], "rimraf/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], @@ -1609,10 +1587,6 @@ "@sentry/node/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "archiver-utils/glob/minimatch/brace-expansion": ["brace-expansion@2.1.0", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="], - - "archiver-utils/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], - "glob-watcher/chokidar/readdirp/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], "gulp-cli/gulplog/glogg/sparkles": ["sparkles@2.1.0", "", {}, "sha512-r7iW1bDw8R/cFifrD3JnQJX0K1jqT0kprL48BiBpLZLJPmAm34zsVBsK5lc7HirZYZqMW65dOXZgbAGt/I6frg=="], @@ -1625,14 +1599,10 @@ "log-symbols/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="], - "readdir-glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "rimraf/glob/minimatch/brace-expansion": ["brace-expansion@2.1.0", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="], "rimraf/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], - "archiver-utils/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "log-symbols/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], "rimraf/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], diff --git a/package.json b/package.json index a99a8bb..d807e65 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "gulp-uglify": "^3.0.2", "playwright": "^1.60.0", "sass": "^1.100.0", - "@wordpress/env": "^11.6.0", + "@wordpress/env": "^11.8.0", "bestzip": "^3.0.1" } } From 54e493fb91e5582bf64a8291bcad0750cc9ea2f6 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:44:49 +0300 Subject: [PATCH 4/9] PHPCS fixes --- includes/class.cooked-cli.php | 113 +++++++++++++------------ includes/class.cooked-plugin-extra.php | 61 ++++++++----- includes/class.cooked-widgets.php | 55 +++++++++--- 3 files changed, 138 insertions(+), 91 deletions(-) diff --git a/includes/class.cooked-cli.php b/includes/class.cooked-cli.php index 26b3bf2..396d42a 100644 --- a/includes/class.cooked-cli.php +++ b/includes/class.cooked-cli.php @@ -7,12 +7,15 @@ * @since 1.13.0 */ +/** + * Exit if accessed directly + */ if ( ! defined( 'ABSPATH' ) ) { - exit; + exit; } if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) { - return; + return; } /** @@ -20,66 +23,66 @@ */ class Cooked_CLI_Tools_Command { - /** - * Run a Cooked migration/maintenance tool by name. - * - * ## OPTIONS - * - * - * : The tool to run. Use `wp cooked tools list` to see available tools. - * - * ## EXAMPLES - * - * wp cooked tools run remove_recipes_from_cooked_user_meta - * wp cooked tools run update_rewrite_rules - * - * @param array $args Positional args. 0 = tool name. - * @param array $assoc_args Associative args. - */ - public function run( $args, $assoc_args ) { - if ( empty( $args[0] ) ) { - \WP_CLI::error( __( 'Please provide a tool name. Use `wp cooked tools list` to see available tools.', 'cooked' ) ); - } + /** + * Run a Cooked migration/maintenance tool by name. + * + * ## OPTIONS + * + * + * : The tool to run. Use `wp cooked tools list` to see available tools. + * + * ## EXAMPLES + * + * wp cooked tools run remove_recipes_from_cooked_user_meta + * wp cooked tools run update_rewrite_rules + * + * @param array $args Positional args. 0 = tool name. + * @param array $assoc_args Associative args. + */ + public function run( $args, $assoc_args ) { + if ( empty( $args[0] ) ) { + \WP_CLI::error( __( 'Please provide a tool name. Use `wp cooked tools list` to see available tools.', 'cooked' ) ); + } - $tool_name = $args[0]; - $result = Cooked_Updates::run_tool( $tool_name ); + $tool_name = $args[0]; + $result = Cooked_Updates::run_tool( $tool_name ); - if ( is_wp_error( $result ) ) { - \WP_CLI::error( $result->get_error_message() ); - } + if ( is_wp_error( $result ) ) { + \WP_CLI::error( $result->get_error_message() ); + } - \WP_CLI::success( __( 'Tool completed successfully.', 'cooked' ) ); - } + \WP_CLI::success( __( 'Tool completed successfully.', 'cooked' ) ); + } - /** - * List available Cooked tools that can be run on demand. - * - * ## EXAMPLES - * - * wp cooked tools list - * - * @param array $args Positional args. - * @param array $assoc_args Associative args. - */ - public function list_tools( $args, $assoc_args ) { - $tools = Cooked_Updates::get_runnable_tools(); + /** + * List available Cooked tools that can be run on demand. + * + * ## EXAMPLES + * + * wp cooked tools list + * + * @param array $args Positional args. + * @param array $assoc_args Associative args. + */ + public function list_tools( $args, $assoc_args ) { + $tools = Cooked_Updates::get_runnable_tools(); - if ( empty( $tools ) ) { - \WP_CLI::log( __( 'No tools available.', 'cooked' ) ); - return; - } + if ( empty( $tools ) ) { + \WP_CLI::log( __( 'No tools available.', 'cooked' ) ); + return; + } - $rows = []; - foreach ( $tools as $tool ) { - $rows[] = [ - 'id' => $tool['id'], - 'name' => $tool['name'], - 'description' => $tool['description'], - ]; - } + $rows = array(); + foreach ( $tools as $tool ) { + $rows[] = array( + 'id' => $tool['id'], + 'name' => $tool['name'], + 'description' => $tool['description'], + ); + } - \WP_CLI\Utils\format_items( 'table', $rows, [ 'id', 'name', 'description' ] ); - } + \WP_CLI\Utils\format_items( 'table', $rows, array( 'id', 'name', 'description' ) ); + } } \WP_CLI::add_command( 'cooked tools', 'Cooked_CLI_Tools_Command' ); diff --git a/includes/class.cooked-plugin-extra.php b/includes/class.cooked-plugin-extra.php index 6ef3d83..d3729b3 100644 --- a/includes/class.cooked-plugin-extra.php +++ b/includes/class.cooked-plugin-extra.php @@ -5,31 +5,46 @@ * @package Cooked * @subpackage Widgets * @since 1.8.8 -*/ + */ -// Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) exit; +/** + * Exit if accessed directly + */ +if ( ! defined( 'ABSPATH' ) ) { + exit; +} +/** + * Cooked Plugin Extra. + * + * @since 1.8.8 + */ class Cooked_Plugin_Extra { - public function __construct() { - add_action( 'plugin_action_links_cooked/cooked.php', [&$this, 'cooked_plugin_action_links_action'], 10, 1 ); - } - /** - * Plugin Action Links Filter - * - * Adds a "Upgrade to Pro" link to the plugin list page. - * - * @since 1.8.8 - * @param array $links - * @return array - */ - function cooked_plugin_action_links_action( $links ) { - if (!class_exists( 'Cooked_Pro_Plugin')) { - return array_merge(['Upgrade to Pro'], $links); - } else { - array_unshift($links, '' . __( 'Required by Cooked Pro', 'cooked' ) . ''); - return $links; - } - } + /** + * Constructor. + * + * @since 1.8.8 + */ + public function __construct() { + add_action( 'plugin_action_links_cooked/cooked.php', array( &$this, 'cooked_plugin_action_links_action' ), 10, 1 ); + } + + /** + * Plugin Action Links Filter + * + * Adds a "Upgrade to Pro" link to the plugin list page. + * + * @since 1.8.8 + * @param array $links The plugin action links. + * @return array + */ + public function cooked_plugin_action_links_action( $links ) { + if ( ! class_exists( 'Cooked_Pro_Plugin' ) ) { + return array_merge( array( 'Upgrade to Pro' ), $links ); + } else { + array_unshift( $links, '' . __( 'Required by Cooked Pro', 'cooked' ) . '' ); + return $links; + } + } } diff --git a/includes/class.cooked-widgets.php b/includes/class.cooked-widgets.php index d4896f3..94e069a 100644 --- a/includes/class.cooked-widgets.php +++ b/includes/class.cooked-widgets.php @@ -7,26 +7,47 @@ * @since 1.0.0 */ -// Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) +/** + * Exit if accessed directly + */ +if ( ! defined( 'ABSPATH' ) ) { exit; +} require_once 'widgets/init.php'; +/** + * Cooked Widgets. + * + * @since 1.0.0 + */ class Cooked_Widgets { + /** + * Constructor. + * + * @since 1.0.0 + */ public function __construct() { - add_action( 'widgets_init', [ &$this, 'register_widgets' ], 10, 1 ); + add_action( 'widgets_init', array( &$this, 'register_widgets' ), 10, 1 ); } + /** + * Register widgets. + * + * @since 1.0.0 + */ public function register_widgets() { - $widgets = apply_filters( 'cooked_widgets', [ - 'Cooked_Widget_Nutrition', - 'Cooked_Widget_Search', - 'Cooked_Widget_Recipe_List', - 'Cooked_Widget_Recipe_Categories', - 'Cooked_Widget_Recipe_Card', - ] ); + $widgets = apply_filters( + 'cooked_widgets', + array( + 'Cooked_Widget_Nutrition', + 'Cooked_Widget_Search', + 'Cooked_Widget_Recipe_List', + 'Cooked_Widget_Recipe_Categories', + 'Cooked_Widget_Recipe_Card', + ) + ); if ( ! empty( $widgets ) ) : foreach ( $widgets as $widget ) : register_widget( $widget ); @@ -34,14 +55,23 @@ public function register_widgets() { endif; } + /** + * Recipe finder. + * + * @since 1.0.0 + * + * @param string $field_id The field ID. + * @param string $field_name The field name. + * @param string $included The included recipes. + */ public static function recipe_finder( $field_id = '', $field_name = '', $included = '' ) { $button_title = ( ! empty( $included ) ? __( 'Edit Recipe(s)...', 'cooked' ) : __( 'Choose recipe(s)...', 'cooked' ) ); echo ''; - echo ''; if ( ! empty( $included ) ) : foreach ( $included as $recipe ) : $recipe_status = get_post_status( $recipe ); - if ( $recipe_status === 'publish' ) : + if ( 'publish' === $recipe_status ) : $_recipe = Cooked_Recipes::get( $recipe, true, false, false, true ); echo ''; endif; @@ -49,5 +79,4 @@ public static function recipe_finder( $field_id = '', $field_name = '', $include endif; echo ''; } - } From 1f8f7fb1124b0d67ff7097656a2e68fdb4670b73 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 21:21:22 +0300 Subject: [PATCH 5/9] Add units of measure library. --- composer.json | 3 +- composer.lock | 55 ++++- includes/class.cooked-recipes.php | 4 +- includes/class.cooked-unit-converter.php | 141 ++++++------ tests/phpunit/UnitConverterTest.php | 273 +++++++++-------------- 5 files changed, 234 insertions(+), 242 deletions(-) diff --git a/composer.json b/composer.json index b785f14..ec3e9a3 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,8 @@ "prefer-stable": true, "require": { "php": ">=7.4.0", - "nxp/math-executor": "^2.3" + "nxp/math-executor": "^2.3", + "php-units-of-measure/php-units-of-measure": "^2.2" }, "require-dev": { "phpunit/phpunit": "^9.6", diff --git a/composer.lock b/composer.lock index 0cf7ff9..20aa6ae 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "689564a88bf4f1a2ca5891e0f753a7bb", + "content-hash": "5fafb24fed0730a4a82cc268b6968bd5", "packages": [ { "name": "nxp/math-executor", @@ -62,6 +62,59 @@ "source": "https://github.com/neonxp/MathExecutor/tree/v2.3.2" }, "time": "2022-12-08T16:15:34+00:00" + }, + { + "name": "php-units-of-measure/php-units-of-measure", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure.git", + "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PhpUnitsOfMeasure/php-units-of-measure/zipball/cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1", + "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "replace": { + "triplepoint/php-units-of-measure": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpUnitsOfMeasure\\": "source/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Hanson", + "role": "Developer" + } + ], + "description": "A PHP library for converting between standard units of measure.", + "homepage": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure", + "keywords": [ + "conversion", + "data", + "measurements" + ], + "support": { + "issues": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure/issues", + "source": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure" + }, + "time": "2025-04-30T23:02:43+00:00" } ], "packages-dev": [ diff --git a/includes/class.cooked-recipes.php b/includes/class.cooked-recipes.php index 782c8cb..a9085f3 100644 --- a/includes/class.cooked-recipes.php +++ b/includes/class.cooked-recipes.php @@ -1012,8 +1012,8 @@ public static function single_ingredient( $ing, $checkboxes = true, $plain_text if ( $measurement_system && $measurement_key && $float_amount && isset( $measurements[ $measurement_key ]['system'] ) ) { $source_system = $measurements[ $measurement_key ]['system']; if ( $source_system && $source_system !== $measurement_system ) { - $converter = new Cooked_Unit_Converter(); - $result = $converter->convert( $float_amount, $measurement_key ); + $target = Cooked_Unit_Converter::get_target_unit( $measurement_key ); + $result = $target ? Cooked_Unit_Converter::convert( $float_amount, $measurement_key, $target ) : null; if ( $result ) { $float_amount = $result['amount']; $measurement_key = $result['unit']; diff --git a/includes/class.cooked-unit-converter.php b/includes/class.cooked-unit-converter.php index 84d9395..5e37f8f 100644 --- a/includes/class.cooked-unit-converter.php +++ b/includes/class.cooked-unit-converter.php @@ -12,117 +12,106 @@ exit; } +use PhpUnitsOfMeasure\PhysicalQuantity\Volume; +use PhpUnitsOfMeasure\PhysicalQuantity\Mass; + /** * Cooked_Unit_Converter Class * - * Converts ingredient amounts between metric and imperial systems. + * Converts ingredient amounts between measurement units using the + * php-units-of-measure library. * * @since 1.15.0 */ class Cooked_Unit_Converter { /** - * Conversion table mapping each unit to its opposite-system equivalent. + * Maps Cooked unit keys to [PhysicalQuantity class, library unit name]. * * @since 1.15.0 * @var array */ - private static $table = array( - 'cup' => array( - 'to' => 'ml', - 'factor' => 236.588, - ), - 'tsp' => array( - 'to' => 'ml', - 'factor' => 4.929, - ), - 'tbsp' => array( - 'to' => 'ml', - 'factor' => 14.787, - ), - 'floz' => array( - 'to' => 'ml', - 'factor' => 29.574, - ), - 'gal' => array( - 'to' => 'l', - 'factor' => 3.785, - ), - 'pt' => array( - 'to' => 'ml', - 'factor' => 473.176, - ), - 'qt' => array( - 'to' => 'ml', - 'factor' => 946.353, - ), - 'dl' => array( - 'to' => 'floz', - 'factor' => 3.381, - ), - 'ml' => array( - 'to' => 'floz', - 'factor' => 0.034, - ), - 'l' => array( - 'to' => 'cup', - 'factor' => 4.227, - ), - 'oz' => array( - 'to' => 'g', - 'factor' => 28.3495, - ), - 'lb' => array( - 'to' => 'g', - 'factor' => 453.592, - ), - 'g' => array( - 'to' => 'oz', - 'factor' => 0.0353, - ), - 'kg' => array( - 'to' => 'lb', - 'factor' => 2.205, - ), - 'mg' => array( - 'to' => 'g', - 'factor' => 0.001, - ), + private static $unit_map = array( + 'cup' => array( Volume::class, 'cup' ), + 'tsp' => array( Volume::class, 'tsp' ), + 'tbsp' => array( Volume::class, 'tbsp' ), + 'floz' => array( Volume::class, 'fl oz' ), + 'gal' => array( Volume::class, 'gal' ), + 'pt' => array( Volume::class, 'pt' ), + 'qt' => array( Volume::class, 'qt' ), + 'dl' => array( Volume::class, 'dl' ), + 'ml' => array( Volume::class, 'ml' ), + 'l' => array( Volume::class, 'l' ), + 'oz' => array( Mass::class, 'oz' ), + 'lb' => array( Mass::class, 'lb' ), + 'g' => array( Mass::class, 'g' ), + 'kg' => array( Mass::class, 'kg' ), + 'mg' => array( Mass::class, 'mg' ), ); /** - * Convert an amount from one unit to its opposite-system equivalent. + * Default opposite-system target for each unit. * * @since 1.15.0 - * @param float $amount The numeric amount to convert. - * @param string $from_unit_key The measurement key to convert from (e.g. 'cup', 'oz', 'g'). - * @return array|null Array with 'amount' (float) and 'unit' (string) on success, null if no conversion exists. + * @var array */ - public static function convert( $amount, $from_unit_key ) { - if ( ! isset( self::$table[ $from_unit_key ] ) ) { + private static $default_targets = array( + 'cup' => 'ml', + 'tsp' => 'ml', + 'tbsp' => 'ml', + 'floz' => 'ml', + 'gal' => 'l', + 'pt' => 'ml', + 'qt' => 'ml', + 'dl' => 'floz', + 'ml' => 'floz', + 'l' => 'cup', + 'oz' => 'g', + 'lb' => 'g', + 'g' => 'oz', + 'kg' => 'lb', + 'mg' => 'g', + ); + + /** + * Convert an amount from one unit to another. + * + * @since 1.15.0 + * @param float $amount The numeric amount to convert. + * @param string $from The measurement key to convert from. + * @param string $to The target measurement key. + * @return array|null Array with 'amount' (float) and 'unit' (string), or null. + */ + public static function convert( $amount, $from, $to ) { + if ( ! isset( self::$unit_map[ $from ], self::$unit_map[ $to ] ) ) { return null; } - $target = self::$table[ $from_unit_key ]; + list( $from_class, $from_unit ) = self::$unit_map[ $from ]; + list( $to_class, $to_unit ) = self::$unit_map[ $to ]; + + if ( $from_class !== $to_class ) { + return null; + } return array( - 'amount' => $amount * $target['factor'], - 'unit' => $target['to'], + 'amount' => ( new $from_class( $amount, $from_unit ) )->toUnit( $to_unit ), + 'unit' => $to, ); } /** - * Get the target unit key for a given source unit. + * Get the default opposite-system target unit for a given source unit. * * @since 1.15.0 * @param string $from_unit_key The measurement key to convert from. - * @return string|null The target unit key, or null if no conversion exists. + * @return string|null The target unit key, or null if no conversion exists. */ public static function get_target_unit( $from_unit_key ) { - if ( ! isset( self::$table[ $from_unit_key ] ) ) { + if ( ! isset( self::$default_targets[ $from_unit_key ] ) ) { return null; } - return self::$table[ $from_unit_key ]['to']; + return self::$default_targets[ $from_unit_key ]; } } diff --git a/tests/phpunit/UnitConverterTest.php b/tests/phpunit/UnitConverterTest.php index 512a217..b53bea6 100644 --- a/tests/phpunit/UnitConverterTest.php +++ b/tests/phpunit/UnitConverterTest.php @@ -10,166 +10,115 @@ class UnitConverterTest extends TestCase { - /** - * Test volume conversions from imperial to metric. - * - * @dataProvider data_volume_imperial_to_metric - */ - public function test_volume_imperial_to_metric( $from, $to, $amount, $expected_amount, $tolerance ) { - $result = Cooked_Unit_Converter::convert( $amount, $from ); - $this->assertNotNull( $result ); - $this->assertSame( $to, $result['unit'] ); - $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); - } - - public function data_volume_imperial_to_metric() { - return array( - 'cup to ml' => array( 'cup', 'ml', 1, 236.588, 0.001 ), - 'tsp to ml' => array( 'tsp', 'ml', 1, 4.929, 0.001 ), - 'tbsp to ml' => array( 'tbsp', 'ml', 1, 14.787, 0.001 ), - 'floz to ml' => array( 'floz', 'ml', 1, 29.574, 0.001 ), - 'gal to l' => array( 'gal', 'l', 1, 3.785, 0.001 ), - 'pt to ml' => array( 'pt', 'ml', 1, 473.176, 0.001 ), - 'qt to ml' => array( 'qt', 'ml', 1, 946.353, 0.001 ), - ); - } - - /** - * Test volume conversions from metric to imperial. - * - * @dataProvider data_volume_metric_to_imperial - */ - public function test_volume_metric_to_imperial( $from, $to, $amount, $expected_amount, $tolerance ) { - $result = Cooked_Unit_Converter::convert( $amount, $from ); - $this->assertNotNull( $result ); - $this->assertSame( $to, $result['unit'] ); - $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); - } - - public function data_volume_metric_to_imperial() { - return array( - 'dl to floz' => array( 'dl', 'floz', 1, 3.381, 0.001 ), - 'ml to floz' => array( 'ml', 'floz', 1, 0.034, 0.001 ), - 'l to cup' => array( 'l', 'cup', 1, 4.227, 0.001 ), - ); - } - - /** - * Test weight conversions from imperial to metric. - * - * @dataProvider data_weight_imperial_to_metric - */ - public function test_weight_imperial_to_metric( $from, $to, $amount, $expected_amount, $tolerance ) { - $result = Cooked_Unit_Converter::convert( $amount, $from ); - $this->assertNotNull( $result ); - $this->assertSame( $to, $result['unit'] ); - $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); - } - - public function data_weight_imperial_to_metric() { - return array( - 'oz to g' => array( 'oz', 'g', 1, 28.3495, 0.001 ), - 'lb to g' => array( 'lb', 'g', 1, 453.592, 0.001 ), - ); - } - - /** - * Test weight conversions from metric to imperial. - * - * @dataProvider data_weight_metric_to_imperial - */ - public function test_weight_metric_to_imperial( $from, $to, $amount, $expected_amount, $tolerance ) { - $result = Cooked_Unit_Converter::convert( $amount, $from ); - $this->assertNotNull( $result ); - $this->assertSame( $to, $result['unit'] ); - $this->assertEqualsWithDelta( $expected_amount, $result['amount'], $tolerance ); - } - - public function data_weight_metric_to_imperial() { - return array( - 'g to oz' => array( 'g', 'oz', 1, 0.0353, 0.001 ), - 'kg to lb' => array( 'kg', 'lb', 1, 2.205, 0.001 ), - 'mg to g' => array( 'mg', 'g', 1, 0.001, 0.0001 ), - ); - } - - /** - * Test get_target_unit returns correct target keys. - * - * @dataProvider data_target_units - */ - public function test_get_target_unit( $from, $expected_target ) { - $this->assertSame( $expected_target, Cooked_Unit_Converter::get_target_unit( $from ) ); - } - - public function data_target_units() { - return array( - array( 'cup', 'ml' ), - array( 'tsp', 'ml' ), - array( 'tbsp', 'ml' ), - array( 'floz', 'ml' ), - array( 'gal', 'l' ), - array( 'pt', 'ml' ), - array( 'qt', 'ml' ), - array( 'dl', 'floz' ), - array( 'ml', 'floz' ), - array( 'l', 'cup' ), - array( 'oz', 'g' ), - array( 'lb', 'g' ), - array( 'g', 'oz' ), - array( 'kg', 'lb' ), - array( 'mg', 'g' ), - ); - } - - /** - * Test that neutral units return null. - */ - public function test_neutral_units_return_null() { - $neutral_units = array( 'stick', 'dash', 'drop', 'pinch', 'drizzle', 'clove', 'jar', 'can' ); - foreach ( $neutral_units as $unit ) { - $this->assertNull( Cooked_Unit_Converter::convert( 1, $unit ) ); - $this->assertNull( Cooked_Unit_Converter::get_target_unit( $unit ) ); - } - } - - /** - * Test unknown units return null. - */ - public function test_unknown_unit_returns_null() { - $this->assertNull( Cooked_Unit_Converter::convert( 1, 'nonexistent' ) ); - $this->assertNull( Cooked_Unit_Converter::get_target_unit( 'nonexistent' ) ); - } - - /** - * Test converting zero amount. - */ - public function test_convert_zero_amount() { - $result = Cooked_Unit_Converter::convert( 0, 'cup' ); - $this->assertNotNull( $result ); - $this->assertSame( 'ml', $result['unit'] ); - $this->assertEquals( 0, $result['amount'] ); - } - - /** - * Test converting fractional amounts. - */ - public function test_convert_fractional_amount() { - $result = Cooked_Unit_Converter::convert( 0.5, 'cup' ); - $this->assertNotNull( $result ); - $this->assertSame( 'ml', $result['unit'] ); - $this->assertEqualsWithDelta( 118.294, $result['amount'], 0.001 ); - } - - /** - * Test converting large amounts. - */ - public function test_convert_large_amount() { - $result = Cooked_Unit_Converter::convert( 10, 'oz' ); - $this->assertNotNull( $result ); - $this->assertSame( 'g', $result['unit'] ); - $this->assertEqualsWithDelta( 283.495, $result['amount'], 0.001 ); - } - - + /** + * @dataProvider data_volume_conversions + */ + public function test_volume_conversions( $amount, $from, $to, $expected, $tolerance ) { + $result = Cooked_Unit_Converter::convert( $amount, $from, $to ); + $this->assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected, $result['amount'], $tolerance ); + } + + public function data_volume_conversions() { + return array( + 'cup to ml' => array( 1, 'cup', 'ml', 236.5882, 0.0001 ), + 'tsp to ml' => array( 1, 'tsp', 'ml', 4.92892, 0.00001 ), + 'tbsp to ml' => array( 1, 'tbsp', 'ml', 14.78676, 0.00001 ), + 'tbsp to tsp' => array( 1, 'tbsp', 'tsp', 3, 0.001 ), + 'floz to ml' => array( 1, 'floz', 'ml', 29.57353, 0.00001 ), + 'gal to l' => array( 1, 'gal', 'l', 3.78541, 0.00001 ), + 'pt to ml' => array( 1, 'pt', 'ml', 473.17648, 0.0001 ), + 'qt to ml' => array( 1, 'qt', 'ml', 946.35295, 0.0001 ), + 'dl to floz' => array( 1, 'dl', 'floz', 3.3814, 0.0001 ), + 'l to cup' => array( 1, 'l', 'cup', 4.22675, 0.0001 ), + ); + } + + /** + * @dataProvider data_weight_conversions + */ + public function test_weight_conversions( $amount, $from, $to, $expected, $tolerance ) { + $result = Cooked_Unit_Converter::convert( $amount, $from, $to ); + $this->assertNotNull( $result ); + $this->assertSame( $to, $result['unit'] ); + $this->assertEqualsWithDelta( $expected, $result['amount'], $tolerance ); + } + + public function data_weight_conversions() { + return array( + 'oz to g' => array( 1, 'oz', 'g', 28.34952, 0.0001 ), + 'g to oz' => array( 1, 'g', 'oz', 0.035274, 0.000001 ), + 'lb to g' => array( 1, 'lb', 'g', 453.59237, 0.0001 ), + 'kg to lb' => array( 1, 'kg', 'lb', 2.20462, 0.0001 ), + 'mg to g' => array( 1, 'mg', 'g', 0.001, 0.0001 ), + 'g to kg' => array( 1000, 'g', 'kg', 1, 0.0001 ), + 'oz to lb' => array( 16, 'oz', 'lb', 1, 0.001 ), + 'kg to g' => array( 1, 'kg', 'g', 1000, 0.001 ), + 'lb to oz' => array( 1, 'lb', 'oz', 16, 0.001 ), + ); + } + + public function test_get_target_unit() { + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'cup' ) ); + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'tsp' ) ); + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'tbsp' ) ); + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'floz' ) ); + $this->assertSame( 'l', Cooked_Unit_Converter::get_target_unit( 'gal' ) ); + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'pt' ) ); + $this->assertSame( 'ml', Cooked_Unit_Converter::get_target_unit( 'qt' ) ); + $this->assertSame( 'floz', Cooked_Unit_Converter::get_target_unit( 'dl' ) ); + $this->assertSame( 'floz', Cooked_Unit_Converter::get_target_unit( 'ml' ) ); + $this->assertSame( 'cup', Cooked_Unit_Converter::get_target_unit( 'l' ) ); + $this->assertSame( 'g', Cooked_Unit_Converter::get_target_unit( 'oz' ) ); + $this->assertSame( 'g', Cooked_Unit_Converter::get_target_unit( 'lb' ) ); + $this->assertSame( 'oz', Cooked_Unit_Converter::get_target_unit( 'g' ) ); + $this->assertSame( 'lb', Cooked_Unit_Converter::get_target_unit( 'kg' ) ); + $this->assertSame( 'g', Cooked_Unit_Converter::get_target_unit( 'mg' ) ); + } + + public function test_neutral_units_return_null() { + $neutral_units = array( 'stick', 'dash', 'drop', 'pinch', 'drizzle', 'clove', 'jar', 'can' ); + foreach ( $neutral_units as $unit ) { + $this->assertNull( Cooked_Unit_Converter::convert( 1, $unit, 'ml' ) ); + $this->assertNull( Cooked_Unit_Converter::get_target_unit( $unit ) ); + } + } + + public function test_unknown_unit_returns_null() { + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'nonexistent', 'ml' ) ); + $this->assertNull( Cooked_Unit_Converter::get_target_unit( 'nonexistent' ) ); + } + + public function test_unknown_target_returns_null() { + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'cup', 'nonexistent' ) ); + } + + public function test_cross_type_conversion_returns_null() { + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'cup', 'g' ) ); + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'oz', 'ml' ) ); + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'cup', 'oz' ) ); + $this->assertNull( Cooked_Unit_Converter::convert( 1, 'g', 'tsp' ) ); + } + + public function test_convert_zero_amount() { + $result = Cooked_Unit_Converter::convert( 0, 'cup', 'ml' ); + $this->assertNotNull( $result ); + $this->assertSame( 'ml', $result['unit'] ); + $this->assertEquals( 0, $result['amount'] ); + } + + public function test_convert_fractional_amount() { + $result = Cooked_Unit_Converter::convert( 0.5, 'cup', 'ml' ); + $this->assertNotNull( $result ); + $this->assertSame( 'ml', $result['unit'] ); + $this->assertEqualsWithDelta( 118.2941, $result['amount'], 0.0001 ); + } + + public function test_convert_large_amount() { + $result = Cooked_Unit_Converter::convert( 10, 'oz', 'g' ); + $this->assertNotNull( $result ); + $this->assertSame( 'g', $result['unit'] ); + $this->assertEqualsWithDelta( 283.4952, $result['amount'], 0.0001 ); + } } From cb391b8c36eb8fd282640d9cbf611dd457f222a8 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 22:06:34 +0300 Subject: [PATCH 6/9] Add links to sample recipes --- includes/class.cooked-import.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class.cooked-import.php b/includes/class.cooked-import.php index b623c81..11d1cd8 100644 --- a/includes/class.cooked-import.php +++ b/includes/class.cooked-import.php @@ -217,6 +217,10 @@ public static function field_message( $name, $field_options, $color, $field ) { } public static function field_csv_upload( $name, $field_options, $color, $field ) { + echo '

' . __( 'Download sample CSV files:', 'cooked' ) . ' '; + echo '' . __( 'Small (1 recipe)', 'cooked' ) . ', '; + echo '' . __( 'Medium (3 recipes)', 'cooked' ) . ', '; + echo '' . __( 'Large (10 recipes)', 'cooked' ) . '

'; echo '
'; echo '

'; echo ''; From ae99fba7d7357bf837232c20262b071bc86304b0 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 22:18:49 +0300 Subject: [PATCH 7/9] Add sample data to bundle --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d807e65..5be5aba 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lint-fix": "./vendor/bin/phpcbf --standard=phpcs.xml .", "test": "./vendor/bin/phpunit", "icons:embed": "bun scripts/embed-icons-font.js", - "bundle": "bun run gulp build && bun run i18n && composer install --no-dev && bunx bestzip build/cooked.zip cooked.php LICENSE readme.txt wpml-config.xml assets/ includes/ languages/ templates/ vendor/" + "bundle": "bun run gulp build && bun run i18n && composer install --no-dev && bunx bestzip build/cooked.zip cooked.php LICENSE readme.txt wpml-config.xml assets/ includes/ languages/ sample-data/ templates/ vendor/" }, "repository": { "type": "git", From 2531a1d85059b7ec44e05cf25e6271967f56dbcd Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 23:09:20 +0300 Subject: [PATCH 8/9] Add sample data to bundle --- .github/workflows/gh-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 7effee0..0039f32 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -59,7 +59,7 @@ jobs: run: composer install --no-dev --optimize-autoloader --no-interaction --prefer-dist --no-progress - name: Create plugin zip - run: bunx bestzip build/cooked.zip cooked.php LICENSE readme.txt wpml-config.xml assets/ includes/ languages/ templates/ vendor/ + run: bunx bestzip build/cooked.zip cooked.php LICENSE readme.txt wpml-config.xml assets/ includes/ languages/ sample-data/ templates/ vendor/ - name: Create Release uses: softprops/action-gh-release@v2 From 9d2c66764666aa1548c6a475f2fcd7fb7f6f52f1 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Mon, 15 Jun 2026 23:19:09 +0300 Subject: [PATCH 9/9] Change to 3-arg api. --- includes/class.cooked-recipes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class.cooked-recipes.php b/includes/class.cooked-recipes.php index a9085f3..1f7b6ae 100644 --- a/includes/class.cooked-recipes.php +++ b/includes/class.cooked-recipes.php @@ -1059,7 +1059,8 @@ public static function single_ingredient( $ing, $checkboxes = true, $plain_text if ( $measurement_system && $sub_measurement_key && $sub_float_amount && isset( $measurements[ $sub_measurement_key ]['system'] ) ) { $sub_source_system = $measurements[ $sub_measurement_key ]['system']; if ( $sub_source_system && $sub_source_system !== $measurement_system ) { - $sub_result = $converter->convert( $sub_float_amount, $sub_measurement_key ); + $sub_target = Cooked_Unit_Converter::get_target_unit( $sub_measurement_key ); + $sub_result = $sub_target ? Cooked_Unit_Converter::convert( $sub_float_amount, $sub_measurement_key, $sub_target ) : null; if ( $sub_result ) { $sub_float_amount = $sub_result['amount']; $sub_measurement_key = $sub_result['unit'];