WP Recipe Maker - Version 1.3.0

Version Description

  • Feature: Import from WP Ultimate Recipe
  • Feature: wpDiscuz support for comment ratings
  • Improvement: Use photo from Photo tab when importing from EasyRecipe
  • Improvement: Check for custom templates in both parent and child theme
  • Improvement: Different print system for better browser compatibility
  • Fix: Round average comment rating to 2 decimals
Download this release

Release Info

Developer BrechtVds
Plugin Icon 128x128 WP Recipe Maker
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.0 to 1.3.0

Files changed (35) hide show
  1. assets/css/admin/import.min.css +1 -1
  2. assets/css/admin/import.scss +8 -0
  3. assets/css/admin/modal.min.css +1 -1
  4. assets/css/admin/modal/_container.scss +363 -286
  5. assets/css/admin/modal/_recipe-details.scss +1 -0
  6. assets/css/admin/modal/_recipe-ingredients.scss +115 -114
  7. assets/css/admin/modal/_shortcode-builder.scss +1 -0
  8. assets/css/public/_comments.scss +1 -0
  9. assets/js/public/print.js +6 -31
  10. includes/admin/class-wprm-import-manager.php +5 -4
  11. includes/admin/import/class-wprm-import-easyrecipe.php +62 -8
  12. includes/admin/import/class-wprm-import-wpultimaterecipe.php +325 -0
  13. includes/admin/import/class-wprm-import.php +11 -2
  14. includes/admin/menu/class-wprm-admin-menu-faq.php +1 -1
  15. includes/class-wp-recipe-maker.php +1 -1
  16. includes/public/class-wprm-comment-rating.php +13 -0
  17. includes/public/class-wprm-print.php +27 -0
  18. includes/public/class-wprm-recipe.php +1 -1
  19. includes/public/class-wprm-shortcode.php +46 -0
  20. includes/public/class-wprm-template-manager.php +19 -3
  21. readme.txt +15 -5
  22. templates/admin/menu/faq/getting_started.php +4 -0
  23. templates/admin/menu/faq/support.php +2 -0
  24. templates/admin/menu/faq/whats_new.php +9 -0
  25. templates/admin/menu/import-recipes.php +15 -0
  26. templates/admin/modal/tabs/recipe-ingredients-instructions.php +4 -0
  27. templates/recipe/clean-print-with-image/clean-print-with-image.jpg +0 -0
  28. templates/recipe/clean-print-with-image/clean-print-with-image.png +0 -0
  29. templates/recipe/clean-print/clean-print.jpg +0 -0
  30. templates/recipe/clean-print/clean-print.png +0 -0
  31. templates/recipe/simple/simple.jpg +0 -0
  32. templates/recipe/simple/simple.png +0 -0
  33. templates/recipe/tastefully-simple/tastefully-simple.jpg +0 -0
  34. templates/recipe/tastefully-simple/tastefully-simple.png +0 -0
  35. wp-recipe-maker.php +1 -1
assets/css/admin/import.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-import p{max-width:600px}.wprm-import .wprm-import-recipes{width:100%}.wprm-import .wprm-import-recipes td:nth-child(1){width:2%}
1
+ .wprm-import p{max-width:600px}.wprm-import .wprm-import-error{max-width:600px;border:1px solid darkred;background-color:#ff9f9f;padding:10px}.wprm-import .wprm-import-recipes{width:100%}.wprm-import .wprm-import-recipes td:nth-child(1){width:2%}
assets/css/admin/import.scss CHANGED
@@ -2,6 +2,14 @@
2
  p {
3
  max-width: 600px;
4
  }
 
 
 
 
 
 
 
 
5
  .wprm-import-recipes {
6
  width: 100%;
7
 
2
  p {
3
  max-width: 600px;
4
  }
5
+
6
+ .wprm-import-error {
7
+ max-width: 600px;
8
+ border: 1px solid darkred;
9
+ background-color: #ff9f9f;
10
+ padding: 10px;
11
+ }
12
+
13
  .wprm-import-recipes {
14
  width: 100%;
15
 
assets/css/admin/modal.min.css CHANGED
@@ -1 +1 @@
1
- .select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-toolbar{z-index:100080}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,0.8);box-shadow:0 0 2px rgba(30,140,190,0.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:0.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-container{display:none}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:0.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;-webkit-transition:color 0.1s ease-in-out,background 0.1s ease-in-out;transition:color 0.1s ease-in-out,background 0.1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\f158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.7);box-shadow:0 5px 15px rgba(0,0,0,0.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:0.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router{display:none}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-frame .hidden{display:none}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router:not(.active){display:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-content-tab{margin:20px}.wprm-frame-content-tab:not(.active){display:none}.wprm-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100}.wprm-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width: 900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-title{left:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar{left:0}.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width: 640px), screen and (max-height: 400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width: 480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-details-form,.wprm-recipe-notes-form{max-width:600px}.wprm-recipe-details-form .wprm-recipe-details-form-container,.wprm-recipe-details-form .wprm-recipe-notes-form-container,.wprm-recipe-notes-form .wprm-recipe-details-form-container,.wprm-recipe-notes-form .wprm-recipe-notes-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-notes-form .wprm-recipe-details-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds,.wprm-recipe-notes-form .wprm-recipe-details-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-details-form label,.wprm-recipe-notes-form label{display:block;font-weight:bold;margin-bottom:5px}.wprm-recipe-details-form input,.wprm-recipe-notes-form input{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-details-form input#wprm-recipe-name,.wprm-recipe-notes-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input[type="number"],.wprm-recipe-notes-form input[type="number"]{max-width:50px}.wprm-recipe-details-form input#wprm-recipe-calories,.wprm-recipe-notes-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form input.select2_wprm-search__field,.wprm-recipe-notes-form input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-details-form select,.wprm-recipe-notes-form select{width:100%}.wprm-recipe-details-form textarea,.wprm-recipe-notes-form textarea{width:100%;resize:vertical}.wprm-recipe-details-form .wprm-recipe-image-preview,.wprm-recipe-notes-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img,.wprm-recipe-notes-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container,.wprm-recipe-notes-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width: 480px){.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds{display:block;width:100%}.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:0.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:bold;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:0.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}
1
+ .select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-toolbar{z-index:100080}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,0.8);box-shadow:0 0 2px rgba(30,140,190,0.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:0.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-hint{max-width:400px}.wprm-modal-hint .wprm-modal-hint-header{font-weight:bold;font-variant:small-caps}.wprm-modal-hint .wprm-modal-hint-text{font-style:italic}.wprm-modal-container{display:none}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:0.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;-webkit-transition:color 0.1s ease-in-out,background 0.1s ease-in-out;transition:color 0.1s ease-in-out,background 0.1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\f158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.7);box-shadow:0 5px 15px rgba(0,0,0,0.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:0.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router{display:none}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-frame .hidden{display:none}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router:not(.active){display:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-content-tab{margin:20px}.wprm-frame-content-tab:not(.active){display:none}.wprm-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100}.wprm-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width: 900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-title{left:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar{left:0}.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width: 640px), screen and (max-height: 400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width: 480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-details-form,.wprm-recipe-notes-form{max-width:600px}.wprm-recipe-details-form .wprm-recipe-details-form-container,.wprm-recipe-details-form .wprm-recipe-notes-form-container,.wprm-recipe-notes-form .wprm-recipe-details-form-container,.wprm-recipe-notes-form .wprm-recipe-notes-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-notes-form .wprm-recipe-details-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds,.wprm-recipe-notes-form .wprm-recipe-details-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-details-form label,.wprm-recipe-notes-form label{display:block;font-weight:bold;margin-bottom:5px}.wprm-recipe-details-form input,.wprm-recipe-notes-form input{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-details-form input#wprm-recipe-name,.wprm-recipe-notes-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input[type="number"],.wprm-recipe-notes-form input[type="number"]{max-width:50px}.wprm-recipe-details-form input#wprm-recipe-calories,.wprm-recipe-notes-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form input.select2_wprm-search__field,.wprm-recipe-notes-form input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-details-form select,.wprm-recipe-notes-form select{width:100%}.wprm-recipe-details-form textarea,.wprm-recipe-notes-form textarea{width:100%;resize:vertical}.wprm-recipe-details-form .wprm-recipe-image-preview,.wprm-recipe-notes-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img,.wprm-recipe-notes-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container,.wprm-recipe-notes-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width: 480px){.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds{display:block;width:100%}.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:0.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:bold;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:0.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}
assets/css/admin/modal/_container.scss CHANGED
@@ -1,383 +1,460 @@
 
 
1
  .select2_wprm-container {
2
- z-index: 100075;
3
- &.select2_wprm-container--focus .select2_wprm-selection {
4
- border-color: #5b9dd9;
5
- }
6
- li {
7
- margin: 0;
8
- }
9
- .select2_wprm-selection {
10
- border-color: #ddd;
11
- }
 
 
 
12
  }
 
13
  .medium-editor-toolbar {
14
- z-index: 100080;
15
  }
 
16
  .medium-editor-element {
17
- border: 1px solid #ddd;
18
- -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
19
- box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
20
- min-height: 68px;
21
- padding: 3px 5px;
22
- &:focus {
23
- border-color: #5b9dd9;
24
- -webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
25
- box-shadow: 0 0 2px rgba(30,140,190,.8);
26
- }
27
- &:after {
28
- font-style: normal;
29
- color: #999;
30
- opacity: 0.5;
31
- font-size: 14px;
32
- line-height: 28px;
33
- }
34
- p:first-child {
35
- margin-top: 0;
36
- }
37
- p:last-child {
38
- margin-bottom: 0;
39
- }
 
 
 
 
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  .wprm-modal-container {
42
- display: none;
43
  }
 
44
  .wprm-modal-backdrop {
45
- position: fixed;
46
- top: 0;
47
- left: 0;
48
- right: 0;
49
- bottom: 0;
50
- min-height: 360px;
51
- background: #000;
52
- opacity: 0.7;
53
- z-index: 100000;
54
  }
 
55
  .wprm-modal {
56
- position: fixed;
57
- top: 30px;
58
- left: 30px;
59
- right: 30px;
60
- bottom: 30px;
61
- z-index: 100050;
62
- * {
63
- -webkit-box-sizing: border-box;
64
- -moz-box-sizing: border-box;
65
- box-sizing: border-box;
66
- }
 
67
  }
 
68
  .wprm-modal-close {
69
- position: absolute;
70
- top: 0;
71
- right: 0;
72
- width: 50px;
73
- height: 50px;
74
- padding: 0;
75
- z-index: 1000;
76
- -webkit-transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
77
- transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
78
- .wprm-modal-icon:before {
79
- content: "\f158";
80
- font: 400 20px/1 dashicons;
81
- speak: none;
82
- vertical-align: middle;
83
- -webkit-font-smoothing: antialiased;
84
- -moz-osx-font-smoothing: grayscale;
85
- color: #666;
86
- }
 
87
  }
 
88
  .wprm-modal-content {
89
- position: absolute;
90
- top: 0;
91
- left: 0;
92
- right: 0;
93
- bottom: 0;
94
- overflow: auto;
95
- min-height: 300px;
96
- -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.7);
97
- box-shadow: 0 5px 15px rgba(0,0,0,.7);
98
- background: #fcfcfc;
99
- -webkit-font-smoothing: subpixel-antialiased;
100
-
101
- ::-webkit-input-placeholder {
102
- color: #999;
103
- opacity: 0.5;
104
- }
105
 
106
- :-moz-placeholder {
107
- color: #999;
108
- opacity: 0.5;
109
- }
110
 
111
- ::-moz-placeholder {
112
- color: #999;
113
- opacity: 0.5;
114
- }
115
 
116
- :-ms-input-placeholder {
117
- color: #999;
118
- opacity: 0.5;
119
- }
 
 
 
 
 
120
  }
 
121
  .wprm-frame {
122
- overflow: hidden;
123
- right: 0;
124
  }
 
125
  .wprm-frame,
126
  .wprm-frame-menu {
127
- position: absolute;
128
- left: 0;
129
- bottom: 0;
130
- top: 0;
131
  }
 
132
  .wprm-frame-menu {
133
- width: 200px;
134
- z-index: 150;
135
  }
 
136
  .wprm-frame-title .dashicons,
137
  .wprm-frame.hide-router .wprm-frame-router {
138
- display: none;
139
  }
 
140
  .wprm-frame-title {
141
- top: 0;
142
- height: 50px;
143
  }
 
144
  .wprm-frame-router,
145
  .wprm-frame-title {
146
- z-index: 200;
147
- left: 200px;
148
- position: absolute;
149
- right: 0;
150
  }
 
151
  .wprm-menu-item {
152
- -webkit-box-sizing: content-box;
153
- -moz-box-sizing: content-box;
154
- box-sizing: content-box;
155
  }
 
156
  .wprm-menu {
157
- position: absolute;
158
- left: 0;
159
- margin: 0;
160
- padding: 10px 0;
161
- border-right-width: 1px;
162
- border-right-style: solid;
163
- border-right-color: #ccc;
164
- user-select: none;
165
  }
 
166
  .wprm-menu,
167
  .wprm-sidebar {
168
- top: 0;
169
- bottom: 0;
170
- background: #f3f3f3;
171
- right: 0;
172
  }
 
173
  .wprm-menu .active,
174
  .wprm-menu .active:hover {
175
- color: #23282d;
176
- font-weight: 700;
177
  }
 
178
  .wprm-menu > a {
179
- display: block;
180
- position: relative;
181
- padding: 8px 20px;
182
- margin: 0;
183
- color: #0073aa;
184
  }
 
185
  .wprm-menu > a,
186
  .wprm-router > a {
187
- line-height: 18px;
188
- font-size: 14px;
189
- text-decoration: none;
190
  }
 
191
  .wprm-frame a {
192
- border-bottom: none;
193
- color: #0073aa;
194
  }
 
195
  .wprm-frame .hidden {
196
- display: none;
197
  }
 
198
  .wprm-menu .separator {
199
- height: 0;
200
- margin: 12px 20px;
201
- padding: 0;
202
- border-top: 1px solid #ddd;
203
  }
 
204
  .wprm-frame-title h1 {
205
- padding: 0 16px;
206
- font-size: 22px;
207
- line-height: 50px;
208
- margin: 0;
209
  }
 
210
  .wprm-frame-router {
211
- top: 50px;
212
- height: 36px;
213
  }
 
214
  .wprm-router {
215
- position: relative;
216
- padding: 0 6px;
217
- margin: 0;
218
- clear: both;
219
- user-select: none;
220
- &:not(.active) {
221
- display: none;
222
- }
 
223
  }
 
224
  .wprm-router > a {
225
- position: relative;
226
- float: left;
227
- padding: 8px 10px 9px;
228
- margin: 0;
229
- height: 18px;
230
  }
 
231
  .wprm-router a {
232
- -webkit-transition: none;
233
- transition: none;
234
  }
 
235
  .wprm-router > a:last-child {
236
- border-right: 0;
237
  }
 
238
  .wprm-router .active,
239
  .wprm-router > a.active:last-child {
240
- margin: -1px -1px 0;
241
- background: #fff;
242
- border: 1px solid #ddd;
243
- border-bottom: none;
244
  }
 
245
  .wprm-router .active,
246
  .wprm-router .active:hover {
247
- color: #32373c;
248
  }
 
249
  .wprm-frame-content {
250
- position: absolute;
251
- top: 84px;
252
- left: 200px;
253
- right: 0;
254
- bottom: 61px;
255
- height: auto;
256
- width: auto;
257
- margin: 0;
258
- overflow: auto;
259
- background: #fff;
260
- border-top: 1px solid #ddd;
261
- border-bottom: 1px solid #ddd;
262
  }
 
263
  .wprm-frame-content-tab {
264
- margin: 20px;
265
- &:not(.active) {
266
- display: none;
267
- }
 
268
  }
 
269
  .wprm-frame-toolbar {
270
- position: absolute;
271
- left: 200px;
272
- right: 0;
273
- bottom: 0;
274
- height: 60px;
275
- z-index: 100;
276
  }
 
277
  .wprm-toolbar {
278
- position: absolute;
279
- top: 0;
280
- left: 0;
281
- right: 0;
282
- z-index: 100;
283
- height: 60px;
284
- padding: 0 16px;
285
- border: 0 solid #ddd;
286
- overflow: hidden;
287
  }
 
288
  .wprm-modal-content .wprm-toolbar-primary.search-form {
289
- width: 33%;
290
  }
 
291
  .wprm-toolbar-primary {
292
- float: right;
293
- height: 100%;
294
  }
 
295
  .wprm-modal-content .wprm-toolbar-primary .wprm-button {
296
- float: right;
297
  }
 
298
  .wprm-toolbar-primary > .wprm-button,
299
  .wprm-toolbar-primary > .wprm-button-group {
300
- margin-left: 10px;
301
- float: left;
302
- margin-top: 15px;
303
  }
304
  @media only screen and (max-width: 900px) {
305
- .wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
306
- display: inline-block;
307
- line-height: 50px;
308
- }
309
- .wprm-frame:not(.hide-menu) .wprm-frame-menu {
310
- position: static;
311
- width: 0;
312
- }
313
- .wprm-frame:not(.hide-menu) .wprm-frame-title {
314
- left: 0;
315
- }
316
- .wprm-frame:not(.hide-menu) .wprm-frame-content,
317
- .wprm-frame:not(.hide-menu) .wprm-frame-router,
318
- .wprm-frame:not(.hide-menu) .wprm-frame-title,
319
- .wprm-frame:not(.hide-menu) .wprm-frame-toolbar {
320
- left: 0;
321
- }
322
- .wprm-frame:not(.hide-menu) .wprm-menu.visible {
323
- left: 0;
324
- }
325
- .wprm-frame:not(.hide-menu) .wprm-menu {
326
- width: auto;
327
- max-width: 80%;
328
- overflow: auto;
329
- z-index: 2000;
330
- top: 50px;
331
- left: -300px;
332
- right: auto;
333
- bottom: auto;
334
- padding: 5px 0;
335
- border: 1px solid #ccc;
336
- }
337
- .wprm-frame:not(.hide-menu) .wprm-menu > a.active {
338
- display: none;
339
- }
340
- .wprm-frame:not(.hide-menu) .wprm-menu > a {
341
- padding: 12px 16px;
342
- font-size: 16px;
343
- }
344
- .wprm-frame:not(.hide-menu) .wprm-menu .separator {
345
- margin: 5px 10px;
346
- }
347
- .wprm-frame:not(.hide-menu) .wprm-frame-title h1 {
348
- color: #0073aa;
349
- line-height: 3;
350
- font-size: 18px;
351
- float: left;
352
- cursor: pointer;
353
- }
 
 
 
 
 
 
 
 
 
354
  }
355
  @media only screen and (max-width: 640px), screen and (max-height: 400px) {
356
- .wprm-modal {
357
- position: fixed;
358
- top: 0;
359
- left: 0;
360
- right: 0;
361
- bottom: 0;
362
- .wprm-frame-title {
363
- height: 40px;
364
- }
365
  }
 
366
  }
367
  @media only screen and (max-width: 480px) {
368
- .wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
369
- line-height: 40px;
370
- }
371
- .wprm-frame-router,
372
- .wprm-frame:not(.hide-menu) .wprm-menu {
373
- top: 40px;
374
- }
375
- .wprm-frame:not(.hide-menu) .wprm-frame-title h1,
376
- .wprm-modal .wprm-frame-title h1 {
377
- font-size: 18px;
378
- line-height: 40px;
379
- }
380
- .wprm-frame-content {
381
- top: 74px;
382
- }
 
 
 
383
  }
1
+ // main: ../modal.scss
2
+
3
  .select2_wprm-container {
4
+ z-index: 100075;
5
+
6
+ &.select2_wprm-container--focus .select2_wprm-selection {
7
+ border-color: #5b9dd9;
8
+ }
9
+
10
+ li {
11
+ margin: 0;
12
+ }
13
+
14
+ .select2_wprm-selection {
15
+ border-color: #ddd;
16
+ }
17
  }
18
+
19
  .medium-editor-toolbar {
20
+ z-index: 100080;
21
  }
22
+
23
  .medium-editor-element {
24
+ border: 1px solid #ddd;
25
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
26
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
27
+ min-height: 68px;
28
+ padding: 3px 5px;
29
+
30
+ &:focus {
31
+ border-color: #5b9dd9;
32
+ -webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
33
+ box-shadow: 0 0 2px rgba(30,140,190,.8);
34
+ }
35
+
36
+ &:after {
37
+ font-style: normal;
38
+ color: #999;
39
+ opacity: 0.5;
40
+ font-size: 14px;
41
+ line-height: 28px;
42
+ }
43
+
44
+ p:first-child {
45
+ margin-top: 0;
46
+ }
47
+
48
+ p:last-child {
49
+ margin-bottom: 0;
50
+ }
51
  }
52
+
53
+ .wprm-modal-hint {
54
+ max-width: 400px;
55
+
56
+ .wprm-modal-hint-header {
57
+ font-weight: bold;
58
+ font-variant: small-caps;
59
+ }
60
+
61
+ .wprm-modal-hint-text {
62
+ font-style: italic;
63
+ }
64
+ }
65
+ /* Media Modal Replication */
66
  .wprm-modal-container {
67
+ display: none;
68
  }
69
+
70
  .wprm-modal-backdrop {
71
+ position: fixed;
72
+ top: 0;
73
+ left: 0;
74
+ right: 0;
75
+ bottom: 0;
76
+ min-height: 360px;
77
+ background: #000;
78
+ opacity: 0.7;
79
+ z-index: 100000;
80
  }
81
+
82
  .wprm-modal {
83
+ position: fixed;
84
+ top: 30px;
85
+ left: 30px;
86
+ right: 30px;
87
+ bottom: 30px;
88
+ z-index: 100050;
89
+
90
+ * {
91
+ -webkit-box-sizing: border-box;
92
+ -moz-box-sizing: border-box;
93
+ box-sizing: border-box;
94
+ }
95
  }
96
+
97
  .wprm-modal-close {
98
+ position: absolute;
99
+ top: 0;
100
+ right: 0;
101
+ width: 50px;
102
+ height: 50px;
103
+ padding: 0;
104
+ z-index: 1000;
105
+ -webkit-transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
106
+ transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
107
+
108
+ .wprm-modal-icon:before {
109
+ content: "\f158";
110
+ font: 400 20px/1 dashicons;
111
+ speak: none;
112
+ vertical-align: middle;
113
+ -webkit-font-smoothing: antialiased;
114
+ -moz-osx-font-smoothing: grayscale;
115
+ color: #666;
116
+ }
117
  }
118
+
119
  .wprm-modal-content {
120
+ position: absolute;
121
+ top: 0;
122
+ left: 0;
123
+ right: 0;
124
+ bottom: 0;
125
+ overflow: auto;
126
+ min-height: 300px;
127
+ -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.7);
128
+ box-shadow: 0 5px 15px rgba(0,0,0,.7);
129
+ background: #fcfcfc;
130
+ -webkit-font-smoothing: subpixel-antialiased;
 
 
 
 
 
131
 
132
+ ::-webkit-input-placeholder {
133
+ color: #999;
134
+ opacity: 0.5;
135
+ }
136
 
137
+ :-moz-placeholder {
138
+ color: #999;
139
+ opacity: 0.5;
140
+ }
141
 
142
+ ::-moz-placeholder {
143
+ color: #999;
144
+ opacity: 0.5;
145
+ }
146
+
147
+ :-ms-input-placeholder {
148
+ color: #999;
149
+ opacity: 0.5;
150
+ }
151
  }
152
+
153
  .wprm-frame {
154
+ overflow: hidden;
155
+ right: 0;
156
  }
157
+
158
  .wprm-frame,
159
  .wprm-frame-menu {
160
+ position: absolute;
161
+ left: 0;
162
+ bottom: 0;
163
+ top: 0;
164
  }
165
+
166
  .wprm-frame-menu {
167
+ width: 200px;
168
+ z-index: 150;
169
  }
170
+
171
  .wprm-frame-title .dashicons,
172
  .wprm-frame.hide-router .wprm-frame-router {
173
+ display: none;
174
  }
175
+
176
  .wprm-frame-title {
177
+ top: 0;
178
+ height: 50px;
179
  }
180
+
181
  .wprm-frame-router,
182
  .wprm-frame-title {
183
+ z-index: 200;
184
+ left: 200px;
185
+ position: absolute;
186
+ right: 0;
187
  }
188
+
189
  .wprm-menu-item {
190
+ -webkit-box-sizing: content-box;
191
+ -moz-box-sizing: content-box;
192
+ box-sizing: content-box;
193
  }
194
+
195
  .wprm-menu {
196
+ position: absolute;
197
+ left: 0;
198
+ margin: 0;
199
+ padding: 10px 0;
200
+ border-right-width: 1px;
201
+ border-right-style: solid;
202
+ border-right-color: #ccc;
203
+ user-select: none;
204
  }
205
+
206
  .wprm-menu,
207
  .wprm-sidebar {
208
+ top: 0;
209
+ bottom: 0;
210
+ background: #f3f3f3;
211
+ right: 0;
212
  }
213
+
214
  .wprm-menu .active,
215
  .wprm-menu .active:hover {
216
+ color: #23282d;
217
+ font-weight: 700;
218
  }
219
+
220
  .wprm-menu > a {
221
+ display: block;
222
+ position: relative;
223
+ padding: 8px 20px;
224
+ margin: 0;
225
+ color: #0073aa;
226
  }
227
+
228
  .wprm-menu > a,
229
  .wprm-router > a {
230
+ line-height: 18px;
231
+ font-size: 14px;
232
+ text-decoration: none;
233
  }
234
+
235
  .wprm-frame a {
236
+ border-bottom: none;
237
+ color: #0073aa;
238
  }
239
+
240
  .wprm-frame .hidden {
241
+ display: none;
242
  }
243
+
244
  .wprm-menu .separator {
245
+ height: 0;
246
+ margin: 12px 20px;
247
+ padding: 0;
248
+ border-top: 1px solid #ddd;
249
  }
250
+
251
  .wprm-frame-title h1 {
252
+ padding: 0 16px;
253
+ font-size: 22px;
254
+ line-height: 50px;
255
+ margin: 0;
256
  }
257
+
258
  .wprm-frame-router {
259
+ top: 50px;
260
+ height: 36px;
261
  }
262
+
263
  .wprm-router {
264
+ position: relative;
265
+ padding: 0 6px;
266
+ margin: 0;
267
+ clear: both;
268
+ user-select: none;
269
+
270
+ &:not(.active) {
271
+ display: none;
272
+ }
273
  }
274
+
275
  .wprm-router > a {
276
+ position: relative;
277
+ float: left;
278
+ padding: 8px 10px 9px;
279
+ margin: 0;
280
+ height: 18px;
281
  }
282
+
283
  .wprm-router a {
284
+ -webkit-transition: none;
285
+ transition: none;
286
  }
287
+
288
  .wprm-router > a:last-child {
289
+ border-right: 0;
290
  }
291
+
292
  .wprm-router .active,
293
  .wprm-router > a.active:last-child {
294
+ margin: -1px -1px 0;
295
+ background: #fff;
296
+ border: 1px solid #ddd;
297
+ border-bottom: none;
298
  }
299
+
300
  .wprm-router .active,
301
  .wprm-router .active:hover {
302
+ color: #32373c;
303
  }
304
+
305
  .wprm-frame-content {
306
+ position: absolute;
307
+ top: 84px;
308
+ left: 200px;
309
+ right: 0;
310
+ bottom: 61px;
311
+ height: auto;
312
+ width: auto;
313
+ margin: 0;
314
+ overflow: auto;
315
+ background: #fff;
316
+ border-top: 1px solid #ddd;
317
+ border-bottom: 1px solid #ddd;
318
  }
319
+
320
  .wprm-frame-content-tab {
321
+ margin: 20px;
322
+
323
+ &:not(.active) {
324
+ display: none;
325
+ }
326
  }
327
+
328
  .wprm-frame-toolbar {
329
+ position: absolute;
330
+ left: 200px;
331
+ right: 0;
332
+ bottom: 0;
333
+ height: 60px;
334
+ z-index: 100;
335
  }
336
+
337
  .wprm-toolbar {
338
+ position: absolute;
339
+ top: 0;
340
+ left: 0;
341
+ right: 0;
342
+ z-index: 100;
343
+ height: 60px;
344
+ padding: 0 16px;
345
+ border: 0 solid #ddd;
346
+ overflow: hidden;
347
  }
348
+
349
  .wprm-modal-content .wprm-toolbar-primary.search-form {
350
+ width: 33%;
351
  }
352
+
353
  .wprm-toolbar-primary {
354
+ float: right;
355
+ height: 100%;
356
  }
357
+
358
  .wprm-modal-content .wprm-toolbar-primary .wprm-button {
359
+ float: right;
360
  }
361
+
362
  .wprm-toolbar-primary > .wprm-button,
363
  .wprm-toolbar-primary > .wprm-button-group {
364
+ margin-left: 10px;
365
+ float: left;
366
+ margin-top: 15px;
367
  }
368
  @media only screen and (max-width: 900px) {
369
+ .wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
370
+ display: inline-block;
371
+ line-height: 50px;
372
+ }
373
+
374
+ .wprm-frame:not(.hide-menu) .wprm-frame-menu {
375
+ position: static;
376
+ width: 0;
377
+ }
378
+
379
+ .wprm-frame:not(.hide-menu) .wprm-frame-title {
380
+ left: 0;
381
+ }
382
+
383
+ .wprm-frame:not(.hide-menu) .wprm-frame-content,
384
+ .wprm-frame:not(.hide-menu) .wprm-frame-router,
385
+ .wprm-frame:not(.hide-menu) .wprm-frame-title,
386
+ .wprm-frame:not(.hide-menu) .wprm-frame-toolbar {
387
+ left: 0;
388
+ }
389
+
390
+ .wprm-frame:not(.hide-menu) .wprm-menu.visible {
391
+ left: 0;
392
+ }
393
+
394
+ .wprm-frame:not(.hide-menu) .wprm-menu {
395
+ width: auto;
396
+ max-width: 80%;
397
+ overflow: auto;
398
+ z-index: 2000;
399
+ top: 50px;
400
+ left: -300px;
401
+ right: auto;
402
+ bottom: auto;
403
+ padding: 5px 0;
404
+ border: 1px solid #ccc;
405
+ }
406
+
407
+ .wprm-frame:not(.hide-menu) .wprm-menu > a.active {
408
+ display: none;
409
+ }
410
+
411
+ .wprm-frame:not(.hide-menu) .wprm-menu > a {
412
+ padding: 12px 16px;
413
+ font-size: 16px;
414
+ }
415
+
416
+ .wprm-frame:not(.hide-menu) .wprm-menu .separator {
417
+ margin: 5px 10px;
418
+ }
419
+
420
+ .wprm-frame:not(.hide-menu) .wprm-frame-title h1 {
421
+ color: #0073aa;
422
+ line-height: 3;
423
+ font-size: 18px;
424
+ float: left;
425
+ cursor: pointer;
426
+ }
427
  }
428
  @media only screen and (max-width: 640px), screen and (max-height: 400px) {
429
+ .wprm-modal {
430
+ position: fixed;
431
+ top: 0;
432
+ left: 0;
433
+ right: 0;
434
+ bottom: 0;
435
+
436
+ .wprm-frame-title {
437
+ height: 40px;
438
  }
439
+ }
440
  }
441
  @media only screen and (max-width: 480px) {
442
+ .wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
443
+ line-height: 40px;
444
+ }
445
+
446
+ .wprm-frame-router,
447
+ .wprm-frame:not(.hide-menu) .wprm-menu {
448
+ top: 40px;
449
+ }
450
+
451
+ .wprm-frame:not(.hide-menu) .wprm-frame-title h1,
452
+ .wprm-modal .wprm-frame-title h1 {
453
+ font-size: 18px;
454
+ line-height: 40px;
455
+ }
456
+
457
+ .wprm-frame-content {
458
+ top: 74px;
459
+ }
460
  }
assets/css/admin/modal/_recipe-details.scss CHANGED
@@ -1,3 +1,4 @@
 
1
  .wprm-recipe-details-form,
2
  .wprm-recipe-notes-form {
3
  max-width: 600px;
1
+ // main: ../modal.scss
2
  .wprm-recipe-details-form,
3
  .wprm-recipe-notes-form {
4
  max-width: 600px;
assets/css/admin/modal/_recipe-ingredients.scss CHANGED
@@ -1,119 +1,120 @@
 
1
  .wprm-recipe-ingredients-form,
2
  .wprm-recipe-instructions-form {
3
- max-width: 750px;
4
- margin-bottom: 15px;
5
- input {
6
- margin: 0;
7
- width: 100%;
8
- height: 34px;
9
- line-height: 34px;
10
- }
11
- textarea {
12
- width: 100%;
13
- resize: vertical;
14
- }
15
- ::-webkit-input-placeholder {
16
- color: #999;
17
- opacity: 0.5;
18
- }
19
- :-moz-placeholder {
20
- color: #999;
21
- opacity: 0.5;
22
- }
23
- ::-moz-placeholder {
24
- color: #999;
25
- opacity: 0.5;
26
- }
27
- :-ms-input-placeholder {
28
- color: #999;
29
- opacity: 0.5;
30
- }
31
- table {
32
- width: 100%;
33
- &.wprm-recipe-ingredients-container {
34
- th {
35
- text-align: left;
36
- &:nth-child(1),
37
- &:nth-child(6) {
38
- width: 5%;
39
- text-align: center;
40
- }
41
- &:nth-child(2) {
42
- width: 10%;
43
- }
44
- &:nth-child(3) {
45
- width: 15%;
46
- }
47
- &:nth-child(4) {
48
- width: 40%;
49
- }
50
- &:nth-child(5) {
51
- width: 25%;
52
- }
53
- }
54
- }
55
- &.wprm-recipe-instructions-container {
56
- th {
57
- text-align: left;
58
- &:nth-child(1),
59
- &:nth-child(4) {
60
- width: 5%;
61
- text-align: center;
62
- }
63
- &:nth-child(2) {
64
- width: 65%;
65
- }
66
- &:nth-child(3) {
67
- width: 25%;
68
- }
69
- }
70
- }
71
- .wprm-recipe-ingredients-placeholder,
72
- .wprm-recipe-instructions-placeholder {
73
- display: none;
74
- }
75
- td {
76
- text-align: left;
77
- vertical-align: top;
78
- &:first-child,
79
- &:last-child {
80
- text-align: center;
81
- vertical-align: middle;
82
- }
83
- }
84
- }
85
- .ui-sortable-helper {
86
- display: table;
87
- .wprm-recipe-instruction-text {
88
- min-width: 200px;
89
- }
90
- }
91
- .wprm-recipe-ingredients-instructions-sort {
92
- cursor: move;
93
- }
94
- .wprm-recipe-ingredients-instructions-delete {
95
- cursor: pointer;
96
- }
97
- .wprm-recipe-ingredients-instructions-delete,
98
- .wprm-recipe-ingredients-instructions-sort {
99
- color: #999;
100
- opacity: 0.5;
101
- &:hover {
102
- color: #444;
103
- opacity: 1;
104
- }
105
- }
106
- .wprm-recipe-ingredients-actions,
107
- .wprm-recipe-instructions-actions {
108
- margin: 10px;
109
- }
110
- .wprm-recipe-image-preview {
111
- max-width: 75px;
112
 
113
- img {
114
- max-width: 100%;
115
- height: auto;
116
- }
117
- }
118
  }
119
  @media only screen and (max-width: 480px) {}
1
+ // main: ../modal.scss
2
  .wprm-recipe-ingredients-form,
3
  .wprm-recipe-instructions-form {
4
+ max-width: 750px;
5
+ margin-bottom: 15px;
6
+ input {
7
+ margin: 0;
8
+ width: 100%;
9
+ height: 34px;
10
+ line-height: 34px;
11
+ }
12
+ textarea {
13
+ width: 100%;
14
+ resize: vertical;
15
+ }
16
+ ::-webkit-input-placeholder {
17
+ color: #999;
18
+ opacity: 0.5;
19
+ }
20
+ :-moz-placeholder {
21
+ color: #999;
22
+ opacity: 0.5;
23
+ }
24
+ ::-moz-placeholder {
25
+ color: #999;
26
+ opacity: 0.5;
27
+ }
28
+ :-ms-input-placeholder {
29
+ color: #999;
30
+ opacity: 0.5;
31
+ }
32
+ table {
33
+ width: 100%;
34
+ &.wprm-recipe-ingredients-container {
35
+ th {
36
+ text-align: left;
37
+ &:nth-child(1),
38
+ &:nth-child(6) {
39
+ width: 5%;
40
+ text-align: center;
41
+ }
42
+ &:nth-child(2) {
43
+ width: 10%;
44
+ }
45
+ &:nth-child(3) {
46
+ width: 15%;
47
+ }
48
+ &:nth-child(4) {
49
+ width: 40%;
50
+ }
51
+ &:nth-child(5) {
52
+ width: 25%;
53
+ }
54
+ }
55
+ }
56
+ &.wprm-recipe-instructions-container {
57
+ th {
58
+ text-align: left;
59
+ &:nth-child(1),
60
+ &:nth-child(4) {
61
+ width: 5%;
62
+ text-align: center;
63
+ }
64
+ &:nth-child(2) {
65
+ width: 65%;
66
+ }
67
+ &:nth-child(3) {
68
+ width: 25%;
69
+ }
70
+ }
71
+ }
72
+ .wprm-recipe-ingredients-placeholder,
73
+ .wprm-recipe-instructions-placeholder {
74
+ display: none;
75
+ }
76
+ td {
77
+ text-align: left;
78
+ vertical-align: top;
79
+ &:first-child,
80
+ &:last-child {
81
+ text-align: center;
82
+ vertical-align: middle;
83
+ }
84
+ }
85
+ }
86
+ .ui-sortable-helper {
87
+ display: table;
88
+ .wprm-recipe-instruction-text {
89
+ min-width: 200px;
90
+ }
91
+ }
92
+ .wprm-recipe-ingredients-instructions-sort {
93
+ cursor: move;
94
+ }
95
+ .wprm-recipe-ingredients-instructions-delete {
96
+ cursor: pointer;
97
+ }
98
+ .wprm-recipe-ingredients-instructions-delete,
99
+ .wprm-recipe-ingredients-instructions-sort {
100
+ color: #999;
101
+ opacity: 0.5;
102
+ &:hover {
103
+ color: #444;
104
+ opacity: 1;
105
+ }
106
+ }
107
+ .wprm-recipe-ingredients-actions,
108
+ .wprm-recipe-instructions-actions {
109
+ margin: 10px;
110
+ }
111
+ .wprm-recipe-image-preview {
112
+ max-width: 75px;
113
 
114
+ img {
115
+ max-width: 100%;
116
+ height: auto;
117
+ }
118
+ }
119
  }
120
  @media only screen and (max-width: 480px) {}
assets/css/admin/modal/_shortcode-builder.scss CHANGED
@@ -1,3 +1,4 @@
 
1
  .wprm-shortcode-builder {
2
  .wprm-shortcode-builder-container {
3
  margin-bottom: 15px;
1
+ // main: ../modal.scss
2
  .wprm-shortcode-builder {
3
  .wprm-shortcode-builder-container {
4
  margin-bottom: 15px;
assets/css/public/_comments.scss CHANGED
@@ -1,3 +1,4 @@
 
1
  .comment-form-wprm-rating {
2
  display: none;
3
 
1
+ // main: public.scss
2
  .comment-form-wprm-rating {
3
  display: none;
4
 
assets/js/public/print.js CHANGED
@@ -1,38 +1,13 @@
1
  var wprm = wprm || {};
2
 
3
- wprm.print_html = function(html) {
4
- var iframe = document.createElement('iframe');
5
-
6
- iframe.style.visibility = 'hidden';
7
- iframe.style.position = 'fixed';
8
- iframe.style.right = '0';
9
- iframe.style.bottom = '0';
10
-
11
- document.body.appendChild(iframe);
12
- iframe.contentWindow.document.open();
13
- iframe.contentWindow.document.write(html);
14
- iframe.contentWindow.document.close();
15
-
16
- iframe.contentWindow.focus(); // Required for IE
17
- iframe.contentWindow.print();
18
-
19
- setTimeout(function() {
20
- jQuery(iframe).remove();
21
- }, 500);
22
- };
23
-
24
  wprm.print_recipe = function(recipe_id) {
25
- var data = {
26
- action: 'wprm_print_recipe',
27
- security: wprm_public.nonce,
28
- recipe_id: recipe_id
 
 
29
  };
30
-
31
- jQuery.post(wprm_public.ajax_url, data, function(out) {
32
- if (out.success) {
33
- wprm.print_html(out.data.html);
34
- }
35
- }, 'json');
36
  };
37
 
38
  jQuery(document).ready(function($) {
1
  var wprm = wprm || {};
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  wprm.print_recipe = function(recipe_id) {
4
+ var print_window = window.open('/wprm_print/' + recipe_id, '_blank');
5
+ print_window.onload = function() {
6
+ print_window.focus();
7
+ print_window.document.title = document.title;
8
+ print_window.history.pushState('', 'Print Recipe', location.href.replace(location.hash,""));
9
+ print_window.print();
10
  };
 
 
 
 
 
 
11
  };
12
 
13
  jQuery(document).ready(function($) {
includes/admin/class-wprm-import-manager.php CHANGED
@@ -93,7 +93,7 @@ class WPRM_Import_Manager {
93
  $importer = self::get_importer( $importer_uid );
94
 
95
  if ( $importer && count( $recipes ) > 0 ) {
96
- self::import_recipes( $importer, $recipes );
97
  }
98
  }
99
  wp_safe_redirect( admin_url( 'admin.php?page=wprm_import_overview' ) );
@@ -128,13 +128,14 @@ class WPRM_Import_Manager {
128
  * @since 1.0.0
129
  * @param object $importer Importer to use for importing.
130
  * @param array $recipes IDs of recipes to import.
 
131
  */
132
- public static function import_recipes( $importer, $recipes ) {
133
  // Reverse sort by ID to make sure multiple recipes in the same post are handled correctly.
134
  arsort( $recipes );
135
 
136
  foreach ( $recipes as $import_recipe_id ) {
137
- $imported_recipe = $importer->get_recipe( $import_recipe_id );
138
 
139
  if ( $imported_recipe ) {
140
  $imported_recipe['import_source'] = $importer->get_uid();
@@ -151,7 +152,7 @@ class WPRM_Import_Manager {
151
  $recipe_id = WPRM_Recipe_Saver::create_recipe( $recipe );
152
  }
153
 
154
- $importer->replace_recipe( $import_recipe_id, $recipe_id );
155
  }
156
  }
157
  }
93
  $importer = self::get_importer( $importer_uid );
94
 
95
  if ( $importer && count( $recipes ) > 0 ) {
96
+ self::import_recipes( $importer, $recipes, $_POST ); // Input var okay.
97
  }
98
  }
99
  wp_safe_redirect( admin_url( 'admin.php?page=wprm_import_overview' ) );
128
  * @since 1.0.0
129
  * @param object $importer Importer to use for importing.
130
  * @param array $recipes IDs of recipes to import.
131
+ * @param array $post_data POST data passed along when submitting the form.
132
  */
133
+ public static function import_recipes( $importer, $recipes, $post_data ) {
134
  // Reverse sort by ID to make sure multiple recipes in the same post are handled correctly.
135
  arsort( $recipes );
136
 
137
  foreach ( $recipes as $import_recipe_id ) {
138
+ $imported_recipe = $importer->get_recipe( $import_recipe_id, $post_data );
139
 
140
  if ( $imported_recipe ) {
141
  $imported_recipe['import_source'] = $importer->get_uid();
152
  $recipe_id = WPRM_Recipe_Saver::create_recipe( $recipe );
153
  }
154
 
155
+ $importer->replace_recipe( $import_recipe_id, $recipe_id, $post_data );
156
  }
157
  }
158
  }
includes/admin/import/class-wprm-import-easyrecipe.php CHANGED
@@ -36,6 +36,15 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
36
  return 'EasyRecipe';
37
  }
38
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Get a list of recipes that are available to import.
41
  *
@@ -103,8 +112,9 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
103
  *
104
  * @since 1.0.0
105
  * @param mixed $id ID of the recipe we want to import.
 
106
  */
107
- public function get_recipe( $id ) {
108
  if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
109
  require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
110
  libxml_use_internal_errors( true );
@@ -127,9 +137,19 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
127
  );
128
 
129
  // Featured Image.
130
- $images = $this->get_easyrecipe_images( $recipe_html->innertext );
131
- if ( isset( $images[0] ) ) {
132
- $recipe['image_id'] = $images[0]['id'];
 
 
 
 
 
 
 
 
 
 
133
  }
134
 
135
  // Simple matching.
@@ -290,8 +310,9 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
290
  * @since 1.0.0
291
  * @param mixed $id ID of the recipe we want replace.
292
  * @param mixed $wprm_id ID of the WPRM recipe to replace with.
 
293
  */
294
- public function replace_recipe( $id, $wprm_id ) {
295
  if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
296
  require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
297
  libxml_use_internal_errors( true );
@@ -373,7 +394,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
373
  preg_match( '/src=\"([^\"]*)\"/i', $easyrecipe_image, $image );
374
 
375
  if ( isset( $image[1] ) ) {
376
- $id = $this->get_attachment_id_from_url( $image[1] );
377
  $image = wp_get_attachment_image_src( $id, array( 9999, 150 ) );
378
 
379
  $images[] = array(
@@ -387,6 +408,39 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
387
  return $images;
388
  }
389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  /**
391
  * Get image attachment ID from a given URL.
392
  * Source: https://philipnewcomer.net/2012/11/get-the-attachment-id-from-an-image-url-in-wordpress/
@@ -394,7 +448,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
394
  * @since 1.0.0
395
  * @param mixed $attachment_url Image URL.
396
  */
397
- function get_attachment_id_from_url( $attachment_url = '' ) {
398
  global $wpdb;
399
  $attachment_id = false;
400
 
@@ -461,7 +515,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
461
  $string = str_ireplace( '[/u]', '</span>', $string );
462
  $string = str_ireplace( '[br]', '<br/>', $string );
463
 
464
- if( $images ) {
465
  $string = preg_replace( '/\[img([^\]]*)]/i', "<img$1 />", $string );
466
  } else {
467
  $string = preg_replace( '/\[img[^\]]*]/i', '', $string );
36
  return 'EasyRecipe';
37
  }
38
 
39
+ /**
40
+ * Get HTML for the import settings.
41
+ *
42
+ * @since 1.3.0
43
+ */
44
+ public function get_settings_html() {
45
+ return '';
46
+ }
47
+
48
  /**
49
  * Get a list of recipes that are available to import.
50
  *
112
  *
113
  * @since 1.0.0
114
  * @param mixed $id ID of the recipe we want to import.
115
+ * @param array $post_data POST data passed along when submitting the form.
116
  */
117
+ public function get_recipe( $id, $post_data ) {
118
  if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
119
  require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
120
  libxml_use_internal_errors( true );
137
  );
138
 
139
  // Featured Image.
140
+ // Check for image set on "Photo" tab.
141
+ $easyrecipe_field = $recipe_html->find( 'link[itemprop=image]', 0 );
142
+ $image_url = is_object( $easyrecipe_field ) ? $easyrecipe_field->attr['href'] : '';
143
+ $image_id = $this->get_or_upload_attachment( $post_id, $image_url );
144
+
145
+ if ( $image_id ) {
146
+ $recipe['image_id'] = $image_id;
147
+ } else {
148
+ // Use first image added to recipe.
149
+ $images = $this->get_easyrecipe_images( $recipe_html->innertext );
150
+ if ( isset( $images[0] ) ) {
151
+ $recipe['image_id'] = $images[0]['id'];
152
+ }
153
  }
154
 
155
  // Simple matching.
310
  * @since 1.0.0
311
  * @param mixed $id ID of the recipe we want replace.
312
  * @param mixed $wprm_id ID of the WPRM recipe to replace with.
313
+ * @param array $post_data POST data passed along when submitting the form.
314
  */
315
+ public function replace_recipe( $id, $wprm_id, $post_data ) {
316
  if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
317
  require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
318
  libxml_use_internal_errors( true );
394
  preg_match( '/src=\"([^\"]*)\"/i', $easyrecipe_image, $image );
395
 
396
  if ( isset( $image[1] ) ) {
397
+ $id = $this->get_or_upload_attachment( $post_id, $image[1] );
398
  $image = wp_get_attachment_image_src( $id, array( 9999, 150 ) );
399
 
400
  $images[] = array(
408
  return $images;
409
  }
410
 
411
+ /**
412
+ * Get image attachment ID from a given URL or sideload the image if not on the website.
413
+ *
414
+ * @since 1.3.0
415
+ * @param int $post_id Post to associate the image with.
416
+ * @param mixed $url Image URL.
417
+ */
418
+ private function get_or_upload_attachment( $post_id, $url ) {
419
+ $image_id = $this->get_attachment_id_from_url( $url );
420
+
421
+ if ( $image_id ) {
422
+ return $image_id;
423
+ } else {
424
+ $media = media_sideload_image( $url, $post_id );
425
+
426
+ $attachments = get_posts( array(
427
+ 'numberposts' => '1',
428
+ 'post_parent' => $post_id,
429
+ 'post_type' => 'attachment',
430
+ 'post_mime_type' => 'image',
431
+ 'orderby' => 'post_date',
432
+ 'order' => 'DESC',
433
+ )
434
+ );
435
+
436
+ if ( count( $attachments ) > 0 ) {
437
+ return $attachments[0]->ID;
438
+ }
439
+ }
440
+
441
+ return false;
442
+ }
443
+
444
  /**
445
  * Get image attachment ID from a given URL.
446
  * Source: https://philipnewcomer.net/2012/11/get-the-attachment-id-from-an-image-url-in-wordpress/
448
  * @since 1.0.0
449
  * @param mixed $attachment_url Image URL.
450
  */
451
+ private function get_attachment_id_from_url( $attachment_url = '' ) {
452
  global $wpdb;
453
  $attachment_id = false;
454
 
515
  $string = str_ireplace( '[/u]', '</span>', $string );
516
  $string = str_ireplace( '[br]', '<br/>', $string );
517
 
518
+ if ( $images ) {
519
  $string = preg_replace( '/\[img([^\]]*)]/i', "<img$1 />", $string );
520
  } else {
521
  $string = preg_replace( '/\[img[^\]]*]/i', '', $string );
includes/admin/import/class-wprm-import-wpultimaterecipe.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Responsible for importing WP Ultimate Recipe recipes.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.3.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/includes/admin/import
10
+ */
11
+
12
+ /**
13
+ * Responsible for importing WP Ultimate Recipe recipes.
14
+ *
15
+ * @since 1.3.0
16
+ * @package WP_Recipe_Maker
17
+ * @subpackage WP_Recipe_Maker/includes/admin/import
18
+ * @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
19
+ */
20
+ class WPRM_Import_Wpultimaterecipe extends WPRM_Import {
21
+ /**
22
+ * Get the UID of this import source.
23
+ *
24
+ * @since 1.3.0
25
+ */
26
+ public function get_uid() {
27
+ return 'wpultimaterecipe';
28
+ }
29
+
30
+ /**
31
+ * Get the name of this import source.
32
+ *
33
+ * @since 1.3.0
34
+ */
35
+ public function get_name() {
36
+ return 'WP Ultimate Recipe';
37
+ }
38
+
39
+ /**
40
+ * Get HTML for the import settings.
41
+ *
42
+ * @since 1.3.0
43
+ */
44
+ public function get_settings_html() {
45
+ $html = '<h4>Import Type</h4>';
46
+ $html .= '<input type="radio" name="wpurp-import-type" value="convert" id="wpurp-import-type-convert" /> <label for="wpurp-import-type-convert">Convert to posts</label>';
47
+ $html .= "<p>Use this if you've been treating your WP Ultimate Recipe recipes like posts. The recipe post type will be converted to a regular post that includes a WP Recipe Maker recipe. Every occurrence of the WP Ultimate Recipe recipe shortcode will be replaced as well.</p>";
48
+ $html .= '<input type="radio" name="wpurp-import-type" value="hide" id="wpurp-import-type-hide" /> <label for="wpurp-import-type-hide">No conversion to posts needed</label>';
49
+ $html .= '<p>Use this if you were only including WP Ultimate Recipe recipes into regular posts/pages instead of having the recipe post type act like a regular post. The new WP Recipe Maker recipes will only show up wherever you used the WP Ultimate Recipe recipe shortcode.</p>';
50
+ $html .= '<h4>Recipe Tags</h4>';
51
+
52
+ $wpurp_taxonomies = get_option( 'wpurp_taxonomies', array() );
53
+ unset( $wpurp_taxonomies['ingredient'] );
54
+
55
+ $html .= '<label for="wpurp-tags-course">Courses:</label> ';
56
+ $html .= '<select name="wpurp-tags-course" id="wpurp-tags-course">';
57
+ $html .= "<option value=\"\">Don't import anything for this tag</option>";
58
+ foreach ( $wpurp_taxonomies as $name => $options ) {
59
+ $selected = 'course' === $name ? ' selected="selected"' : '';
60
+ $html .= '<option value="' . esc_attr( $name ) . '"' . esc_html( $selected ) . '>' . esc_html( $options['labels']['name'] ) . '</option>';
61
+ }
62
+ $html .= '</select>';
63
+ $html .= '<br />';
64
+
65
+ $html .= '<label for="wpurp-tags-cuisine">Cuisines:</label> ';
66
+ $html .= '<select name="wpurp-tags-cuisine" id="wpurp-tags-cuisine">';
67
+ $html .= "<option value=\"\">Don't import anything for this tag</option>";
68
+ foreach ( $wpurp_taxonomies as $name => $options ) {
69
+ $selected = 'cuisine' === $name ? ' selected="selected"' : '';
70
+ $html .= '<option value="' . esc_attr( $name ) . '"' . esc_html( $selected ) . '>' . esc_html( $options['labels']['name'] ) . '</option>';
71
+ }
72
+ $html .= '</select>';
73
+
74
+ return $html;
75
+ }
76
+
77
+ /**
78
+ * Get a list of recipes that are available to import.
79
+ *
80
+ * @since 1.3.0
81
+ */
82
+ public function get_recipes() {
83
+ $recipes = array();
84
+
85
+ // Loop through all posts.
86
+ $limit = 100;
87
+ $offset = 0;
88
+
89
+ while ( true ) {
90
+ $args = array(
91
+ 'post_type' => 'recipe',
92
+ 'post_status' => 'any',
93
+ 'orderby' => 'date',
94
+ 'order' => 'DESC',
95
+ 'posts_per_page' => $limit,
96
+ 'offset' => $offset,
97
+ );
98
+
99
+ $query = new WP_Query( $args );
100
+
101
+ if ( ! $query->have_posts() ) {
102
+ break;
103
+ }
104
+
105
+ $posts = $query->posts;
106
+
107
+ foreach ( $posts as $post ) {
108
+ $recipes[ $post->ID ] = array(
109
+ 'name' => $post->post_title,
110
+ 'url' => get_edit_post_link( $post->ID ),
111
+ );
112
+
113
+ wp_cache_delete( $post->ID, 'posts' );
114
+ wp_cache_delete( $post->ID, 'post_meta' );
115
+ }
116
+
117
+ $offset += $limit;
118
+ wp_cache_flush();
119
+ }
120
+
121
+ return $recipes;
122
+ }
123
+
124
+ /**
125
+ * Get recipe with the specified ID in the import format.
126
+ *
127
+ * @since 1.3.0
128
+ * @param mixed $id ID of the recipe we want to import.
129
+ * @param array $post_data POST data passed along when submitting the form.
130
+ */
131
+ public function get_recipe( $id, $post_data ) {
132
+ $post = get_post( $id );
133
+ $post_meta = get_post_custom( $id );
134
+ $import_type = isset( $post_data['wpurp-import-type'] ) ? $post_data['wpurp-import-type'] : '';
135
+
136
+ // If the import type is not set, redirect back.
137
+ if ( ! in_array( $import_type, array( 'convert', 'hide' ), true ) ) {
138
+ wp_safe_redirect( add_query_arg( array( 'from' => $this->get_uid(), 'error' => rawurlencode( 'You need to select an import type.' ) ), admin_url( 'admin.php?page=wprm_import' ) ) );
139
+ exit();
140
+ }
141
+
142
+ // If we're converting the WPURP recipe to a normal post we want the import ID to be 0.
143
+ $import_id = 'convert' === $import_type ? 0 : $id;
144
+
145
+ $recipe = array(
146
+ 'import_id' => $import_id,
147
+ 'import_backup' => array(
148
+ 'wpultimaterecipe_recipe_id' => $id,
149
+ 'wpultimaterecipe_import_type' => $import_type,
150
+ ),
151
+ );
152
+
153
+ $alternate_image = isset( $post_meta['recipe_alternate_image'] ) ? $post_meta['recipe_alternate_image'][0] : false;
154
+ $recipe['image_id'] = $alternate_image ? $alternate_image : get_post_thumbnail_id( $id );
155
+
156
+ $recipe_title = isset( $post_meta['recipe_title'] ) ? $post_meta['recipe_title'][0] : false;
157
+ $recipe['name'] = $recipe_title ? $recipe_title : $post->post_title;
158
+
159
+ $recipe['summary'] = isset( $post_meta['recipe_description'] ) ? $post_meta['recipe_description'][0] : '';
160
+ $recipe['servings'] = isset( $post_meta['recipe_servings'] ) ? $post_meta['recipe_servings'][0] : '';
161
+ $recipe['servings_unit'] = isset( $post_meta['recipe_servings_type'] ) ? $post_meta['recipe_servings_type'][0] : '';
162
+ $recipe['notes'] = isset( $post_meta['recipe_notes'] ) ? $post_meta['recipe_notes'][0] : '';
163
+
164
+ // Recipe Times.
165
+ $prep_time = isset( $post_meta['recipe_prep_time'] ) ? $post_meta['recipe_prep_time'][0] : '';
166
+ $prep_time_unit = isset( $post_meta['recipe_prep_time_text'] ) ? $post_meta['recipe_prep_time_text'][0] : '';
167
+ $recipe['prep_time'] = self::get_time_in_minutes( $prep_time, $prep_time_unit );
168
+
169
+ $cook_time = isset( $post_meta['recipe_cook_time'] ) ? $post_meta['recipe_cook_time'][0] : '';
170
+ $cook_time_unit = isset( $post_meta['recipe_cook_time_text'] ) ? $post_meta['recipe_cook_time_text'][0] : '';
171
+ $recipe['cook_time'] = self::get_time_in_minutes( $cook_time, $cook_time_unit );
172
+
173
+ $passive_time = isset( $post_meta['recipe_passive_time'] ) ? $post_meta['recipe_passive_time'][0] : '';
174
+ $passive_time_unit = isset( $post_meta['recipe_passive_time_text'] ) ? $post_meta['recipe_passive_time_text'][0] : '';
175
+ $passive_time_minutes = self::get_time_in_minutes( $passive_time, $passive_time_unit );
176
+
177
+ $recipe['total_time'] = $recipe['prep_time'] + $recipe['cook_time'] + $passive_time_minutes;
178
+
179
+ // Recipe Tags.
180
+ $course_tag = isset( $post_data['wpurp-tags-course'] ) ? $post_data['wpurp-tags-course'] : false;
181
+ $cuisine_tag = isset( $post_data['wpurp-tags-cuisine'] ) ? $post_data['wpurp-tags-cuisine'] : false;
182
+
183
+ $recipe['tags'] = array();
184
+ $recipe['tags']['course'] = array();
185
+ if ( $course_tag ) {
186
+ $terms = get_the_terms( $id, $course_tag );
187
+ if ( $terms && ! is_wp_error( $terms ) ) {
188
+ foreach ( $terms as $term ) {
189
+ $recipe['tags']['course'][] = $term->name;
190
+ }
191
+ }
192
+ }
193
+
194
+ $recipe['tags']['cuisine'] = array();
195
+ if ( $cuisine_tag ) {
196
+ $terms = get_the_terms( $id, $cuisine_tag );
197
+ if ( $terms && ! is_wp_error( $terms ) ) {
198
+ foreach ( $terms as $term ) {
199
+ $recipe['tags']['cuisine'][] = $term->name;
200
+ }
201
+ }
202
+ }
203
+
204
+ // Recipe Ingredients.
205
+ $ingredients = isset( $post_meta['recipe_ingredients'] ) ? maybe_unserialize( $post_meta['recipe_ingredients'][0] ) : array();
206
+ $recipe['ingredients'] = array();
207
+
208
+ $current_group = array(
209
+ 'name' => '',
210
+ 'ingredients' => array(),
211
+ );
212
+ foreach ( $ingredients as $ingredient ) {
213
+ if ( isset( $ingredient['group'] ) && $ingredient['group'] !== $current_group['name'] ) {
214
+ $recipe['ingredients'][] = $current_group;
215
+ $current_group = array(
216
+ 'name' => $ingredient['group'],
217
+ 'ingredients' => array(),
218
+ );
219
+ }
220
+
221
+ $current_group['ingredients'][] = array(
222
+ 'amount' => $ingredient['amount'],
223
+ 'unit' => $ingredient['unit'],
224
+ 'name' => $ingredient['ingredient'],
225
+ 'notes' => $ingredient['notes'],
226
+ );
227
+ }
228
+ $recipe['ingredients'][] = $current_group;
229
+
230
+ // Recipe Instructions.
231
+ $instructions = isset( $post_meta['recipe_instructions'] ) ? maybe_unserialize( $post_meta['recipe_instructions'][0] ) : array();
232
+ $recipe['instructions'] = array();
233
+
234
+ $current_group = array(
235
+ 'name' => '',
236
+ 'instructions' => array(),
237
+ );
238
+ foreach ( $instructions as $instruction ) {
239
+ if ( isset( $instruction['group'] ) && $instruction['group'] !== $current_group['name'] ) {
240
+ $recipe['instructions'][] = $current_group;
241
+ $current_group = array(
242
+ 'name' => $instruction['group'],
243
+ 'instructions' => array(),
244
+ );
245
+ }
246
+
247
+ $current_group['instructions'][] = array(
248
+ 'text' => $instruction['description'],
249
+ 'image' => $instruction['image'],
250
+ );
251
+ }
252
+ $recipe['instructions'][] = $current_group;
253
+
254
+ // Recipe Nutrition.
255
+ $recipe['nutrition'] = array();
256
+
257
+ $nutrition = isset( $post_meta['recipe_nutritional'] ) ? maybe_unserialize( $post_meta['recipe_nutritional'][0] ) : array();
258
+ $recipe['nutrition']['calories'] = isset( $nutrition['calories'] ) ? $nutrition['calories'] : '';
259
+
260
+ return $recipe;
261
+ }
262
+
263
+ /**
264
+ * Replace the original recipe with the newly imported WPRM one.
265
+ *
266
+ * @since 1.3.0
267
+ * @param mixed $id ID of the recipe we want replace.
268
+ * @param mixed $wprm_id ID of the WPRM recipe to replace with.
269
+ * @param array $post_data POST data passed along when submitting the form.
270
+ */
271
+ public function replace_recipe( $id, $wprm_id, $post_data ) {
272
+ $import_type = isset( $post_data['wpurp-import-type'] ) ? $post_data['wpurp-import-type'] : '';
273
+
274
+ // If the import type is not set, redirect back.
275
+ if ( ! in_array( $import_type, array( 'convert', 'hide' ), true ) ) {
276
+ wp_safe_redirect( add_query_arg( array( 'from' => $this->get_uid(), 'error' => rawurlencode( 'You need to select an import type.' ) ), admin_url( 'admin.php?page=wprm_import' ) ) );
277
+ exit();
278
+ }
279
+
280
+ // If import type is "hide" we count on the fallback shortcode.
281
+ if ( 'convert' === $import_type ) {
282
+ $post = get_post( $id );
283
+ $content = $post->post_content;
284
+
285
+ if ( 0 === substr_count( $content, '[recipe]' ) ) {
286
+ $content .= ' [wprm-recipe id="' . $wprm_id . '"]';
287
+ } else {
288
+ $content = str_ireplace( '[recipe]', '[wprm-recipe id="' . $wprm_id . '"]', $content );
289
+ }
290
+
291
+ $content = preg_replace( "/\[ultimate-recipe\s.*?id='?\"?" . $id . '.*?]/im', '[wprm-recipe id="' . $wprm_id . '"]', $content );
292
+
293
+ // Remove searchable recipe part
294
+ $content = preg_replace( '/\[wpurp-searchable-recipe\][^\[]*\[\/wpurp-searchable-recipe\]/', '', $content );
295
+
296
+ $update_content = array(
297
+ 'ID' => $id,
298
+ 'post_type' => 'post',
299
+ 'post_content' => $content,
300
+ );
301
+ wp_update_post( $update_content );
302
+ }
303
+ }
304
+
305
+ /**
306
+ * Convert time string to minutes.
307
+ *
308
+ * @since 1.3.0
309
+ * @param mixed $time Time string to convert to minutes.
310
+ * @param mixed $unit Unit of the time string.
311
+ */
312
+ private function get_time_in_minutes( $time, $unit ) {
313
+ $minutes = intval( $time );
314
+
315
+ if ( strtolower( $unit ) === strtolower( __( 'hour', 'wp-ultimate-recipe' ) )
316
+ || strtolower( $unit ) === strtolower( __( 'hours', 'wp-ultimate-recipe' ) )
317
+ || strtolower( $unit ) === 'h'
318
+ || strtolower( $unit ) === 'hr'
319
+ || strtolower( $unit ) === 'hrs' ) {
320
+ $minutes = $minutes * 60;
321
+ }
322
+
323
+ return $minutes;
324
+ }
325
+ }
includes/admin/import/class-wprm-import.php CHANGED
@@ -32,6 +32,13 @@ abstract class WPRM_Import {
32
  */
33
  abstract public function get_name();
34
 
 
 
 
 
 
 
 
35
  /**
36
  * Get a list of recipes that are available to import.
37
  *
@@ -44,8 +51,9 @@ abstract class WPRM_Import {
44
  *
45
  * @since 1.0.0
46
  * @param mixed $id ID of the recipe we want to import.
 
47
  */
48
- abstract public function get_recipe( $id );
49
 
50
  /**
51
  * Replace the original recipe with the newly imported WPRM one.
@@ -53,6 +61,7 @@ abstract class WPRM_Import {
53
  * @since 1.0.0
54
  * @param mixed $id ID of the recipe we want replace.
55
  * @param mixed $wprm_id ID of the WPRM recipe to replace with.
 
56
  */
57
- abstract public function replace_recipe( $id, $wprm_id );
58
  }
32
  */
33
  abstract public function get_name();
34
 
35
+ /**
36
+ * Get HTML for the import settings.
37
+ *
38
+ * @since 1.3.0
39
+ */
40
+ abstract public function get_settings_html();
41
+
42
  /**
43
  * Get a list of recipes that are available to import.
44
  *
51
  *
52
  * @since 1.0.0
53
  * @param mixed $id ID of the recipe we want to import.
54
+ * @param array $post_data POST data passed along when submitting the form.
55
  */
56
+ abstract public function get_recipe( $id, $post_data );
57
 
58
  /**
59
  * Replace the original recipe with the newly imported WPRM one.
61
  * @since 1.0.0
62
  * @param mixed $id ID of the recipe we want replace.
63
  * @param mixed $wprm_id ID of the WPRM recipe to replace with.
64
+ * @param array $post_data POST data passed along when submitting the form.
65
  */
66
+ abstract public function replace_recipe( $id, $wprm_id, $post_data );
67
  }
includes/admin/menu/class-wprm-admin-menu-faq.php CHANGED
@@ -37,7 +37,7 @@ class WPRM_Admin_Menu_Faq {
37
  * @since 1.0.0
38
  */
39
  public static function enqueue() {
40
- wp_enqueue_style( 'wprm-import', WPRM_URL . 'assets/css/admin/faq.min.css', array(), WPRM_VERSION, 'all' );
41
  }
42
 
43
  /**
37
  * @since 1.0.0
38
  */
39
  public static function enqueue() {
40
+ wp_enqueue_style( 'wprm-faq', WPRM_URL . 'assets/css/admin/faq.min.css', array(), WPRM_VERSION, 'all' );
41
  }
42
 
43
  /**
includes/class-wp-recipe-maker.php CHANGED
@@ -41,7 +41,7 @@ class WP_Recipe_Maker {
41
  * @since 1.0.0
42
  */
43
  private function define_constants() {
44
- define( 'WPRM_VERSION', '1.2.0' );
45
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
46
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
47
  define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
41
  * @since 1.0.0
42
  */
43
  private function define_constants() {
44
+ define( 'WPRM_VERSION', '1.3.0' );
45
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
46
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
47
  define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
includes/public/class-wprm-comment-rating.php CHANGED
@@ -27,6 +27,8 @@ class WPRM_Comment_Rating {
27
  public static function init() {
28
  add_filter( 'comment_text', array( __CLASS__, 'add_stars_to_comment' ), 10, 2 );
29
 
 
 
30
  add_action( 'comment_form_after_fields', array( __CLASS__, 'add_rating_field_to_comments' ) );
31
  add_action( 'comment_form_logged_in_after', array( __CLASS__, 'add_rating_field_to_comments' ) );
32
  add_action( 'add_meta_boxes_comment', array( __CLASS__, 'add_rating_field_to_admin_comments' ) );
@@ -78,6 +80,17 @@ class WPRM_Comment_Rating {
78
  return $rating_html . $text;
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
81
  /**
82
  * Add field to the comment form.
83
  *
27
  public static function init() {
28
  add_filter( 'comment_text', array( __CLASS__, 'add_stars_to_comment' ), 10, 2 );
29
 
30
+ add_action( 'init', array( __CLASS__, 'wpdiscuz_compatibility' ) );
31
+ add_action( 'wpdiscuz_button', array( __CLASS__, 'add_rating_field_to_comments' ) );
32
  add_action( 'comment_form_after_fields', array( __CLASS__, 'add_rating_field_to_comments' ) );
33
  add_action( 'comment_form_logged_in_after', array( __CLASS__, 'add_rating_field_to_comments' ) );
34
  add_action( 'add_meta_boxes_comment', array( __CLASS__, 'add_rating_field_to_admin_comments' ) );
80
  return $rating_html . $text;
81
  }
82
 
83
+ /**
84
+ * Compatibility with the wpDiscuz plugin.
85
+ *
86
+ * @since 1.3.0
87
+ */
88
+ public static function wpdiscuz_compatibility() {
89
+ if ( ! defined( 'WPDISCUZ_BOTTOM_TOOLBAR' ) ) {
90
+ define( 'WPDISCUZ_BOTTOM_TOOLBAR', true );
91
+ }
92
+ }
93
+
94
  /**
95
  * Add field to the comment form.
96
  *
includes/public/class-wprm-print.php CHANGED
@@ -25,6 +25,7 @@ class WPRM_Print {
25
  * @since 1.0.0
26
  */
27
  public static function init() {
 
28
  add_action( 'wp_ajax_wprm_print_recipe', array( __CLASS__, 'ajax_print_recipe' ) );
29
  add_action( 'wp_ajax_nopriv_wprm_print_recipe', array( __CLASS__, 'ajax_print_recipe' ) );
30
 
@@ -45,6 +46,32 @@ class WPRM_Print {
45
  ));
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  /**
49
  * Get print HTML for a specific recipe.
50
  *
25
  * @since 1.0.0
26
  */
27
  public static function init() {
28
+ add_action( 'init', array( __CLASS__, 'print_page' ) );
29
  add_action( 'wp_ajax_wprm_print_recipe', array( __CLASS__, 'ajax_print_recipe' ) );
30
  add_action( 'wp_ajax_nopriv_wprm_print_recipe', array( __CLASS__, 'ajax_print_recipe' ) );
31
 
46
  ));
47
  }
48
 
49
+ /**
50
+ * Check if someone is trying to reach the print page.
51
+ *
52
+ * @since 1.3.0
53
+ */
54
+ public static function print_page() {
55
+ preg_match( '/\/wprm_print\/(\d+)$/', $_SERVER['REQUEST_URI'], $print_url ); // Input var okay.
56
+ $recipe_id = isset( $print_url[1] ) ? intval( $print_url[1] ) : false;
57
+ if ( $recipe_id && WPRM_POST_TYPE === get_post_type( $recipe_id ) ) {
58
+ $recipe = WPRM_Recipe_Manager::get_recipe( $recipe_id );
59
+
60
+ $styles = WPRM_Template_Manager::get_template_styles( $recipe, 'print' );
61
+
62
+ // Fix for IE.
63
+ header( 'HTTP/1.1 200 OK' );
64
+
65
+ $charset = get_bloginfo( 'charset' );
66
+ $print_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '" />' . $styles . '</head><body class="wprm-print">';
67
+ $print_html .= WPRM_Template_Manager::get_template( $recipe, 'print' );
68
+ $print_html .= '</body></html>';
69
+ echo $print_html;
70
+ flush();
71
+ exit;
72
+ }
73
+ }
74
+
75
  /**
76
  * Get print HTML for a specific recipe.
77
  *
includes/public/class-wprm-recipe.php CHANGED
@@ -238,7 +238,7 @@ class WPRM_Recipe {
238
  }
239
 
240
  if ( $rating['count'] > 0 ) {
241
- $rating['average'] = $rating['total'] / $rating['count'];
242
  }
243
 
244
  return $rating;
238
  }
239
 
240
  if ( $rating['count'] > 0 ) {
241
+ $rating['average'] = ceil( $rating['total'] / $rating['count'] * 100) / 100;
242
  }
243
 
244
  return $rating;
includes/public/class-wprm-shortcode.php CHANGED
@@ -28,6 +28,10 @@ class WPRM_Shortcode {
28
  add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
29
  add_shortcode( 'wprm-recipe-jump', array( __CLASS__, 'jump_to_recipe_shortcode' ) );
30
  add_shortcode( 'wprm-recipe-print', array( __CLASS__, 'print_recipe_shortcode' ) );
 
 
 
 
31
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
32
  }
33
 
@@ -40,6 +44,48 @@ class WPRM_Shortcode {
40
  wp_enqueue_style( 'wprm-public', WPRM_URL . 'assets/css/public/public.min.css', array(), WPRM_VERSION, 'all' );
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Output for the recipe shortcode.
45
  *
28
  add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
29
  add_shortcode( 'wprm-recipe-jump', array( __CLASS__, 'jump_to_recipe_shortcode' ) );
30
  add_shortcode( 'wprm-recipe-print', array( __CLASS__, 'print_recipe_shortcode' ) );
31
+
32
+ add_filter( 'content_edit_pre', array( __CLASS__, 'replace_wpultimaterecipe_shortcode' ) );
33
+
34
+ add_action( 'init', array( __CLASS__, 'fallback_shortcodes' ), 11 );
35
  add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
36
  }
37
 
44
  wp_enqueue_style( 'wprm-public', WPRM_URL . 'assets/css/public/public.min.css', array(), WPRM_VERSION, 'all' );
45
  }
46
 
47
+ /**
48
+ * Fallback shortcodes for recipe plugins that we imported from.
49
+ *
50
+ * @since 1.3.0
51
+ */
52
+ public static function fallback_shortcodes() {
53
+ if ( ! shortcode_exists( 'ultimate-recipe' ) ) {
54
+ add_shortcode( 'ultimate-recipe', array( __CLASS__, 'recipe_shortcode' ) );
55
+ }
56
+
57
+ if ( ! shortcode_exists( 'nutrition-label' ) ) {
58
+ add_shortcode( 'nutrition-label', array( __CLASS__, 'remove_shortcode' ) );
59
+ add_shortcode( 'ultimate-nutrition-label', array( __CLASS__, 'remove_shortcode' ) );
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Replace WP Ultimate Recipe shortcode with ours.
65
+ *
66
+ * @since 1.3.0
67
+ * @param mixed $content Content we want to filter before it gets passed along.
68
+ */
69
+ public static function replace_wpultimaterecipe_shortcode( $content ) {
70
+ preg_match_all( "/\[ultimate-recipe\s.*?id='?\"?(\d+).*?]/im", $content, $matches );
71
+ foreach ( $matches[0] as $key => $match ) {
72
+ if ( WPRM_POST_TYPE === get_post_type( $matches[1][ $key ] ) ) {
73
+ $content = str_replace( $match, '[wprm-recipe id="' . $matches[1][ $key ] . '"]', $content );
74
+ }
75
+ }
76
+
77
+ return $content;
78
+ }
79
+
80
+ /**
81
+ * To be used for shortcodes we want to (temporarily) remove from the content.
82
+ *
83
+ * @since 1.3.0
84
+ */
85
+ public static function remove_shortcode() {
86
+ return '';
87
+ }
88
+
89
  /**
90
  * Output for the recipe shortcode.
91
  *
includes/public/class-wprm-template-manager.php CHANGED
@@ -140,11 +140,11 @@ class WPRM_Template_Manager {
140
  $templates[ $template['slug'] ] = $template;
141
  }
142
 
143
- // Load custom templates.
144
- $theme_dir = get_stylesheet_directory();
145
 
146
  if ( file_exists( $theme_dir . '/wprm-templates' ) && file_exists( $theme_dir . '/wprm-templates/recipe' ) ) {
147
- $theme_url = get_stylesheet_directory_uri();
148
 
149
  $dirs = array_filter( glob( $theme_dir . '/wprm-templates/recipe/*' ), 'is_dir' );
150
 
@@ -154,6 +154,22 @@ class WPRM_Template_Manager {
154
  }
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  self::$templates = $templates;
158
  }
159
 
140
  $templates[ $template['slug'] ] = $template;
141
  }
142
 
143
+ // Load custom templates from parent theme.
144
+ $theme_dir = get_template_directory();
145
 
146
  if ( file_exists( $theme_dir . '/wprm-templates' ) && file_exists( $theme_dir . '/wprm-templates/recipe' ) ) {
147
+ $theme_url = get_template_directory_uri();
148
 
149
  $dirs = array_filter( glob( $theme_dir . '/wprm-templates/recipe/*' ), 'is_dir' );
150
 
154
  }
155
  }
156
 
157
+ // Load custom templates from child theme (if present).
158
+ if ( get_stylesheet_directory() !== $theme_dir ) {
159
+ $theme_dir = get_stylesheet_directory();
160
+
161
+ if ( file_exists( $theme_dir . '/wprm-templates' ) && file_exists( $theme_dir . '/wprm-templates/recipe' ) ) {
162
+ $theme_url = get_stylesheet_directory_uri();
163
+
164
+ $dirs = array_filter( glob( $theme_dir . '/wprm-templates/recipe/*' ), 'is_dir' );
165
+
166
+ foreach ( $dirs as $dir ) {
167
+ $template = self::load_template( $dir, true );
168
+ $templates[ $template['slug'] ] = $template;
169
+ }
170
+ }
171
+ }
172
+
173
  self::$templates = $templates;
174
  }
175
 
readme.txt CHANGED
@@ -12,7 +12,7 @@ The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadat
12
 
13
  == Description ==
14
 
15
- WP Recipe Maker is the easy recipe plugin that everyone can use. An easy workflow allows you to add recipes to any post or page with automatic JSON-LD metadata for your recipes. This recipe metadata will improve your SEO and get you more visitors!
16
 
17
  An overview of WP Recipe Maker features:
18
 
@@ -31,6 +31,7 @@ An overview of WP Recipe Maker features:
31
  Currently using another recipe plugin? No problem! You can easily migrate all your existing recipes to WP Recipe Maker if you're using any of the following plugins:
32
 
33
  * EasyRecipe
 
34
  * (More coming soon!)
35
 
36
  This plugin is in active development and following features (and more) are coming soon:
@@ -49,10 +50,8 @@ Feel free to contact us with any feature requests or ideas.
49
 
50
  == Frequently asked questions ==
51
 
52
- = Can I create my own recipe template? =
53
- Yes! We will include some easy templating options to the plugin in the future, but anyone who knows HTML and CSS can already code their own template.
54
-
55
- Take a look at the /templates/recipe/ folder for an example of the included templates. You can create your own template in this same structure by adding a /wprm-templates/recipe/your-template/ folder to your (child) theme.
56
 
57
  = What's the difference with WP Ultimate Recipe? =
58
 
@@ -75,6 +74,14 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
 
 
78
  = 1.2.0 =
79
  * Feature: New "Tastefully Simple" template, similar to EasyRecipe
80
  * Feature: New "Clean Print with Image" recipe template
@@ -101,6 +108,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
101
 
102
  == Upgrade notice ==
103
 
 
 
 
104
  = 1.2.0 =
105
  Update for some new SEO improvements and recipe templates.
106
 
12
 
13
  == Description ==
14
 
15
+ [WP Recipe Maker](http://bootstrapped.ventures/wp-recipe-maker/) is the easy recipe plugin that everyone can use. An easy workflow allows you to add recipes to any post or page with automatic JSON-LD metadata for your recipes. This recipe metadata will improve your SEO and get you more visitors!
16
 
17
  An overview of WP Recipe Maker features:
18
 
31
  Currently using another recipe plugin? No problem! You can easily migrate all your existing recipes to WP Recipe Maker if you're using any of the following plugins:
32
 
33
  * EasyRecipe
34
+ * WP Ultimate Recipe
35
  * (More coming soon!)
36
 
37
  This plugin is in active development and following features (and more) are coming soon:
50
 
51
  == Frequently asked questions ==
52
 
53
+ = Where can I find a demo and some more documentation? =
54
+ Go to the [WP Recipe Maker demo website](http://bootstrapped.ventures/wp-recipe-maker/) for more information on all of our features!
 
 
55
 
56
  = What's the difference with WP Ultimate Recipe? =
57
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.3.0 =
78
+ * Feature: Import from WP Ultimate Recipe
79
+ * Feature: wpDiscuz support for comment ratings
80
+ * Improvement: Use photo from Photo tab when importing from EasyRecipe
81
+ * Improvement: Check for custom templates in both parent and child theme
82
+ * Improvement: Different print system for better browser compatibility
83
+ * Fix: Round average comment rating to 2 decimals
84
+
85
  = 1.2.0 =
86
  * Feature: New "Tastefully Simple" template, similar to EasyRecipe
87
  * Feature: New "Clean Print with Image" recipe template
108
 
109
  == Upgrade notice ==
110
 
111
+ = 1.3.0 =
112
+ Another week, another update!
113
+
114
  = 1.2.0 =
115
  Update for some new SEO improvements and recipe templates.
116
 
templates/admin/menu/faq/getting_started.php CHANGED
@@ -21,3 +21,7 @@
21
  You can edit a recipe by clicking on the placeholder that will appear in the visual editor after adding a recipe.
22
  </p>
23
  <img src="<?php echo esc_attr( $img_dir ); ?>/recipe-placeholder.png" />
 
 
 
 
21
  You can edit a recipe by clicking on the placeholder that will appear in the visual editor after adding a recipe.
22
  </p>
23
  <img src="<?php echo esc_attr( $img_dir ); ?>/recipe-placeholder.png" />
24
+ <h3>I need more help!</h3>
25
+ <p>
26
+ Take a look at the <a href="http://bootstrapped.ventures/wp-recipe-maker/" target="_blank">WP Recipe Maker website</a> for more documentation and demos. Or just <a href="<?php echo esc_url( add_query_arg( 'sub', 'support', admin_url( 'admin.php?page=wprecipemaker' ) ) ); ?>">contact us</a> if you have any questions at all!
27
+ </p>
templates/admin/menu/faq/support.php CHANGED
@@ -13,6 +13,8 @@
13
 
14
  <p>Unfortunately there are many things that can go wrong when you're working together with themes and plugins created by other developers. But don't worry, we're here to help!</p>
15
  <h3>How to get help</h3>
 
 
16
  <h4>Chat with us</h4>
17
  <p>In the bottom-right of this page you can find a chat widget that allows you to contact us directly. Just wait a few seconds if it doesn't show up immediately.</p>
18
  <h4>Send us a message</h4>
13
 
14
  <p>Unfortunately there are many things that can go wrong when you're working together with themes and plugins created by other developers. But don't worry, we're here to help!</p>
15
  <h3>How to get help</h3>
16
+ <h4>Documentation</h4>
17
+ <p>More documentation and demos can be found on the <a href="http://bootstrapped.ventures/wp-recipe-maker/" target="_blank">WP Recipe Maker website</a>.</p>
18
  <h4>Chat with us</h4>
19
  <p>In the bottom-right of this page you can find a chat widget that allows you to contact us directly. Just wait a few seconds if it doesn't show up immediately.</p>
20
  <h4>Send us a message</h4>
templates/admin/menu/faq/whats_new.php CHANGED
@@ -12,6 +12,15 @@
12
  ?>
13
 
14
  <h3>Latest Update (<?php echo esc_html( $version ); ?>)</h3>
 
 
 
 
 
 
 
 
 
15
  <ul>
16
  <li>Feature: New "Tastefully Simple" template, similar to EasyRecipe</li>
17
  <li>Feature: New "Clean Print with Image" recipe template</li>
12
  ?>
13
 
14
  <h3>Latest Update (<?php echo esc_html( $version ); ?>)</h3>
15
+ <ul>
16
+ <li>Feature: Import from WP Ultimate Recipe</li>
17
+ <li>Feature: wpDiscuz support for comment ratings</li>
18
+ <li>Improvement: Use photo from Photo tab when importing from EasyRecipe</li>
19
+ <li>Improvement: Check for custom templates in both parent and child theme</li>
20
+ <li>Improvement: Different print system for better browser compatibility</li>
21
+ <li>Fix: Round average comment rating to 2 decimals</li>
22
+ </ul>
23
+ <h3>1.2.0</h3>
24
  <ul>
25
  <li>Feature: New "Tastefully Simple" template, similar to EasyRecipe</li>
26
  <li>Feature: New "Clean Print with Image" recipe template</li>
templates/admin/menu/import-recipes.php CHANGED
@@ -25,7 +25,22 @@
25
  <input type="hidden" name="importer" value="<?php echo esc_attr( $importer->get_uid() ); ?>">
26
  <?php wp_nonce_field( 'wprm_import_recipes', 'wprm_import_recipes', false ); ?>
27
  <h2><?php printf( esc_html__( 'Import from %s', 'wp-recipe-maker' ), esc_html( $importer->get_name() ) ); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  <h3><?php esc_html_e( 'Import Settings', 'wp-recipe-maker' ); ?></h3>
 
 
29
  <h3><?php esc_html_e( 'Recipes to Import', 'wp-recipe-maker' ); ?></h3>
30
  <?php esc_html_e( 'Select', 'wp-recipe-maker' ); ?>: <a href="#" class="wprm-import-recipes-select-all"><?php esc_html_e( 'all', 'wp-recipe-maker' ); ?></a>, <a href="#" class="wprm-import-recipes-select-none"><?php esc_html_e( 'none', 'wp-recipe-maker' ); ?></a>
31
  <table class="wprm-import-recipes">
25
  <input type="hidden" name="importer" value="<?php echo esc_attr( $importer->get_uid() ); ?>">
26
  <?php wp_nonce_field( 'wprm_import_recipes', 'wprm_import_recipes', false ); ?>
27
  <h2><?php printf( esc_html__( 'Import from %s', 'wp-recipe-maker' ), esc_html( $importer->get_name() ) ); ?></h2>
28
+ <?php
29
+ $error = isset( $_GET['error'] ) ? sanitize_text_field( wp_unslash( $_GET['error'] ) ) : ''; // Input var okay.
30
+ if ( $error ) :
31
+ ?>
32
+ <div class="wprm-import-error">
33
+ <?php echo esc_html( $error ); ?>
34
+ </div>
35
+ <?php endif; // Error. ?>
36
+ <?php
37
+ $settings = $importer->get_settings_html();
38
+
39
+ if ( $settings ) :
40
+ ?>
41
  <h3><?php esc_html_e( 'Import Settings', 'wp-recipe-maker' ); ?></h3>
42
+ <?php echo $settings; ?>
43
+ <?php endif; // Settings. ?>
44
  <h3><?php esc_html_e( 'Recipes to Import', 'wp-recipe-maker' ); ?></h3>
45
  <?php esc_html_e( 'Select', 'wp-recipe-maker' ); ?>: <a href="#" class="wprm-import-recipes-select-all"><?php esc_html_e( 'all', 'wp-recipe-maker' ); ?></a>, <a href="#" class="wprm-import-recipes-select-none"><?php esc_html_e( 'none', 'wp-recipe-maker' ); ?></a>
46
  <table class="wprm-import-recipes">
templates/admin/modal/tabs/recipe-ingredients-instructions.php CHANGED
@@ -83,3 +83,7 @@
83
  </div>
84
  </div>
85
  </div>
 
 
 
 
83
  </div>
84
  </div>
85
  </div>
86
+ <div class='wprm-modal-hint'>
87
+ <span class="wprm-modal-hint-header"><?php esc_html_e( 'Hint', 'wp-recipe-maker' ); ?></span>
88
+ <span class="wprm-modal-hint-text"><?php esc_html_e( 'Use the TAB key to easily move from field to field and add ingredients/instructions without having to click the button.', 'wp-recipe-maker' ); ?></span>
89
+ </div>
templates/recipe/clean-print-with-image/clean-print-with-image.jpg DELETED
Binary file
templates/recipe/clean-print-with-image/clean-print-with-image.png ADDED
Binary file
templates/recipe/clean-print/clean-print.jpg DELETED
Binary file
templates/recipe/clean-print/clean-print.png ADDED
Binary file
templates/recipe/simple/simple.jpg DELETED
Binary file
templates/recipe/simple/simple.png ADDED
Binary file
templates/recipe/tastefully-simple/tastefully-simple.jpg DELETED
Binary file
templates/recipe/tastefully-simple/tastefully-simple.png ADDED
Binary file
wp-recipe-maker.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
- * Version: 1.2.0
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
+ * Version: 1.3.0
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+