diff --git a/CITATION.cff b/CITATION.cff index ff530cd..3d12001 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -6,7 +6,7 @@ authors: given-names: Justin - family-names: Tresova given-names: Armand -version: 1.9.2 +version: 1.9.3 doi: 10.5281/zenodo.1171250 date-released: 2017-05-08 url: "https://github.com/XjSv/cooked" \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md index f15a326..4e4de88 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,7 +5,8 @@ Versions that are currently being supported with security updates. | Version | Supported | | ------- | ------------------ | -| 1.9.2 | :white_check_mark: | +| 1.9.3 | :white_check_mark: | +| 1.9.2 | :x: | | 1.9.1 | :x: | | 1.9.0 | :x: | | 1.8.9 | :x: | diff --git a/assets/js/cooked-functions.js b/assets/js/cooked-functions.js index cfad4df..f128724 100644 --- a/assets/js/cooked-functions.js +++ b/assets/js/cooked-functions.js @@ -153,10 +153,15 @@ var cooked_loading = false; // Add sort segment urlSegments.push(`sort/${encodeURIComponent(formValues.sort)}`); - // Build and navigate to URL - const prettyUrl = '/' + urlSegments.filter(Boolean).join('/'); + // Build URL + const prettyUrl = urlSegments.filter(Boolean).join('/'); - window.location.href = prettyUrl; + // Use WordPress site URL as base + const siteUrl = new URL(cooked_js_vars.site_url); + const finalUrl = `${siteUrl.pathname}/${prettyUrl}`.replace(/\/+/g, '/'); + + // Navigate to URL + window.location.href = finalUrl; }); } } diff --git a/assets/js/cooked-functions.min.js b/assets/js/cooked-functions.min.js index 11d6324..d72e827 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(){$_Cooked_Fotorama.length&&$_Cooked_Fotorama.fotorama();{function s(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"))})}$_Cooked_Ingredient_Boxes.length&&s($_Cooked_Ingredient_Boxes)}var a,i;function d(e){e.on("click",function(e){e.preventDefault();var o,c,e=l(this),s="cookedTimer-"+e.data("timer-id"),i=l("#cooked-timers-wrap").find(".cooked-timer-block").length;l("div#"+s).length?(l("div#"+s).css({background:"#eeeeee"}),setTimeout(function(){l("div#"+s).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),c=e.parents(".cooked-single-direction").length?e.parents(".cooked-single-direction").data("step"):cooked_js_vars.i18n_timer,c={id:s,seconds:e.data("seconds"),step:c,desc:e.data("desc")},l("#cooked-timers-wrap").length?(e=1==i?" cooked-visible":"",a",{id:"cooked-timers-wrap"}),i=t(c),e.append(i),l("body").append(e),n(l("#"+c.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 c=cooked_js_vars.timer_sound,s=new Audio(c),i=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(){s.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){s.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("#"+i).append('
'),n(l("#"+i).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,c){o=100-o/c*100;e.find(".cooked-progress > span").css({width:o+"%"}),100<=o&&e.addClass("cooked-complete")}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{e.value&&o.push(e.prefix+"/"+encodeURIComponent(e.value))}),e.search&&o.push("search/"+encodeURIComponent(e.search)),o.push("sort/"+encodeURIComponent(e.sort));e="/"+o.filter(Boolean).join("/");window.location.href=e}),$_Cooked_Timers.length&&(a=1,d($_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")),c=o.find(".cooked-ingredient-checkbox");d(e),s(c),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"),c=e.parents(".cooked-fsm");c.find(".cooked-fsm-mobile-nav > a").removeClass("cooked-active"),c.find(".cooked-fsm-content").removeClass("cooked-active"),e.addClass("cooked-active"),("ingredients"==o?c.find(".cooked-fsm-content.cooked-fsm-ingredients"):(c.find(".cooked-fsm-content.cooked-fsm-directions-wrap").addClass("cooked-active"),c.find(".cooked-fsm-content.cooked-fsm-directions").addClass("cooked-active"),c.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(){$_Cooked_Fotorama.length&&$_Cooked_Fotorama.fotorama();{function s(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"))})}$_Cooked_Ingredient_Boxes.length&&s($_Cooked_Ingredient_Boxes)}var a,i;function d(e){e.on("click",function(e){e.preventDefault();var o,c,e=l(this),s="cookedTimer-"+e.data("timer-id"),i=l("#cooked-timers-wrap").find(".cooked-timer-block").length;l("div#"+s).length?(l("div#"+s).css({background:"#eeeeee"}),setTimeout(function(){l("div#"+s).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),c=e.parents(".cooked-single-direction").length?e.parents(".cooked-single-direction").data("step"):cooked_js_vars.i18n_timer,c={id:s,seconds:e.data("seconds"),step:c,desc:e.data("desc")},l("#cooked-timers-wrap").length?(e=1==i?" cooked-visible":"",a",{id:"cooked-timers-wrap"}),i=t(c),e.append(i),l("body").append(e),n(l("#"+c.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 c=cooked_js_vars.timer_sound,s=new Audio(c),i=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(){s.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){s.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("#"+i).append('
'),n(l("#"+i).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,c){o=100-o/c*100;e.find(".cooked-progress > span").css({width:o+"%"}),100<=o&&e.addClass("cooked-complete")}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{e.value&&o.push(e.prefix+"/"+encodeURIComponent(e.value))}),e.search&&o.push("search/"+encodeURIComponent(e.search)),o.push("sort/"+encodeURIComponent(e.sort));e=o.filter(Boolean).join("/"),e=(new URL(cooked_js_vars.site_url).pathname+"/"+e).replace(/\/+/g,"/");window.location.href=e}),$_Cooked_Timers.length&&(a=1,d($_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")),c=o.find(".cooked-ingredient-checkbox");d(e),s(c),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"),c=e.parents(".cooked-fsm");c.find(".cooked-fsm-mobile-nav > a").removeClass("cooked-active"),c.find(".cooked-fsm-content").removeClass("cooked-active"),e.addClass("cooked-active"),("ingredients"==o?c.find(".cooked-fsm-content.cooked-fsm-ingredients"):(c.find(".cooked-fsm-content.cooked-fsm-directions-wrap").addClass("cooked-active"),c.find(".cooked-fsm-content.cooked-fsm-directions").addClass("cooked-active"),c.find(".cooked-fsm-content.cooked-fsm-notes"))).addClass("cooked-active")}))})})(jQuery); \ No newline at end of file diff --git a/composer.json b/composer.json index e6deb44..7f2b68e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "recipe" ], "homepage": "https://wordpress.org/plugins/cooked/", - "version": "1.9.2", + "version": "1.9.3", "type": "wordpress-plugin", "license": "GPL-3.0-or-later", "prefer-stable": true, diff --git a/composer.lock b/composer.lock index 3e10af3..db3d29c 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": "fafbb15c7e8fec507c8ed0417978aa0b", + "content-hash": "10c3e30c2072246078dd5497d86d5353", "packages": [ { "name": "nxp/math-executor", diff --git a/cooked.php b/cooked.php index 313b59e..46ea517 100644 --- a/cooked.php +++ b/cooked.php @@ -6,7 +6,7 @@ Description: A recipe plugin for WordPress. Author: Gora Tech Author URI: https://goratech.dev -Version: 1.9.2 +Version: 1.9.3 Text Domain: cooked Domain Path: languages License: GPL2 @@ -30,7 +30,7 @@ require_once __DIR__ . '/vendor/autoload.php'; -define( 'COOKED_VERSION', '1.9.2' ); +define( 'COOKED_VERSION', '1.9.3' ); define( 'COOKED_DEV', false ); if ( ! class_exists( 'Cooked_Plugin' ) ) : diff --git a/includes/class.cooked-enqueues.php b/includes/class.cooked-enqueues.php index 520607d..cb39640 100644 --- a/includes/class.cooked-enqueues.php +++ b/includes/class.cooked-enqueues.php @@ -38,6 +38,7 @@ public function enqueues($hook) { 'timer_sound' => apply_filters('cooked_timer_sound_mp3', COOKED_URL . 'assets/audio/ding.mp3'), 'i18n_timer' => __('Timer', 'cooked'), 'permalink_structure' => get_option('permalink_structure'), + 'site_url' => get_site_url(), 'browse_recipes_slug' => $browse_recipes_slug, 'recipe_category_slug' => !isset($_cooked_settings['recipe_category_permalink']) ? 'recipe-category' : $_cooked_settings['recipe_category_permalink'], 'recipe_cooking_method_slug' => !isset($_cooked_settings['recipe_cooking_method_permalink']) ? 'cooking-method' : $_cooked_settings['recipe_cooking_method_permalink'], diff --git a/languages/cooked.pot b/languages/cooked.pot index 2573261..184c205 100644 --- a/languages/cooked.pot +++ b/languages/cooked.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPL2. msgid "" msgstr "" -"Project-Id-Version: Cooked - Recipe Management 1.9.2\n" +"Project-Id-Version: Cooked - Recipe Management 1.9.3\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cooked\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-12-30T18:24:53-05:00\n" +"POT-Creation-Date: 2024-12-30T19:21:07-05:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" "X-Domain: cooked\n" diff --git a/package-lock.json b/package-lock.json index ff34e22..dccf798 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cooked", - "version": "1.9.2", + "version": "1.9.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cooked", - "version": "1.9.2", + "version": "1.9.3", "license": "ISC", "devDependencies": { "@playwright/test": "^1.48.2", diff --git a/package.json b/package.json index 9c0391c..026ac9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cooked", - "version": "1.9.2", + "version": "1.9.3", "description": "Cooked is the absolute best way to create & display recipes with WordPress. SEO optimized (rich snippets), galleries, cooking timers, printable recipes and much more.", "main": "index.js", "scripts": { diff --git a/readme.txt b/readme.txt index 1c81737..1bb9ae3 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: xjsv, boxystudio Tags: recipe, recipes, food, cooking, nutrition Requires at least: 4.7 Tested up to: 6.7.1 -Stable tag: 1.9.2 +Stable tag: 1.9.3 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -76,10 +76,13 @@ Be sure to check the [Cooked Documentation](https://github.com/XjSv/Cooked/wiki) == Upgrade Notice == -Version 1.9.2 includes a hotfix for the permalink structure that was introduced in version 1.9.0. Update is highly recommended! +Version 1.9.3 includes a hotfix for the permalink structure that was introduced in version 1.9.0. Update is highly recommended! == Changelog == += 1.9.3 = +* **FIX:** Fixed issue with the permalink structure specifically for the Browse Recipe page. + = 1.9.2 = * **FIX:** Fixed issue with the permalink structure specifically for the Browse Recipe page. diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index c6611a0..57d0e38 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'xjsv/cooked', - 'pretty_version' => '1.9.1', - 'version' => '1.9.1.0', + 'pretty_version' => '1.9.3', + 'version' => '1.9.3.0', 'reference' => null, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', @@ -20,8 +20,8 @@ 'dev_requirement' => false, ), 'xjsv/cooked' => array( - 'pretty_version' => '1.9.1', - 'version' => '1.9.1.0', + 'pretty_version' => '1.9.3', + 'version' => '1.9.3.0', 'reference' => null, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../',