WP Recipe Maker - Version 1.1.0

Version Description

  • Feature: Comment ratings with metadata
  • Feature: Inline metadata for Pinterest rich pins
  • Feature: Calories field for nutrition metadata
  • Improvement: FAQ pages
  • Improvement: Strip HTML from JSON-LD metadata
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.1.0

Files changed (41) hide show
  1. assets/css/admin/comments.min.css +1 -0
  2. assets/css/admin/comments.scss +22 -0
  3. assets/css/admin/faq.min.css +1 -1
  4. assets/css/admin/faq.scss +55 -1
  5. assets/css/admin/modal.min.css +1 -1
  6. assets/css/admin/modal/_recipe-details.scss +103 -82
  7. assets/css/public/_comments.scss +22 -0
  8. assets/css/public/public.min.css +1 -0
  9. assets/css/public/public.scss +1 -0
  10. assets/icons/battery.svg +5 -0
  11. assets/icons/star-empty.svg +4 -0
  12. assets/icons/star-full.svg +5 -0
  13. assets/images/faq/recipe-placeholder.png +0 -0
  14. assets/images/faq/wp-recipe-maker-button.png +0 -0
  15. assets/images/icon-128x128.png +0 -0
  16. assets/js/admin/recipe-form.js +6 -0
  17. assets/js/public/comment-rating.js +44 -0
  18. assets/js/{print.js → public/print.js} +0 -0
  19. includes/admin/class-wprm-recipe-sanitizer.php +7 -0
  20. includes/admin/class-wprm-recipe-saver.php +1 -0
  21. includes/admin/import/class-wprm-import-easyrecipe.php +18 -1
  22. includes/admin/menu/class-wprm-admin-menu-faq.php +1 -1
  23. includes/class-wp-recipe-maker.php +2 -1
  24. includes/public/class-wprm-comment-rating.php +137 -0
  25. includes/public/class-wprm-metadata.php +28 -8
  26. includes/public/class-wprm-print.php +1 -1
  27. includes/public/class-wprm-recipe.php +52 -0
  28. includes/public/class-wprm-shortcode.php +10 -0
  29. readme.txt +16 -4
  30. templates/admin/menu/faq.php +36 -19
  31. templates/admin/menu/faq/getting_started.php +23 -0
  32. templates/admin/menu/faq/support.php +26 -0
  33. templates/admin/menu/faq/welcome.php +42 -0
  34. templates/admin/menu/faq/whats_new.php +30 -0
  35. templates/admin/modal/tabs/recipe-details.php +4 -0
  36. templates/public/comment-rating-form.php +29 -0
  37. templates/public/comment-rating.php +27 -0
  38. templates/recipe/clean-print/clean-print.php +11 -4
  39. templates/recipe/simple/simple.min.css +1 -1
  40. templates/recipe/simple/simple.php +47 -12
  41. templates/recipe/simple/simple.scss +17 -2
assets/css/admin/comments.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .comment-form-wprm-rating label{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.comment-form-wprm-rating .wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.comment-form-wprm-rating .wprm-rating-star.rated svg polygon{fill:black}
assets/css/admin/comments.scss ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .comment-form-wprm-rating {
2
+ label {
3
+ display: none;
4
+ }
5
+
6
+ .wprm-rating-star {
7
+ cursor: pointer;
8
+
9
+ svg {
10
+ vertical-align: middle;
11
+ width: 16px;
12
+ height: 16px;
13
+ margin: 0;
14
+ }
15
+
16
+ &.rated {
17
+ svg polygon {
18
+ fill: black;
19
+ }
20
+ }
21
+ }
22
+ }
assets/css/admin/faq.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-faq p{max-width:600px}
1
+ .wprm-faq p{max-width:650px}.wprm-faq ul{list-style-type:square}.wprm-faq .wprm-drip-form{margin:20px 0}.wprm-faq .wprm-drip-form input{width:100%;max-width:400px;margin:10px 0}.wprm-faq .wprm-drip-form input[type=submit]{max-width:250px;margin-bottom:0}.wprm-faq .wprm-drip-form .wprm-disclaimer{font-size:0.8em}.wprm-badge{background:#fff url(../../images/icon-128x128.png) no-repeat;background-position:center 20px;-webkit-background-size:128px 128px;background-size:128px 128px;color:#333;font-size:14px;text-align:center;font-weight:600;margin:5px 0 0;padding-top:155px;height:25px;display:inline-block;width:150px;text-rendering:optimizeLegibility;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.2);box-shadow:0 1px 3px rgba(0,0,0,0.2)}.about-wrap .wprm-badge{position:absolute;top:0;right:0}@media only screen and (max-width: 500px){.about-wrap .wprm-badge{position:relative;margin-bottom:1.5em;width:100%}}
assets/css/admin/faq.scss CHANGED
@@ -1,5 +1,59 @@
1
  .wprm-faq {
2
  p {
3
- max-width: 600px;
4
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
1
  .wprm-faq {
2
  p {
3
+ max-width: 650px;
4
  }
5
+
6
+ ul {
7
+ list-style-type: square;
8
+ }
9
+
10
+ .wprm-drip-form {
11
+ margin: 20px 0;
12
+ input {
13
+ width: 100%;
14
+ max-width: 400px;
15
+ margin: 10px 0;
16
+
17
+ &[type=submit] {
18
+ max-width: 250px;
19
+ margin-bottom: 0;
20
+ }
21
+ }
22
+ .wprm-disclaimer {
23
+ font-size: 0.8em;
24
+ }
25
+ }
26
+ }
27
+
28
+ .wprm-badge {
29
+ background: #ffffff url(../../images/icon-128x128.png) no-repeat;
30
+ background-position: center 20px;
31
+ -webkit-background-size: 128px 128px;
32
+ background-size: 128px 128px;
33
+ color: #333;
34
+ font-size: 14px;
35
+ text-align: center;
36
+ font-weight: 600;
37
+ margin: 5px 0 0;
38
+ padding-top: 155px;
39
+ height: 25px;
40
+ display: inline-block;
41
+ width: 150px;
42
+ text-rendering: optimizeLegibility;
43
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2);
44
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
45
+ }
46
+
47
+ .about-wrap .wprm-badge {
48
+ position: absolute;
49
+ top: 0;
50
+ right: 0;
51
+ }
52
+
53
+ @media only screen and (max-width: 500px) {
54
+ .about-wrap .wprm-badge {
55
+ position: relative;
56
+ margin-bottom: 1.5em;
57
+ width: 100%;
58
+ }
59
  }
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-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.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 ::-webkit-input-placeholder,.wprm-recipe-notes-form ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-moz-placeholder,.wprm-recipe-notes-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form ::-moz-placeholder,.wprm-recipe-notes-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-ms-input-placeholder,.wprm-recipe-notes-form :-ms-input-placeholder{color:#999;opacity:0.5}.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}
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-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 ::-webkit-input-placeholder,.wprm-recipe-notes-form ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-moz-placeholder,.wprm-recipe-notes-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form ::-moz-placeholder,.wprm-recipe-notes-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-ms-input-placeholder,.wprm-recipe-notes-form :-ms-input-placeholder{color:#999;opacity:0.5}.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}
assets/css/admin/modal/_recipe-details.scss CHANGED
@@ -1,87 +1,108 @@
1
  .wprm-recipe-details-form,
2
  .wprm-recipe-notes-form {
3
- max-width: 600px;
4
- .wprm-recipe-details-form-container,
5
- .wprm-recipe-notes-form-container {
6
- margin-bottom: 15px;
7
- vertical-align: top;
8
- }
9
- .wprm-recipe-details-form-container-halfs {
10
- display: inline-block;
11
- width: 50%;
12
- }
13
- .wprm-recipe-details-form-container-thirds {
14
- display: inline-block;
15
- width: 33.3%;
16
- }
17
- label {
18
- display: block;
19
- font-weight: bold;
20
- margin-bottom: 5px;
21
- }
22
- input {
23
- margin: 0;
24
- width: 100%;
25
- max-width: 120px;
26
- height: 34px;
27
- line-height: 34px;
28
- &#wprm-recipe-name {
29
- max-width: 450px;
30
- }
31
- &[type="number"] {
32
- max-width: 50px;
33
- }
34
- &.select2_wprm-search__field {
35
- height: 18px;
36
- line-height: 18px;
37
- }
38
- }
39
- select {
40
- width: 100%;
41
- }
42
- textarea {
43
- width: 100%;
44
- resize: vertical;
45
- }
46
- ::-webkit-input-placeholder {
47
- color: #999;
48
- opacity: 0.5;
49
- }
50
- :-moz-placeholder {
51
- color: #999;
52
- opacity: 0.5;
53
- }
54
- ::-moz-placeholder {
55
- color: #999;
56
- opacity: 0.5;
57
- }
58
- :-ms-input-placeholder {
59
- color: #999;
60
- opacity: 0.5;
61
- }
62
- .wprm-recipe-image-preview {
63
- float: right;
64
- max-width: 100px;
65
-
66
- img {
67
- max-width: 100%;
68
- height: auto;
69
- }
70
- }
71
- .wprm-recipe-summary-container {
72
- clear: both;
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  @media only screen and (max-width: 480px) {
76
- .wprm-recipe-details-form {
77
- .wprm-recipe-details-form-container-halfs,
78
- .wprm-recipe-details-form-container-thirds {
79
- display: block;
80
- width: 100%;
81
- }
82
- .wprm-recipe-image-preview {
83
- float: none;
84
- margin: 10px auto;
85
- }
86
- }
 
87
  }
1
  .wprm-recipe-details-form,
2
  .wprm-recipe-notes-form {
3
+ max-width: 600px;
4
+
5
+ .wprm-recipe-details-form-container,
6
+ .wprm-recipe-notes-form-container {
7
+ margin-bottom: 15px;
8
+ vertical-align: top;
9
+ }
10
+
11
+ .wprm-recipe-details-form-container-halfs {
12
+ display: inline-block;
13
+ width: 50%;
14
+ }
15
+
16
+ .wprm-recipe-details-form-container-thirds {
17
+ display: inline-block;
18
+ width: 33.3%;
19
+ }
20
+
21
+ label {
22
+ display: block;
23
+ font-weight: bold;
24
+ margin-bottom: 5px;
25
+ }
26
+
27
+ input {
28
+ margin: 0;
29
+ width: 100%;
30
+ max-width: 120px;
31
+ height: 34px;
32
+ line-height: 34px;
33
+
34
+ &#wprm-recipe-name {
35
+ max-width: 450px;
36
+ }
37
+
38
+ &[type="number"] {
39
+ max-width: 50px;
40
+ }
41
+
42
+ &#wprm-recipe-calories {
43
+ max-width: 70px;
44
+ }
45
+
46
+ &.select2_wprm-search__field {
47
+ height: 18px;
48
+ line-height: 18px;
49
+ }
50
+ }
51
+
52
+ select {
53
+ width: 100%;
54
+ }
55
+
56
+ textarea {
57
+ width: 100%;
58
+ resize: vertical;
59
+ }
60
+
61
+ ::-webkit-input-placeholder {
62
+ color: #999;
63
+ opacity: 0.5;
64
+ }
65
+
66
+ :-moz-placeholder {
67
+ color: #999;
68
+ opacity: 0.5;
69
+ }
70
+
71
+ ::-moz-placeholder {
72
+ color: #999;
73
+ opacity: 0.5;
74
+ }
75
+
76
+ :-ms-input-placeholder {
77
+ color: #999;
78
+ opacity: 0.5;
79
+ }
80
+
81
+ .wprm-recipe-image-preview {
82
+ float: right;
83
+ max-width: 100px;
84
+
85
+ img {
86
+ max-width: 100%;
87
+ height: auto;
88
+ }
89
+ }
90
+
91
+ .wprm-recipe-summary-container {
92
+ clear: both;
93
+ }
94
  }
95
  @media only screen and (max-width: 480px) {
96
+ .wprm-recipe-details-form {
97
+ .wprm-recipe-details-form-container-halfs,
98
+ .wprm-recipe-details-form-container-thirds {
99
+ display: block;
100
+ width: 100%;
101
+ }
102
+
103
+ .wprm-recipe-image-preview {
104
+ float: none;
105
+ margin: 10px auto;
106
+ }
107
+ }
108
  }
assets/css/public/_comments.scss ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .comment-form-wprm-rating {
2
+ display: none;
3
+
4
+ .wprm-rating-star {
5
+ cursor: pointer;
6
+ }
7
+ }
8
+
9
+ .wprm-rating-star {
10
+ svg {
11
+ vertical-align: middle;
12
+ width: 16px;
13
+ height: 16px;
14
+ margin: 0;
15
+ }
16
+
17
+ &.rated {
18
+ svg polygon {
19
+ fill: black;
20
+ }
21
+ }
22
+ }
assets/css/public/public.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .comment-form-wprm-rating{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-rating-star.rated svg polygon{fill:black}
assets/css/public/public.scss ADDED
@@ -0,0 +1 @@
 
1
+ @import "comments";
assets/icons/battery.svg ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 24 24"><g >
2
+ <rect data-color="color-2" x="21" y="8" fill="#343434" width="3" height="8"/>
3
+ <path fill="#343434" d="M18,5H1C0.448,5,0,5.447,0,6v12c0,0.553,0.448,1,1,1h17c0.552,0,1-0.447,1-1V6C19,5.447,18.552,5,18,5z
4
+ M11,12v4l-7-5l5,1V8l6,5L11,12z"/>
5
+ </g></svg>
assets/icons/star-empty.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 24 24"><g transform="translate(0, 0)">
2
+ <polygon fill="none" stroke="#343434" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" points="12,2.6 15,9
3
+ 21.4,9 16.7,13.9 18.6,21.4 12,17.6 5.4,21.4 7.3,13.9 2.6,9 9,9 " stroke-linejoin="miter"/>
4
+ </g></svg>
assets/icons/star-full.svg ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 24 24"><g >
2
+ <path fill="#343434" d="M12.712,1.942l2.969,6.015l6.638,0.965c0.651,0.095,0.911,0.895,0.44,1.354l-4.804,4.682l1.134,6.612
3
+ c0.111,0.649-0.57,1.143-1.152,0.837L12,19.286l-5.938,3.122C5.48,22.714,4.799,22.219,4.91,21.57l1.134-6.612l-4.804-4.682
4
+ c-0.471-0.459-0.211-1.26,0.44-1.354l6.638-0.965l2.969-6.015C11.579,1.352,12.421,1.352,12.712,1.942z"/>
5
+ </g></svg>
assets/images/faq/recipe-placeholder.png ADDED
Binary file
assets/images/faq/wp-recipe-maker-button.png ADDED
Binary file
assets/images/icon-128x128.png ADDED
Binary file
assets/js/admin/recipe-form.js CHANGED
@@ -38,6 +38,7 @@ wprm_admin.clear_recipe_fields = function() {
38
  wprm_admin.rich_editor.resetContent(''); // Recipe summary
39
  jQuery('#wprm-recipe-servings').val('');
40
  jQuery('#wprm-recipe-servings-unit').val('');
 
41
  jQuery('#wprm-recipe-prep-time').val('');
42
  jQuery('#wprm-recipe-cook-time').val('');
43
  jQuery('#wprm-recipe-total-time').val('');
@@ -71,11 +72,13 @@ wprm_admin.set_recipe_fields = function(recipe) {
71
  jQuery('#wprm-recipe-servings-unit').val(recipe.servings_unit);
72
 
73
  var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
 
74
  prep_time = parseInt(recipe.prep_time) > 0 ? parseInt(recipe.prep_time) : '',
75
  cook_time = parseInt(recipe.cook_time) > 0 ? parseInt(recipe.cook_time) : '',
76
  total_time = parseInt(recipe.total_time) > 0 ? parseInt(recipe.total_time) : '';
77
 
78
  jQuery('#wprm-recipe-servings').val(servings);
 
79
  jQuery('#wprm-recipe-prep-time').val(prep_time);
80
  jQuery('#wprm-recipe-cook-time').val(cook_time);
81
  jQuery('#wprm-recipe-total-time').val(total_time);
@@ -370,6 +373,9 @@ jQuery(document).ready(function($) {
370
  prep_time: jQuery('#wprm-recipe-prep-time').val(),
371
  cook_time: jQuery('#wprm-recipe-cook-time').val(),
372
  total_time: jQuery('#wprm-recipe-total-time').val(),
 
 
 
373
  tags: {
374
  course: jQuery('#wprm-recipe-tag-course').val(),
375
  cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
38
  wprm_admin.rich_editor.resetContent(''); // Recipe summary
39
  jQuery('#wprm-recipe-servings').val('');
40
  jQuery('#wprm-recipe-servings-unit').val('');
41
+ jQuery('#wprm-recipe-calories').val('');
42
  jQuery('#wprm-recipe-prep-time').val('');
43
  jQuery('#wprm-recipe-cook-time').val('');
44
  jQuery('#wprm-recipe-total-time').val('');
72
  jQuery('#wprm-recipe-servings-unit').val(recipe.servings_unit);
73
 
74
  var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
75
+ calories = recipe.nutrition.calories ? parseInt(recipe.nutrition.calories) : '',
76
  prep_time = parseInt(recipe.prep_time) > 0 ? parseInt(recipe.prep_time) : '',
77
  cook_time = parseInt(recipe.cook_time) > 0 ? parseInt(recipe.cook_time) : '',
78
  total_time = parseInt(recipe.total_time) > 0 ? parseInt(recipe.total_time) : '';
79
 
80
  jQuery('#wprm-recipe-servings').val(servings);
81
+ jQuery('#wprm-recipe-calories').val(calories);
82
  jQuery('#wprm-recipe-prep-time').val(prep_time);
83
  jQuery('#wprm-recipe-cook-time').val(cook_time);
84
  jQuery('#wprm-recipe-total-time').val(total_time);
373
  prep_time: jQuery('#wprm-recipe-prep-time').val(),
374
  cook_time: jQuery('#wprm-recipe-cook-time').val(),
375
  total_time: jQuery('#wprm-recipe-total-time').val(),
376
+ nutrition: {
377
+ calories: jQuery('#wprm-recipe-calories').val()
378
+ },
379
  tags: {
380
  course: jQuery('#wprm-recipe-tag-course').val(),
381
  cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
assets/js/public/comment-rating.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wprm = wprm || {};
2
+
3
+ jQuery(document).ready(function($) {
4
+ if (jQuery('.wprm-recipe-container').length > 0 || jQuery('body.wp-admin').length > 0) {
5
+ jQuery('.comment-form-wprm-rating').show();
6
+
7
+ jQuery(document).on('mouseenter', '.comment-form-wprm-rating .wprm-rating-star', function() {
8
+ jQuery(this).prevAll().andSelf().each(function() {
9
+ jQuery(this).find('polygon').css('fill', 'black');
10
+ });
11
+ jQuery(this).nextAll().each(function() {
12
+ jQuery(this).find('polygon').css('fill', 'none');
13
+ });
14
+ });
15
+ jQuery(document).on('mouseleave', '.comment-form-wprm-rating .wprm-rating-star', function() {
16
+ jQuery(this).siblings().andSelf().each(function() {
17
+ jQuery(this).find('polygon').css('fill', '');
18
+ });
19
+ });
20
+ jQuery(document).on('click', '.comment-form-wprm-rating .wprm-rating-star', function() {
21
+ var star = jQuery(this),
22
+ rating = star.data('rating'),
23
+ input = star.parents('.comment-form-wprm-rating').find('#wprm-comment-rating'),
24
+ current_rating = input.val();
25
+
26
+ if (current_rating == rating) {
27
+ input.val('');
28
+
29
+ jQuery(this).siblings('').andSelf().each(function() {
30
+ jQuery(this).removeClass('rated');
31
+ });
32
+ } else {
33
+ input.val(rating);
34
+
35
+ jQuery(this).prevAll().andSelf().each(function() {
36
+ jQuery(this).addClass('rated');
37
+ });
38
+ jQuery(this).nextAll().each(function() {
39
+ jQuery(this).removeClass('rated');
40
+ });
41
+ }
42
+ });
43
+ }
44
+ });
assets/js/{print.js → public/print.js} RENAMED
File without changes
includes/admin/class-wprm-recipe-sanitizer.php CHANGED
@@ -129,6 +129,13 @@ class WPRM_Recipe_Sanitizer {
129
  }
130
  }
131
 
 
 
 
 
 
 
 
132
  // Other fields.
133
  $sanitized_recipe['import_source'] = isset( $recipe['import_source'] ) ? sanitize_text_field( $recipe['import_source'] ) : '';
134
  $sanitized_recipe['import_backup'] = isset( $recipe['import_backup'] ) ? $recipe['import_backup'] : array();
129
  }
130
  }
131
 
132
+ // Recipe Nutrition.
133
+ $sanitized_recipe['nutrition'] = array();
134
+
135
+ if ( isset( $recipe['nutrition'] ) ) {
136
+ $sanitized_recipe['nutrition']['calories'] = isset( $recipe['nutrition']['calories'] ) ? intval( $recipe['nutrition']['calories'] ) : false;
137
+ }
138
+
139
  // Other fields.
140
  $sanitized_recipe['import_source'] = isset( $recipe['import_source'] ) ? sanitize_text_field( $recipe['import_source'] ) : '';
141
  $sanitized_recipe['import_backup'] = isset( $recipe['import_backup'] ) ? $recipe['import_backup'] : array();
includes/admin/class-wprm-recipe-saver.php CHANGED
@@ -120,6 +120,7 @@ class WPRM_Recipe_Saver {
120
  update_post_meta( $id, 'wprm_ingredients', $recipe['ingredients'] );
121
  update_post_meta( $id, 'wprm_instructions', $recipe['instructions'] );
122
  update_post_meta( $id, 'wprm_notes', $recipe['notes'] );
 
123
 
124
  update_post_meta( $id, 'wprm_import_source', $recipe['import_source'] );
125
  update_post_meta( $id, 'wprm_import_backup', $recipe['import_backup'] );
120
  update_post_meta( $id, 'wprm_ingredients', $recipe['ingredients'] );
121
  update_post_meta( $id, 'wprm_instructions', $recipe['instructions'] );
122
  update_post_meta( $id, 'wprm_notes', $recipe['notes'] );
123
+ update_post_meta( $id, 'wprm_nutrition', $recipe['nutrition'] );
124
 
125
  update_post_meta( $id, 'wprm_import_source', $recipe['import_source'] );
126
  update_post_meta( $id, 'wprm_import_backup', $recipe['import_backup'] );
includes/admin/import/class-wprm-import-easyrecipe.php CHANGED
@@ -270,6 +270,13 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
270
  }
271
  $instructions[] = $group;
272
  $recipe['instructions'] = $instructions;
 
 
 
 
 
 
 
273
  } else {
274
  $recipe = false;
275
  }
@@ -302,7 +309,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
302
 
303
  // If surrounded by wrapper we need to replace that as well.
304
  $parent = $easyrecipe->parent();
305
- if( isset( $parent->class ) && false !== strpos( $parent->class, 'easyrecipeWrapper' ) ) {
306
  $easyrecipe = $parent;
307
  }
308
  $easyrecipe->outertext = '[wprm-recipe id="' . $wprm_id . '"]';
@@ -315,6 +322,16 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
315
  'post_content' => $content,
316
  );
317
  wp_update_post( $update_content );
 
 
 
 
 
 
 
 
 
 
318
  }
319
 
320
  /**
270
  }
271
  $instructions[] = $group;
272
  $recipe['instructions'] = $instructions;
273
+
274
+ // Nutrition.
275
+ $recipe['nutrition'] = array();
276
+
277
+ $easyrecipe_field = $recipe_html->find( 'span[class=calories]', 0 );
278
+ $wprm_field = is_object( $easyrecipe_field ) ? intval( $easyrecipe_field->plaintext ) : false;
279
+ $recipe['nutrition']['calories'] = $wprm_field;
280
  } else {
281
  $recipe = false;
282
  }
309
 
310
  // If surrounded by wrapper we need to replace that as well.
311
  $parent = $easyrecipe->parent();
312
+ if ( isset( $parent->class ) && false !== strpos( $parent->class, 'easyrecipeWrapper' ) ) {
313
  $easyrecipe = $parent;
314
  }
315
  $easyrecipe->outertext = '[wprm-recipe id="' . $wprm_id . '"]';
322
  'post_content' => $content,
323
  );
324
  wp_update_post( $update_content );
325
+
326
+ // Migrate comment ratings.
327
+ $comments = get_comments( array( 'post_id' => $post_id ) );
328
+
329
+ foreach ( $comments as $comment ) {
330
+ $comment_rating = intval( get_comment_meta( $comment->comment_ID, 'ERRating', true ) );
331
+ if ( $comment_rating ) {
332
+ update_comment_meta( $comment->comment_ID, 'wprm-comment-rating', $comment_rating );
333
+ }
334
+ }
335
  }
336
 
337
  /**
includes/admin/menu/class-wprm-admin-menu-faq.php CHANGED
@@ -44,7 +44,7 @@ class WPRM_Admin_Menu_Faq {
44
  *
45
  * @since 1.0.0
46
  */
47
- public static function add_support_widget( $hook ) {
48
  require_once( WPRM_DIR . 'templates/admin/menu/support-widget.html' );
49
  }
50
 
44
  *
45
  * @since 1.0.0
46
  */
47
+ public static function add_support_widget() {
48
  require_once( WPRM_DIR . 'templates/admin/menu/support-widget.html' );
49
  }
50
 
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.0.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__ ) ) );
@@ -57,6 +57,7 @@ class WP_Recipe_Maker {
57
  require_once( WPRM_DIR . 'includes/class-wprm-i18n.php' );
58
 
59
  // Public.
 
60
  require_once( WPRM_DIR . 'includes/public/class-wprm-fallback-recipe.php' );
61
  require_once( WPRM_DIR . 'includes/public/class-wprm-metadata.php' );
62
  require_once( WPRM_DIR . 'includes/public/class-wprm-post-type.php' );
41
  * @since 1.0.0
42
  */
43
  private function define_constants() {
44
+ define( 'WPRM_VERSION', '1.1.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__ ) ) );
57
  require_once( WPRM_DIR . 'includes/class-wprm-i18n.php' );
58
 
59
  // Public.
60
+ require_once( WPRM_DIR . 'includes/public/class-wprm-comment-rating.php' );
61
  require_once( WPRM_DIR . 'includes/public/class-wprm-fallback-recipe.php' );
62
  require_once( WPRM_DIR . 'includes/public/class-wprm-metadata.php' );
63
  require_once( WPRM_DIR . 'includes/public/class-wprm-post-type.php' );
includes/public/class-wprm-comment-rating.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Allow visitors to rate the recipe in the comment.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.1.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/includes/public
10
+ */
11
+
12
+ /**
13
+ * Allow visitors to rate the recipe in the comment.
14
+ *
15
+ * @since 1.1.0
16
+ * @package WP_Recipe_Maker
17
+ * @subpackage WP_Recipe_Maker/includes/public
18
+ * @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
19
+ */
20
+ class WPRM_Comment_Rating {
21
+
22
+ /**
23
+ * Register actions and filters.
24
+ *
25
+ * @since 1.1.0
26
+ */
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' ) );
33
+
34
+ add_action( 'comment_post', array( __CLASS__, 'save_comment_rating' ) );
35
+ add_action( 'edit_comment', array( __CLASS__, 'save_admin_comment_rating' ) );
36
+
37
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
38
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_admin' ) );
39
+ }
40
+
41
+ /**
42
+ * Enqueue stylesheets and scripts.
43
+ *
44
+ * @since 1.1.0
45
+ */
46
+ public static function enqueue() {
47
+ wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . '/assets/js/public/comment-rating.js', array( 'jquery' ), WPRM_VERSION, true );
48
+ }
49
+
50
+ /**
51
+ * Enqueue stylesheets and scripts for admin.
52
+ *
53
+ * @since 1.1.0
54
+ */
55
+ public static function enqueue_admin() {
56
+ wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . '/assets/js/public/comment-rating.js', array( 'jquery' ), WPRM_VERSION, true );
57
+ wp_enqueue_style( 'wprm-comments', WPRM_URL . '/assets/css/admin/comments.min.css', array(), WPRM_VERSION, 'all' );
58
+ }
59
+
60
+ /**
61
+ * Add field to the comment form.
62
+ *
63
+ * @since 1.1.0
64
+ * @param mixed $text Comment text.
65
+ * @param object $comment Comment object.
66
+ */
67
+ public static function add_stars_to_comment( $text, $comment ) {
68
+ $rating = intval( get_comment_meta( $comment->comment_ID, 'wprm-comment-rating', true ) );
69
+
70
+ $rating_html = '';
71
+ if ( $rating ) {
72
+ ob_start();
73
+ require( WPRM_DIR . 'templates/public/comment-rating.php' );
74
+ $rating_html = ob_get_contents();
75
+ ob_end_clean();
76
+ }
77
+
78
+ return $rating_html . $text;
79
+ }
80
+
81
+ /**
82
+ * Add field to the comment form.
83
+ *
84
+ * @since 1.1.0
85
+ */
86
+ public static function add_rating_field_to_comments() {
87
+ $rating = 0;
88
+ require( WPRM_DIR . 'templates/public/comment-rating-form.php' );
89
+ }
90
+
91
+ /**
92
+ * Add field to the admin comment form.
93
+ *
94
+ * @since 1.1.0
95
+ */
96
+ public static function add_rating_field_to_admin_comments() {
97
+ add_meta_box( 'wprm-comment-rating', __( 'Recipe Rating', 'wp-recipe-maker' ), array( __CLASS__, 'add_rating_field_to_admin_comments_form' ), 'comment', 'normal', 'high' );
98
+ }
99
+
100
+ /**
101
+ * Callback for the admin comments meta box.
102
+ *
103
+ * @since 1.1.0
104
+ * @param object $comment Comment being edited.
105
+ */
106
+ public static function add_rating_field_to_admin_comments_form( $comment ) {
107
+ $rating = intval( get_comment_meta( $comment->comment_ID, 'wprm-comment-rating', true ) );
108
+ wp_nonce_field( 'wprm-comment-rating-nonce', 'wprm-comment-rating-nonce', false );
109
+ require( WPRM_DIR . 'templates/public/comment-rating-form.php' );
110
+ }
111
+
112
+ /**
113
+ * Save the comment rating.
114
+ *
115
+ * @since 1.1.0
116
+ * @param int $comment_id ID of the comment being saved.
117
+ */
118
+ public static function save_comment_rating( $comment_id ) {
119
+ $rating = isset( $_POST['wprm-comment-rating'] ) ? intval( $_POST['wprm-comment-rating'] ) : 0; // Input var okay.
120
+ update_comment_meta( $comment_id, 'wprm-comment-rating', $rating );
121
+ }
122
+
123
+ /**
124
+ * Save the admin comment rating.
125
+ *
126
+ * @since 1.1.0
127
+ * @param int $comment_id ID of the comment being saved.
128
+ */
129
+ public static function save_admin_comment_rating( $comment_id ) {
130
+ if ( isset( $_POST['wprm-comment-rating-nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['wprm-comment-rating-nonce'] ), 'wprm-comment-rating-nonce' ) ) { // Input var okay.
131
+ $rating = isset( $_POST['wprm-comment-rating'] ) ? intval( $_POST['wprm-comment-rating'] ) : 0; // Input var okay.
132
+ update_comment_meta( $comment_id, 'wprm-comment-rating', $rating );
133
+ }
134
+ }
135
+ }
136
+
137
+ WPRM_Comment_Rating::init();
includes/public/class-wprm-metadata.php CHANGED
@@ -56,7 +56,7 @@ class WPRM_Metadata {
56
  ),
57
  'datePublished' => $recipe->date(),
58
  'image' => $recipe->image_url( 'full' ),
59
- 'description' => esc_html( $recipe->summary() ),
60
  );
61
 
62
  // Yield.
@@ -65,18 +65,19 @@ class WPRM_Metadata {
65
  }
66
 
67
  // Times.
68
- if ( $recipe->prep_time() && $recipe->cook_time() ) {
69
- // Only use separate ones when we have both.
70
  $metadata['prepTime'] = 'PT' . $recipe->prep_time() . 'M';
 
 
71
  $metadata['cookTime'] = 'PT' . $recipe->cook_time() . 'M';
72
- } elseif ( $recipe->total_time() ) {
73
- // Otherwise use total time.
74
  $metadata['totalTime'] = 'PT' . $recipe->total_time() . 'M';
75
  }
76
 
77
  // Ingredients.
78
  $ingredients = $recipe->ingredients_without_groups();
79
- if( count( $ingredients ) > 0 ) {
80
  $metadata_ingredients = array();
81
 
82
  foreach ( $ingredients as $ingredient ) {
@@ -93,11 +94,11 @@ class WPRM_Metadata {
93
 
94
  // Instructions.
95
  $instructions = $recipe->instructions_without_groups();
96
- if( count( $instructions ) > 0 ) {
97
  $metadata_instructions = array();
98
 
99
  foreach ( $instructions as $instruction ) {
100
- $metadata_instructions[] = esc_html( $instruction['text'] );
101
  }
102
 
103
  $metadata['recipeInstructions'] = $metadata_instructions;
@@ -113,6 +114,25 @@ class WPRM_Metadata {
113
  $metadata['recipeCuisine'] = wp_list_pluck( $cuisines, 'name' );
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  // Allow external filtering of metadata.
117
  return apply_filters( 'wprm_recipe_metadata', $metadata, $recipe );
118
  }
56
  ),
57
  'datePublished' => $recipe->date(),
58
  'image' => $recipe->image_url( 'full' ),
59
+ 'description' => wp_strip_all_tags( $recipe->summary() ),
60
  );
61
 
62
  // Yield.
65
  }
66
 
67
  // Times.
68
+ if ( $recipe->prep_time() ) {
 
69
  $metadata['prepTime'] = 'PT' . $recipe->prep_time() . 'M';
70
+ }
71
+ if ( $recipe->cook_time() ) {
72
  $metadata['cookTime'] = 'PT' . $recipe->cook_time() . 'M';
73
+ }
74
+ if ( $recipe->total_time() ) {
75
  $metadata['totalTime'] = 'PT' . $recipe->total_time() . 'M';
76
  }
77
 
78
  // Ingredients.
79
  $ingredients = $recipe->ingredients_without_groups();
80
+ if ( count( $ingredients ) > 0 ) {
81
  $metadata_ingredients = array();
82
 
83
  foreach ( $ingredients as $ingredient ) {
94
 
95
  // Instructions.
96
  $instructions = $recipe->instructions_without_groups();
97
+ if ( count( $instructions ) > 0 ) {
98
  $metadata_instructions = array();
99
 
100
  foreach ( $instructions as $instruction ) {
101
+ $metadata_instructions[] = wp_strip_all_tags( $instruction['text'] );
102
  }
103
 
104
  $metadata['recipeInstructions'] = $metadata_instructions;
114
  $metadata['recipeCuisine'] = wp_list_pluck( $cuisines, 'name' );
115
  }
116
 
117
+ // Nutrition.
118
+ $calories = $recipe->calories();
119
+ if ( $calories ) {
120
+ $metadata['nutrition'] = array(
121
+ '@type' => 'NutritionInformation',
122
+ 'calories' => $calories . ' ' . esc_html__( 'kcal', 'wp-recipe-maker' ),
123
+ );
124
+ }
125
+
126
+ // Rating.
127
+ $rating = $recipe->rating();
128
+ if ( $rating['count'] > 0 ) {
129
+ $metadata['aggregateRating'] = array(
130
+ '@type' => 'AggregateRating',
131
+ 'ratingValue' => $rating['average'],
132
+ 'reviewCount' => $rating['count'],
133
+ );
134
+ }
135
+
136
  // Allow external filtering of metadata.
137
  return apply_filters( 'wprm_recipe_metadata', $metadata, $recipe );
138
  }
includes/public/class-wprm-print.php CHANGED
@@ -37,7 +37,7 @@ class WPRM_Print {
37
  * @since 1.0.0
38
  */
39
  public static function enqueue() {
40
- wp_enqueue_script( 'wprm-print', WPRM_URL . '/assets/js/print.js', array( 'jquery' ), WPRM_VERSION, true );
41
 
42
  wp_localize_script( 'wprm-print', 'wprm_public', array(
43
  'ajax_url' => admin_url( 'admin-ajax.php' ),
37
  * @since 1.0.0
38
  */
39
  public static function enqueue() {
40
+ wp_enqueue_script( 'wprm-print', WPRM_URL . '/assets/js/public/print.js', array( 'jquery' ), WPRM_VERSION, true );
41
 
42
  wp_localize_script( 'wprm-print', 'wprm_public', array(
43
  'ajax_url' => admin_url( 'admin-ajax.php' ),
includes/public/class-wprm-recipe.php CHANGED
@@ -81,6 +81,9 @@ class WPRM_Recipe {
81
  // Recipe Notes.
82
  $recipe['notes'] = $this->notes();
83
 
 
 
 
84
  return $recipe;
85
  }
86
 
@@ -119,6 +122,16 @@ class WPRM_Recipe {
119
  }
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
122
  /**
123
  * Get the recipe publish date.
124
  *
@@ -182,6 +195,45 @@ class WPRM_Recipe {
182
  return $this->post->post_title;
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  /**
186
  * Get the recipe summary.
187
  *
81
  // Recipe Notes.
82
  $recipe['notes'] = $this->notes();
83
 
84
+ // Recipe Nutrition.
85
+ $recipe['nutrition'] = $this->nutrition();
86
+
87
  return $recipe;
88
  }
89
 
122
  }
123
  }
124
 
125
+ /**
126
+ * Get the recipe calories.
127
+ *
128
+ * @since 1.0.0
129
+ */
130
+ public function calories() {
131
+ $nutrition = $this->nutrition();
132
+ return isset( $nutrition['calories'] ) ? $nutrition['calories'] : false;
133
+ }
134
+
135
  /**
136
  * Get the recipe publish date.
137
  *
195
  return $this->post->post_title;
196
  }
197
 
198
+ /**
199
+ * Get the recipe nutrition data.
200
+ *
201
+ * @since 1.0.0
202
+ */
203
+ public function nutrition() {
204
+ return maybe_unserialize( $this->meta( 'wprm_nutrition', array() ) );
205
+ }
206
+
207
+ /**
208
+ * Get the recipe rating.
209
+ *
210
+ * @since 1.1.0
211
+ */
212
+ public function rating() {
213
+ $rating = array(
214
+ 'count' => 0,
215
+ 'total' => 0,
216
+ 'average' => 0,
217
+ );
218
+
219
+ // TODO cache the recipe rating.
220
+ $comments = get_approved_comments( $this->parent_post_id() );
221
+
222
+ foreach ( $comments as $comment ) {
223
+ $comment_rating = intval( get_comment_meta( $comment->comment_ID, 'wprm-comment-rating', true ) );
224
+ if ( $comment_rating ) {
225
+ $rating['count']++;
226
+ $rating['total'] += $comment_rating;
227
+ }
228
+ }
229
+
230
+ if ( $rating['count'] > 0 ) {
231
+ $rating['average'] = $rating['total'] / $rating['count'];
232
+ }
233
+
234
+ return $rating;
235
+ }
236
+
237
  /**
238
  * Get the recipe summary.
239
  *
includes/public/class-wprm-shortcode.php CHANGED
@@ -26,6 +26,16 @@ class WPRM_Shortcode {
26
  */
27
  public static function init() {
28
  add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
 
 
 
 
 
 
 
 
 
 
29
  }
30
 
31
  /**
26
  */
27
  public static function init() {
28
  add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
29
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
30
+ }
31
+
32
+ /**
33
+ * Enqueue stylesheets and scripts.
34
+ *
35
+ * @since 1.1.0
36
+ */
37
+ public static function enqueue() {
38
+ wp_enqueue_style( 'wprm-public', WPRM_URL . '/assets/css/public/public.min.css', array(), WPRM_VERSION, 'all' );
39
  }
40
 
41
  /**
readme.txt CHANGED
@@ -16,12 +16,14 @@ WP Recipe Maker is the easy recipe plugin that everyone can use. An easy workflo
16
 
17
  An overview of WP Recipe Maker features:
18
 
19
- * **Easy workflow** to add recipes to any post or page.
20
- * Uses schema.org/Recipe JSON-LD metadata optimised for **Google Recipe search**.
 
 
21
  * Clean **print recipe** version for your visitors
22
  * **Fallback recipe** shows up when the plugin is disabled
23
- * Add **photos** to any step of the recipe.
24
- * This plugin is **fully responsive**. That means that your recipes will look good on any device.
25
  * Structure your ingredients and instructions in **groups** (e.g. icing and cake batter)
26
  * **Full text search** for your recipes
27
 
@@ -66,6 +68,13 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
 
 
69
  = 1.0.0 =
70
  * Very first version of this recipe plugin
71
  * Feature: JSON-LD Metadata
@@ -76,5 +85,8 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
76
 
77
  == Upgrade notice ==
78
 
 
 
 
79
  = 1.0.0 =
80
  First version of this recipe plugin, no upgrades needed.
16
 
17
  An overview of WP Recipe Maker features:
18
 
19
+ * **Easy workflow** to add recipes to any post or page
20
+ * Uses schema.org/Recipe JSON-LD metadata optimised for **Google Recipe search**
21
+ * A combination of JSON-LD and inline metadata to ensure compatibility with **Pinterest Rich Pins**
22
+ * **Recipe ratings** in the user comments
23
  * Clean **print recipe** version for your visitors
24
  * **Fallback recipe** shows up when the plugin is disabled
25
+ * Add **photos** to any step of the recipe
26
+ * This plugin is **fully responsive**, your recipes will look good on any device
27
  * Structure your ingredients and instructions in **groups** (e.g. icing and cake batter)
28
  * **Full text search** for your recipes
29
 
68
 
69
  == Changelog ==
70
 
71
+ = 1.1.0 =
72
+ * Feature: Comment ratings with metadata
73
+ * Feature: Inline metadata for Pinterest rich pins
74
+ * Feature: Calories field for nutrition metadata
75
+ * Improvement: FAQ pages
76
+ * Improvement: Strip HTML from JSON-LD metadata
77
+
78
  = 1.0.0 =
79
  * Very first version of this recipe plugin
80
  * Feature: JSON-LD Metadata
85
 
86
  == Upgrade notice ==
87
 
88
+ = 1.1.0 =
89
+ Update highly recommended for SEO purposes.
90
+
91
  = 1.0.0 =
92
  First version of this recipe plugin, no upgrades needed.
templates/admin/menu/faq.php CHANGED
@@ -3,30 +3,47 @@
3
  * Template for the WP Recipe Maker FAQ.
4
  *
5
  * @link http://bootstrapped.ventures
6
- * @since 1.0.0
7
  *
8
  * @package WP_Recipe_Maker
9
  * @subpackage WP_Recipe_Maker/templates/admin/menu
10
  */
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ?>
13
 
14
- <div class="wrap wprm-faq">
15
- <h2><?php esc_html_e( 'FAQ & Support', 'wp-recipe-maker' ); ?></h2>
16
- <h3>How can I add a recipe?</h3>
17
- <p>
18
- When creating or editing a regular post or page you should see a "WP Recipe Maker" button appear next to the "Add Media" button right above the post editor. Click that button to insert recipes.
19
- </p>
20
- <h3>How can I edit a recipe?</h3>
21
- <p>
22
- You can edit a recipe by clicking on the placeholder that will appear in the visual editor after adding a recipe.
23
- </p>
24
- <h3>Are there any other features?</h3>
25
- <p>
26
- WP Recipe Maker is in active development with many features planned. Any suggestions are welcome as well. See the next question on how to contact us.
27
- </p>
28
- <h3>I need more help!</h3>
29
- <p>
30
- We're happy to help you with any questions or suggestions you have, just contact us using the "Help" icon in the bottom right of this page (it might take a couple of seconds to load) or send us an email at <a href="mailto:support@bootstrapped.ventures">support@bootstrapped.ventures</a>!
31
- </p>
 
 
 
32
  </div>
3
  * Template for the WP Recipe Maker FAQ.
4
  *
5
  * @link http://bootstrapped.ventures
6
+ * @since 1.1.0
7
  *
8
  * @package WP_Recipe_Maker
9
  * @subpackage WP_Recipe_Maker/templates/admin/menu
10
  */
11
 
12
+ // Subpage.
13
+ $sub = isset( $_GET['sub'] ) ? sanitize_key( wp_unslash( $_GET['sub'] ) ) : 'faq'; // Input var okay.
14
+
15
+ if ( ! in_array( $sub, array( 'welcome', 'getting_started', 'whats_new', 'support' ), true ) ) {
16
+ $sub = 'welcome';
17
+ }
18
+
19
+ // Active version.
20
+ $name = 'WP Recipe Maker';
21
+ $version = WPRM_VERSION;
22
+ $full_name = $name . ' ' . $version;
23
+
24
+ // Image directory.
25
+ $img_dir = WPRM_URL . '/assets/images/faq';
26
  ?>
27
 
28
+ <div class="wrap about-wrap wprm-faq">
29
+
30
+ <h1><?php echo esc_html( $name ); ?></h1>
31
+
32
+ <div class="about-text">Welcome to version <?php echo esc_html( $version ) ?> of the very best recipe plugin!</div>
33
+
34
+ <div class="wprm-badge">Version <?php echo esc_html( $version ); ?></div>
35
+
36
+ <h2 class="nav-tab-wrapper">
37
+ <a href="<?php echo esc_url( add_query_arg( 'sub', 'welcome', admin_url( 'admin.php?page=wprecipemaker' ) ) ); ?>" class="nav-tab<?php if ( 'welcome' === $sub ) { echo esc_attr( ' nav-tab-active' ); } ?>">
38
+ Welcome
39
+ </a><a href="<?php echo esc_url( add_query_arg( 'sub', 'getting_started', admin_url( 'admin.php?page=wprecipemaker' ) ) ); ?>" class="nav-tab<?php if ( 'getting_started' === $sub ) { echo esc_attr( ' nav-tab-active' ); } ?>">
40
+ Getting Started
41
+ </a><a href="<?php echo esc_url( add_query_arg( 'sub', 'whats_new', admin_url( 'admin.php?page=wprecipemaker' ) ) ); ?>" class="nav-tab<?php if ( 'whats_new' === $sub ) { echo esc_attr( ' nav-tab-active' ); } ?>">
42
+ What&#8217;s New
43
+ </a><a href="<?php echo esc_url( add_query_arg( 'sub', 'support', admin_url( 'admin.php?page=wprecipemaker' ) ) ); ?>" class="nav-tab<?php if ( 'support' === $sub ) { echo esc_attr( ' nav-tab-active' ); } ?>">
44
+ Support
45
+ </a>
46
+ </h2>
47
+
48
+ <?php include( WPRM_DIR . '/templates/admin/menu/faq/' . $sub . '.php' ); ?>
49
  </div>
templates/admin/menu/faq/getting_started.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for the WP Recipe Maker FAQ Getting Started page.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.0.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/admin/menu/faq
10
+ */
11
+
12
+ ?>
13
+
14
+ <h3>Adding Recipes</h3>
15
+ <p>
16
+ When creating or editing a regular post or page you should see a "WP Recipe Maker" button appear next to the "Add Media" button right above the post editor. Click that button to insert recipes.
17
+ </p>
18
+ <img src="<?php echo esc_attr( $img_dir ); ?>/wp-recipe-maker-button.png" />
19
+ <h3>Editing Recipes</h3>
20
+ <p>
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" />
templates/admin/menu/faq/support.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for the WP Recipe Maker FAQ Support page.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.0.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/admin/menu/faq
10
+ */
11
+
12
+ ?>
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>
19
+ <p>If we're not available to chat you can use that very same widget to send us a message. Just make sure to enter your email address correctly.</p>
20
+ <h4>Email Us</h4>
21
+ <p>Or just email us directly over at <a href="mailto:support@bootstrapped.ventures">support@bootstrapped.ventures</a></p>
22
+
23
+ <h3>When should I expect an answer?</h3>
24
+ <p>Once you've sent a message to our support system you should immediately receive a confirmation in your inbox. If not, <strong>check your spam folder</strong> and make sure you've entered your email correctly.</p>
25
+ <p>If you got the confirmation email, hang tight. We try to answer all requests <strong>within 24 hours</strong> and usually faster than that.</p>
26
+ <p>Note: Support is handled from Belgium, so there might be some delay due to different timezones.</p>
templates/admin/menu/faq/welcome.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for the WP Recipe Maker FAQ Welcome page.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.0.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/admin/menu/faq
10
+ */
11
+
12
+ ?>
13
+
14
+ <h3>Do you want us to promote your website for free?</h3>
15
+ <p>
16
+ We're happy that you choose WP Recipe Maker for your blog and would love to spread the word and get you even <strong>more visitors</strong>.
17
+ </p>
18
+ <p>
19
+ How? By following your blog and <strong>sharing the best recipes you publish</strong> on our social media accounts!
20
+ </p>
21
+ <p>
22
+ To be able to follow your blog we need to know about your website. Fill in the form below and we'll <strong>promote your recipes for free</strong>!
23
+ </p>
24
+ <?php
25
+ $current_user = wp_get_current_user();
26
+ $email = $current_user->user_email;
27
+ $website = get_site_url();
28
+ ?>
29
+ <form action="https://www.getdrip.com/forms/24755599/submissions" method="post" class="wprm-drip-form" data-drip-embedded-form="24755599" target="_blank">
30
+ <div>
31
+ <label for="fields[email]">Email Address</label><br />
32
+ <input type="email" id="fields[email]" name="fields[email]" value="<?php echo esc_attr( $email ); ?>" />
33
+ </div>
34
+ <div>
35
+ <label for="fields[website]">Website</label><br />
36
+ <input type="text" id="fields[website]" name="fields[website]" value="<?php echo esc_attr( $website ); ?>" />
37
+ </div>
38
+ <div>
39
+ <input type="submit" name="submit" value="I want you to promote my website!" class="button button-primary" data-drip-attribute="sign-up-button" />
40
+ <p class="wprm-disclaimer">Make sure to confirm that you want this by clicking the link in the email!</p>
41
+ </div>
42
+ </form>
templates/admin/menu/faq/whats_new.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for the WP Recipe Maker FAQ What's New page.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.1.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/admin/menu/faq
10
+ */
11
+
12
+ ?>
13
+
14
+ <h3>Latest Update (<?php echo esc_html( $version ); ?>)</h3>
15
+ <ul>
16
+ <li>Feature: Comment ratings with metadata</li>
17
+ <li>Feature: Inline metadata for Pinterest rich pins</li>
18
+ <li>Feature: Calories field for nutrition metadata</li>
19
+ <li>Improvement: FAQ pages</li>
20
+ <li>Improvement: Strip HTML from JSON-LD metadata</li>
21
+ </ul>
22
+
23
+ <h3>1.0.0</h3>
24
+ <ul>
25
+ <li>Feature: JSON-LD Metadata</li>
26
+ <li>Feature: Intuitive workflow using regular posts or pages</li>
27
+ <li>Feature: Import from EasyRecipe</li>
28
+ <li>Feature: Clean printing of recipes</li>
29
+ <li>Feature: Fallback recipe when the plugin is disabled</li>
30
+ </ul>
templates/admin/modal/tabs/recipe-details.php CHANGED
@@ -31,6 +31,10 @@
31
  <label for="wprm-recipe-servings"><?php esc_html_e( 'Servings', 'wp-recipe-maker' ); ?></label>
32
  <input type="number" id="wprm-recipe-servings" placeholder="4" /> <input type="text" id="wprm-recipe-servings-unit" placeholder="<?php esc_attr_e( 'people', 'wp-recipe-maker' ); ?>" />
33
  </div>
 
 
 
 
34
  <div class="wprm-recipe-details-form-container wprm-recipe-details-form-container-thirds">
35
  <label for="wprm-recipe-prep-time"><?php esc_html_e( 'Prep Time', 'wp-recipe-maker' ); ?></label>
36
  <input type="number" id="wprm-recipe-prep-time" class="wprm-recipe-time" placeholder="10" /> <?php esc_html_e( 'minutes', 'wp-recipe-maker' ); ?>
31
  <label for="wprm-recipe-servings"><?php esc_html_e( 'Servings', 'wp-recipe-maker' ); ?></label>
32
  <input type="number" id="wprm-recipe-servings" placeholder="4" /> <input type="text" id="wprm-recipe-servings-unit" placeholder="<?php esc_attr_e( 'people', 'wp-recipe-maker' ); ?>" />
33
  </div>
34
+ <div class="wprm-recipe-details-form-container">
35
+ <label for="wprm-recipe-calories"><?php esc_html_e( 'Calories', 'wp-recipe-maker' ); ?></label>
36
+ <input type="number" id="wprm-recipe-calories" placeholder="280" /> <?php esc_html_e( 'kcal', 'wp-recipe-maker' ); ?>
37
+ </div>
38
  <div class="wprm-recipe-details-form-container wprm-recipe-details-form-container-thirds">
39
  <label for="wprm-recipe-prep-time"><?php esc_html_e( 'Prep Time', 'wp-recipe-maker' ); ?></label>
40
  <input type="number" id="wprm-recipe-prep-time" class="wprm-recipe-time" placeholder="10" /> <?php esc_html_e( 'minutes', 'wp-recipe-maker' ); ?>
templates/public/comment-rating-form.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template to be used for the rating field in the comment form.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.1.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/public
10
+ */
11
+
12
+ ?>
13
+ <p class="comment-form-wprm-rating">
14
+ <label for="wprm-rating"><?php esc_html_e( 'Recipe Rating', 'wp-recipe-maker' ); ?></label>
15
+ <span class="wprm-rating-stars">
16
+ <?php
17
+ for ( $i = 1; $i <= 5; $i++ ) {
18
+ if ( $i <= $rating ) {
19
+ echo '<span class="wprm-rating-star rated" data-rating="' . esc_attr( $i ) . '">';
20
+ } else {
21
+ echo '<span class="wprm-rating-star" data-rating="' . esc_attr( $i ) . '">';
22
+ }
23
+ include( WPRM_DIR . 'assets/icons/star-empty.svg' );
24
+ echo '</span>';
25
+ }
26
+ ?>
27
+ </span>
28
+ <input id="wprm-comment-rating" name="wprm-comment-rating" type="hidden" value="<?php echo esc_attr( $rating ); ?>">
29
+ </p>
templates/public/comment-rating.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template to be used for the rating in comments.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.1.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/public
10
+ */
11
+
12
+ ?>
13
+ <div class="wprm-comment-rating">
14
+ <span class="wprm-rating-stars">
15
+ <?php
16
+ for ( $i = 1; $i <= 5; $i++ ) {
17
+ echo '<span class="wprm-rating-star">';
18
+ if ( $i <= $rating ) {
19
+ include( WPRM_DIR . 'assets/icons/star-full.svg' );
20
+ } else {
21
+ include( WPRM_DIR . 'assets/icons/star-empty.svg' );
22
+ }
23
+ echo '</span>';
24
+ }
25
+ ?>
26
+ </span>
27
+ </div>
templates/recipe/clean-print/clean-print.php CHANGED
@@ -65,11 +65,18 @@
65
  </div>
66
  <?php endif; // Total time. ?>
67
  </div>
68
- <?php if ( $recipe->servings() ) : ?>
69
- <div class="wprm-recipe-details-container wprm-recipe-servings-container">
70
- <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
 
 
 
 
 
 
 
 
71
  </div>
72
- <?php endif; // Servings. ?>
73
 
74
  <?php
75
  $ingredients = $recipe->ingredients();
65
  </div>
66
  <?php endif; // Total time. ?>
67
  </div>
68
+ <div class="wprm-recipe-details-container">
69
+ <?php if ( $recipe->servings() ) : ?>
70
+ <div class="wprm-recipe-servings-container">
71
+ <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
72
+ </div>
73
+ <?php endif; // Servings. ?>
74
+ <?php if ( $recipe->calories() ) : ?>
75
+ <div class="wprm-recipe-calories-container">
76
+ <span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php _e( 'Calories', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span>
77
+ </div>
78
+ <?php endif; // Calories. ?>
79
  </div>
 
80
 
81
  <?php
82
  $ingredients = $recipe->ingredients();
templates/recipe/simple/simple.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-recipe-simple{border-top:1px solid #aaaaaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:0.9em}.wprm-recipe-simple h2.wprm-recipe-name,.wprm-recipe-simple h3.wprm-recipe-header,.wprm-recipe-simple h4.wprm-recipe-group-name{font-variant:normal;text-transform:none;letter-spacing:normal;margin:0}.wprm-recipe-simple .wprm-recipe-image-container{float:right;text-align:center;margin-bottom:10px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-image{margin:0 0 5px 5px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:0.9em;cursor:pointer}.wprm-recipe-simple h2.wprm-recipe-name{clear:none;font-size:1.8em}.wprm-recipe-simple .wprm-recipe-details-container,.wprm-recipe-simple .wprm-recipe-summary{margin-bottom:15px}.wprm-recipe-simple .wprm-recipe-details-icon svg{vertical-align:middle;width:16px;height:16px}.wprm-recipe-simple .wprm-recipe-details-name{display:inline-block;font-weight:bold;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:0.8em}.wprm-recipe-simple h3.wprm-recipe-header{margin-top:10px;font-size:1.2em}.wprm-recipe-simple ol,.wprm-recipe-simple ul{margin:0 0 8px}.wprm-recipe-simple ol li,.wprm-recipe-simple ul li{margin:0 0 0 32px}.wprm-recipe-simple h4.wprm-recipe-group-name{margin-top:5px !important;font-weight:300;font-size:1em}.wprm-recipe-simple .wprm-recipe-ingredient-notes{color:#999999}.wprm-recipe-simple .wprm-recipe-instructions .wprm-recipe-instruction{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-instruction-text p{margin:0 0 5px}.wprm-recipe-simple .wprm-recipe-instruction-text p:last-of-type{margin-bottom:0}.wprm-recipe-simple .wprm-recipe-instruction-image{margin:5px 0 15px}@media only screen and (max-width: 640px){.wprm-recipe-simple .wprm-recipe-image-container{float:none}.wprm-recipe-simple .wprm-recipe-details-name{min-width:0}}
1
+ .wprm-recipe-simple{border-top:1px solid #aaaaaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:0.9em}.wprm-recipe-simple h2.wprm-recipe-name,.wprm-recipe-simple h3.wprm-recipe-header,.wprm-recipe-simple h4.wprm-recipe-group-name{font-variant:normal;text-transform:none;letter-spacing:normal;margin:0}.wprm-recipe-simple .wprm-recipe-image-container{float:right;text-align:center;margin:0 0 10px 10px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-image{margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font-size:0.8em}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:0.9em;cursor:pointer}.wprm-recipe-simple h2.wprm-recipe-name{clear:none;font-size:1.8em}.wprm-recipe-simple .wprm-recipe-details-container,.wprm-recipe-simple .wprm-recipe-summary{margin-bottom:15px}.wprm-recipe-simple .wprm-recipe-details-icon svg{vertical-align:middle;width:16px;height:16px}.wprm-recipe-simple .wprm-recipe-details-name{display:inline-block;font-weight:bold;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:0.8em}.wprm-recipe-simple h3.wprm-recipe-header{margin-top:10px;font-size:1.2em}.wprm-recipe-simple ol,.wprm-recipe-simple ul{margin:0 0 8px}.wprm-recipe-simple ol li,.wprm-recipe-simple ul li{margin:0 0 0 32px}.wprm-recipe-simple h4.wprm-recipe-group-name{margin-top:5px !important;font-weight:300;font-size:1em}.wprm-recipe-simple .wprm-recipe-ingredient-notes{color:#999999}.wprm-recipe-simple .wprm-recipe-instructions .wprm-recipe-instruction{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-instruction-text p{margin:0 0 5px}.wprm-recipe-simple .wprm-recipe-instruction-text p:last-of-type{margin-bottom:0}.wprm-recipe-simple .wprm-recipe-instruction-image{margin:5px 0 15px}@media only screen and (max-width: 640px){.wprm-recipe-simple .wprm-recipe-image-container{float:none}.wprm-recipe-simple .wprm-recipe-details-name{min-width:0}}
templates/recipe/simple/simple.php CHANGED
@@ -11,13 +11,38 @@
11
 
12
  // @codingStandardsIgnoreStart
13
  ?>
14
- <div class="wprm-recipe wprm-recipe-simple">
 
 
 
15
  <div class="wprm-recipe-image-container">
16
  <div class="wprm-recipe-image"><?php echo $recipe->image(); ?></div>
17
- <div class="wprm-recipe-buttons"><span class="wprm-recipe-print"><span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/printer.svg' ); ?></span> <?php _e( 'Print', 'wp-recipe-maker' ); ?></span></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  </div>
19
- <h2 class="wprm-recipe-name"><?php echo $recipe->name(); ?></h2>
20
- <div class="wprm-recipe-summary">
21
  <?php echo $recipe->summary(); ?>
22
  </div>
23
  <div class="wprm-recipe-details-container wprm-recipe-tags-container">
@@ -26,7 +51,7 @@
26
  if ( count( $courses ) > 0 ) : ?>
27
  <div class="wprm-recipe-course-container">
28
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-course-name"><?php _e( 'Course', 'wp-recipe-maker' ); ?></span>
29
- <span class="wprm-recipe-course">
30
  <?php foreach ( $courses as $index => $course ) {
31
  if ( 0 !== $index ) {
32
  echo ', ';
@@ -41,7 +66,7 @@
41
  if ( count( $recipe->tags( 'cuisine' ) ) > 0 ) : ?>
42
  <div class="wprm-recipe-cuisine-container">
43
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cuisine-name"><?php _e( 'Cuisine', 'wp-recipe-maker' ); ?></span>
44
- <span class="wprm-recipe-details wprm-recipe-cuisine">
45
  <?php foreach ( $cuisines as $index => $cuisine ) {
46
  if ( 0 !== $index ) {
47
  echo ', ';
@@ -55,25 +80,35 @@
55
  <div class="wprm-recipe-details-container wprm-recipe-times-container">
56
  <?php if ( $recipe->prep_time() ) : ?>
57
  <div class="wprm-recipe-prep-time-container">
 
58
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/knife.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-prep-time-name"><?php _e( 'Prep Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-prep-time"><?php echo $recipe->prep_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-prep-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
59
  </div>
60
  <?php endif; // Prep time. ?>
61
  <?php if ( $recipe->cook_time() ) : ?>
62
  <div class="wprm-recipe-cook-time-container">
 
63
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/pan.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cook-time-name"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-cook-time"><?php echo $recipe->cook_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-cook-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
64
  </div>
65
  <?php endif; // Cook time. ?>
66
  <?php if ( $recipe->total_time() ) : ?>
67
  <div class="wprm-recipe-total-time-container">
 
68
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/clock.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-total-time-name"><?php _e( 'Total Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-total-time"><?php echo $recipe->total_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-total-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
69
  </div>
70
  <?php endif; // Total time. ?>
71
  </div>
72
- <?php if ( $recipe->servings() ) : ?>
73
- <div class="wprm-recipe-details-container wprm-recipe-servings-container">
74
- <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/cutlery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
 
 
 
 
 
 
 
 
75
  </div>
76
- <?php endif; // Servings. ?>
77
 
78
  <?php
79
  $ingredients = $recipe->ingredients();
@@ -87,7 +122,7 @@
87
  <?php endif; // Ingredient group name. ?>
88
  <ul class="wprm-recipe-ingredients">
89
  <?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
90
- <li class="wprm-recipe-ingredient">
91
  <?php if ( $ingredient['amount'] ) : ?>
92
  <span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
93
  <?php endif; // Ingredient amount. ?>
@@ -121,7 +156,7 @@
121
  <?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
122
  <li class="wprm-recipe-instruction">
123
  <?php if ( $instruction['text'] ) : ?>
124
- <div class="wprm-recipe-instruction-text"><?php echo $instruction['text']; ?></div>
125
  <?php endif; // Instruction text. ?>
126
  <?php if ( $instruction['image'] ) : ?>
127
  <div class="wprm-recipe-instruction-image"><?php echo wp_get_attachment_image( $instruction['image'], 'thumbnail' ); ?></div>
11
 
12
  // @codingStandardsIgnoreStart
13
  ?>
14
+ <div class="wprm-recipe wprm-recipe-simple" itemscope itemtype="http://schema.org/Recipe">
15
+ <meta itemprop="author" content="<?php echo $recipe->author(); ?>" />
16
+ <meta itemprop="datePublished" content="<?php echo $recipe->date(); ?>" />
17
+ <meta itemprop="image" content="<?php echo $recipe->image_url( 'full' ); ?>" />
18
  <div class="wprm-recipe-image-container">
19
  <div class="wprm-recipe-image"><?php echo $recipe->image(); ?></div>
20
+ <div class="wprm-recipe-buttons">
21
+ <?php
22
+ $rating = $recipe->rating();
23
+ if ( $rating['count'] > 0 ) :
24
+ ?>
25
+ <div class="wprm-recipe-rating">
26
+ <?php
27
+ $rating_value = ceil ( $rating['average'] );
28
+ for ( $i = 1; $i <= 5; $i++ ) {
29
+ echo '<span class="wprm-rating-star">';
30
+ if ( $i <= $rating_value ) {
31
+ include( WPRM_DIR . 'assets/icons/star-full.svg' );
32
+ } else {
33
+ include( WPRM_DIR . 'assets/icons/star-empty.svg' );
34
+ }
35
+ echo '</span>';
36
+ }
37
+ ?>
38
+ <div class="wprm-recipe-rating-details" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue"><?php echo esc_html( $rating['average'] ); ?></span> <?php esc_html_e( 'from', 'wp-recipe-maker' ); ?> <span itemprop="ratingCount"><?php echo esc_html( $rating['count'] ); ?></span> <?php echo esc_html( _n( 'vote', 'votes', $rating['count'], 'wp-recipe-maker' ) ); ?></div>
39
+ </div>
40
+ <?php endif; // Rating. ?>
41
+ <span class="wprm-recipe-print"><span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/printer.svg' ); ?></span> <?php _e( 'Print', 'wp-recipe-maker' ); ?></span>
42
+ </div>
43
  </div>
44
+ <h2 class="wprm-recipe-name" itemprop="name"><?php echo $recipe->name(); ?></h2>
45
+ <div class="wprm-recipe-summary" itemprop="description">
46
  <?php echo $recipe->summary(); ?>
47
  </div>
48
  <div class="wprm-recipe-details-container wprm-recipe-tags-container">
51
  if ( count( $courses ) > 0 ) : ?>
52
  <div class="wprm-recipe-course-container">
53
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-course-name"><?php _e( 'Course', 'wp-recipe-maker' ); ?></span>
54
+ <span class="wprm-recipe-course" itemprop="recipeCategory">
55
  <?php foreach ( $courses as $index => $course ) {
56
  if ( 0 !== $index ) {
57
  echo ', ';
66
  if ( count( $recipe->tags( 'cuisine' ) ) > 0 ) : ?>
67
  <div class="wprm-recipe-cuisine-container">
68
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cuisine-name"><?php _e( 'Cuisine', 'wp-recipe-maker' ); ?></span>
69
+ <span class="wprm-recipe-details wprm-recipe-cuisine" itemprop="recipeCuisine">
70
  <?php foreach ( $cuisines as $index => $cuisine ) {
71
  if ( 0 !== $index ) {
72
  echo ', ';
80
  <div class="wprm-recipe-details-container wprm-recipe-times-container">
81
  <?php if ( $recipe->prep_time() ) : ?>
82
  <div class="wprm-recipe-prep-time-container">
83
+ <meta itemprop="prepTime" content="PT<?php echo $recipe->prep_time(); ?>M" />
84
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/knife.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-prep-time-name"><?php _e( 'Prep Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-prep-time"><?php echo $recipe->prep_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-prep-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
85
  </div>
86
  <?php endif; // Prep time. ?>
87
  <?php if ( $recipe->cook_time() ) : ?>
88
  <div class="wprm-recipe-cook-time-container">
89
+ <meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
90
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/pan.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cook-time-name"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-cook-time"><?php echo $recipe->cook_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-cook-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
91
  </div>
92
  <?php endif; // Cook time. ?>
93
  <?php if ( $recipe->total_time() ) : ?>
94
  <div class="wprm-recipe-total-time-container">
95
+ <meta itemprop="totalTime" content="PT<?php echo $recipe->total_time(); ?>M" />
96
  <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/clock.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-total-time-name"><?php _e( 'Total Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-total-time"><?php echo $recipe->total_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-total-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
97
  </div>
98
  <?php endif; // Total time. ?>
99
  </div>
100
+ <div class="wprm-recipe-details-container">
101
+ <?php if ( $recipe->servings() ) : ?>
102
+ <div class="wprm-recipe-servings-container">
103
+ <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/cutlery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span> <span itemprop="recipeYield"><span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span></span>
104
+ </div>
105
+ <?php endif; // Servings. ?>
106
+ <?php if ( $recipe->calories() ) : ?>
107
+ <div class="wprm-recipe-calories-container" itemprop="nutrition" itemscope itemtype="http://schema.org/NutritionInformation">
108
+ <span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/battery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php _e( 'Calories', 'wp-recipe-maker' ); ?></span> <span itemprop="calories"><span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span></span>
109
+ </div>
110
+ <?php endif; // Calories. ?>
111
  </div>
 
112
 
113
  <?php
114
  $ingredients = $recipe->ingredients();
122
  <?php endif; // Ingredient group name. ?>
123
  <ul class="wprm-recipe-ingredients">
124
  <?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
125
+ <li class="wprm-recipe-ingredient" itemprop="recipeIngredient">
126
  <?php if ( $ingredient['amount'] ) : ?>
127
  <span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
128
  <?php endif; // Ingredient amount. ?>
156
  <?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
157
  <li class="wprm-recipe-instruction">
158
  <?php if ( $instruction['text'] ) : ?>
159
+ <div class="wprm-recipe-instruction-text" itemprop="recipeInstructions"><?php echo $instruction['text']; ?></div>
160
  <?php endif; // Instruction text. ?>
161
  <?php if ( $instruction['image'] ) : ?>
162
  <div class="wprm-recipe-instruction-image"><?php echo wp_get_attachment_image( $instruction['image'], 'thumbnail' ); ?></div>
templates/recipe/simple/simple.scss CHANGED
@@ -17,10 +17,25 @@
17
  .wprm-recipe-image-container {
18
  float: right;
19
  text-align: center;
20
- margin-bottom: 10px;
21
 
22
  .wprm-recipe-image {
23
- margin: 0 0 5px 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  .wprm-recipe-print {
17
  .wprm-recipe-image-container {
18
  float: right;
19
  text-align: center;
20
+ margin: 0 0 10px 10px;
21
 
22
  .wprm-recipe-image {
23
+ margin: 0;
24
+ }
25
+
26
+ .wprm-recipe-rating {
27
+ margin-bottom: 5px;
28
+
29
+ svg {
30
+ vertical-align: middle;
31
+ width: 16px;
32
+ height: 16px;
33
+ margin: 0;
34
+ }
35
+
36
+ .wprm-recipe-rating-details {
37
+ font-size: 0.8em;
38
+ }
39
  }
40
 
41
  .wprm-recipe-print {